:root {
  color-scheme: light;
  font-family: "Avenir Next", Avenir, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --ink: #26243a;
  --muted: #797689;
  --paper: #faf9ff;
  --violet: #755cff;
  --mint: #3fbdad;
  --line: #eeecf5;
  --accent: #755cff;
  --theme-bg: #f0edff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% -15%, #efeaff 0%, transparent 46%),
    radial-gradient(ellipse at 96% 47%, #fff0e9 0%, transparent 32%),
    var(--paper);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgb(117 92 255 / 36%);
  outline-offset: 4px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 300px;
  height: 300px;
  pointer-events: none;
  opacity: 0.48;
  filter: blur(80px);
}

.ambient-left {
  top: 38%;
  left: -210px;
  background: #dcd6ff;
}

.ambient-right {
  right: -240px;
  bottom: 14%;
  background: #ffdccf;
}

.app-shell {
  width: min(100% - 44px, 940px);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: white;
  background: var(--violet);
  border-radius: 11px;
  font-size: 20px;
}

.brand-name {
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.5px;
}

.brand-name span {
  color: var(--violet);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #777388;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.3px;
}

.status-pill span {
  width: 8px;
  height: 8px;
  background: #56c5a3;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgb(86 197 163 / 12%);
}

.intro {
  padding: 28px 0 34px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--violet);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.3px;
}

.eyebrow span {
  margin-right: 5px;
}

.intro h1 {
  margin: 0;
  font-size: clamp(36px, 5.3vw, 58px);
  font-weight: 800;
  letter-spacing: -2.9px;
  line-height: 1.2;
}

.intro h1 span {
  background: linear-gradient(110deg, #7356fc 4%, #e67d9b 94%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro-copy {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.mobile-break {
  display: none;
}

.maker-panel {
  padding: 23px 24px 18px;
  background: rgb(255 255 255 / 85%);
  border: 1px solid rgb(235 233 245 / 90%);
  border-radius: 21px;
  box-shadow: 0 12px 42px rgb(44 33 100 / 6%);
  backdrop-filter: blur(12px);
}

.prompt-label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 720;
}

.prompt-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 55px;
  background: #fbfaff;
  border: 1px solid #edebf7;
  border-radius: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.prompt-input-wrap:focus-within {
  border-color: #a294ff;
  box-shadow: 0 0 0 4px rgb(117 92 255 / 9%);
}

.input-spark {
  margin-left: 16px;
  color: var(--violet);
  font-size: 19px;
}

#prompt-input {
  width: 100%;
  min-width: 0;
  padding: 15px 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 14px;
  outline: none;
}

#prompt-input::placeholder {
  color: #a49faf;
}

.clear-prompt {
  display: grid;
  width: 35px;
  height: 35px;
  margin-right: 7px;
  place-items: center;
  color: #89849b;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 22px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 13px;
}

.button {
  min-height: 45px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 740;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover,
.suggestion-chip:hover,
.action-button:hover {
  transform: translateY(-2px);
}

.button:active,
.suggestion-chip:active,
.action-button:active {
  transform: scale(0.98);
}

.button-primary {
  flex: 1;
  color: white;
  background: linear-gradient(110deg, #795fff, #6852ee);
  box-shadow: 0 7px 17px rgb(117 92 255 / 23%);
}

.button-primary:hover {
  box-shadow: 0 10px 21px rgb(117 92 255 / 32%);
}

.button-random {
  min-width: 116px;
  color: #574f78;
  background: #f1effb;
}

.input-hint {
  margin: 10px 0 0;
  color: #9893a6;
  font-size: 10px;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 17px;
  padding-top: 16px;
  border-top: 1px solid #f0edf7;
}

.suggestions-label {
  margin-right: 3px;
  color: #858095;
  font-size: 10px;
}

.suggestion-chip {
  min-height: 32px;
  padding: 0 11px;
  color: #5e5970;
  background: white;
  border: 1px solid #ece9f4;
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  transition: transform 150ms ease, border-color 150ms ease;
}

.suggestion-chip:hover {
  border-color: #c5bbff;
}

.game-section {
  margin-top: 19px;
  outline: none;
}

.idle-card {
  display: grid;
  min-height: 244px;
  padding: 26px 20px;
  place-content: center;
  justify-items: center;
  background: rgb(255 255 255 / 55%);
  border: 1px dashed #ddd8f0;
  border-radius: 20px;
  text-align: center;
}

.idle-orbit {
  position: relative;
  width: 116px;
  height: 105px;
}

.idle-token,
.idle-orbit-core {
  position: absolute;
  display: grid;
  place-items: center;
}

.idle-token {
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgb(63 49 114 / 9%);
  font-size: 21px;
  animation: floating 2.6s ease-in-out infinite;
}

.idle-token-one {
  top: 7px;
  left: 2px;
}

.idle-token-two {
  top: 0;
  right: 2px;
  animation-delay: 0.65s;
}

.idle-token-three {
  bottom: 9px;
  left: 41px;
  animation-delay: 1.1s;
}

.idle-orbit-core {
  top: 31px;
  left: 43px;
  width: 32px;
  height: 32px;
  color: #917fff;
  font-size: 25px;
}

.idle-title {
  margin: 1px 0 6px;
  color: #777087;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 2px;
}

.idle-copy {
  margin: 0;
  color: #9390a0;
  font-size: 12px;
}

.game-card {
  overflow: hidden;
  background: white;
  border: 1px solid #ebe8f4;
  border-radius: 20px;
  box-shadow: 0 13px 40px rgb(44 33 100 / 7%);
  animation: appear 230ms ease both;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 101px;
  padding: 19px 22px 17px;
}

.game-type {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

.game-title {
  margin: 0;
  font-size: 17px;
  font-weight: 780;
  line-height: 1.35;
}

.game-description {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.game-theme-emoji {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  margin-left: 12px;
  place-items: center;
  background: var(--theme-bg);
  border-radius: 15px;
  font-size: 29px;
}

.game-board {
  position: relative;
  display: flex;
  min-height: 298px;
  overflow: hidden;
  flex-direction: column;
  background:
    radial-gradient(circle at 17% 19%, rgb(255 255 255 / 75%) 0 8%, transparent 9%),
    radial-gradient(circle at 80% 75%, rgb(255 255 255 / 55%) 0 12%, transparent 13%),
    var(--theme-bg);
}

.board-topline {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px 0;
}

.board-badge {
  display: inline-flex;
  min-height: 33px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  background: rgb(255 255 255 / 82%);
  border-radius: 999px;
  color: #49435b;
  font-size: 11px;
  font-weight: 720;
}

.board-badge strong {
  color: var(--accent);
  font-size: 13px;
}

.playfield {
  position: relative;
  min-height: 229px;
  flex: 1;
}

.tap-target {
  position: absolute;
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  background: rgb(255 255 255 / 96%);
  border: 2px solid rgb(255 255 255 / 85%);
  border-radius: 22px;
  box-shadow: 0 9px 24px rgb(57 39 92 / 14%);
  cursor: pointer;
  font-size: 37px;
  touch-action: manipulation;
  transition: left 160ms cubic-bezier(.2,.75,.3,1), top 160ms cubic-bezier(.2,.75,.3,1), transform 110ms ease;
}

.tap-target:hover {
  transform: scale(1.07);
}

.tap-target:active {
  transform: scale(0.9);
}

.mascot {
  position: absolute;
  right: 16px;
  bottom: 11px;
  opacity: 0.8;
  font-size: 40px;
  pointer-events: none;
  animation: floating 2.4s ease-in-out infinite;
}

.score-pop {
  position: absolute;
  z-index: 2;
  color: var(--accent);
  font-size: 17px;
  font-weight: 800;
  pointer-events: none;
  animation: pop-up 700ms ease both;
}

.board-start,
.reaction-surface,
.result-screen {
  display: flex;
  min-height: 298px;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 23px;
  text-align: center;
}

.board-start-emoji,
.result-emoji {
  margin-bottom: 10px;
  font-size: 54px;
}

.board-start h3,
.result-screen h3,
.reaction-surface h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.board-start p,
.result-screen p,
.reaction-surface p {
  margin: 0;
  color: #726d80;
  font-size: 12px;
  line-height: 1.65;
}

.board-main-button {
  min-height: 44px;
  margin-top: 16px;
  padding: 0 22px;
  color: white;
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 740;
}

.quiz-shell {
  min-height: 298px;
  padding: 20px 21px 23px;
}

.quiz-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #625c71;
  font-size: 11px;
  font-weight: 720;
}

.quiz-progress-dots {
  display: flex;
  gap: 6px;
}

.quiz-progress-dot {
  width: 8px;
  height: 8px;
  background: rgb(80 68 108 / 20%);
  border-radius: 50%;
}

.quiz-progress-dot.active {
  background: var(--accent);
}

.quiz-question {
  margin: 24px 0 15px;
  font-size: 16px;
  font-weight: 780;
  line-height: 1.5;
}

.quiz-options {
  display: grid;
  gap: 8px;
}

.quiz-option {
  min-height: 42px;
  padding: 8px 12px;
  color: #453f56;
  background: rgb(255 255 255 / 86%);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--accent);
}

.quiz-option.correct {
  color: #157c61;
  background: #e6faef;
  border-color: #6ecaa6;
}

.quiz-option.incorrect {
  color: #bd4c59;
  background: #fff0f1;
  border-color: #efa6ae;
}

.reaction-surface {
  width: 100%;
  border: 0;
  cursor: pointer;
  transition: background 160ms ease;
}

.reaction-surface.waiting {
  background: rgb(255 244 229 / 75%);
}

.reaction-surface.ready {
  background: rgb(211 250 227 / 84%);
}

.reaction-icon {
  margin-bottom: 11px;
  font-size: 57px;
}

.reaction-millis,
.result-number {
  margin: 8px 0;
  color: var(--accent);
  font-size: 38px;
  font-weight: 850;
  letter-spacing: -1.4px;
}

.result-number small {
  margin-left: 4px;
  font-size: 15px;
}

.result-copy-button {
  margin-top: 12px;
  color: #5c5670;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 11px;
  text-decoration: underline;
}

.game-actions {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 0 16px;
}

.action-button {
  min-height: 38px;
  padding: 0 9px;
  color: #655f75;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 11px;
  transition: transform 150ms ease, background 150ms ease;
}

.action-button:hover {
  background: #f4f2fa;
}

.action-button-share {
  color: var(--violet);
  font-weight: 750;
}

.feature-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 22px 0 21px;
  color: #737084;
  font-size: 11px;
}

.feature-strip span span {
  margin-right: 4px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 0 22px;
  border-top: 1px solid #ece9f4;
  color: #898496;
  font-size: 9px;
}

.footer strong {
  color: #676177;
  font-weight: 680;
}

.toast {
  position: fixed;
  z-index: 5;
  right: 20px;
  bottom: 20px;
  max-width: calc(100vw - 40px);
  padding: 12px 17px;
  color: white;
  background: #363247;
  border-radius: 11px;
  box-shadow: 0 11px 28px rgb(37 32 55 / 20%);
  font-size: 12px;
  animation: appear 170ms ease both;
}

@keyframes floating {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pop-up {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-28px); }
}

@media (max-width: 600px) {
  .app-shell {
    width: min(100% - 30px, 480px);
  }

  .topbar {
    height: 70px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .status-pill {
    font-size: 0;
  }

  .status-pill span {
    width: 9px;
    height: 9px;
  }

  .intro {
    padding: 30px 0 26px;
  }

  .intro h1 {
    font-size: clamp(35px, 10vw, 47px);
    letter-spacing: -2px;
  }

  .intro-copy {
    font-size: 12px;
  }

  .mobile-break {
    display: inline;
  }

  .maker-panel {
    padding: 19px 16px 15px;
  }

  .button-random {
    min-width: 105px;
  }

  .suggestions {
    gap: 7px;
  }

  .suggestions-label {
    width: 100%;
  }

  .game-header {
    min-height: 105px;
    padding: 16px;
  }

  .game-title {
    font-size: 15px;
  }

  .game-theme-emoji {
    width: 43px;
    height: 43px;
    font-size: 25px;
  }

  .game-actions {
    padding: 0 8px;
  }

  .action-button {
    padding: 0 6px;
    font-size: 10px;
  }

  .feature-strip {
    gap: 10px;
    font-size: 9px;
  }

  .footer {
    flex-direction: column;
    gap: 7px;
    padding-bottom: 19px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

