/* ============================================================
   CLASH ROYALE - Supercell-Inspired Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lilita+One&family=Nunito:wght@600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --blue-primary: #2980b9;
    --blue-dark: #1a5276;
    --blue-light: #3498db;
    --gold: #ffd700;
    --gold-dark: #cca800;
    --green: #27ae60;
    --green-dark: #1e8449;
    --red: #e74c3c;
    --red-dark: #c0392b;
    --purple: #8e44ad;
    --purple-dark: #6c3483;
    --bg-dark: #1a1a2e;
    --bg-medium: #16213e;
    --bg-light: #0f3460;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --card-common: #8e8e8e;
    --card-rare: #f0a030;
    --card-epic: #c030e0;
    --card-legendary: #f0e840;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    user-select: none;
    touch-action: manipulation;
}

/* ============= SCREENS ============= */

.screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.screen.active {
    display: flex;
}

/* ============= LOADING SCREEN ============= */

#screen-loading {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    justify-content: center;
    align-items: center;
}

.loading-content {
    text-align: center;
}

.logo-crown {
    font-size: 72px;
    animation: bounce 1s infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.game-title {
    font-family: 'Lilita One', cursive;
    font-size: 42px;
    color: var(--gold);
    text-shadow: 0 3px 0 var(--gold-dark), 0 5px 10px rgba(0,0,0,0.5);
    letter-spacing: 3px;
    margin: 10px 0;
}

.game-title.small {
    font-size: 28px;
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: 30px;
}

.loading-bar-container {
    width: 250px;
    height: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    margin: 0 auto 15px;
    overflow: hidden;
}

.loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--blue-primary), var(--purple));
    border-radius: 6px;
    transition: width 0.3s;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============= AUTH SCREEN ============= */

#screen-auth {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    justify-content: center;
    align-items: center;
}

.auth-container {
    width: 90%;
    max-width: 360px;
    text-align: center;
}

.auth-tabs {
    display: flex;
    margin: 20px 0 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--blue-primary);
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--blue-primary);
    color: white;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form.hidden {
    display: none;
}

.auth-form input {
    padding: 12px 15px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: white;
    font-size: 15px;
    font-family: 'Nunito', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    border-color: var(--blue-primary);
}

.auth-form input::placeholder {
    color: rgba(255,255,255,0.4);
}

.error-msg {
    color: var(--red);
    font-size: 13px;
    margin-top: 10px;
    min-height: 20px;
}

/* ============= BUTTONS ============= */

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-family: 'Lilita One', 'Nunito', cursive;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(180deg, var(--blue-light), var(--blue-primary));
    color: white;
    box-shadow: 0 4px 0 var(--blue-dark), 0 6px 15px rgba(0,0,0,0.3);
}

.btn-primary:active {
    box-shadow: 0 2px 0 var(--blue-dark);
    transform: translateY(2px);
}

.btn-battle {
    background: linear-gradient(180deg, #f39c12, #e67e22);
    color: white;
    font-size: 24px;
    padding: 18px 50px;
    box-shadow: 0 5px 0 #d35400, 0 8px 20px rgba(0,0,0,0.3);
    width: 80%;
    max-width: 300px;
}

.btn-battle:active {
    box-shadow: 0 2px 0 #d35400;
    transform: translateY(3px);
}

.btn-training {
    background: linear-gradient(180deg, var(--green), var(--green-dark));
    color: white;
    font-size: 16px;
    padding: 12px 30px;
    box-shadow: 0 4px 0 #145a32, 0 6px 15px rgba(0,0,0,0.3);
    width: 60%;
    max-width: 220px;
}

.btn-training:active {
    box-shadow: 0 2px 0 #145a32;
    transform: translateY(2px);
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    background: var(--blue-primary);
    color: white;
    border: none;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}

.btn-secondary {
    background: linear-gradient(180deg, #666, #444);
    color: white;
    box-shadow: 0 3px 0 #222;
}

.btn-danger {
    background: linear-gradient(180deg, var(--red), var(--red-dark));
    color: white;
    box-shadow: 0 4px 0 #922b21;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.btn-back {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 22px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============= MAIN MENU ============= */

#screen-menu {
    background: linear-gradient(180deg, #0f3460 0%, #1a1a2e 100%);
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0,0,0,0.3);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.player-name {
    font-weight: 800;
    font-size: 16px;
}

.player-trophies {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    color: var(--gold);
}

.trophy-icon {
    font-size: 18px;
}

.resource-bar {
    display: flex;
    gap: 15px;
}

.resource {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 15px;
    background: rgba(0,0,0,0.3);
}

.resource-icon {
    font-size: 16px;
}

.resource.gold { color: var(--gold); }
.resource.gems { color: #44ddff; }

.menu-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
}

.arena-banner {
    text-align: center;
    padding: 15px 30px;
    background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(255,215,0,0.05));
    border: 2px solid rgba(255,215,0,0.3);
    border-radius: 12px;
    margin-bottom: 10px;
}

.arena-name {
    font-family: 'Lilita One', cursive;
    font-size: 22px;
    color: var(--gold);
}

.arena-range {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.menu-deck-preview {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    flex-wrap: wrap;
}

.deck-preview-card {
    width: 42px;
    height: 54px;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.deck-preview-card:active {
    transform: scale(0.9);
}

.deck-preview-card .card-art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.deck-preview-card .card-elixir-badge {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E070F0, #9030A0);
    color: white;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #7020A0;
}

.menu-nav {
    display: flex;
    background: rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-btn {
    flex: 1;
    padding: 10px 5px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: color 0.2s;
}

.nav-btn span {
    font-size: 20px;
}

.nav-btn.active {
    color: var(--gold);
}

/* ============= COLLECTION ============= */

.screen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0,0,0,0.3);
}

.screen-header h2 {
    font-family: 'Lilita One', cursive;
    font-size: 20px;
    color: var(--gold);
}

.collection-grid {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    align-content: start;
}

.collection-card {
    aspect-ratio: 3/4.2;
    border-radius: 10px;
    border: 2.5px solid rgba(255,255,255,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px 5px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.collection-card:active {
    transform: scale(0.93);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.collection-card.locked {
    opacity: 0.45;
    filter: grayscale(0.7) brightness(0.7);
}

.collection-card .card-elixir {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E070F0, #9030A0);
    color: white;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    border: 1.5px solid #7020A0;
}

.collection-card .card-level {
    position: absolute;
    top: 3px;
    right: 4px;
    font-size: 10px;
    font-weight: 800;
    color: var(--gold);
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    z-index: 2;
}

.collection-card .card-lock {
    position: absolute;
    top: 3px;
    right: 4px;
    font-size: 12px;
    z-index: 2;
}

.collection-card .card-art-preview {
    width: 80%;
    aspect-ratio: 1;
    border-radius: 6px;
    margin: 2px 0;
    image-rendering: auto;
    border: 1.5px solid rgba(0,0,0,0.2);
}

.collection-card .card-name {
    font-size: 9px;
    font-weight: 800;
    text-align: center;
    line-height: 1.1;
    color: #FFF;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    margin-top: 2px;
}

.collection-card .card-progress {
    width: 85%;
    height: 4px;
    background: rgba(0,0,0,0.3);
    border-radius: 2px;
    margin-top: 2px;
    overflow: hidden;
}

.collection-card .card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 2px;
    transition: width 0.3s;
}

.collection-card .card-count {
    font-size: 8px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 1px;
}

.rarity-common { border-color: #8e8e8e; background: linear-gradient(180deg, rgba(142,142,142,0.2), rgba(100,100,100,0.15)); }
.rarity-rare { border-color: #f0a030; background: linear-gradient(180deg, rgba(240,160,48,0.2), rgba(200,120,20,0.15)); box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 0 10px rgba(240,160,48,0.1); }
.rarity-epic { border-color: #c030e0; background: linear-gradient(180deg, rgba(192,48,224,0.2), rgba(140,30,180,0.15)); box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 0 10px rgba(192,48,224,0.1); }

/* ============= DECK BUILDER ============= */

#screen-deck {
    background: var(--bg-dark);
}

.deck-current {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    min-height: 120px;
    border-bottom: 2px solid rgba(255,215,0,0.3);
}

.deck-label {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.deck-available {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 15px;
    align-content: start;
}

.deck-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 5px 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.deck-avg-elixir {
    font-size: 12px;
}

.deck-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    width: 100%;
}

.deck-card-slot {
    aspect-ratio: 3/4;
    border-radius: 8px;
    border: 2.5px solid rgba(255,255,255,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.deck-card-slot:active { transform: scale(0.93); }

.deck-card-slot.empty {
    background: rgba(255,255,255,0.05);
    border-style: dashed;
    border-color: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.deck-empty-slot {
    font-size: 24px;
    color: rgba(255,255,255,0.2);
}

.deck-card-slot.in-deck {
    opacity: 0.35;
}

.deck-card-slot .elixir-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E070F0, #9030A0);
    color: white;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border: 1px solid #7020A0;
}

.deck-card-art {
    width: 85%;
    aspect-ratio: 1;
    border-radius: 5px;
    margin-top: 2px;
    border: 1px solid rgba(0,0,0,0.2);
}

.deck-card-name {
    font-size: 8px;
    font-weight: 700;
    text-align: center;
    color: #FFF;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    line-height: 1.1;
    margin-top: auto;
}

.deck-card-remove {
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 10px;
    color: #FF4444;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 2;
}

.deck-card-slot:hover .deck-card-remove {
    opacity: 1;
}

.deck-card-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: var(--green);
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    z-index: 2;
}

.deck-available {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 6px;
    padding: 10px 15px;
    align-content: start;
}

#btn-save-deck {
    margin: 10px auto;
    display: block;
    width: 80%;
    max-width: 250px;
}

/* ============= BATTLE SCREEN ============= */

#screen-battle {
    background: #000;
}

.battle-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#game-canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.battle-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.battle-overlay.hidden { display: none; }

.battle-result {
    text-align: center;
    margin-bottom: 20px;
}

.battle-result h2 {
    font-family: 'Lilita One', cursive;
    font-size: 36px;
    margin-bottom: 10px;
}

.battle-result .victory { color: var(--gold); text-shadow: 0 3px 0 var(--gold-dark); }
.battle-result .defeat { color: var(--red); }
.battle-result .draw { color: var(--text-secondary); }

.battle-result .trophy-change {
    font-size: 20px;
    font-weight: 700;
    margin: 10px 0;
}

.battle-result .trophy-change.positive { color: var(--green); }
.battle-result .trophy-change.negative { color: var(--red); }

.battle-result .crowns-display {
    font-size: 28px;
    margin: 10px 0;
}

.battle-countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Lilita One', cursive;
    font-size: 80px;
    color: var(--gold);
    text-shadow: 0 4px 0 var(--gold-dark), 0 8px 20px rgba(0,0,0,0.5);
    z-index: 5;
    animation: countdown-pop 0.5s ease-out;
}

.battle-countdown.hidden { display: none; }

@keyframes countdown-pop {
    0% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ============= PROFILE ============= */

#screen-profile {
    background: var(--bg-dark);
}

.profile-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.profile-card {
    background: linear-gradient(135deg, var(--bg-medium), var(--bg-light));
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-primary), var(--purple));
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    border: 3px solid var(--gold);
}

.profile-name {
    font-family: 'Lilita One', cursive;
    font-size: 24px;
    color: var(--gold);
}

.profile-trophies {
    font-size: 20px;
    margin: 8px 0;
}

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.stat-box {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--gold);
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.profile-deck {
    margin-top: 20px;
}

.profile-deck h3 {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-deck-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* ============= FRIENDS ============= */

#screen-friends {
    background: var(--bg-dark);
}

.friends-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
}

.friends-actions input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: white;
    font-size: 14px;
    font-family: 'Nunito', sans-serif;
    outline: none;
}

.friends-tabs {
    display: flex;
    padding: 0 16px;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.friend-tab {
    padding: 10px 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.friend-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.friends-list, .friends-pending {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
}

.friends-pending.hidden { display: none; }

.friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    margin-bottom: 8px;
}

.friend-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-weight: 700;
    font-size: 15px;
}

.friend-trophies {
    font-size: 12px;
    color: var(--gold);
}

.friend-online {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.friend-actions {
    display: flex;
    gap: 6px;
}

/* ============= SETTINGS ============= */

#screen-settings {
    background: var(--bg-dark);
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.settings-section {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 15px;
}

.settings-section h3 {
    color: var(--gold);
    font-size: 15px;
    margin-bottom: 12px;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.setting-row:last-child { border-bottom: none; }

.setting-row label {
    font-size: 14px;
    font-weight: 700;
    min-width: 100px;
    color: var(--text-secondary);
}

.setting-row input[type="email"],
.setting-row input[type="password"] {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    color: white;
    font-size: 13px;
    font-family: 'Nunito', sans-serif;
    outline: none;
}

.setting-row input[type="range"] {
    flex: 1;
    accent-color: var(--blue-primary);
}

/* ============= MODALS & BANNERS ============= */

.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden { display: none; }

.modal-content {
    background: linear-gradient(135deg, var(--bg-medium), var(--bg-light));
    border-radius: 15px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.modal-content h3 {
    font-family: 'Lilita One', cursive;
    color: var(--gold);
    font-size: 22px;
    margin-bottom: 10px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.modal-actions .btn {
    flex: 1;
}

.card-detail {
    text-align: center;
}

.card-detail .detail-name {
    font-family: 'Lilita One', cursive;
    font-size: 24px;
    color: var(--gold);
    margin-bottom: 5px;
}

.card-detail .detail-rarity {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.card-detail .detail-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 15px 0;
    text-align: left;
}

.card-detail .detail-stat {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 5px;
    font-size: 13px;
}

.card-detail .detail-stat .val {
    font-weight: 800;
    color: var(--gold);
}

.card-detail .detail-art-frame {
    width: 110px;
    height: 110px;
    margin: 12px auto;
    border-radius: 12px;
    border: 3px solid rgba(255,255,255,0.2);
    padding: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.card-detail .detail-art-frame.rarity-common { border-color: #8e8e8e; background: rgba(142,142,142,0.2); }
.card-detail .detail-art-frame.rarity-rare { border-color: #f0a030; background: rgba(240,160,48,0.2); box-shadow: 0 4px 15px rgba(0,0,0,0.4), 0 0 20px rgba(240,160,48,0.15); }
.card-detail .detail-art-frame.rarity-epic { border-color: #c030e0; background: rgba(192,48,224,0.2); box-shadow: 0 4px 15px rgba(0,0,0,0.4), 0 0 20px rgba(192,48,224,0.15); }

.card-detail .detail-art-img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.card-detail .detail-desc {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 13px;
    margin: 12px 0;
}

.card-detail .upgrade-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.card-detail .upgrade-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.banner {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    animation: slideDown 0.3s ease-out;
}

.banner.hidden { display: none; }

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-100%); }
    to { transform: translateX(-50%) translateY(0); }
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--purple), var(--purple-dark));
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    font-size: 14px;
    font-weight: 700;
}

.banner-icon {
    font-size: 20px;
}

/* ============= SCROLLBAR ============= */

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}

/* ============= UTILITY ============= */

.hidden {
    display: none !important;
}

/* ============= ANIMATIONS ============= */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.screen.active {
    animation: fadeIn 0.2s ease-out;
}

/* ============= RESPONSIVE ============= */

@media (min-width: 768px) {
    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .btn-battle {
        font-size: 28px;
        padding: 20px 60px;
    }
}

@media (max-height: 600px) {
    .menu-center {
        gap: 8px;
        padding: 10px;
    }

    .arena-banner {
        padding: 8px 20px;
    }

    .btn-battle {
        font-size: 18px;
        padding: 12px 30px;
    }
}
