﻿  /* ============================================================
     RESET & BASE
  ============================================================ */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --bg:        #0a0f0a;
    --surface:   #111811;
    --surface2:  #192219;
    --border:    #2a3d2a;
    --gold:      #c8a84b;
    --gold2:     #f0d080;
    --green:     #1e6b3a;
    --green2:    #27a05a;
    --red:       #c0392b;
    --text:      #e8e8d8;
    --text2:     #a0a890;
    --card-bg:   #f5f0e8;
    --card-txt:  #1a1a1a;
    --hearts:    #b03030;
    --diamonds:  #b03030;
    --spades:    #1a1a1a;
    --clubs:     #1a1a1a;
    /* Edition-Farben */
    --foil-color:  #4fc3f7;
    --holo-color:  #ffd700;
    --wild-color:  #ce93d8;
  }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Georgia', serif;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-x: hidden;
  }
  button {
    cursor: pointer;
    border: none;
    font-family: inherit;
  }
  button:disabled { opacity: 0.4; cursor: not-allowed; }

  /* ============================================================
     SCREENS (nur jeweils einer sichtbar)
  ============================================================ */
  .screen {
    display: none;
    width: 100%;
    max-width: 1280px;
    padding: 20px;
    flex-direction: column;
    align-items: center;
  }
  .screen.active { display: flex; }

  /* ============================================================
     TITLE SCREEN
  ============================================================ */
  #screen-title {
    justify-content: center;
    min-height: 100vh;
    gap: 20px;
    background: radial-gradient(ellipse at center, #1a2f1a 0%, #0a0f0a 70%);
  }
  .title-logo {
    font-size: 6rem;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 0 0 40px rgba(200,168,75,0.6), 0 0 80px rgba(200,168,75,0.3);
    letter-spacing: 0.15em;
    text-align: center;
  }
  .title-subtitle {
    font-size: 1.3rem;
    color: var(--text2);
    text-align: center;
    letter-spacing: 0.05em;
  }
  .title-flavor {
    max-width: 520px;
    text-align: center;
    color: var(--text2);
    line-height: 1.7;
    font-style: italic;
    border: 1px solid var(--border);
    padding: 16px 24px;
    border-radius: 8px;
    background: var(--surface);
  }
  .btn-primary {
    background: linear-gradient(135deg, var(--gold), #8a6020);
    color: #1a1000;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 14px 48px;
    border-radius: 6px;
    letter-spacing: 0.08em;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(200,168,75,0.4);
  }
  .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--gold2), var(--gold));
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(200,168,75,0.6);
  }
  .title-suits {
    font-size: 2rem;
    color: var(--gold);
    letter-spacing: 1rem;
    opacity: 0.5;
  }

  /* ---- Account-Panel im Titel-Screen ---- */
  .auth-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px 32px;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .auth-panel h3 {
    color: var(--gold);
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 4px;
  }
  .auth-panel input {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    padding: 8px 12px;
    outline: none;
    transition: border-color 0.15s;
  }
  .auth-panel input:focus { border-color: var(--gold); }
  .auth-panel input::placeholder { color: var(--text2); }
  .auth-error {
    color: var(--red);
    font-size: 0.85rem;
    text-align: center;
    min-height: 1.2em;
  }
  .auth-tabs {
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
  }
  .auth-tab {
    flex: 1;
    padding: 8px;
    background: var(--surface2);
    color: var(--text2);
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 0.04em;
    transition: all 0.15s;
    text-align: center;
    cursor: pointer;
    border: none;
  }
  .auth-tab.active {
    background: var(--green);
    color: #d0ffd0;
  }

  /* Eingeloggt-Panel */
  .logged-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 28px;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }
  .logged-user {
    font-size: 1.2rem;
    color: var(--gold);
    font-weight: bold;
    text-align: center;
  }
  .logged-elo {
    font-size: 0.9rem;
    color: var(--text2);
    text-align: center;
  }
  .logged-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .btn-secondary {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: bold;
    padding: 10px 24px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    transition: all 0.15s;
  }
  .btn-secondary:hover:not(:disabled) {
    border-color: var(--gold);
    color: var(--gold);
  }
  .btn-danger {
    background: transparent;
    border: 1px solid var(--red);
    color: var(--red);
    font-size: 0.85rem;
    padding: 7px 16px;
    border-radius: 5px;
    transition: all 0.15s;
  }
  .btn-danger:hover:not(:disabled) {
    background: var(--red);
    color: white;
  }

  /* ============================================================
     HUD (Spielbereich oben)
  ============================================================ */
  #screen-game { gap: 12px; min-height: 100vh; padding-bottom: 30px; }

  #hud {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    align-items: center;
  }
  .hud-block { display: flex; flex-direction: column; gap: 4px; }
  .hud-label { font-size: 0.7rem; color: var(--text2); letter-spacing: 0.08em; text-transform: uppercase; }
  .hud-value { font-size: 1.3rem; color: var(--gold); font-weight: bold; }
  .hud-center { align-items: center; text-align: center; }
  .hud-right { align-items: flex-end; text-align: right; }

  /* Progress bar */
  .progress-wrap { width: 100%; background: var(--surface2); border-radius: 4px; height: 10px; overflow: hidden; border: 1px solid var(--border); }
  .progress-bar { height: 100%; background: linear-gradient(90deg, var(--green), var(--green2)); border-radius: 4px; transition: width 0.4s ease; }

  /* Million bar */
  .million-wrap { width: 100%; background: var(--surface2); border-radius: 4px; height: 6px; overflow: hidden; border: 1px solid var(--border); }
  .million-bar { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold2)); border-radius: 4px; transition: width 0.4s ease; }

  /* Beste Hand Anzeige */
  .hud-best-hand {
    font-size: 0.72rem;
    color: var(--text2);
    font-style: italic;
    margin-top: 2px;
  }
  .hud-best-hand span { color: var(--gold2); font-weight: bold; }

  /* Resources */
  .resources {
    display: flex; gap: 16px; justify-content: center; align-items: center;
    flex-wrap: wrap;
  }
  .res-item {
    display: flex; align-items: center; gap: 6px;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 6px; padding: 6px 14px;
    font-size: 0.95rem;
  }
  .res-icon { font-size: 1.1rem; }
  .res-val { color: var(--gold); font-weight: bold; font-size: 1.1rem; }

  /* Relics strip */
  #relics-strip {
    width: 100%;
    display: flex; gap: 8px; flex-wrap: wrap;
    min-height: 36px;
    align-items: center;
  }
  .relic-chip {
    background: var(--surface2);
    border: 1px solid var(--gold);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    color: var(--gold);
    cursor: help;
    white-space: nowrap;
  }

  /* Score flash */
  #score-flash {
    width: 100%;
    text-align: center;
    min-height: 64px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px;
  }
  .flash-combo { font-size: 1.3rem; color: var(--gold2); font-weight: bold; letter-spacing: 0.05em; }
  .flash-calc { font-size: 1.1rem; color: var(--text); }
  .flash-total { font-size: 1.8rem; color: var(--green2); font-weight: bold; }
  .flash-besthand { font-size: 0.82rem; color: var(--gold); font-style: italic; margin-top: 4px; }
  @keyframes flashIn {
    0%   { opacity: 0; transform: scale(0.7) translateY(10px); }
    60%  { opacity: 1; transform: scale(1.08) translateY(-4px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
  }
  .flash-anim { animation: flashIn 0.35s ease forwards; }

  /* ============================================================
     DUEL-HUD (zusätzlich im Duell-Modus)
  ============================================================ */
  #duel-hud {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--gold);
    border-radius: 10px;
    padding: 10px 20px;
    display: none;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }
  #duel-hud.active { display: flex; }
  .duel-player-info {
    display: flex; flex-direction: column; gap: 2px;
    min-width: 140px;
  }
  .duel-player-name {
    font-size: 0.9rem;
    color: var(--gold);
    font-weight: bold;
  }
  .duel-player-score {
    font-size: 1.1rem;
    color: var(--green2);
    font-weight: bold;
  }
  .duel-timer {
    font-size: 1.5rem;
    color: var(--gold);
    font-weight: bold;
    text-align: center;
    min-width: 80px;
  }
  .duel-timer.urgent { color: var(--red); animation: timerPulse 1s infinite; }
  @keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
  }
  .duel-vs { color: var(--text2); font-size: 0.85rem; text-align: center; }
  .duel-round-badge {
    background: var(--gold);
    color: #1a1000;
    border-radius: 4px;
    padding: 2px 10px;
    font-size: 0.8rem;
    font-weight: bold;
  }

  /* Shop-Countdown im Duell */
  #shop-duel-info {
    display: none;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 10px 16px;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }
  #shop-duel-info.active { display: flex; }

  /* ============================================================
     SORTIER-BUTTONS
  ============================================================ */
  #sort-area {
    width: 100%;
    display: flex; gap: 8px; justify-content: center; align-items: center;
    margin-bottom: 4px;
  }
  .btn-sort {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text2);
    border-radius: 5px;
    padding: 5px 16px;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    transition: all 0.15s;
  }
  .btn-sort:hover { border-color: var(--gold); color: var(--gold); }
  .btn-sort.active { border-color: var(--gold); color: var(--gold); background: #1e2a1e; }

  /* ============================================================
     HAND / CARDS
  ============================================================ */
  #hand-area {
    width: 100%;
    display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
    min-height: 160px; align-items: flex-end;
  }

  .card {
    width: 80px; height: 120px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 2px solid #ccc;
    display: flex; flex-direction: column;
    justify-content: space-between;
    padding: 5px 7px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    user-select: none;
    position: relative;
    box-shadow: 0 3px 10px rgba(0,0,0,0.5);
  }
  .card:hover { transform: translateY(-8px); box-shadow: 0 10px 20px rgba(0,0,0,0.6); }
  .card.selected {
    transform: translateY(-20px);
    border-color: var(--gold);
    box-shadow: 0 0 18px rgba(200,168,75,0.7);
  }
  .card.hearts   .card-val, .card.hearts   .card-suit-big { color: var(--hearts); }
  .card.diamonds .card-val, .card.diamonds .card-suit-big { color: var(--diamonds); }
  .card.spades   .card-val, .card.spades   .card-suit-big { color: var(--spades); }
  .card.clubs    .card-val, .card.clubs    .card-suit-big { color: var(--clubs); }
  .card-top { font-size: 0.85rem; font-weight: bold; line-height: 1; display: flex; flex-direction: column; align-items: flex-start; }
  .card-val { font-size: 1rem; font-weight: bold; line-height: 1; }
  .card-suit-small { font-size: 0.8rem; line-height: 1; }
  .card-suit-big { font-size: 2rem; text-align: center; line-height: 1; }
  .card-bot { font-size: 0.85rem; font-weight: bold; transform: rotate(180deg); line-height: 1; display: flex; flex-direction: column; align-items: flex-start; }

  /* Editions-Rahmen & Label */
  .card.edition-foil {
    border-color: var(--foil-color) !important;
    box-shadow: 0 0 10px rgba(79,195,247,0.55), 0 3px 10px rgba(0,0,0,0.5);
  }
  .card.edition-foil.selected {
    box-shadow: 0 0 22px rgba(79,195,247,0.9);
  }
  .card.edition-holo {
    border-color: var(--holo-color) !important;
    box-shadow: 0 0 10px rgba(255,215,0,0.55), 0 3px 10px rgba(0,0,0,0.5);
  }
  .card.edition-holo.selected {
    box-shadow: 0 0 22px rgba(255,215,0,0.9);
  }
  .card.edition-wild {
    border-color: var(--wild-color) !important;
    box-shadow: 0 0 10px rgba(206,147,216,0.55), 0 3px 10px rgba(0,0,0,0.5);
  }
  .card.edition-wild.selected {
    box-shadow: 0 0 22px rgba(206,147,216,0.9);
  }
  /* Editions-Badge oben rechts auf der Karte */
  .edition-badge {
    position: absolute;
    top: 3px; right: 4px;
    font-size: 0.55rem;
    font-weight: bold;
    border-radius: 3px;
    padding: 1px 3px;
    line-height: 1.2;
    pointer-events: none;
    z-index: 2;
  }
  .edition-badge.foil  { background: var(--foil-color);  color: #002a3a; }
  .edition-badge.holo  { background: var(--holo-color);  color: #3a2800; }
  .edition-badge.wild  { background: var(--wild-color);  color: #1e003a; }

  /* Combo preview badge */
  #combo-preview {
    font-size: 0.95rem;
    color: var(--gold);
    min-height: 22px;
    text-align: center;
    font-style: italic;
  }

  /* ============================================================
     ACTION BUTTONS
  ============================================================ */
  #action-area {
    display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  }
  .btn-action {
    padding: 12px 32px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    transition: all 0.15s;
  }
  .btn-play {
    background: linear-gradient(135deg, var(--green), #145228);
    color: #d0ffd0;
    box-shadow: 0 3px 14px rgba(30,107,58,0.5);
  }
  .btn-play:hover:not(:disabled) { background: linear-gradient(135deg, var(--green2), var(--green)); transform: translateY(-1px); }
  .btn-discard {
    background: linear-gradient(135deg, #6a3a10, #3a1a08);
    color: #ffd8a0;
    box-shadow: 0 3px 14px rgba(106,58,16,0.4);
  }
  .btn-discard:hover:not(:disabled) { background: linear-gradient(135deg, #8a4a18, #6a3a10); transform: translateY(-1px); }

  /* ============================================================
     SHOP SCREEN
  ============================================================ */
  #screen-shop { gap: 20px; min-height: 100vh; }
  .shop-header { text-align: center; }
  .shop-title { font-size: 2rem; color: var(--gold); font-weight: bold; }
  .shop-money { font-size: 1.2rem; color: var(--green2); margin-top: 4px; }
  .shop-section { width: 100%; }
  .shop-section-title {
    font-size: 0.85rem; color: var(--text2); letter-spacing: 0.1em; text-transform: uppercase;
    border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 12px;
  }
  .shop-items { display: flex; gap: 14px; flex-wrap: wrap; }

  .shop-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    width: 160px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    transition: border-color 0.15s;
    position: relative;
  }
  .shop-card:hover { border-color: var(--gold); }
  .shop-card .card { pointer-events: none; }
  .shop-card .price-tag {
    background: var(--gold);
    color: #1a1000;
    border-radius: 20px;
    padding: 3px 14px;
    font-weight: bold;
    font-size: 0.9rem;
  }
  .btn-buy {
    background: var(--green);
    color: #d0ffd0;
    border-radius: 5px;
    padding: 6px 18px;
    font-size: 0.85rem;
    font-weight: bold;
    width: 100%;
    transition: background 0.15s;
  }
  .btn-buy:hover:not(:disabled) { background: var(--green2); }

  /* Edition-Beschriftung im Shop */
  .shop-edition-label {
    font-size: 0.78rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 2px;
  }
  .shop-edition-label.foil  { background: var(--foil-color); color: #002a3a; }
  .shop-edition-label.holo  { background: var(--holo-color); color: #3a2800; }
  .shop-edition-label.wild  { background: var(--wild-color); color: #1e003a; }
  .shop-edition-desc { font-size: 0.7rem; color: var(--text2); text-align: center; font-style: italic; }

  .relic-shop {
    background: var(--surface);
    border: 1px solid var(--gold);
    border-radius: 10px;
    padding: 14px;
    width: 200px;
    display: flex; flex-direction: column; gap: 8px;
  }
  .relic-name { color: var(--gold); font-weight: bold; font-size: 1rem; }
  .relic-desc { color: var(--text2); font-size: 0.82rem; line-height: 1.4; }

  /* Deck-Slim Section */
  .deck-cards {
    display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow-y: auto;
  }
  .deck-card-mini {
    width: 60px; height: 90px;
    background: var(--card-bg);
    border-radius: 6px;
    border: 1px solid #ccc;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
    position: relative;
  }
  .deck-card-mini:hover { border-color: var(--red); transform: scale(1.05); }
  .deck-card-mini .cv { font-size: 0.9rem; font-weight: bold; }
  .deck-card-mini .cs { font-size: 1.2rem; }
  .deck-card-mini.hearts   .cv, .deck-card-mini.hearts   .cs { color: var(--hearts); }
  .deck-card-mini.diamonds .cv, .deck-card-mini.diamonds .cs { color: var(--diamonds); }
  .deck-card-mini.spades   .cv, .deck-card-mini.spades   .cs { color: var(--spades); }
  .deck-card-mini.clubs    .cv, .deck-card-mini.clubs    .cs { color: var(--clubs); }
  .slim-price { font-size: 0.65rem; color: var(--red); position: absolute; bottom: 3px; right: 4px; }
  /* Editions-Rahmen auch bei Mini-Karten */
  .deck-card-mini.edition-foil  { border-color: var(--foil-color); box-shadow: 0 0 6px rgba(79,195,247,0.5); }
  .deck-card-mini.edition-holo  { border-color: var(--holo-color); box-shadow: 0 0 6px rgba(255,215,0,0.5); }
  .deck-card-mini.edition-wild  { border-color: var(--wild-color); box-shadow: 0 0 6px rgba(206,147,216,0.5); }

  .btn-continue {
    background: linear-gradient(135deg, var(--gold), #8a6020);
    color: #1a1000;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 12px 40px;
    border-radius: 6px;
    letter-spacing: 0.06em;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(200,168,75,0.4);
    margin-top: 10px;
  }
  .btn-continue:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(200,168,75,0.6); }

  /* ============================================================
     WIN / LOSE SCREENS
  ============================================================ */
  #screen-win, #screen-lose {
    justify-content: center; min-height: 100vh; gap: 24px;
    background: radial-gradient(ellipse at center, #1a2f1a 0%, #0a0f0a 70%);
  }
  .end-title { font-size: 3.5rem; font-weight: bold; text-align: center; }
  .win-title { color: var(--gold); text-shadow: 0 0 40px rgba(200,168,75,0.6); }
  .lose-title { color: var(--red); text-shadow: 0 0 40px rgba(192,57,43,0.6); }
  .end-subtitle { font-size: 1.3rem; color: var(--text2); text-align: center; }
  .end-stats {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 20px 40px;
    display: flex; flex-direction: column; gap: 10px;
    min-width: 320px;
  }
  .stat-row { display: flex; justify-content: space-between; gap: 30px; }
  .stat-label { color: var(--text2); }
  .stat-value { color: var(--gold); font-weight: bold; }

  /* ============================================================
     LOBBY SCREEN
  ============================================================ */
  #screen-lobby {
    gap: 24px;
    min-height: 100vh;
    background: radial-gradient(ellipse at center, #1a2f1a 0%, #0a0f0a 70%);
    justify-content: flex-start;
    padding-top: 40px;
  }
  .lobby-title {
    font-size: 2rem;
    color: var(--gold);
    font-weight: bold;
    text-align: center;
  }
  .lobby-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 24px;
    width: 100%;
    max-width: 600px;
  }
  .lobby-section h3 {
    color: var(--gold);
    font-size: 1rem;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
  }
  .queue-buttons {
    display: flex; gap: 12px; flex-wrap: wrap;
  }
  .btn-queue {
    background: linear-gradient(135deg, var(--green), #145228);
    color: #d0ffd0;
    font-size: 1rem;
    font-weight: bold;
    padding: 12px 28px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    transition: all 0.15s;
    box-shadow: 0 3px 12px rgba(30,107,58,0.4);
  }
  .btn-queue:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--green2), var(--green));
    transform: translateY(-1px);
  }
  .queue-status {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .queue-spinner {
    width: 16px; height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
  }
  .queue-spinner.active { display: block; }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* Stats-Tabelle */
  .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
  }
  .stats-grid .stat-label { font-size: 0.82rem; color: var(--text2); }
  .stats-grid .stat-value { font-size: 0.95rem; color: var(--gold); font-weight: bold; }

  /* Leaderboard */
  .leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
  }
  .leaderboard-table th {
    color: var(--text2);
    text-align: left;
    padding: 4px 8px;
    border-bottom: 1px solid var(--border);
  }
  .leaderboard-table td {
    padding: 4px 8px;
    border-bottom: 1px solid var(--surface2);
    color: var(--text);
  }
  .leaderboard-table tr.me td { color: var(--gold); font-weight: bold; }
  .leaderboard-scroll {
    max-height: 300px;
    overflow-y: auto;
  }

  /* ============================================================
     MATCH-ENDE SCREEN
  ============================================================ */
  #screen-match-end {
    justify-content: center; min-height: 100vh; gap: 24px;
    background: radial-gradient(ellipse at center, #1a2f1a 0%, #0a0f0a 70%);
  }
  .match-end-result {
    font-size: 3.5rem;
    font-weight: bold;
    text-align: center;
  }
  .match-end-result.win   { color: var(--gold);  text-shadow: 0 0 40px rgba(200,168,75,0.6); }
  .match-end-result.loss  { color: var(--red);   text-shadow: 0 0 40px rgba(192,57,43,0.6); }
  .match-end-result.draw  { color: var(--text2); }
  .match-end-result.abort { color: var(--text2); }

  /* ============================================================
     MISC UTILITIES
  ============================================================ */
  .divider {
    width: 100%; border: none; border-top: 1px solid var(--border); margin: 4px 0;
  }
  .gold { color: var(--gold); }
  .green2 { color: var(--green2); }
  .red { color: var(--red); }
  .small { font-size: 0.82rem; color: var(--text2); }

  /* scrollbar style */
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: var(--surface); }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

  /* ============================================================
     P1 TUTORIAL-OVERLAY
  ============================================================ */
  #how-to-play-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 8000;
    background: rgba(0,0,0,0.82);
    align-items: center;
    justify-content: center;
    padding: 16px;
  }
  #how-to-play-overlay.active { display: flex; }
  .htp-modal {
    background: var(--surface);
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 28px 32px;
    max-width: 680px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
  }
  .htp-title {
    font-size: 1.7rem;
    color: var(--gold);
    font-weight: bold;
    text-align: center;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
  }
  .htp-section-title {
    font-size: 1rem;
    color: var(--gold2);
    font-weight: bold;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
    margin-bottom: 8px;
  }
  .htp-text {
    font-size: 0.92rem;
    color: var(--text);
    line-height: 1.65;
  }
  .htp-combo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
  }
  .htp-combo-table th {
    color: var(--text2);
    text-align: left;
    padding: 4px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }
  .htp-combo-table td {
    padding: 4px 8px;
    border-bottom: 1px solid var(--surface2);
    color: var(--text);
  }
  .htp-combo-table td:first-child { color: var(--gold); font-weight: bold; }
  .htp-close-btn {
    position: absolute;
    top: 14px; right: 18px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text2);
    border-radius: 5px;
    padding: 4px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
  }
  .htp-close-btn:hover { border-color: var(--gold); color: var(--gold); }

  /* ============================================================
     MOBILE OPTIMIERUNGEN
  ============================================================ */
  * { -webkit-tap-highlight-color: transparent; }
  .card, button, .deck-remove-card { touch-action: manipulation; user-select: none; }

  @media (max-width: 768px) {
    #hud { gap: 8px; padding: 8px 10px; }
    .hud-value { font-size: 1.2rem; }
    .hud-label { font-size: 0.68rem; }
    .million-wrap, .progress-wrap { height: 5px; }
    #hud-best-hand { font-size: 0.68rem; }
    .res-val { font-size: 1rem; }

    .card {
      width: 62px; height: 92px;
      padding: 3px 5px;
      border-radius: 6px;
    }
    .card-suit-big { font-size: 1.4rem; }
    .card-val { font-size: 0.82rem; }
    .card-suit-small { font-size: 0.65rem; }
    #hand-area { gap: 5px; min-height: 110px; }

    .btn-action { padding: 12px 20px; font-size: 0.9rem; min-height: 44px; }
    .btn-primary, .btn-continue { min-height: 44px; }
    .btn-sort { min-height: 36px; padding: 6px 12px; }

    .shop-card { width: 130px; padding: 10px; }
    .shop-title { font-size: 1.4rem; }
    .title-logo { font-size: clamp(2.5rem, 12vw, 5rem); }

    .card.selected { transform: translateY(-14px); }
  }

  /* ============================================================
     C3-Q: KOSMETIK — CSS-Klassen-Map (id → Klasse, H-XSS-2)
     Kartenrücken, Tisch-Theme, Profilrahmen, Namensfarbe
  ============================================================ */

  /* --- Kartenrücken --- */
  .cb-back_classic  { --card-back-color: #c0392b; }
  .cb-back_midnight { --card-back-color: #1a237e; }
  .cb-back_emerald  { --card-back-color: #1b5e20; }
  .cb-back_gold     { --card-back-color: #f9a825; }
  .cb-back_neon     { --card-back-color: #00e5ff; }

  /* --- Tisch-Themes (body-Klasse) --- */
  .tt-table_green    { --bg: #0a160a; --surface: #0e1e0e; --green: #1e6b3a; }
  .tt-table_crimson  { --bg: #160a0a; --surface: #1e0e0e; --green: #6b1e2a; }
  .tt-table_obsidian { --bg: #0a0a10; --surface: #0e0e18; --green: #2a2a4a; }
  .tt-table_royal    { --bg: #100a16; --surface: #180e1e; --green: #4a1e6b; }

  /* --- Profilrahmen --- */
  .fr-frame_none    { --profile-frame: none; }
  .fr-frame_bronze  { --profile-frame: 2px solid #cd7f32; }
  .fr-frame_silver  { --profile-frame: 2px solid #c0c0c0; }
  .fr-frame_diamond { --profile-frame: 2px solid #b9f2ff; box-shadow: 0 0 8px #b9f2ff88; }

  /* --- Namensfarben (H-XSS-2: ausschließlich über Klassen, nie roher Style-String) --- */
  .nc-color_white   { color: #e8e8d8; }
  .nc-color_gold    { color: #c8a84b; }
  .nc-color_crimson { color: #c0392b; }

  /* ============================================================
     C3-Q: FREUNDE-SCREEN
  ============================================================ */
  #screen-friends {
    gap: 16px;
    min-height: 100vh;
  }
  .friends-title {
    font-size: 1.8rem;
    color: var(--gold);
    font-weight: bold;
    letter-spacing: 0.08em;
    text-align: center;
  }
  .friends-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    width: 100%;
    max-width: 640px;
  }
  .friends-tab {
    flex: 1;
    background: transparent;
    color: var(--text2);
    font-size: 0.95rem;
    padding: 10px 8px;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    letter-spacing: 0.04em;
  }
  .friends-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
    font-weight: bold;
  }
  .friends-tab:hover:not(.active) { color: var(--text); }
  .friends-panel {
    display: none;
    width: 100%;
    max-width: 640px;
    flex-direction: column;
    gap: 10px;
  }
  .friends-panel.active { display: flex; }
  .friend-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
  }
  .friend-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--surface2);
    border: var(--profile-frame, 1px solid var(--border));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
  }
  .friend-info { flex: 1; min-width: 0; }
  .friend-name {
    font-weight: bold;
    font-size: 0.95rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .friend-meta { font-size: 0.78rem; color: var(--text2); }
  .friend-online  { color: var(--green2); font-weight: bold; }
  .friend-offline { color: var(--text2); }
  .friend-actions { display: flex; gap: 6px; flex-shrink: 0; }
  .friend-actions button {
    font-size: 0.82rem;
    padding: 5px 12px;
    border-radius: 5px;
  }
  .friends-empty {
    text-align: center;
    color: var(--text2);
    font-size: 0.9rem;
    padding: 24px 0;
  }
  .friends-search-row {
    display: flex; gap: 8px; align-items: center;
  }
  .friends-search-row input {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 9px 12px;
    font-family: inherit;
    font-size: 0.95rem;
  }
  .friends-search-row input::placeholder { color: var(--text2); }
  .friends-search-row input:focus {
    outline: none;
    border-color: var(--gold);
  }
  .friends-msg {
    font-size: 0.85rem;
    min-height: 1.2em;
    padding: 2px 0;
  }
  .friends-msg.ok  { color: var(--green2); }
  .friends-msg.err { color: var(--red); }

  /* ============================================================
     C3-Q: KOSMETIK-SHOP-SCREEN
  ============================================================ */
  #screen-cosmeticshop {
    gap: 16px;
    min-height: 100vh;
  }
  .cshop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 860px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .cshop-title {
    font-size: 1.8rem;
    color: var(--gold);
    font-weight: bold;
    letter-spacing: 0.08em;
  }
  .cshop-coins {
    background: var(--surface);
    border: 1px solid var(--gold);
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 1rem;
    color: var(--gold);
    font-weight: bold;
  }
  .cshop-tabs {
    display: flex; gap: 0;
    border-bottom: 2px solid var(--border);
    width: 100%; max-width: 860px;
  }
  .cshop-tab {
    flex: 1;
    background: transparent;
    color: var(--text2);
    font-size: 0.95rem;
    padding: 10px 8px;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    letter-spacing: 0.04em;
  }
  .cshop-tab.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: bold; }
  .cshop-tab:hover:not(.active) { color: var(--text); }
  .cshop-panel { display: none; width: 100%; max-width: 860px; flex-direction: column; gap: 16px; }
  .cshop-panel.active { display: flex; }
  .cshop-type-section { display: flex; flex-direction: column; gap: 8px; }
  .cshop-type-title {
    font-size: 0.85rem;
    color: var(--gold2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
  }
  .cshop-items { display: flex; flex-wrap: wrap; gap: 10px; }
  .cshop-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    min-width: 140px;
    max-width: 200px;
    flex: 1 1 140px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.15s;
    position: relative;
  }
  .cshop-item.owned  { border-color: var(--green2); }
  .cshop-item.equipped { border-color: var(--gold); box-shadow: 0 0 8px rgba(200,168,75,0.3); }
  .cshop-item-name { font-weight: bold; font-size: 0.92rem; color: var(--text); }
  .cshop-item-price { font-size: 0.82rem; color: var(--gold); }
  .cshop-item-premium { font-size: 0.72rem; color: var(--gold2); }
  .cshop-item-status { font-size: 0.78rem; color: var(--green2); font-weight: bold; }
  .cshop-item-btns { display: flex; gap: 6px; flex-wrap: wrap; }
  .cshop-item-btns button { font-size: 0.8rem; padding: 5px 10px; border-radius: 4px; }
  /* Münz-Pakete */
  .cshop-pack {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
  }
  .cshop-pack-name { font-weight: bold; font-size: 1rem; color: var(--gold); }
  .cshop-pack-coins { font-size: 0.9rem; color: var(--text); }
  .cshop-pack-btn { font-size: 0.9rem; padding: 8px 18px; border-radius: 6px; }
  .cshop-sim-notice {
    background: var(--surface2);
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.88rem;
    color: var(--gold2);
    text-align: center;
  }

  /* ============================================================
     C3-Q: PROFIL-ANSICHT (innerhalb Freunde-Screen)
  ============================================================ */
  .profile-view {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 640px;
  }
  .profile-view-header {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .profile-view-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--surface2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
  }
  .profile-view-name { font-size: 1.3rem; font-weight: bold; }
  .profile-view-elo  { font-size: 0.9rem; color: var(--gold); }
  .profile-view-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 0.88rem; }
  .profile-view-stats .stat-label { color: var(--text2); }
  .profile-view-stats .stat-value { color: var(--gold); font-weight: bold; }

/* ================================================================
   MATCH-HINTERGRÜNDE (matchBg Kosmetik)
   ================================================================ */

/* Static */
.mb-bg_static_default { /* Standard — kein Override */ }
.mb-bg_static_forest  { background: linear-gradient(135deg, #050e06 0%, #091508 100%) !important; }
.mb-bg_static_void    { background: linear-gradient(135deg, #050512 0%, #0a0a1c 100%) !important; }
.mb-bg_static_desert  { background: linear-gradient(135deg, #0e0802 0%, #180e04 100%) !important; }

/* Animiert — Hintergrund-Gradient bewegt sich */
.mb-bg_anim_nebula {
  background: linear-gradient(135deg, #0c0030, #001030, #0c0020, #000c28) !important;
  background-size: 300% 300% !important;
  animation: mbNebula 8s ease infinite;
}
@keyframes mbNebula {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.mb-bg_anim_matrix {
  background: linear-gradient(160deg, #001200, #000800, #001a00, #000d00) !important;
  background-size: 300% 300% !important;
  animation: mbMatrix 5s ease infinite;
}
@keyframes mbMatrix {
  0%   { background-position: 0% 0%;   filter: brightness(1); }
  50%  { background-position: 100% 100%; filter: brightness(1.25); }
  100% { background-position: 0% 0%;   filter: brightness(1); }
}

.mb-bg_anim_fire {
  background: linear-gradient(180deg, #0c0000 0%, #250800 40%, #120300 100%) !important;
  background-size: 100% 300% !important;
  animation: mbFire 3s ease-in-out infinite;
}
@keyframes mbFire {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 0% 100%; }
  100% { background-position: 0% 0%; }
}

.mb-bg_anim_aurora {
  background: linear-gradient(135deg, #000c0a, #001810, #001214, #000e0a) !important;
  background-size: 400% 400% !important;
  animation: mbAurora 10s ease infinite;
}
@keyframes mbAurora {
  0%   { background-position: 0% 50%; }
  33%  { background-position: 100% 0%; }
  66%  { background-position: 0% 100%; }
  100% { background-position: 0% 50%; }
}

/* ================================================================
   HAND-ANIMATIONS-EFFEKTE (handAnim Kosmetik)
   Werden als CSS-Klassen auf #hand-area gesetzt und nach der
   Animation automatisch per JS entfernt.
   ================================================================ */

@keyframes haFlash {
  0%   { filter: brightness(1); }
  25%  { filter: brightness(3) saturate(2); }
  100% { filter: brightness(1); }
}
.ha-ha_flash { animation: haFlash 0.4s ease-out; }

@keyframes haRipple {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.07); }
  65%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}
.ha-ha_ripple { animation: haRipple 0.5s ease-out; }

@keyframes haExplode {
  0%   { transform: scale(1);    opacity: 1; }
  40%  { transform: scale(1.18); opacity: 0.7; }
  70%  { transform: scale(0.95); opacity: 0.95; }
  100% { transform: scale(1);    opacity: 1; }
}
.ha-ha_explode { animation: haExplode 0.6s ease-out; }

@keyframes haRainbow {
  0%   { filter: hue-rotate(0deg)   saturate(1); }
  50%  { filter: hue-rotate(180deg) saturate(2); }
  100% { filter: hue-rotate(360deg) saturate(1); }
}
.ha-ha_rainbow { animation: haRainbow 0.55s linear; }

/* ================================================================
   WERBUNGS-OVERLAY + DSGVO-BANNER
   ================================================================ */
#ad-overlay.visible      { display: flex !important; }
#consent-banner.visible  { display: flex !important; }

/* Ad-Close-Button: aktiviert wenn Countdown abgelaufen */
#ad-close-btn:not(:disabled) {
  opacity: 1;
  cursor: pointer;
}
#ad-close-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ================================================================
   PHASE 2 — SETTINGS SCREEN (2.5)
   ================================================================ */

#screen-settings {
  gap: 16px;
  min-height: 100vh;
  padding-top: 32px;
}
/* ---- Settings top bar ---- */
.settings-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 600px;
  padding-bottom: 8px;
  gap: 12px;
}
.settings-back-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.settings-back-btn:hover { border-color: var(--gold); color: var(--gold); }
.settings-title {
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: bold;
  letter-spacing: 0.06em;
  flex: 1;
  text-align: center;
}
.settings-profile-mini {
  font-size: 0.8rem;
  color: var(--text2);
  text-align: right;
  white-space: nowrap;
  min-width: 80px;
}
.settings-profile-mini strong { color: var(--text); display: block; }

/* ---- Tab bar ---- */
.settings-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  width: 100%;
  max-width: 600px;
}
.settings-tab {
  flex: 1;
  background: transparent;
  color: var(--text2);
  font-size: 0.82rem;
  padding: 8px 4px 6px;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s;
}
.settings-tab .tab-icon { font-size: 1.15rem; line-height: 1; }
.settings-tab .tab-label { font-size: 0.75rem; letter-spacing: 0.02em; }
.settings-tab.active {
  background: var(--surface);
  color: var(--gold);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.settings-tab:hover:not(.active) { color: var(--text); background: rgba(255,255,255,0.04); }

/* ---- Settings body & cards ---- */
.settings-body {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.settings-panel { display: none; width: 100%; flex-direction: column; gap: 12px; padding-top: 12px; }
.settings-panel.active { display: flex; }
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-card-label {
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
}
.settings-card-desc {
  font-size: 0.82rem;
  color: var(--text2);
  margin-top: -4px;
}

/* ---- Toggle group (sort / anim) ---- */
.settings-toggle-group {
  display: flex;
  gap: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  width: fit-content;
  margin-top: 4px;
}
.stg-btn {
  background: transparent;
  border: none;
  color: var(--text2);
  border-radius: 6px;
  padding: 7px 20px;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.stg-btn.active {
  background: var(--surface);
  color: var(--gold);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.stg-btn:hover:not(.active) { color: var(--text); }

/* ---- Hotkey grid ---- */
.rebind-hint-bar {
  background: rgba(200,168,75,0.12);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--gold);
  text-align: center;
}
.hk-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  align-items: center;
}
.hk-label { font-size: 0.9rem; color: var(--text2); }
.hk-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.85rem;
  font-family: monospace;
  color: var(--gold);
  cursor: pointer;
  min-width: 60px;
  text-align: center;
  transition: all 0.15s;
  user-select: none;
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}
.hk-badge:hover { border-color: var(--gold); transform: translateY(-1px); }
.hk-badge:active { transform: translateY(0); box-shadow: none; }
.hk-badge.rebinding { border-color: var(--gold); color: var(--gold2); animation: pulse 0.8s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
.hk-cards-row { display: flex; gap: 4px; flex-wrap: wrap; }
.hk-small { min-width: 32px; padding: 4px 6px; font-size: 0.78rem; }
.settings-reset-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  align-self: flex-start;
}
.settings-reset-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ---- Language selector ---- */
.settings-lang-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.settings-lang-globe { font-size: 1.2rem; }
.settings-lang-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  flex: 1;
  transition: border-color 0.15s;
}
.settings-lang-select:focus { outline: none; border-color: var(--gold); }

/* ---- Account cards ---- */
.settings-expand-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
}
.settings-expand-btn:hover { border-color: var(--gold); color: var(--gold); }
.settings-expand-danger {
  border-color: rgba(231,76,60,0.4);
  color: var(--red);
}
.settings-expand-danger:hover { border-color: var(--red); background: rgba(231,76,60,0.08); }
.settings-danger-zone { border-color: rgba(231,76,60,0.3); }
.settings-danger-label {
  font-size: 0.82rem;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.settings-danger-warning {
  font-size: 0.85rem;
  color: var(--red);
  padding: 8px 0 4px;
}
/* Account sub-forms */
.settings-subform {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 4px;
}
.settings-subform input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.settings-subform input:focus { border-color: var(--gold); }
.settings-subform input::placeholder { color: var(--text2); }

/* ================================================================
   PHASE 2 — COSMETICS PREVIEW OVERLAY (2.4)
   ================================================================ */

#cosmetic-preview-overlay.visible { display: flex !important; }
.cosmetic-preview-modal {
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 24px 28px;
  max-width: 440px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.cp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cp-item-name {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.cp-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}
.cp-close:hover { border-color: var(--gold); color: var(--gold); }
.cp-preview-area {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}
.cp-item-desc { font-size: 0.88rem; color: var(--text2); line-height: 1.5; }
.cp-price { font-size: 1rem; color: var(--gold); font-weight: bold; }
.cp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cp-actions button { flex: 1; min-width: 100px; }

/* ================================================================
   PHASE 2 — FREUNDE-WIDGET IN LOBBY (2.3)
   ================================================================ */

.lobby-friends-widget {
  background: var(--surface);
  border: 1px solid var(--green);
  border-radius: 10px;
  padding: 14px 18px;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lfw-title {
  font-size: 0.9rem;
  color: var(--green2);
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lfw-count {
  background: var(--green);
  color: #d0ffd0;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.75rem;
}
.lfw-list { display: flex; gap: 8px; flex-wrap: wrap; }
.lfw-item {
  background: var(--surface2);
  border: 1px solid var(--green);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lfw-item .lfw-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green2);
  flex-shrink: 0;
}
.lfw-item .lfw-name { color: var(--text); font-weight: bold; }
.lfw-item .lfw-elo { color: var(--text2); font-size: 0.78rem; }
.lfw-item .lfw-invite {
  background: var(--green);
  color: #d0ffd0;
  border: none;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.lfw-item .lfw-invite:hover { background: var(--green2); }

/* ================================================================
   PHASE 2 — LAYOUT IMPROVEMENTS (2.2)
   ================================================================ */

/* Screen transitions */
.screen { transition: opacity 0.15s ease; }

/* Leaderboard alternating rows */
.leaderboard-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.02);
}
.leaderboard-table tbody tr:hover td {
  background: rgba(200,168,75,0.06);
}

/* Better card design — deeper shadow, gradient fill */
.card {
  background: linear-gradient(160deg, #faf5ec 0%, #ede8df 100%);
  box-shadow: 0 4px 14px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.4);
}
.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.65), inset 0 1px 0 rgba(255,255,255,0.4);
}

/* Screen transition opacity */
.screen.active { animation: screenFadeIn 0.15s ease; }
@keyframes screenFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Stronger selected card glow */
.card.selected {
  transform: translateY(-22px);
  box-shadow: 0 0 22px rgba(200,168,75,0.75), 0 8px 20px rgba(0,0,0,0.6);
}

/* CSS variable for animation speed override */
[data-anim="fast"] .card { transition: transform 0.08s, box-shadow 0.08s, border-color 0.08s; }
[data-anim="fast"] .progress-bar, [data-anim="fast"] .million-bar { transition: width 0.1s ease; }
[data-anim="off"]  .card { transition: none; }
[data-anim="off"]  .progress-bar, [data-anim="off"] .million-bar { transition: none; }
[data-anim="off"]  .screen.active { animation: none; }

/* ================================================================
   PHASE 2 — DESKTOP LAYOUT (2.1) — min-width: 1024px
   ================================================================ */

@media (min-width: 1024px) {
  /* Lobby: 2-column grid */
  #screen-lobby {
    display: grid;
    grid-template-columns: 380px 1fr;
    grid-template-rows: auto;
    align-items: start;
    column-gap: 24px;
    max-width: 1100px;
    padding-top: 32px;
  }
  #screen-lobby .lobby-title {
    grid-column: 1 / -1;
  }
  #screen-lobby .lobby-friends-widget {
    grid-column: 1 / -1;
    max-width: none;
  }
  /* Left column: Queue + Stats + Social + Private room + Back */
  #screen-lobby .lobby-section:nth-of-type(1),
  #screen-lobby .lobby-section:nth-of-type(2),
  #screen-lobby .lobby-section:nth-of-type(4),
  #screen-lobby #private-room-section,
  #screen-lobby > .btn-secondary:last-of-type {
    grid-column: 1;
    max-width: none;
  }
  /* Right column: Leaderboard */
  #screen-lobby .lobby-section:nth-of-type(3) {
    grid-column: 2;
    grid-row: 2 / 8;
    max-width: none;
  }
  #screen-lobby .lobby-section:nth-of-type(3) .leaderboard-scroll {
    max-height: 520px;
  }

  /* Cosmetics shop: 4-column grid at desktop */
  .cshop-items {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  .cshop-item { max-width: none; flex: none; }

  /* Settings screen: wider */
  #screen-settings .settings-panel { max-width: 680px; }
  #screen-settings .settings-tabs  { max-width: 680px; }

  /* Friends widget horizontal scroll on desktop when many friends */
  .lfw-list { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
}
