.game-screen {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: calc(900px - 76px);
  background: var(--paper);
}

.game-statusbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 0 28px;
  border-bottom: 2px solid var(--line);
}

.game-statusbar h1 {
  overflow: hidden;
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-chip.is-hot { color: var(--ink); background: var(--lime); }

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(360px, 0.72fr);
  min-height: 720px;
}

.play-column {
  display: grid;
  grid-template-rows: auto minmax(240px, 1fr) auto;
  min-width: 0;
  border-right: 2px solid var(--line);
}

.prompt-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 20px 26px;
  border-bottom: 2px solid var(--line);
  background: var(--soft-blue);
}

.prompt-strip .label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.prompt-strip p {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.chat-log {
  overflow: auto;
  padding: 26px;
  background:
    linear-gradient(rgba(21, 21, 21, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 21, 21, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
}

.empty-chat {
  display: grid;
  min-height: 240px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-chat strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 24px;
}

.message-row {
  display: flex;
  margin-bottom: 18px;
}

.message-row.user { justify-content: flex-end; }
.message-row.ai { justify-content: flex-start; }

.message {
  max-width: min(72%, 580px);
  padding: 14px 18px;
  border: 2px solid var(--line);
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: 3px 3px 0 var(--line);
}

.message-row.user .message {
  border-bottom-right-radius: 4px;
  color: #fff;
  background: var(--blue);
}

.message-row.ai .message {
  border-bottom-left-radius: 4px;
  background: var(--paper);
}

.answer-word {
  display: block;
  margin-bottom: 4px;
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.answer-word.yes { color: var(--yes); }
.answer-word.no { color: var(--no); }
.answer-word.irrelevant { color: var(--muted); }

.thinking-dots {
  display: inline-flex;
  gap: 5px;
}

.thinking-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  animation: bounce 800ms ease-in-out infinite alternate;
}

.thinking-dots i:nth-child(2) { animation-delay: 130ms; }
.thinking-dots i:nth-child(3) { animation-delay: 260ms; }

@keyframes bounce { to { transform: translateY(-6px); opacity: 0.35; } }

.composer {
  position: relative;
  padding: 18px 22px 22px;
  border-top: 2px solid var(--line);
  background: var(--paper);
}

.composer-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.question-input {
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--white);
}

.question-input::placeholder { color: var(--muted); }
.question-input.is-error { border-color: var(--danger); }

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.recommend-button {
  min-height: 42px;
  padding: 0 16px;
  border-width: 1.5px;
  font-size: 12px;
}

.composer-hint {
  color: var(--muted);
  font-size: 12px;
}

.error-text {
  margin: 8px 0 0 18px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.recommend-panel {
  position: absolute;
  right: 22px;
  bottom: calc(100% - 4px);
  left: 22px;
  z-index: 15;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--line);
  animation: panel-up 260ms var(--ease-pop) both;
}

@keyframes panel-up { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

.recommend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.recommend-head span { color: var(--muted); font-size: 11px; }

.recommend-list { display: grid; gap: 8px; }

.chip-button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  text-align: left;
  background: var(--white);
  font-size: 13px;
  font-weight: 800;
}

.chip-button:hover { color: #fff; background: var(--blue); }

.insight-column {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
  background: var(--paper);
}

.host-panel {
  display: grid;
  grid-template-columns: 106px 1fr;
  align-items: center;
  gap: 16px;
  min-height: 154px;
  padding: 22px;
  border-bottom: 2px solid var(--line);
  color: #fff;
  background: var(--blue);
}

.host-panel .host-avatar { width: 106px; height: 106px; }
.host-panel h2 { margin: 0 0 7px; font-size: 22px; letter-spacing: -0.04em; }
.host-panel p { margin: 0; font-size: 13px; line-height: 1.5; }

.puzzle-panel {
  padding: 24px;
  border-bottom: 2px solid var(--line);
}

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-heading h3 { margin: 0; font-size: 17px; }
.panel-heading span { color: var(--muted); font-size: 12px; }

.puzzle-board {
  position: relative;
  display: grid;
  max-width: 330px;
  margin: 0 auto;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 12px;
}

.puzzle-piece {
  position: relative;
  display: grid;
  aspect-ratio: 1.12;
  place-items: center;
  border: 2px solid var(--line);
  color: var(--muted);
  background: var(--white);
  font-family: var(--display);
  font-size: 19px;
  transition: transform 520ms var(--ease-pop), color 260ms ease, background 520ms ease;
}

.puzzle-piece:nth-child(1), .puzzle-piece:nth-child(5) { border-radius: 18px 4px 4px 4px; }
.puzzle-piece:nth-child(2), .puzzle-piece:nth-child(6) { border-radius: 4px 18px 4px 4px; }
.puzzle-piece:nth-child(3), .puzzle-piece:nth-child(4) { border-radius: 4px 4px 18px 4px; }

.puzzle-piece:nth-child(1)::after,
.puzzle-piece:nth-child(2)::after,
.puzzle-piece:nth-child(4)::after,
.puzzle-piece:nth-child(5)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -12px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-left: 0;
  border-radius: 0 50% 50% 0;
  background: inherit;
  transform: translateY(-50%);
}

.puzzle-piece:nth-child(1)::before,
.puzzle-piece:nth-child(3)::before,
.puzzle-piece:nth-child(5)::before {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 50%;
  z-index: 3;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-top: 0;
  border-radius: 0 0 50% 50%;
  background: inherit;
  transform: translateX(-50%);
}

.puzzle-piece.is-filled { color: #fff; transform: rotate(-2deg) scale(1.035); animation: piece-pop 520ms var(--ease-pop) both; }
.puzzle-piece.is-yes { background: var(--yes); }
.puzzle-piece.is-no { background: var(--no); }
.puzzle-piece.is-irrelevant { color: var(--ink); background: var(--irrelevant); }

@keyframes piece-pop {
  0% { transform: scale(0.72) rotate(-8deg); }
  70% { transform: scale(1.08) rotate(2deg); }
  100% { transform: scale(1.035) rotate(-2deg); }
}

.puzzle-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border: 1px solid var(--line); border-radius: 50%; }
.legend-dot.yes { background: var(--yes); }
.legend-dot.no { background: var(--no); }
.legend-dot.irrelevant { background: var(--irrelevant); }

.guess-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: 24px;
}

.guess-panel p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.answer-screen,
.report-screen {
  min-height: calc(900px - 76px);
  padding: 32px;
  background: var(--paper);
}

.answer-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  border: 2px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}

.answer-main {
  min-height: 470px;
  padding: clamp(34px, 5vw, 68px);
  border-right: 2px solid var(--line);
  color: #fff;
  background: var(--blue);
}

.answer-main h1 {
  margin: 18px 0 24px;
  font-family: var(--display);
  font-size: clamp(42px, 5vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.answer-main p {
  max-width: 760px;
  margin: 0;
  font-size: 17px;
  line-height: 1.8;
  text-wrap: pretty;
}

.answer-score {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px;
  background: var(--lime);
}

.score-number {
  font-family: var(--display);
  font-size: clamp(88px, 11vw, 148px);
  line-height: 0.8;
  letter-spacing: -0.1em;
}

.score-number small { font-size: 26px; letter-spacing: 0; }
.answer-score p { margin: 16px 0 0; font-size: 14px; line-height: 1.65; }

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
  border: 2px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}

.knowledge-card {
  min-height: 190px;
  padding: 24px;
  border-right: 2px solid var(--line);
  background: var(--paper);
}

.knowledge-card:last-child { border-right: 0; }
.knowledge-card span { color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: 0.1em; }
.knowledge-card h3 { margin: 20px 0 10px; font-size: 20px; letter-spacing: -0.035em; }
.knowledge-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.answer-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.report-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px;
  margin-bottom: 20px;
}

.report-header h1 {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: clamp(46px, 6vw, 86px);
  line-height: 0.9;
  letter-spacing: -0.075em;
}

.report-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr 0.75fr;
  grid-template-rows: 280px 250px;
  gap: 14px;
}

.report-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 0;
  border-radius: 18px;
  background: var(--paper);
}

.report-card h2,
.report-card h3 { margin: 0; letter-spacing: -0.045em; }
.report-card p { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.report-card.tag-card { grid-row: span 2; color: #fff; background: var(--blue); }
.report-card.tag-card p { color: rgba(255, 255, 255, 0.78); }
.report-card.community-card { grid-column: span 2; background: var(--lime); }
.report-card.path-card { background: var(--ink); color: #fff; }
.report-card.path-card p { color: rgba(255,255,255,.68); }

.report-tag {
  margin-top: 60px;
  font-family: var(--display);
  font-size: clamp(46px, 5vw, 76px);
  line-height: 0.9;
  letter-spacing: -0.075em;
}

.report-host {
  position: absolute;
  right: -18px;
  bottom: -24px;
  width: 190px;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 18px 15px rgba(0,0,0,.2));
}

.metric-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}

.metric-big {
  font-family: var(--display);
  font-size: 86px;
  line-height: 0.8;
  letter-spacing: -0.09em;
}

.metric-big small { font-size: 22px; letter-spacing: 0; }

.mini-bars {
  display: flex;
  height: 80px;
  align-items: end;
  gap: 7px;
}

.mini-bars i {
  width: 16px;
  border: 1.5px solid var(--line);
  background: var(--blue);
}

.path-steps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 32px;
}

.path-step {
  height: 56px;
  border: 0;
  background: rgba(255,255,255,.08);
}

.path-step.yes { background: var(--blue); }
.path-step.no { background: #fff; }
.path-step.irrelevant { background: #777; }

.community-card .metric-big { margin-top: 28px; }
.demo-data { display: inline-flex; margin-top: 10px; padding: 6px 9px; border: 0; border-radius: 999px; background: rgba(255,255,255,.48); font-size: 10px; font-weight: 900; letter-spacing: .08em; }

.report-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(8, 15, 28, 0.72);
  backdrop-filter: blur(8px);
  animation: fade-in 180ms ease both;
}

@keyframes fade-in { from { opacity: 0; } }

.modal {
  width: min(680px, 100%);
  padding: 28px;
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: none;
  animation: modal-in 320ms var(--ease-pop) both;
}

@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.modal h2 { margin: 0; font-size: 34px; letter-spacing: -0.055em; }
.modal p { color: var(--muted); line-height: 1.7; }

.guess-input {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: 16px;
  border: 1px solid #cfd5dc;
  border-radius: 14px;
  color: var(--ink);
  background: var(--white);
  line-height: 1.7;
  outline: none;
}

.guess-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(5,102,255,.12);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 15px 18px;
  border: 2px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--lime);
  box-shadow: 5px 5px 0 var(--line);
  font-size: 13px;
  font-weight: 900;
  animation: toast-in 320ms var(--ease-pop) both;
}

@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } }

.icon-button { display: grid; width: 44px; height: 44px; place-items: center; border: 1.5px solid currentColor; border-radius: 50%; background: transparent; font-size: 22px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1100px) {
  .app-frame { width: calc(100vw - 24px); margin: 12px auto; }
  .topbar { grid-template-columns: 1fr auto; }
  .topnav { display: none; }
  .hero-grid { grid-template-columns: 1fr 380px; }
  .choice-strip { grid-template-columns: 1fr 1fr; }
  .rule-card { grid-column: span 2; min-height: 150px; }
  .carousel-layout { grid-template-columns: 1fr; }
  .carousel-side { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .side-note { min-height: 180px; }
  .game-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .host-panel { grid-template-columns: 80px 1fr; }
  .host-panel .host-avatar { width: 80px; height: 80px; }
  .report-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .report-card.tag-card { grid-row: span 2; min-height: 500px; }
  .report-card.community-card { grid-column: span 1; }
}

@media (max-width: 820px) {
  .app-frame { width: 100%; min-height: 100vh; margin: 0; border-width: 0; border-radius: 0; }
  .topbar { min-height: 64px; padding: 0 16px; border-bottom-width: 1.5px; }
  .brand-button img { width: 58px; }
  .product-name { font-size: 13px; }
  .progress-pill { padding: 0 11px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { min-height: 520px; border-right: 0; border-bottom: 2px solid var(--line); }
  .hero-host { min-height: 420px; }
  .choice-strip { grid-template-columns: 1fr; }
  .choice-card { min-height: 200px; border-right: 0; border-bottom: 2px solid var(--line); }
  .rule-card { grid-column: auto; }
  .content-screen, .answer-screen, .report-screen { padding: 18px; }
  .section-head { grid-template-columns: 1fr; align-items: start; }
  .mode-tabs { overflow-x: auto; }
  .carousel-shell { min-height: 530px; }
  .topic-card { width: 82%; min-height: 410px; padding: 25px; }
  .topic-card.is-prev { transform: translateX(-78%) rotate(-6deg) scale(.78); }
  .topic-card.is-next { transform: translateX(78%) rotate(6deg) scale(.78); }
  .carousel-side { grid-template-columns: 1fr; }
  .case-intro, .answer-hero { grid-template-columns: 1fr; }
  .case-prompt { min-height: 470px; }
  .case-rules { min-height: 560px; }
  .answer-main { min-height: auto; border-right: 0; border-bottom: 2px solid var(--line); }
  .answer-score { min-height: 300px; }
  .knowledge-grid { grid-template-columns: 1fr; }
  .knowledge-card { border-right: 0; border-bottom: 2px solid var(--line); }
  .knowledge-card:last-child { border-bottom: 0; }
  .game-layout { grid-template-columns: 1fr; }
  .play-column { min-height: 700px; border-right: 0; border-bottom: 2px solid var(--line); }
  .game-statusbar { grid-template-columns: 1fr auto; padding: 0 16px; }
  .game-statusbar .status-chip:first-of-type { display: none; }
  .insight-column { min-height: 740px; }
  .report-header { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .report-card.tag-card { grid-row: auto; min-height: 440px; }
  .report-card.community-card { grid-column: auto; }
  .answer-actions, .report-footer { align-items: stretch; flex-direction: column; }
  .report-actions { width: 100%; }
  .report-action { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
