:root {
  --bg: #0c0f14;
  --panel: #151a22;
  --panel-light: #1d2430;
  --line: #2a3240;
  --text: #eef2f8;
  --muted: #8f9aaa;
  --accent: #4f8cff;
  --success: #28d17c;
  --danger: #ff4d5e;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79, 140, 255, 0.18), transparent 34%),
    linear-gradient(135deg, #090b10, #10141b 60%, #090b10);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px;
}

.app {
  width: min(1080px, 100%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 20px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 5vw, 52px);
  letter-spacing: -0.06em;
}

.topbar p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.status {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status span {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 13px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.game-panel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  background: rgba(21, 26, 34, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(12px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

.game-panel.switching {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
}

.game-panel.success-pulse {
  border-color: rgba(40, 209, 124, 0.82);
  box-shadow:
    0 0 0 4px rgba(40, 209, 124, 0.14),
    0 18px 50px rgba(0, 0, 0, 0.35);
}

.column h2 {
  font-size: 15px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 14px;
}

.list {
  display: grid;
  gap: 14px;
}

.divider {
  width: 1px;
  background: linear-gradient(transparent, var(--line), transparent);
}

.card {
  min-height: 74px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-light), var(--panel));
  border-radius: 16px;
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}

.card:hover:not(.locked):not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(79, 140, 255, 0.75);
  box-shadow: 0 10px 28px rgba(79, 140, 255, 0.12);
}

.card:disabled {
  cursor: default;
}

.card.selected {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px rgba(79, 140, 255, 0.22),
    0 10px 28px rgba(79, 140, 255, 0.12);
}

.card.locked {
  cursor: default;
  border-color: rgba(40, 209, 124, 0.8);
  background:
    linear-gradient(180deg, rgba(40, 209, 124, 0.18), rgba(40, 209, 124, 0.08)),
    var(--panel);
}

.card.wrong {
  animation: wrongFlash 0.42s ease;
}

@keyframes wrongFlash {
  0% {
    border-color: var(--danger);
    box-shadow: 0 0 0 0 rgba(255, 77, 94, 0);
  }

  40% {
    border-color: var(--danger);
    box-shadow: 0 0 0 5px rgba(255, 77, 94, 0.25);
    transform: translateX(-4px);
  }

  70% {
    transform: translateX(4px);
  }

  100% {
    border-color: var(--line);
    box-shadow: none;
    transform: translateX(0);
  }
}

.emoji-row {
  gap: 10px;
  flex-wrap: wrap;
}

.emoji-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.24));
}

.text-token {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
}

.answer-card {
  justify-content: center;
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.controls {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  color: white;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    filter 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.primary {
  background: linear-gradient(135deg, #4f8cff, #7c5cff);
}

.secondary {
  background: #283140;
}

.credit-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(238, 242, 248, 0.42);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 22px;
  z-index: 20;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(420px, 100%);
  background: #151a22;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: center;
  animation: modalIn 0.22s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-card h3 {
  font-size: 28px;
  margin-bottom: 8px;
}

.modal-card p {
  color: var(--muted);
  margin-bottom: 22px;
}

@media (max-width: 760px) {
  body {
    padding: 16px;
    align-items: flex-start;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status {
    justify-content: flex-start;
  }

  .game-panel {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
  }

  .divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line), transparent);
  }

  .card {
    min-height: 64px;
  }

  .emoji-img {
    width: 30px;
    height: 30px;
  }

  .text-token {
    height: 30px;
    min-width: 30px;
    font-size: 16px;
  }

  .controls {
    justify-content: stretch;
  }

  .btn {
    flex: 1;
  }

  .credit-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
  }
  
.fallback-token {
  width: 34px;
  min-width: 34px;
  padding: 0 4px;
  font-size: 9px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(238, 242, 248, 0.86);
  background:
    linear-gradient(180deg, rgba(79, 140, 255, 0.18), rgba(79, 140, 255, 0.08)),
    rgba(255, 255, 255, 0.06);
}