/* AETHER CHRONICLES - COMPACT POST-BATTLE RESULTS SCREEN v1753442000 */

/* ============================================================
   CORE LAYOUT - COMPACT SINGLE SCREEN DESIGN
   ============================================================ */

#screen-battle-results {
    background: 
        radial-gradient(ellipse at top center, rgba(255, 215, 0, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at bottom center, rgba(138, 43, 226, 0.06) 0%, transparent 50%),
        linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 40%, #0f1318 100%);
    
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: calc(100vh - 60px) !important;
    
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 1000 !important;
    
    display: flex;
    flex-direction: column;
    animation: resultsReveal 0.6s ease-out;
}

@keyframes resultsReveal {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================================
   COMPACT HEADER - VICTORY/DEFEAT
   ============================================================ */

.results-header {
    text-align: center;
    padding: 20px 20px 15px;
    margin: 0;
    flex-shrink: 0;
}

#results-outcome {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
    animation: outcomeGlow 2s ease-in-out infinite;
}

/* Victory/Defeat/Draw Styling */
#results-outcome.victory,
#results-outcome.victory-text {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 25%, #fff59d 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 40px rgba(255, 215, 0, 0.3);
}

#results-outcome.defeat,
#results-outcome.defeat-text {
    background: linear-gradient(135deg, #f44336 0%, #e57373 50%, #c62828 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 
        0 0 20px rgba(244, 67, 54, 0.5),
        0 0 40px rgba(244, 67, 54, 0.2);
}

#results-outcome.draw,
#results-outcome.draw-text {
    background: linear-gradient(135deg, #9e9e9e 0%, #bdbdbd 50%, #757575 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 
        0 0 20px rgba(158, 158, 158, 0.5),
        0 0 40px rgba(158, 158, 158, 0.2);
}

@keyframes outcomeGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}

/* ============================================================
   MAIN CONTAINER - COMPACT GRID LAYOUT
   ============================================================ */

.results-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 25px 20px;
    box-sizing: border-box;
    flex: 1;
}

/* Desktop 2-Column Layout */
@media (min-width: 1024px) {
    .results-container {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "stats rewards"
            "mvp mvp";
        gap: 25px;
        padding: 0 30px 25px;
    }
    
    .results-stats { grid-area: stats; }
    .results-rewards { grid-area: rewards; }
    .mvp-section { grid-area: mvp; }
}

/* Hide performance section to save space */
.results-performance {
    display: none !important;
}

/* ============================================================
   BATTLE STATISTICS - COMPACT DESIGN
   ============================================================ */

.results-stats {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.08) 0%, 
        rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 
        0 6px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.results-stats:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(100, 181, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.results-stats h3 {
    font-size: 1.3rem;
    color: #64b5f6;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 15px 0;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.stat-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(3px);
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value {
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
}

/* Performance Grade Styling */
.performance-grade {
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.9rem !important;
    font-weight: 800 !important;
}

.performance-grade.S { 
    background: linear-gradient(135deg, #ffd700, #ffed4e); 
    color: #1a1f2e;
}
.performance-grade.A { 
    background: linear-gradient(135deg, #4caf50, #66bb6a); 
    color: #ffffff;
}
.performance-grade.B { 
    background: linear-gradient(135deg, #2196f3, #42a5f5); 
    color: #ffffff;
}
.performance-grade.C { 
    background: linear-gradient(135deg, #ff9800, #ffb74d); 
    color: #ffffff;
}
.performance-grade.D { 
    background: linear-gradient(135deg, #f44336, #ef5350); 
    color: #ffffff;
}

/* ============================================================
   REWARDS SECTION - COMPACT DESIGN
   ============================================================ */

.results-rewards {
    background: linear-gradient(135deg, 
        rgba(76, 175, 80, 0.08) 0%, 
        rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(76, 175, 80, 0.25);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 
        0 6px 25px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(76, 175, 80, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.results-rewards:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(76, 175, 80, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.results-rewards h3 {
    font-size: 1.3rem;
    color: #4caf50;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 15px 0;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.rewards-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reward-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.reward-item:hover {
    background: rgba(76, 175, 80, 0.08);
    border-color: rgba(76, 175, 80, 0.2);
    transform: translateX(3px);
}

.reward-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
}

.reward-value {
    color: #4caf50;
    font-weight: 700;
    font-size: 1.1rem;
    text-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

/* Card Drops - More Compact */
.card-drops-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.card-drops-section h4 {
    font-size: 1rem;
    color: #ffd700;
    margin-bottom: 10px;
    text-align: center;
}

.card-drops-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.card-drop-item {
    width: 80px;
    height: 112px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-drop-item:hover {
    transform: translateY(-3px) scale(1.05);
    border-color: #ffd700;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

/* ============================================================
   MVP SECTION - COMPACT DESIGN
   ============================================================ */

.mvp-section {
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.12) 0%, 
        rgba(255, 215, 0, 0.04) 50%,
        rgba(138, 43, 226, 0.04) 100%);
    border: 2px solid rgba(255, 215, 0, 0.25);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 215, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: mvpShine 4s ease-in-out infinite;
}

@keyframes mvpShine {
    0%, 100% { 
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.15);
    }
    50% { 
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 215, 0, 0.25);
    }
}

.mvp-section h3 {
    text-align: center;
    font-size: 1.4rem;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 15px 0;
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.mvp-card-spotlight {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.mvp-card-image {
    width: 120px;
    height: 168px;
    background: rgba(0, 0, 0, 0.3);
    border: 3px solid #ffd700;
    border-radius: 8px;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(255, 215, 0, 0.4);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.mvp-details {
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.mvp-card-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.mvp-damage {
    font-size: 1rem;
    color: #ff6b6b;
    margin-bottom: 10px;
}

.mvp-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1f2e;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ============================================================
   ACTION BUTTONS - COMPACT DESIGN
   ============================================================ */

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding: 20px 20px 25px;
    margin-top: auto;
    flex-shrink: 0;
}

.results-actions button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

#results-rematch {
    background: linear-gradient(135deg, #8a2be2 0%, #6a1fb8 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

#results-rematch:hover {
    background: linear-gradient(135deg, #9a3bef 0%, #7a2fc8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.4);
}

#results-main-menu {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

#results-main-menu:hover {
    background: linear-gradient(135deg, #5cbf60 0%, #55b059 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* Optional buttons - hidden by default to save space */
#results-new-battle,
#results-edit-deck,
#results-view-replay {
    display: none;
}

/* ============================================================
   RESPONSIVE DESIGN - MOBILE OPTIMIZATION
   ============================================================ */

@media (max-width: 1024px) {
    .results-container {
        padding: 0 20px 20px;
        gap: 18px;
    }
    
    .mvp-card-spotlight {
        flex-direction: column;
        gap: 15px;
    }
    
    .mvp-card-image {
        width: 100px;
        height: 140px;
    }
}

@media (max-width: 768px) {
    #results-outcome {
        font-size: 1.6rem;
        letter-spacing: 2px;
    }
    
    .results-header {
        padding: 15px 15px 10px;
    }
    
    .results-container {
        padding: 0 15px 15px;
        gap: 15px;
    }
    
    .results-stats,
    .results-rewards,
    .mvp-section {
        padding: 15px;
    }
    
    .mvp-card-image {
        width: 90px;
        height: 126px;
    }
    
    .results-actions {
        flex-direction: column;
        padding: 15px 15px 20px;
        gap: 12px;
    }
    
    .results-actions button {
        width: 100%;
        min-width: unset;
        padding: 14px 25px;
    }
}

@media (max-width: 480px) {
    .results-container {
        padding: 0 12px 12px;
        gap: 12px;
    }
    
    .stat-item,
    .reward-item {
        padding: 8px 12px;
    }
    
    .stat-label,
    .reward-label {
        font-size: 0.85rem;
    }
    
    .stat-value,
    .reward-value {
        font-size: 0.95rem;
    }
}

/* ============================================================
   ANIMATIONS & PERFORMANCE
   ============================================================ */

/* Stagger animations for stats */
.stat-item {
    animation: slideInLeft 0.4s ease-out;
    animation-fill-mode: both;
}

.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.15s; }
.stat-item:nth-child(3) { animation-delay: 0.2s; }
.stat-item:nth-child(4) { animation-delay: 0.25s; }
.stat-item:nth-child(5) { animation-delay: 0.3s; }
.stat-item:nth-child(6) { animation-delay: 0.35s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Reward animations */
.reward-item {
    animation: slideInRight 0.4s ease-out;
    animation-fill-mode: both;
}

.reward-item:nth-child(1) { animation-delay: 0.4s; }
.reward-item:nth-child(2) { animation-delay: 0.45s; }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .stat-item,
    .reward-item,
    .card-drop-item {
        border-width: 2px;
    }
}