:root {
  color-scheme: dark;
  --bg: #101323;
  --panel: rgba(24, 30, 58, 0.88);
  --panel-strong: #20284b;
  --primary: #7cf7ff;
  --secondary: #a78bfa;
  --accent: #ffca3a;
  --danger: #ff5c8a;
  --success: #59ffa0;
  --text: #f7fbff;
  --muted: #aeb8d8;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 247, 255, 0.24), transparent 34rem),
    radial-gradient(circle at 85% 10%, rgba(255, 202, 58, 0.16), transparent 28rem),
    linear-gradient(135deg, #0b1020 0%, #151a35 48%, #211742 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.language-switch {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

.language-switch button {
  min-width: 46px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
}

.language-switch button.active {
  color: #07111f;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hero {
  min-height: 360px;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(124, 247, 255, 0.16), rgba(167, 139, 250, 0.16)),
    var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "IQ";
  position: absolute;
  right: clamp(16px, 8vw, 96px);
  bottom: -46px;
  font-size: clamp(120px, 22vw, 240px);
  font-weight: 950;
  line-height: 1;
  color: rgba(255, 255, 255, 0.045);
}

.eyebrow,
.card-kicker,
.question-type {
  margin: 0 0 10px;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(2.45rem, 7vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.hero-copy {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.primary-action,
.card-footer button,
.recall-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  color: #07111f;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(124, 247, 255, 0.2);
  transition: transform 160ms ease, filter 160ms ease;
}

.primary-action:hover,
.card-footer button:hover,
.recall-form button:hover,
.answer-grid button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.game-card,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.game-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
}

.game-card.featured {
  background:
    linear-gradient(135deg, rgba(255, 202, 58, 0.16), rgba(124, 247, 255, 0.12)),
    var(--panel-strong);
}

.game-card h2 {
  margin-bottom: 12px;
  font-size: 1.7rem;
}

.game-card p,
.panel p {
  color: var(--muted);
  line-height: 1.6;
}

.card-footer,
.top-bar,
.stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-footer {
  margin-top: 24px;
  color: var(--muted);
}

.top-bar {
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(12, 17, 34, 0.72);
  backdrop-filter: blur(14px);
}

.top-bar h2 {
  margin: 0;
}

.ghost,
.score-pill {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.panel {
  padding: clamp(22px, 4vw, 42px);
}

.hidden {
  display: none !important;
}

.setup-panel h3,
.play-panel h3 {
  font-size: clamp(1.6rem, 4vw, 3rem);
  line-height: 1.1;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.difficulty-option {
  min-height: 96px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  text-align: left;
}

.difficulty-option.active {
  color: #091120;
  background: linear-gradient(135deg, var(--accent), var(--primary));
}

.difficulty-option strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.difficulty-option span {
  color: inherit;
  opacity: 0.8;
  font-size: 0.86rem;
}

.stats-row {
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.stats-row span {
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
}

.stats-row strong {
  color: var(--text);
}

.timer-bar,
.health-bar {
  height: 12px;
  margin-bottom: 26px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.timer-bar span,
.health-bar span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success), var(--accent), var(--danger));
  transition: width 220ms ease;
}

.question-text {
  margin-bottom: 18px;
}

.question-text.small {
  font-size: clamp(1.25rem, 3vw, 2rem);
}

.visual-zone,
.sequence-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 58px;
  margin-bottom: 20px;
}

.visual-token,
.sequence-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 54px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 1.5rem;
  font-weight: 900;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.answer-grid button {
  min-height: 58px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  font-weight: 850;
  transition: transform 160ms ease, filter 160ms ease, background 160ms ease;
}

.answer-grid button.correct {
  color: #07111f;
  background: var(--success);
}

.answer-grid button.wrong {
  color: #fff;
  background: var(--danger);
}

.feedback {
  min-height: 28px;
  margin-top: 16px;
  font-weight: 850;
}

.feedback.good {
  color: var(--success);
}

.feedback.bad {
  color: var(--danger);
}

.likert-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.mbti-breakdown {
  display: grid;
  gap: 16px;
  margin: 22px 0;
}

.mbti-row-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.mbti-bar {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.mbti-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.monster-lane {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 130px;
  margin: 8px 0 22px;
  padding: 0 18px;
  border-radius: 24px;
  background: linear-gradient(90deg, rgba(255, 92, 138, 0.15), rgba(124, 247, 255, 0.13));
  overflow: hidden;
}

.monster,
.hero-avatar {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 24px;
  font-weight: 950;
}

.monster {
  position: absolute;
  left: 18px;
  color: #230813;
  background: var(--danger);
  transition: left 240ms ease;
}

.hero-avatar {
  margin-left: auto;
  color: #07111f;
  background: var(--primary);
}

.recall-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.recall-form label {
  color: var(--muted);
  font-weight: 800;
}

.recall-form input {
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.recall-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(124, 247, 255, 0.12);
}

@media (max-width: 880px) {
  .game-grid,
  .difficulty-grid {
    grid-template-columns: 1fr;
  }

  .answer-grid {
    grid-template-columns: 1fr;
  }

  .top-bar,
  .card-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 18px 0;
  }

  .hero,
  .game-card,
  .panel {
    border-radius: 22px;
  }

  .stats-row span {
    width: 100%;
  }
}
