:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface2: #1e1e1e;
  --accent: #c8a96e;
  --accent2: #e8d5a3;
  --text: #f0ece4;
  --muted: #6b6560;
  --border: rgba(200,169,110,0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg); color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; overflow-x: hidden;
}

/* ── TOP BAR ─────────────────────────────────────── */
.topbar {
  width: 100%; padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.topbar-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-weight: 900;
  color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.topbar-logo span { color: var(--accent); }
.brand-logo { height: 28px; width: auto; flex-shrink: 0; object-fit: contain; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

/* ── LANGUAGE SELECTOR ───────────────────────────── */
.lang-select {
  appearance: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 32px 8px 14px;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif; font-size: .875rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c8a96e' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  outline: none;
}
.lang-select:focus { border-color: var(--accent); }

/* ── LEVEL BADGE ─────────────────────────────────── */
.level-badge {
  background: var(--surface2); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 20px;
  font-size: .8rem; font-weight: 600; color: var(--accent); letter-spacing: .05em;
}

/* ── GAME AREA ───────────────────────────────────── */
.game-area {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 16px; width: 100%; max-width: 500px; gap: 28px;
}

/* ── PROGRESS ────────────────────────────────────── */
.progress-wrap { width: 100%; max-width: 420px; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: .75rem; color: var(--muted); margin-bottom: 8px;
}
.progress-bar { height: 3px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.progress-fill {
  height: 100%; background: var(--accent);
  border-radius: 2px; transition: width .4s ease; width: 0%;
}

/* ── CARD ────────────────────────────────────────── */
.card {
  position: relative; width: 100%; max-width: 420px; height: 280px;
  perspective: 1200px; cursor: pointer;
}
.card-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform .7s cubic-bezier(.4,0,.2,1);
  transform-style: preserve-3d;
}
.card-inner.flipped { transform: rotateY(180deg); }
.card-face {
  position: absolute; width: 100%; height: 100%;
  backface-visibility: hidden; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  padding: 32px; text-align: center; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.card-front { background: var(--surface2); border: 1px solid var(--border); }
.card-back { transform: rotateY(180deg); }
.card-face h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 6vw, 2.8rem);
  white-space: nowrap; overflow: hidden;
  color: #fff; font-weight: 700; line-height: 1.2; max-width: 100%;
}
.card-hint {
  position: absolute; bottom: 16px; right: 16px;
  font-size: .72rem; color: rgba(255,255,255,.3);
  letter-spacing: .06em; text-transform: uppercase;
}

/* ── AUDIO BUTTON ────────────────────────────────── */
.audio-btn {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.7); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s, border-color .2s; z-index: 10;
}
.audio-btn:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.audio-btn svg { pointer-events: none; }

/* ── CONTROLS ────────────────────────────────────── */
.controls { display: flex; gap: 16px; align-items: center; }
.btn-next {
  background: var(--accent); color: var(--bg); border: none;
  padding: 14px 40px; border-radius: 4px;
  font-family: 'DM Sans', sans-serif; font-size: 1rem; font-weight: 600;
  cursor: pointer; letter-spacing: .02em;
  transition: background .2s, transform .15s;
}
.btn-next:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-next:active { transform: translateY(0); }

/* ── FLIP HINT ───────────────────────────────────── */
.flip-hint {
  font-size: .8rem; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.flip-hint svg { color: var(--accent); }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 480px) {
  .topbar { padding: 12px 16px; }
  .game-area { padding: 16px; }
  .card { height: 240px; }
  .btn-next { padding: 12px 28px; }
}
