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

:root {
  --accent: #ea580c;
  --text: #7c2d12;
  --glass: rgba(255, 255, 255, 0.92);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

html,
body {
  height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(145deg, #dc2626, #b45309);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.6s ease;
}

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100vh;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-emoji {
  font-size: 34px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

.brand h1 {
  font-size: 1.35rem;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tagline {
  font-size: 0.72rem;
  opacity: 0.85;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 1.15rem;
  transition: transform 0.15s ease, background 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.34);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* ---------- Hint ---------- */
.hint {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  font-size: 0.92rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ---------- Controls ---------- */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding: 9px 34px 9px 12px;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  background: var(--glass) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%2364748b' d='M6 8L0 0h12z'/></svg>") no-repeat right 10px center / 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  max-width: 250px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  transition: transform 0.12s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.chip:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.4);
}

.chip.active {
  background: var(--accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.chip.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  background: var(--glass);
  border-radius: 18px;
  padding: 10px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-value {
  font-weight: 800;
  font-size: 1.05rem;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
}

/* ---------- Board / start panel ---------- */
.board {
  position: relative;
}

.start-panel {
  text-align: center;
  background: var(--glass);
  border-radius: 22px;
  padding: 28px 22px;
  box-shadow: var(--shadow);
  animation: deal 0.4s ease both;
}

.start-panel h2 {
  font-size: 1.4rem;
  color: #0f172a;
  margin-bottom: 10px;
}

.start-panel p {
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 10px;
}

.start-tips {
  font-weight: 700;
  color: var(--accent) !important;
  font-size: 0.85rem !important;
}

.btn {
  padding: 12px 16px;
  border: none;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  background: #f1f5f9;
  color: #334155;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.btn-big {
  font-size: 1.1rem;
  padding: 14px 30px;
  margin-top: 8px;
}

.btn-ghost {
  background: transparent;
  color: #64748b;
}

/* ---------- Question card ---------- */
.game-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: deal 0.4s ease both;
}

.question-card {
  background: var(--glass);
  border-radius: 22px;
  padding: 18px 16px 14px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.clue {
  display: flex;
  align-items: center;
  gap: 14px;
}

.clue-emoji {
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.18));
}

.clue-words {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.clue-direction {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #64748b;
}

.clue-word {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.hear-btn {
  flex-shrink: 0;
  padding: 10px 13px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.hear-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.24);
}

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

.progress {
  margin-top: 14px;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #f59e0b);
  transition: width 0.35s ease;
}

/* ---------- Options ---------- */
.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.option {
  min-height: 88px;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  color: #0f172a;
  background: var(--glass);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 12px;
  overflow-wrap: anywhere;
  touch-action: manipulation;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
  animation: deal 0.35s ease both;
}

.option:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.option:active:not(:disabled) {
  transform: scale(0.96);
}

.option.correct {
  background: #16a34a;
  color: #fff;
  animation: correctPop 0.45s ease both;
}

.option.wrong {
  background: #ef4444;
  color: #fff;
  animation: shake 0.4s ease;
}

.option:disabled {
  cursor: default;
  opacity: 0.55;
}

.option:focus-visible,
.hear-btn:focus-visible,
.icon-btn:focus-visible,
.chip:focus-visible,
.btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
  margin-top: auto;
  padding-top: 12px;
}

/* ---------- Win overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 18px;
  animation: fadeIn 0.25s ease both;
}

.overlay[hidden] {
  display: none;
}

.modal {
  width: min(92vw, 400px);
  background: #fff;
  border-radius: 24px;
  padding: 26px 22px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  animation: popIn 0.35s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

.modal-stars {
  font-size: 2.4rem;
  letter-spacing: 6px;
  line-height: 1;
}

.star {
  color: #cbd5e1;
}

.star.lit {
  color: #f59e0b;
  filter: drop-shadow(0 2px 5px rgba(245, 158, 11, 0.6));
}

.modal h2 {
  margin: 8px 0 2px;
  font-size: 1.5rem;
  color: #0f172a;
}

.modal-subtitle {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 16px 0 20px;
}

.modal-stats div {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 8px 4px;
}

.modal-stats span {
  display: block;
  font-weight: 800;
  font-size: 1rem;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.modal-stats label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Effects canvas ---------- */
.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

/* ---------- No JS ---------- */
.noscript {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
}

/* ---------- Animations ---------- */
@keyframes deal {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes correctPop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes popIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

/* ---------- Small screens ---------- */
@media (max-width: 430px) {
  .stats {
    gap: 4px;
    padding: 8px 4px;
  }

  .stat-value {
    font-size: 0.9rem;
  }

  .brand h1 {
    font-size: 1.1rem;
  }

  .clue {
    flex-wrap: wrap;
  }

  .clue-emoji {
    font-size: 2.4rem;
  }

  .clue-word {
    font-size: 1.4rem;
  }

  .hear-btn {
    width: 100%;
  }

  .option {
    min-height: 78px;
    font-size: 1.02rem;
  }
}
