:root {
  --bg: #f1efe7;
  --surface: #faf9f4;
  --text: #262820;
  --muted: #63665b;
  --line: #d5d5c9;
  --accent: #c93b26;
  --danger: #b63325;
  --online: #527345;
  --radius: 4px;
  color-scheme: light;
  font-family:
    Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23000' filter='url(%23n)' opacity='.5' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}

button,
input,
textarea,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea {
  font: inherit;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}

.primary {
  background: var(--accent);
  color: #fffaf3;
}

.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.wide {
  width: 100%;
}

.arrow-button {
  justify-content: space-between;
}

.arrow-button > span:last-child {
  font-size: 22px;
  font-weight: 400;
}

.small {
  min-height: 44px;
  padding: 9px 15px;
}

.link {
  background: none;
  color: var(--text);
  font-size: 12px;
  padding: 8px 0;
  min-height: 44px;
}

.muted-link {
  color: var(--muted);
}

.skip-link {
  position: fixed;
  left: 20px;
  top: -80px;
  z-index: 20;
  padding: 14px;
  background: var(--text);
  color: white;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  max-width: 1440px;
  margin: auto;
  height: 96px;
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 24px;
}

.brand {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -1.6px;
  text-decoration: none;
}

.brand-dot {
  font-size: 10px;
  align-self: flex-start;
  padding-top: 5px;
  letter-spacing: 0;
}

.brand-mark {
  width: 27px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 80% 0 80% 0;
  transform: rotate(45deg);
  position: relative;
  margin-right: 2px;
}

.brand-mark::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  position: absolute;
  left: 7px;
  top: 2px;
}

.header-caption {
  font: 10px/1.5 monospace;
  letter-spacing: 1.3px;
}

.rules-link {
  background: none;
  color: var(--text);
  padding: 10px 0;
  font-size: 12px;
}

.rules-link span {
  font-size: 20px;
}

main {
  max-width: 1440px;
  margin: auto;
}

.home {
  padding: 0 5%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 4%;
}

.hero-copy {
  padding: 60px 0 38px;
  position: relative;
  z-index: 2;
}

.eyebrow {
  font: 10px/1.5 monospace;
  letter-spacing: 1.6px;
  margin: 0;
  color: var(--muted);
}

.hero-copy > .eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.signal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.edition {
  margin-left: 12px;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(36px, 4.2vw, 60px);
  font-weight: 700;
  line-height: 1.48;
  letter-spacing: -0.055em;
  margin: 27px 0 19px;
}

.serif-word {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-weight: 500;
}

.lead {
  font-size: 13px;
  line-height: 2.05;
  color: var(--muted);
  margin: 0 0 28px;
  letter-spacing: 0.02em;
}

.entry-panel {
  max-width: 352px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}

.field-note {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 8px;
}

.field > span > .field-note {
  float: right;
}

.field > .field-note {
  display: inline;
  align-self: flex-end;
  margin-top: -27px;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #c8c9bd;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.25);
  padding: 14px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
  transition:
    border-color 0.2s,
    background 0.2s;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  font-size: 13px;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
}

textarea {
  resize: vertical;
  max-height: 150px;
}

.scan-icon {
  font-size: 22px;
  line-height: 1;
}

.entry-note {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  margin: 15px 0 0;
}

.entry-note span {
  padding: 0 8px;
}

.message,
.notice {
  color: var(--danger);
  font-size: 12px;
  line-height: 1.7;
  margin: 10px 0 0;
}

.message:empty,
.notice:empty {
  display: none;
}

.entrance {
  max-width: 530px;
  margin: 0 auto;
  padding: 75px 28px;
}

.entrance h1 {
  font-size: 44px;
}

.entrance .stack {
  margin-top: 30px;
}

body:has(.room:not([hidden])) {
  overflow: hidden;
}

.room {
  max-width: 860px;
  margin: auto;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 28px 32px 0;
}

.room-header {
  flex-shrink: 0;
}

.room-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.room-title h1 {
  font-size: 14px;
  letter-spacing: 0.02em;
  font-weight: 400;
  margin: 9px 0 0;
}

.room-title strong {
  font: 26px monospace;
  letter-spacing: 3px;
  margin-left: 12px;
}

.game-status {
  font-size: 12px;
  line-height: 1.7;
  margin: 19px 0 14px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
}

.status-value {
  color: var(--text);
  font-weight: 600;
  margin-left: 5px;
  font-variant-numeric: tabular-nums;
}

.players-row {
  display: flex;
  gap: 17px;
  align-items: center;
  padding-bottom: 20px;
}
.players {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 0;
  max-height: 78px;
  overflow-y: auto;
}

.player {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 5px 10px;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.player::before {
  content: "";
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  border: 1px solid var(--muted);
  border-radius: 50%;
}

.player.online::before {
  background: var(--online);
  border-color: var(--online);
}

.secret {
  margin: 0 0 14px;
  padding: 13px 17px;
  border: 1px dashed #b8b9a7;
  font-size: 13px;
  line-height: 1.8;
  background: #e7e9db;
  overflow-wrap: anywhere;
  max-height: 130px;
  overflow-y: auto;
}

.offline {
  font-size: 12px;
  color: var(--danger);
  background: #f4dfd5;
  padding: 10px 14px;
  margin: 0 0 12px;
}

.log-heading {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  flex-shrink: 0;
}

.log-heading > span:last-child {
  font-size: 10px;
  color: var(--muted);
}

.conversation {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
}

.log {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 12px 0;
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: #babbae transparent;
}

.log:empty {
  padding: 0;
}

.empty-room {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  padding: 12px;
}

.empty-symbol {
  display: grid;
  place-items: center;
  width: 65px;
  height: 84px;
  flex-shrink: 0;
  border: 1px solid #c7c5b6;
  border-radius: 5px;
  color: var(--accent);
  font:
    45px Georgia,
    serif;
  transform: rotate(-8deg);
  margin: 0 0 25px;
}

.empty-room h2 {
  font-size: 20px;
  letter-spacing: -0.04em;
  margin: 13px 0 8px;
}

.empty-room > p:last-child {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
  margin: 0;
}

/* 会話欄は「推理ノート」。1 問 1 行で、左に通し番号、中央に質問文と質問者、右端に判定。
   スマホで 1 画面に 9〜10 問入る密度にし、判定を右端の 1 列にそろえて縦にざっと追えるようにする。
   はい＝ライム、いいえ＝ラベンダーはトップページの YES / NO カードと同じ色。 */
.entry {
  flex-shrink: 0;
  animation: entry-in 0.3s ease-out;
}

.entry.question {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid #2a2c35;
}

.entry .num {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}

/* 自分の質問は番号をライム色にして、自分の流れを追いやすくする */
.entry.mine .num {
  color: var(--accent);
}

.q-body {
  min-width: 0;
}

.q-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.entry .author {
  display: block;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--muted);
  margin-top: 3px;
}

.entry.cancelled .q-text {
  color: var(--muted);
  text-decoration: line-through;
}

.verdict-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 64px;
  padding-top: 1px;
}

.verdict {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

/* 色が見分けにくい人のために矢印も添える */
.verdict::before {
  content: "↗";
  font-weight: 400;
}

.verdict.yes {
  color: #0f1206;
  background: var(--accent);
}

.verdict.no {
  color: #15121f;
  background: var(--no);
}

.verdict.no::before {
  content: "↘";
}

/* はい・いいえのどちらも 65% 未満の「微妙な判定」は薄くする */
.verdict.weak {
  opacity: 0.72;
}

.verdict.note {
  color: var(--muted);
  background: #2b2d36;
  font-weight: 500;
}

.verdict.note::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1s infinite;
}

.entry.cancelled .verdict.note::before {
  display: none;
}

.pct {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 進行の通知は、区切り線つきの 1 行 */
.entry.system {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 6px;
  font-size: 11px;
  color: var(--muted);
}

.entry.system::before,
.entry.system::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

.entry.system .text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: center;
}

/* 想定外の形式（質問者つきの通知など）は、名前と本文をそのまま */
.entry.plain {
  padding: 9px 0 9px 36px;
  border-bottom: 1px solid #2a2c35;
  font-size: 13px;
  line-height: 1.6;
}

.entry.plain .text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 上にスクロールして見返している間に届いた質問を知らせるピル */
.log-new {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #0f1206;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 6px 18px #0009;
  cursor: pointer;
  animation: entry-in 0.3s ease-out;
}

.controls {
  flex-shrink: 0;
  padding: 17px 0 max(20px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  max-height: 55%;
  overflow-y: auto;
}

.controls > .notice:not(:empty) {
  margin: 0 0 10px;
}

.controls .primary.wide {
  min-height: 54px;
}

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

.row > .primary {
  flex: 1;
}

.form-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
  margin: 0 0 3px;
}

.transcript {
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
  margin: 0 0 10px;
}

.transcript:empty {
  display: none;
}

.voice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
}

.talk {
  width: min(100%, 400px);
  min-height: 65px;
  background: var(--accent);
  color: #fffaf3;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  font-size: 16px;
  letter-spacing: 0.1em;
}

.talk::before {
  content: "";
  width: 9px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 8px;
  box-shadow:
    0 4px 0 -2px var(--accent),
    0 6px 0 -2px currentColor;
  margin-right: 6px;
}

.talk[data-state="starting"],
.talk[data-state="stopping"] {
  background: var(--muted);
}

.talk[data-state="listening"] {
  background: var(--danger);
  box-shadow: 0 0 0 5px #c93b2620;
  animation: pulse 1.2s infinite;
}

.talk[data-state="outside"] {
  background: var(--surface);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.talk.off {
  opacity: 0.45;
  cursor: default;
}

.hint {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
  text-align: center;
}

kbd {
  font: 9px monospace;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.links {
  justify-content: space-between;
  margin-top: 8px;
}

.links .link {
  min-height: 44px;
}

#text-form input {
  flex: 1;
}

#text-form button {
  flex: 0 0 auto;
}

#speech-help {
  margin-top: 12px;
}

.voice-help {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
}

.rules-note {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--muted);
}

.rules-note a {
  color: var(--accent);
}

dialog.sheet {
  width: min(92vw, 440px);
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 32px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid #c4c3b7;
  border-radius: 8px;
  box-shadow: 0 30px 100px #22251b30;
}

dialog::backdrop {
  background: #25271dd0;
  backdrop-filter: blur(7px);
}

dialog[open] {
  animation: entry-in 0.25s ease-out;
}

dialog h2 {
  font-size: 25px;
  letter-spacing: -0.04em;
  margin: 12px 0;
}

.dialog-lead {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  margin: 0 0 22px;
}

.qr {
  display: block;
  width: min(100%, 272px);
  height: auto;
  margin: 0 auto 18px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.invite-code-line {
  text-align: center;
  font: 10px monospace;
  letter-spacing: 2px;
  color: var(--muted);
}

.invite-code-line strong {
  font-size: 25px;
  letter-spacing: 4px;
  color: var(--text);
  margin-left: 12px;
}

.url {
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
  user-select: all;
  text-align: center;
  margin: 17px 0 23px;
}

.scanner-video {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 4px;
  background: #25271d;
  margin-top: 12px;
}

#scanner-close {
  margin-top: 18px;
}

.rules-sheet {
  width: min(92vw, 500px) !important;
}

.rules-list {
  padding: 0;
  list-style: none;
  margin: 25px 0;
}

.rules-list li {
  display: flex;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.rules-list li > span {
  font:
    13px Georgia,
    serif;
  color: var(--accent);
  padding-top: 3px;
}

.rules-list h3 {
  font-size: 13px;
  margin: 0 0 8px;
}

.rules-list p {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
  margin: 0;
}

/* 確信度の短いバー。判定した側の割合を塗る */
meter {
  display: block;
  width: 44px;
  height: 3px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: #3b3d48;
  border-radius: 2px;
  overflow: hidden;
}

meter::-webkit-meter-bar {
  background: #3b3d48;
  border: 0;
  border-radius: 2px;
  height: 3px;
}

meter::-webkit-meter-optimum-value {
  background: var(--accent);
}

meter::-moz-meter-bar {
  background: var(--accent);
}

.verdict-box:has(.no) meter::-webkit-meter-optimum-value {
  background: var(--no);
}

.verdict-box:has(.no) meter::-moz-meter-bar {
  background: var(--no);
}

/* 正解・ギブアップは、お題の公開が主役の大きなカード */
.entry.result {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 12px 0 4px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #697647;
  background: linear-gradient(135deg, #30382a, var(--surface));
}

.entry.result.giveup {
  border-color: #5c5572;
  background: linear-gradient(135deg, #342f44, var(--surface));
}

.result-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.entry.result.giveup .result-label {
  color: var(--no);
}

.result-title {
  font-size: 19px;
  line-height: 1.45;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.result-meta {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-wrap;
}

.room:has(#start-form:not([hidden])) .empty-room {
  visibility: hidden;
}

@media (max-width: 700px) {
  .players {
    max-height: 58px;
  }
}

@media (max-width: 360px) {
  .hero-art .card-yes {
    left: calc(50% - 130px);
  }
  .hero-art .card-no {
    right: calc(50% - 130px);
  }
  .hero-art .spark-two {
    right: 3px;
  }
  .hero-art .spark-one {
    left: 5px;
  }
  .room-title strong {
    font-size: 20px;
    letter-spacing: 2px;
  }
  .room-title .small {
    padding: 7px;
    font-size: 10px;
  }
  .form-heading > span:last-child {
    font-size: 9px;
  }
}

@media (max-height: 600px) {
  body:has(.room:not([hidden])) .site-header {
    height: 56px;
  }
  .room {
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
    padding-top: 10px;
  }
  .room-header {
    max-height: 35%;
    overflow-y: auto;
  }
  .log-heading {
    display: none;
  }
  .empty-room {
    display: none;
  }
  .controls {
    max-height: 60%;
    padding-bottom: 10px;
  }
  .talk {
    min-height: 48px;
  }
  .voice {
    gap: 6px;
  }
  .links {
    margin-top: 0;
  }
}

/* INSIDER / midnight edition. Shared tokens keep the room and entry in one world. */
:root {
  --bg: #191a20;
  --surface: #23252d;
  --text: #f1f0e9;
  --muted: #a3a4af;
  --line: #393b45;
  --accent: #dfef78;
  --no: #bdb2e4;
  --danger: #ffaaa0;
  --online: #dfee88;
  --radius: 8px;
  color-scheme: dark;
}

body::before {
  opacity: 0.025;
  z-index: 0;
}

main,
.site-header {
  position: relative;
}

.site-header {
  max-width: 1600px;
  height: 96px;
  padding: 0 5%;
  border: 0;
}

.brand {
  font-size: 29px;
  letter-spacing: -1.7px;
  gap: 8px;
}

.brand-mark {
  border-color: var(--accent);
  width: 25px;
  height: 16px;
}

.brand-mark::after {
  background: var(--accent);
}

.brand-dot {
  color: var(--accent);
}

.header-caption {
  color: var(--muted);
  font:
    12px/1.5 "Hiragino Sans",
    sans-serif;
  letter-spacing: 0.12em;
}

.rules-link {
  border: 1px solid var(--line);
  border-radius: 40px;
  padding: 9px 19px;
  gap: 30px;
}

main {
  max-width: 1600px;
}

.home {
  padding: 24px 5% 0;
  grid-template-columns: 38% 62%;
  column-gap: 0;
}

.hero-heading {
  grid-column: 1;
  grid-row: 1;
  z-index: 2;
  padding-top: 21px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.13em;
}

.hero-heading > .eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.signal-dot {
  display: inline-block;
  background: var(--accent);
  box-shadow: 0 0 12px #dfef7825;
  flex-shrink: 0;
}

.edition {
  font-size: 9px;
  margin-left: 20px;
  color: var(--muted);
}

h1 {
  font-size: clamp(40px, 4.2vw, 66px);
  line-height: 1.4;
  letter-spacing: -0.065em;
  font-weight: 600;
}

.hero-heading h1 {
  margin: 26px 0 0;
  white-space: nowrap;
}

.headline-last {
  color: var(--accent);
}

.serif-word {
  font-weight: 500;
}

.headline-star {
  display: inline-block;
  vertical-align: top;
  margin: 2px 0 0 18px;
  font:
    48px/1 Georgia,
    serif;
  color: var(--accent);
}

.hero-copy {
  grid-column: 1;
  grid-row: 2;
  padding: 25px 0 43px;
}

.lead {
  font-size: 13px;
  line-height: 2.05;
  color: #babbc3;
}

.entry-panel {
  max-width: 354px;
  margin-top: 30px;
}

.entry-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 19px 0 18px;
}

.entry-heading .eyebrow {
  color: var(--accent);
}

.entry-heading > span:last-child {
  color: var(--muted);
  font-size: 10px;
}

.field {
  font-size: 11px;
  gap: 10px;
}

.field-note {
  font-size: 10px;
}

input,
textarea {
  background: #22242b;
  border-color: #44464f;
  min-height: 51px;
  padding: 14px 16px;
  border-radius: 6px;
}

input::placeholder,
textarea::placeholder {
  color: #999ca8;
  font-size: 12px;
}

input:focus,
textarea:focus {
  background: #292c34;
}

.primary {
  background: var(--accent);
  color: #20221a;
  font-weight: 700;
}

.primary.arrow-button {
  min-height: 56px;
  padding: 13px 18px;
}

.arrow-button > span:last-child {
  font-size: 25px;
}

.secondary {
  border-color: #44464f;
}

#scan-open {
  background: transparent;
  border-color: transparent;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 5px 0 15px;
  min-height: 44px;
  font-size: 12px;
  font-weight: 400;
  justify-content: flex-start;
}

.join-arrow {
  margin-left: auto;
  color: var(--muted);
}

/* #scan-open の下に続くリンク。上のボタンとの間隔は縦に並ぶ入力欄やボタンと同じ 12px */
.entry-link {
  position: relative;
  margin-top: 12px;
}

.scan-icon {
  font-size: 24px;
  color: var(--muted);
}

.entry-note {
  font-size: 10px;
  text-align: left;
  margin-top: 12px;
}

.hero-art {
  grid-column: 2;
  grid-row: 1 / 3;
  min-width: 0;
  position: relative;
  isolation: isolate;
  align-self: stretch;
  margin: 0 -2% 30px 0;
  min-height: 625px;
}

.art-grid {
  position: absolute;
  inset: 60px -10px 25px 0;
  background-image:
    linear-gradient(#7376840d 1px, transparent 1px),
    linear-gradient(90deg, #7376840d 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse, #000 10%, transparent 70%);
}

.art-orbit {
  position: absolute;
  width: 540px;
  height: 540px;
  border: 1px solid #41434d;
  border-radius: 50%;
  left: 53%;
  top: 49%;
  transform: translate(-50%, -50%);
  z-index: -1;
}

.orbit-one::after {
  content: "";
  position: absolute;
  inset: 30px;
  border: 1px dashed #3b3d47;
  border-radius: 50%;
}

.orbit-two {
  width: 360px;
  height: 360px;
  border-color: #32343e;
}

.art-coordinate {
  position: absolute;
  right: 5%;
  top: 27px;
  font: 9px monospace;
  letter-spacing: 0.1em;
  color: #858894;
}

.answer-card {
  position: absolute;
  width: 220px;
  height: 302px;
  padding: 22px;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 10px 22px 30px #0004;
  transition: transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.answer-card > span {
  font: 8px monospace;
  letter-spacing: 0.04em;
}

.answer-card strong {
  font-size: 79px;
  letter-spacing: -0.08em;
  line-height: 1;
  font-weight: 800;
}

.answer-card strong span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 500;
  margin-top: 15px;
}

.answer-card i {
  font-size: 34px;
  font-style: normal;
}

.card-yes {
  top: 237px;
  left: 6%;
  transform: rotate(-19deg);
  background: #e9e8df;
  color: #30322a;
  border: 1px solid #fff;
}

.card-no {
  top: 110px;
  right: 5%;
  transform: rotate(17deg);
  background: #a7a0c3;
  color: #252238;
  border: 1px solid #c5bddf;
}

.mystery-card {
  position: absolute;
  width: 237px;
  height: 334px;
  left: 49%;
  top: 154px;
  transform: translateX(-50%) rotate(-7deg);
  border-radius: 13px;
  background: #dfef78;
  color: #252c1c;
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow:
    8px 24px 35px #0006,
    inset 0 0 0 7px #dfef78,
    inset 0 0 0 8px #333e3b40;
  transition: transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card-top,
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 10px monospace;
}

.card-top {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
}

.card-top > span:last-child {
  font-size: 24px;
}

.card-bottom {
  font-size: 9px;
}

.mystery-card > p {
  font: 8px monospace;
  letter-spacing: 0.18em;
  text-align: center;
  margin: 0 0 15px;
}

.secret-graphic {
  position: relative;
  height: 181px;
  display: grid;
  place-items: center;
}

.graphic-ring {
  position: absolute;
  width: 155px;
  height: 155px;
  border: 1px solid #354322;
  border-radius: 50%;
}

.ring-a {
  transform: scaleX(0.38) rotate(35deg);
}
.ring-b {
  transform: rotate(45deg) scaleX(0.48);
}
.ring-c {
  transform: rotate(-45deg) scaleX(0.48);
}
.ring-d {
  transform: scaleY(0.48);
}

.graphic-question {
  position: relative;
  display: grid;
  place-items: center;
  width: 70px;
  height: 83px;
  background: #dfef78;
  border: 1px solid #354322;
  border-radius: 50%;
  font:
    italic 74px/1 Georgia,
    serif;
  padding-right: 8px;
}

.art-sticker {
  position: absolute;
  right: 2%;
  bottom: 87px;
  background: #262932;
  border: 1px solid #565965;
  width: 172px;
  padding: 16px 15px;
  transform: rotate(7deg);
  box-shadow: 0 8px 20px #0003;
  font-size: 11px;
  line-height: 1.8;
}

.art-sticker strong {
  display: block;
  font-weight: 500;
}
.art-sticker > span:last-child {
  position: absolute;
  right: 13px;
  top: 15px;
  font-size: 25px;
  color: var(--accent);
}

.spark-one {
  position: absolute;
  top: 85px;
  left: 16%;
  font:
    70px/1 Georgia,
    serif;
  color: var(--accent);
}

.clue-pill {
  position: absolute;
  left: 3%;
  bottom: 46px;
  padding: 14px 19px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid #555864;
  border-radius: 40px;
  background: #25272e;
  box-shadow: 0 8px 25px #0003;
  font-size: 11px;
  transform: rotate(-4deg);
}

.clue-pill > span:last-child {
  margin-left: 15px;
  font-size: 20px;
  color: var(--accent);
}

.art-caption {
  position: absolute;
  bottom: -8px;
  right: 4%;
  color: #9295a1;
  font: 8px monospace;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.caption-line {
  width: 32px;
  height: 1px;
  background: #737683;
}

.how-strip {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr;
  gap: 25px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 29px 0 32px;
}

.strip-intro {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.strip-intro .eyebrow {
  color: var(--accent);
}
.strip-intro > span:last-child {
  font-size: 12px;
}

.step {
  display: flex;
  gap: 17px;
  border-left: 1px solid var(--line);
  padding-left: 26px;
}

.step-number {
  font:
    italic 24px Georgia,
    serif;
  color: #a5a0bd;
}

.step h2 {
  font-size: 13px;
  margin: 0 0 10px;
  font-weight: 500;
}
.step p {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
}

.home-footer {
  grid-column: 1/-1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 27px 0;
  color: var(--muted);
  font: 8px monospace;
  letter-spacing: 0.06em;
}
.home-footer p {
  font:
    10px "Hiragino Sans",
    sans-serif;
  margin: 0;
}

.footer-brand {
  font:
    900 22px Arial,
    sans-serif;
  letter-spacing: -0.08em;
  color: #777a85;
}
.footer-brand span {
  color: var(--accent);
  font-size: 12px;
  margin-left: 5px;
}

.room {
  max-width: 940px;
  padding: 12px 40px 0;
}

.room-title strong {
  color: var(--accent);
}

.room-title .small {
  border-radius: 40px;
}

.room-title h1 {
  margin-top: 10px;
}

.player {
  background: #24262d;
  color: #c4c5ce;
  border-color: #454751;
  padding: 6px 12px;
}

.secret {
  color: #e2ecbc;
  background: #2b3125;
  border-color: #737c50;
  border-radius: 8px;
}

.offline {
  background: #402c2e;
  border-radius: 6px;
}

.log-heading {
  padding: 15px 0;
}

.empty-symbol {
  background: #dfef78;
  color: #242c1d;
  border: 0;
  box-shadow: 8px 8px 0 #373a32;
}

.controls {
  background: var(--bg);
}

.talk {
  color: #252b1c;
  background: var(--accent);
  border-radius: 50px;
}

.talk[data-state="listening"] {
  background: #edf6b4;
  color: #252b1c;
  box-shadow: 0 0 0 5px #dfef7825;
}

.talk[data-state="starting"],
.talk[data-state="stopping"] {
  color: #202229;
}

.talk[data-state="outside"] {
  color: var(--danger);
}

dialog.sheet {
  background: #24262e;
  border-color: #52545f;
  border-radius: 18px;
  box-shadow: 0 30px 100px #0008;
  padding: 34px;
}

dialog::backdrop {
  background: #0b0d14bb;
  backdrop-filter: blur(12px);
}

dialog h2 {
  margin: 15px 0;
}
dialog .eyebrow {
  color: var(--accent);
}

.qr {
  border: 12px solid white;
  border-radius: 12px;
  background: white;
}

.invite-code-line strong {
  color: var(--accent);
}

.rules-list li > span {
  color: var(--accent);
}

.scanner-video {
  background: #14161d;
}

@media (hover: hover) {
  .primary:hover:not(:disabled) {
    background: #ecf7a0;
    transform: translateY(-2px);
    box-shadow: 0 5px 25px #dfef7818;
  }
  .secondary:hover:not(:disabled),
  .rules-link:hover {
    background: #30333d;
    border-color: #6d717f;
  }
  .link:hover {
    color: var(--accent);
  }
  .hero-art:hover .mystery-card {
    transform: translateX(-50%) translateY(-13px) rotate(-3deg);
  }
  .hero-art:hover .card-yes {
    transform: translate(-8px, 4px) rotate(-24deg);
  }
  .hero-art:hover .card-no {
    transform: translate(8px, -4px) rotate(23deg);
  }
}

@keyframes entry-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.6;
  }
}

.hero-heading,
.hero-copy,
.hero-art,
.how-strip {
  animation: entry-in 0.8s both;
}
.hero-art {
  animation-delay: 0.12s;
}
.hero-copy {
  animation-delay: 0.08s;
}
.how-strip {
  animation-delay: 0.2s;
}

@media (min-width: 1450px) {
  .home {
    padding-top: 40px;
  }
  .hero-art {
    min-height: 680px;
  }
  .hero-heading h1 {
    font-size: 70px;
  }
  .answer-card {
    width: 240px;
    height: 330px;
  }
  .mystery-card {
    width: 260px;
    height: 365px;
    top: 165px;
  }
  .card-yes {
    top: 260px;
  }
  .card-no {
    top: 120px;
  }
  .art-orbit {
    width: 610px;
    height: 610px;
  }
  .orbit-two {
    width: 420px;
    height: 420px;
  }
  .hero-copy {
    padding-top: 30px;
    padding-bottom: 55px;
  }
  .entry-panel {
    max-width: 380px;
  }
}

@media (max-width: 1100px) {
  .site-header {
    height: 80px;
  }
  .home {
    grid-template-columns: 42% 58%;
    padding-top: 15px;
  }
  .hero-heading h1 {
    font-size: 45px;
  }
  .headline-star {
    font-size: 35px;
    margin-left: 8px;
  }
  .hero-art {
    min-height: 615px;
    margin-right: 0;
  }
  .art-orbit {
    width: 420px;
    height: 420px;
  }
  .orbit-two {
    width: 300px;
    height: 300px;
  }
  .answer-card {
    width: 175px;
    height: 265px;
    padding: 18px;
  }
  .answer-card strong {
    font-size: 64px;
  }
  .mystery-card {
    width: 200px;
    height: 300px;
    padding: 22px;
    top: 165px;
  }
  .card-yes {
    left: 3%;
    top: 255px;
  }
  .card-no {
    right: 2%;
    top: 142px;
  }
  .spark-one {
    font-size: 52px;
    left: 15%;
    top: 100px;
  }
  .graphic-ring {
    width: 135px;
    height: 135px;
  }
  .art-sticker {
    right: 0;
    bottom: 62px;
    width: 145px;
    font-size: 10px;
  }
  .clue-pill {
    left: 1%;
    bottom: 24px;
    font-size: 10px;
    padding: 11px 15px;
  }
  .art-caption {
    bottom: -13px;
    font-size: 7px;
  }
  .entry-panel {
    max-width: 320px;
  }
  .how-strip {
    gap: 15px;
  }
  .step {
    padding-left: 18px;
    gap: 13px;
  }
  .step p {
    font-size: 10px;
  }
  .room {
    height: calc(100dvh - 80px);
  }
}

@media (max-width: 900px) {
  .site-header {
    height: 76px;
    padding: 0 6%;
  }
  .brand {
    font-size: 25px;
  }
  .header-caption {
    display: none;
  }
  .rules-link {
    min-height: 40px;
    font-size: 11px;
    padding: 7px 14px;
    gap: 20px;
  }
  .home {
    display: grid;
    grid-template-columns: 1fr;
    padding: 13px 6% 0;
  }
  .hero-heading {
    grid-column: 1;
    grid-row: 1;
    padding-top: 14px;
  }
  .hero-heading > .eyebrow {
    font-size: 8px;
  }
  .edition {
    margin-left: auto;
    font-size: 8px;
  }
  .hero-heading h1 {
    font-size: clamp(37px, 7.9vw, 59px);
    line-height: 1.42;
    margin-top: 24px;
  }
  .headline-star {
    font-size: 33px;
    margin-left: 10px;
  }
  .hero-art {
    grid-column: 1;
    grid-row: 2;
    min-height: 405px;
    width: min(100%, 480px);
    justify-self: center;
    margin: 7px 0 12px;
  }
  .art-coordinate {
    top: 10px;
    right: 0;
    font-size: 7px;
  }
  .art-orbit {
    width: 335px;
    height: 335px;
    left: 50%;
    top: 49%;
  }
  .orbit-two {
    width: 240px;
    height: 240px;
  }
  .art-grid {
    inset: 20px -10px;
    background-size: 40px 40px;
  }
  .answer-card {
    width: 145px;
    height: 211px;
    padding: 16px;
    border-radius: 10px;
  }
  .answer-card > span {
    font-size: 6px;
  }
  .answer-card strong {
    font-size: 53px;
  }
  .answer-card strong span {
    font-size: 10px;
  }
  .answer-card i {
    font-size: 25px;
  }
  .card-yes {
    left: calc(50% - 152px);
    top: 132px;
  }
  .card-no {
    right: calc(50% - 154px);
    top: 65px;
  }
  .mystery-card {
    left: 49%;
    top: 91px;
    width: 162px;
    height: 233px;
    border-radius: 10px;
    padding: 18px;
  }
  .card-top {
    font-size: 10px;
  }
  .card-top > span:last-child {
    font-size: 20px;
  }
  .card-bottom {
    font-size: 7px;
  }
  .secret-graphic {
    height: 125px;
  }
  .graphic-ring {
    width: 109px;
    height: 109px;
  }
  .graphic-question {
    width: 48px;
    height: 60px;
    font-size: 54px;
    padding-right: 6px;
  }
  .mystery-card > p {
    font-size: 6px;
    margin-bottom: 10px;
  }
  .spark-one {
    top: 39px;
    left: 12%;
    font-size: 44px;
  }
  .art-sticker {
    bottom: 42px;
    right: 0;
    width: 127px;
    font-size: 9px;
    padding: 11px;
  }
  .art-sticker > span:last-child {
    font-size: 20px;
    right: 10px;
    top: 9px;
  }
  .clue-pill {
    bottom: 15px;
    left: 0;
    font-size: 9px;
    gap: 8px;
    padding: 9px 12px;
  }
  .clue-pill > span:last-child {
    font-size: 16px;
    margin-left: 3px;
  }
  .art-caption {
    font-size: 6px;
    right: 0;
    bottom: -14px;
  }
  .caption-line {
    width: 20px;
  }
  .hero-copy {
    grid-row: 3;
    padding: 22px 0 31px;
    display: grid;
    grid-template-columns: 1fr;
  }
  .lead {
    font-size: 13px;
    line-height: 2;
    margin-bottom: 0;
  }
  .entry-panel {
    max-width: none;
    margin-top: 22px;
  }
  .entry-heading {
    padding: 18px 0;
  }
  .entry-note {
    text-align: center;
  }
  .field {
    font-size: 12px;
  }
  #scan-open {
    justify-content: center;
    position: relative;
    padding-top: 8px;
    padding-bottom: 15px;
  }
  .join-arrow {
    position: absolute;
    right: 5px;
  }
  /* 枠のあるリンクでは、矢印を枠の内側の余白（18px）に置く */
  .entry-link .join-arrow {
    right: 18px;
  }
  .primary.arrow-button {
    min-height: 56px;
  }
  .how-strip {
    grid-template-columns: 1fr;
    gap: 23px;
    padding: 26px 0;
  }
  .strip-intro {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1px;
  }
  .strip-intro > span:last-child {
    font-size: 11px;
  }
  .step {
    border: 0;
    padding: 0;
    gap: 22px;
    align-items: center;
  }
  .step-number {
    font-size: 25px;
    width: 30px;
  }
  .step h2 {
    font-size: 13px;
    margin-bottom: 5px;
  }
  .step p {
    font-size: 11px;
  }
  .home-footer {
    flex-wrap: wrap;
    gap: 15px;
    padding: 23px 0;
  }
  .home-footer > span:last-child {
    display: none;
  }
  .home-footer p {
    font-size: 9px;
  }
  .room {
    height: calc(100dvh - 76px);
    padding: 19px 6% 0;
  }
  .room-title .eyebrow {
    font-size: 8px;
    letter-spacing: 0.08em;
  }
  .room-title h1 {
    font-size: 11px;
  }
  .room-title strong {
    font-size: 22px;
    margin-left: 7px;
    letter-spacing: 2px;
  }
  .room-title .small {
    font-size: 11px;
    padding: 8px 12px;
  }
  .game-status {
    font-size: 11px;
    gap: 12px;
    margin: 16px 0 12px;
  }
  .players-row {
    padding-bottom: 14px;
    gap: 10px;
  }
  .players-row > .eyebrow {
    font-size: 8px;
  }
  .player {
    font-size: 10px;
    padding: 5px 9px;
  }
  .log-heading {
    padding: 12px 0;
  }
  .log-heading > span:last-child {
    font-size: 9px;
  }
  .log-heading .eyebrow {
    font-size: 9px;
  }
  .empty-room h2 {
    font-size: 19px;
  }
  .empty-room > .eyebrow {
    font-size: 8px;
  }
  .empty-room > p:last-child {
    font-size: 11px;
  }
  .empty-symbol {
    width: 52px;
    height: 68px;
    font-size: 36px;
    margin-bottom: 22px;
  }
  .keyboard-hint {
    display: none;
  }
  .talk {
    min-height: 59px;
  }
  .controls {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
  .secret {
    max-height: 95px;
    font-size: 12px;
  }
  .entrance {
    padding-top: 45px;
  }
  .entrance h1 {
    font-size: 38px;
  }
  dialog.sheet {
    padding: 25px;
  }
  .row {
    gap: 8px;
  }
  .row button {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (max-width: 360px) {
  .hero-heading h1 {
    font-size: 35px;
  }
  .headline-star {
    font-size: 26px;
    margin-left: 6px;
  }
  .art-orbit {
    width: 285px;
    height: 285px;
  }
  .card-yes {
    left: calc(50% - 131px);
  }
  .card-no {
    right: calc(50% - 131px);
  }
  .hero-art {
    min-height: 395px;
  }
  .art-sticker {
    right: -4px;
    bottom: 41px;
  }
  .room-title strong {
    font-size: 19px;
  }
  .room-title .small {
    padding: 7px;
  }
  .room-title .eyebrow {
    font-size: 7px;
  }
}

@media (max-height: 740px) {
  .empty-symbol {
    display: none;
  }
  .empty-room h2 {
    margin-top: 8px;
  }
  .room {
    padding-top: 15px;
  }
  .game-status {
    margin: 10px 0;
  }
  .players-row {
    padding-bottom: 10px;
  }
  .controls {
    padding-top: 12px;
  }
  .log {
    padding-top: 14px;
    padding-bottom: 14px;
  }
}

@media (max-height: 600px) {
  body:has(.room:not([hidden])) .site-header {
    height: 56px;
  }
  .room {
    height: calc(100dvh - 56px);
    padding-top: 10px;
  }
  .room-header {
    max-height: 35%;
    overflow-y: auto;
  }
  .log-heading,
  .empty-room {
    display: none;
  }
  .controls {
    max-height: 60%;
    padding-bottom: 10px;
  }
  .talk {
    min-height: 48px;
  }
  .voice {
    gap: 6px;
  }
  .links {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.mobile-start {
  display: none;
}

#home-name {
  scroll-margin-top: 80px;
}

@media (max-width: 900px) {
  .mobile-start {
    display: inline-flex;
    align-items: center;
    gap: 30px;
    min-height: 44px;
    margin-top: 16px;
    color: var(--accent);
    text-decoration: none;
    font-size: 12px;
    border-bottom: 1px solid #727b48;
  }
  .mobile-start span {
    font-size: 21px;
  }
  .card-no {
    right: calc(50% - 148px);
    transform: rotate(15deg);
  }
  .card-no strong {
    align-self: flex-end;
    font-size: 43px;
    letter-spacing: -0.06em;
  }
  .card-no strong span {
    font-size: 8px;
  }
}
/* Tablet: retain the compact entry, with the smaller card composition. */
@media (min-width: 701px) and (max-width: 900px) {
  .home {
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
  }
  .hero-heading {
    grid-column: 1 / -1;
  }
  .hero-heading h1 {
    font-size: 52px;
  }
  .mobile-start {
    display: none;
  }
  .hero-copy {
    grid-column: 1;
    grid-row: 2;
    padding-top: 30px;
  }
  .hero-art {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    margin: 0;
    transform: scale(0.92);
  }
  .how-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .strip-intro {
    grid-column: 1 / -1;
  }
  .step {
    align-items: flex-start;
    gap: 12px;
  }
  .step-number {
    width: auto;
  }
}

/* ルーム上部の固定情報は、どの幅でも 1 本のバーに畳む。会話欄を画面の大部分にするため。
   サイトヘッダーと「CONVERSATION」の見出しは出さず、ルーム番号・質問数・経過時間を 1 行に並べる。
   広い画面では参加者一覧と招待・遊び方のボタンも同じバーに置き、
   スマホではバー右端のハンバーガーメニューに畳む（要素の移動は layout.js）。
   .room-title を display: contents にして、見出し・状態・参加者・ボタンを同じ flex の並びに置く。 */
body:has(.room:not([hidden])) .site-header {
  display: none;
}
.room-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  min-height: 52px;
  padding: 2px 0 8px;
  border-bottom: 1px solid var(--line);
}
.room-title {
  display: contents;
}
.room-title .eyebrow,
.log-heading {
  display: none;
}
.room-title > div:first-child {
  order: 1;
}
.room-title h1 {
  margin: 0;
  white-space: nowrap;
}
.room-title strong {
  font-size: 20px;
  margin-left: 6px;
}
.room-title .game-status {
  order: 2;
  margin: 0;
  gap: 10px;
  font-size: 11px;
  line-height: 1.4;
}
#players-slot {
  order: 3;
  flex: 1;
  min-width: 0;
}
.room-header .players-row {
  gap: 12px;
  padding: 0;
}
.room-header .players-row .eyebrow {
  display: none;
}
.room-header .players {
  /* チップ 2 行ぶん。それ以上はスクロール */
  max-height: 62px;
}
.room-title .room-actions {
  order: 4;
}
.room-actions:not(:has(*)) {
  display: none;
}
.room-rules {
  order: 5;
  min-height: 44px;
  font-size: 12px;
  color: var(--muted);
}
.room-rules span {
  font-size: 16px;
}
.room-title .menu-button {
  order: 6;
}
.room-header .secret,
.room-header .offline,
.room-header .sound-hint {
  order: 7;
  flex-basis: 100%;
  margin: 0;
}
.secret {
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.6;
  max-height: 64px;
}
.offline {
  padding: 8px 12px;
  font-size: 11px;
}
/* GM の声がオンなのにブラウザが音を止めている間の帯。警告ではないので赤でなく、GM の声のスイッチと同じ色 */
.sound-hint {
  justify-content: flex-start;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border-color: var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  text-align: left;
}
.sound-hint svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.menu-button {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  place-items: center;
}
.menu-lines,
.menu-lines::before,
.menu-lines::after {
  content: "";
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
}
.menu-lines {
  position: relative;
}
.menu-lines::before,
.menu-lines::after {
  position: absolute;
  left: 0;
}
.menu-lines::before {
  top: -6px;
}
.menu-lines::after {
  top: 6px;
}
.menu-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #252b1c;
  font: 700 10px/1 monospace;
}
.menu-count:empty {
  display: none;
}

.menu-sheet h2 strong {
  color: var(--accent);
  font-family: monospace;
  letter-spacing: 3px;
  margin-left: 8px;
}
/* 招待と GM の声。広い画面ではヘッダーの丸いボタン、スマホ幅ではメニューの大きなタイル（コントロールセンター風）。
   GM の声はスイッチで、オンのあいだボタン全体が黄緑に光る */
.control:active {
  transform: scale(0.97);
}
.control-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #33363f;
  color: var(--accent);
  transition:
    background 0.2s,
    color 0.2s;
}
.control-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.control-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.control-sub {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.8;
}
#sound-toggle[aria-checked="true"] .sound-off,
#sound-toggle[aria-checked="false"] .sound-on {
  display: none;
}
#sound-toggle[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #1d2215;
}
#sound-toggle[aria-checked="true"] .control-icon {
  background: #1d2215;
  color: var(--accent);
}
#sound-toggle[aria-checked="false"] .control-icon {
  color: var(--muted);
}
/* ヘッダー: 丸いボタン。招待の「QR・URL」は省く */
.room-actions:has(*) {
  display: flex;
  gap: 8px;
}
.room-actions .control {
  gap: 8px;
  padding: 7px 14px 7px 8px;
}
.room-actions #invite-open .control-sub {
  display: none;
}
/* スマホのメニュー: 大きなタイルを 2 枚並べる */
.menu-actions:has(*) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.menu-actions .control {
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 118px;
  padding: 14px;
  border-color: #44464f;
  border-radius: 18px;
  background: #2e3039;
  text-align: left;
}
.menu-actions .control-icon {
  width: 40px;
  height: 40px;
}
.menu-actions .control-icon svg {
  width: 22px;
  height: 22px;
}
.menu-actions .control-text {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.menu-actions .control-label {
  font-size: 15px;
  font-weight: 700;
}
.menu-actions .control-sub {
  font-size: 12px;
}
.menu-note {
  margin: 10px 2px 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  /* 2 行になるとき、最後の 1 文字だけが次の行に残らないよう長さをそろえる */
  text-wrap: balance;
}
.menu-players {
  margin: 22px 0;
}
.menu-players .players-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 0;
}
.menu-players .players {
  max-height: 40vh;
  gap: 8px;
}
.menu-players .player {
  font-size: 12px;
  padding: 7px 12px;
}
.menu-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-size: 12px;
}
.menu-links a {
  text-decoration: none;
  color: var(--muted);
}

@media (max-width: 900px) {
  .room {
    padding: max(6px, env(safe-area-inset-top)) 4% 0;
  }
  .room-header {
    gap: 8px 10px;
  }
  .room-title .game-status {
    flex: 1;
    justify-content: flex-end;
  }
  /* 参加者一覧と招待・遊び方はメニューの中へ。空になった置き場は詰める */
  #players-slot,
  .room-rules {
    display: none;
  }
  .menu-button {
    display: grid;
    flex-shrink: 0;
  }
  .log {
    padding: 8px 0;
  }
  .q-text {
    font-size: 14.5px;
  }
  .controls {
    padding-top: 12px;
  }
  .talk {
    min-height: 54px;
  }
  .voice {
    gap: 8px;
  }
  .links {
    margin-top: 2px;
  }
}

/* ゲーム開始の案内は、案内役「GM」がアバター付きの吹き出しで喋る。
   吹き出しは角を斜めに落とし、大きなしっぽでアバターを指す。外側がグラデーションの枠、
   内側が暗い本体で、同じ多角形の clip-path を 2 枚重ねて縁取りにしている。
   内側は枠の padding（--edge）だけ内へずれた座標なので、枠の x = --tail の辺は内側では x = --tail に置くと縁が --edge の太さになる。
   寸法は --size（アバター）と吹き出しの変数に集め、スマホでは画面幅に応じて縮める。 */
.entry.host {
  --size: 120px;
  --tail: 28px;
  --cut: 28px;
  --edge: 2.5px;
  --tail-top: 22%;
  --tail-mid: 38%;
  --tail-bottom: 54%;
  --lead: 24px;
  --body: 15px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0;
  padding: 22px 24px 22px 20px;
  border: 1px solid #2b2d3a;
  border-radius: 22px;
  background:
    radial-gradient(90% 120% at 12% 50%, #262a3a 0%, transparent 55%),
    radial-gradient(60% 90% at 95% 100%, #2a2440 0%, transparent 60%),
    linear-gradient(120deg, #15161d, #1a1b24 55%, #141520);
  overflow: hidden;
}
/* 背景に散る小さな三角と粒。ゆっくり漂う */
.host-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.host-deco i {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent);
  opacity: 0.55;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  animation: host-float 4s ease-in-out infinite alternate;
}
.host-deco i:nth-child(1) {
  top: 12%;
  left: 3%;
  transform: rotate(20deg);
}
.host-deco i:nth-child(2) {
  bottom: 14%;
  left: 7%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  clip-path: none;
  background: #c8b8f5;
  animation-delay: -1.2s;
}
.host-deco i:nth-child(3) {
  top: 10%;
  right: 6%;
  width: 8px;
  height: 8px;
  background: #c8b8f5;
  transform: rotate(-30deg);
  animation-delay: -2s;
}
.host-deco i:nth-child(4) {
  bottom: 10%;
  right: 3%;
  width: 7px;
  height: 7px;
  transform: rotate(180deg);
  animation-delay: -0.6s;
}
.host-deco i:nth-child(5) {
  top: 50%;
  left: 1.5%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  clip-path: none;
  animation-delay: -3s;
}
.host-deco i:nth-child(6) {
  top: 6%;
  left: 48%;
  width: 6px;
  height: 6px;
  background: #c8b8f5;
  transform: rotate(45deg);
  animation-delay: -1.7s;
}
.host-avatar {
  position: relative;
  width: var(--size);
  height: var(--size);
  flex-shrink: 0;
  margin: 0 8px 0 0;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(
    from 150deg,
    #b9a6ea,
    var(--accent) 30%,
    var(--accent) 60%,
    #b9a6ea 85%,
    #b9a6ea
  );
  animation:
    host-pop 0.8s cubic-bezier(0.34, 1.7, 0.64, 1) both,
    host-glow 2.2s 0.8s ease-in-out infinite alternate;
}
.host-face {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
  background: #14161d;
  box-shadow: inset 0 0 0 2px #0e0f14;
}
.host-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 元画像は上半身が入っているので、顔に寄せる */
  transform: scale(1.3);
  transform-origin: 52% 38%;
}
.host-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  --angle: calc(var(--n) * 60deg - 110deg);
  opacity: 0;
  animation: host-dot 1.1s calc(0.35s + var(--n) * 0.06s) ease-out both;
}
.host-dot:nth-child(odd) {
  background: #c8b8f5;
  box-shadow: 0 0 10px #c8b8f5;
  width: 5px;
  height: 5px;
}
.host-marks {
  position: absolute;
  top: calc(var(--size) * -0.02);
  right: calc(var(--size) * -0.1);
  width: calc(var(--size) * 0.2);
  height: calc(var(--size) * 0.2);
  transform: rotate(20deg);
  animation: host-marks 0.5s 0.55s ease-out both;
}
.host-marks::before,
.host-marks::after {
  content: "";
  position: absolute;
  width: 11%;
  border-radius: 3px;
  background: #fffdf3;
  box-shadow: 0 0 8px var(--accent);
}
.host-marks::before {
  left: 15%;
  top: 0;
  height: 60%;
  transform: rotate(-25deg);
}
.host-marks::after {
  left: 60%;
  top: 25%;
  height: 80%;
  transform: rotate(-25deg);
}
.host-bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  filter: drop-shadow(0 0 14px #dfef7840) drop-shadow(0 16px 34px #0009);
  animation: host-burst 0.65s 0.25s cubic-bezier(0.34, 1.5, 0.64, 1) both;
}
.host-bubble-frame {
  position: relative;
  overflow: hidden; /* 光の帯が枠の外へ出て横スクロールを生まないように */
  padding: var(--edge);
  background: linear-gradient(
    115deg,
    #f4ffb0 0%,
    var(--accent) 22%,
    #c9b8f0 58%,
    #8f78d6 100%
  );
}
.host-bubble-frame,
.host-shine {
  clip-path: polygon(
    calc(var(--tail) + var(--cut)) 0,
    100% 0,
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    var(--tail) 100%,
    var(--tail) var(--tail-bottom),
    0 var(--tail-mid),
    var(--tail) var(--tail-top)
  );
}
.host-bubble-inner {
  position: relative;
  padding: 50px 56px 24px calc(var(--tail) + 28px);
  background:
    radial-gradient(120% 90% at 100% 0%, #2a2d3c, transparent 60%),
    linear-gradient(135deg, #1c1e29, #121319);
  clip-path: polygon(
    calc(var(--tail) + var(--cut) + 1px) 0,
    100% 0,
    100% calc(100% - var(--cut) - 1px),
    calc(100% - var(--cut) - 1px) 100%,
    var(--tail) 100%,
    var(--tail) calc(var(--tail-bottom) - 1.2%),
    calc(var(--edge) * 1.6) var(--tail-mid),
    var(--tail) calc(var(--tail-top) + 1.2%)
  );
}
/* 話者タグは上辺に乗ったタブ。左の斜めが角のカットと平行になる */
.host-name {
  position: absolute;
  top: 0;
  left: calc(var(--tail) + var(--cut) - 14px);
  padding: 7px 22px 7px 20px;
  background: linear-gradient(100deg, #f4ffb0, var(--accent) 60%, #c9e886);
  color: #1d2215;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.16em;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  animation: host-tag 0.5s 0.6s cubic-bezier(0.34, 1.8, 0.64, 1) both;
}
.host-line {
  margin: 0;
  font-size: var(--body);
  line-height: 1.75;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 10px #0008;
  animation: host-line 0.45s ease-out both;
  animation-delay: calc(0.7s + var(--i, 0) * 0.22s);
}
.host-line.lead {
  font-size: var(--lead);
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 10px;
  color: #fffdf3;
  text-shadow:
    0 0 18px #dfef7866,
    0 2px 10px #0008;
}
.host-spark {
  position: absolute;
  right: -2px;
  bottom: -8px;
  color: var(--accent);
  font-size: 34px;
  line-height: 1;
  text-shadow:
    0 0 14px var(--accent),
    0 0 30px #dfef7888;
  animation: host-twinkle 1.3s 1s ease-in-out infinite alternate;
  opacity: 0;
}
.host-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 35%,
    #ffffff77 48%,
    #ffffffbb 50%,
    #ffffff77 52%,
    transparent 65%
  );
  transform: translateX(-110%);
  animation: host-shine 1.1s 1.1s ease-in-out both;
}
@keyframes host-pop {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(-25deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.12) rotate(4deg);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes host-glow {
  from {
    box-shadow:
      0 0 0 5px #dfef7814,
      0 0 24px #dfef7850,
      0 0 60px #9b7fd640;
  }
  to {
    box-shadow:
      0 0 0 7px #dfef7822,
      0 0 40px #dfef7890,
      0 0 90px #9b7fd670;
  }
}
@keyframes host-dot {
  0% {
    opacity: 0;
    transform: rotate(var(--angle)) translateX(calc(var(--size) * 0.3)) scale(0.2);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--angle)) translateX(calc(var(--size) * 0.72)) scale(1);
  }
}
@keyframes host-marks {
  0% {
    opacity: 0;
    transform: rotate(20deg) scale(0.3);
  }
  60% {
    opacity: 1;
    transform: rotate(20deg) scale(1.3);
  }
  100% {
    opacity: 1;
    transform: rotate(20deg) scale(1);
  }
}
@keyframes host-burst {
  0% {
    opacity: 0;
    transform: translateX(-40px) scale(0.5) rotate(-4deg);
  }
  65% {
    opacity: 1;
    transform: translateX(6px) scale(1.04) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes host-tag {
  0% {
    opacity: 0;
    transform: scale(1.8) rotate(-6deg);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes host-line {
  from {
    opacity: 0;
    transform: translateX(-10px) translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes host-twinkle {
  from {
    opacity: 0.55;
    transform: scale(0.7) rotate(0deg);
  }
  to {
    opacity: 1;
    transform: scale(1.25) rotate(35deg);
  }
}
@keyframes host-shine {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(110%);
  }
}
@keyframes host-float {
  from {
    translate: 0 -4px;
  }
  to {
    translate: 0 5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .host-spark {
    opacity: 1;
  }
  .host-dot,
  .host-shine {
    display: none;
  }
}
/* スマホ: アバターと文字は画面幅に連動して縮め、吹き出しの比率は保つ */
@media (max-width: 900px) {
  .entry.host {
    --size: clamp(56px, 18vw, 88px);
    --tail: 18px;
    --cut: 20px;
    --edge: 2px;
    /* 見出し「お題が設定されました！」（11 文字）が 320px でも 1 行に収まる大きさ */
    --lead: clamp(13px, 4.3vw, 24px);
    --body: clamp(12px, 3.6vw, 15px);
    gap: 0;
    padding: 18px 12px 16px 10px;
    border-radius: 16px;
  }
  .host-avatar {
    margin-right: 2px;
  }
  .host-bubble-inner {
    padding: 34px 14px 14px calc(var(--tail) + 10px);
  }
  .host-name {
    left: calc(var(--tail) + var(--cut) - 10px);
    padding: 5px 16px 5px 14px;
    font-size: 11px;
    clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  }
  .host-line {
    line-height: 1.6;
  }
  .host-line.lead {
    margin-bottom: 6px;
    letter-spacing: -0.03em;
  }
  .host-spark {
    right: -2px;
    bottom: -6px;
    font-size: 24px;
  }
  .host-bubble {
    filter: drop-shadow(0 0 10px #dfef7840) drop-shadow(0 10px 22px #0009);
  }
}

/* 正解は、案内役「GM」がバラエティ番組のテロップで発表する。
   後ろで集中線が回り、黄色に黒縁と赤い影の「正解！！」が横から飛び込み、お題の帯と内訳が続く。
   集中線は 1 周して止める（履歴に何枚も並んだとき、回り続けるぶんスマホが重くなるため）。
   動きを止める設定では animation が消えるので、どの要素も animation なしの姿を完成形にしておく */
@property --celebrate-spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.entry.celebrate {
  --size: 120px;
  --pad: 20px;
  --telop: 48px;
  --band: 18px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 0 4px;
  padding: 22px 24px 22px var(--pad);
  border: 1px solid #3c4228;
  border-radius: 22px;
  background:
    radial-gradient(90% 120% at 12% 50%, #2b3122 0%, transparent 55%),
    linear-gradient(120deg, #15161d, #1a1b24 55%, #141520);
  overflow: hidden;
}
/* 集中線の中心はアバターの中心。アバターのまわりは線を消して顔を見せる */
.celebrate-lines {
  --center: calc(var(--pad) + var(--size) / 2) 50%;
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-conic-gradient(
    from var(--celebrate-spin) at var(--center),
    #dfef7833 0 1.5deg,
    transparent 1.5deg 7deg
  );
  -webkit-mask: radial-gradient(
    circle at var(--center),
    transparent calc(var(--size) * 0.55),
    #000 calc(var(--size) * 2)
  );
  mask: radial-gradient(
    circle at var(--center),
    transparent calc(var(--size) * 0.55),
    #000 calc(var(--size) * 2)
  );
  animation:
    celebrate-fade 0.4s 0.1s both,
    celebrate-spin 10s cubic-bezier(0.2, 0.6, 0.3, 1) both;
}
.celebrate-avatar {
  position: relative;
  width: var(--size);
  height: var(--size);
  flex-shrink: 0;
  margin: 0;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(
    from 150deg,
    #b9a6ea,
    var(--accent) 30%,
    var(--accent) 60%,
    #b9a6ea 85%,
    #b9a6ea
  );
  box-shadow:
    0 0 0 6px #dfef781a,
    0 0 32px #dfef7870,
    0 0 70px #9b7fd650;
  animation: celebrate-hop 1.6s ease-out both;
}
.celebrate-face {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
  background: #14161d;
  box-shadow: inset 0 0 0 2px #0e0f14;
}
.celebrate-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 両手を上げた上半身の絵なので、顔に少しだけ寄せる */
  transform: scale(1.1);
  transform-origin: 50% 40%;
}
.celebrate-body {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.celebrate-telop {
  display: inline-block;
  font-size: var(--telop);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: #ffe14d;
  transform: skewX(-8deg);
  /* 黒い縁取りを 8 方向の影で描き、最後に赤い影を落とす */
  text-shadow:
    0.06em 0 0 #1d1d16,
    -0.06em 0 0 #1d1d16,
    0 0.06em 0 #1d1d16,
    0 -0.06em 0 #1d1d16,
    0.045em 0.045em 0 #1d1d16,
    -0.045em 0.045em 0 #1d1d16,
    0.045em -0.045em 0 #1d1d16,
    -0.045em -0.045em 0 #1d1d16,
    0.13em 0.13em 0 #c93b26;
  animation: celebrate-telop 0.55s 0.3s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.celebrate-telop span {
  display: inline-block;
  animation: celebrate-jump 0.5s calc(0.85s + var(--i, 0) * 0.07s) ease-out both;
}
.celebrate-band {
  max-width: 100%;
  margin: 12px 0 0;
  padding: 6px 18px;
  background: #fffdf3;
  color: #1d2215;
  font-size: var(--band);
  font-weight: 900;
  line-height: 1.45;
  overflow-wrap: anywhere;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  animation: celebrate-band 0.45s 0.8s ease-out both;
}
.celebrate-meta {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1em;
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
  animation: celebrate-fade 0.4s 1.1s both;
}
/* 正解のクラッカーの紙吹雪（confetti.js）。画面全体に重ね、タップは下へ通す */
.confetti {
  position: fixed;
  inset: 0;
  z-index: 30;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
@keyframes celebrate-spin {
  to {
    --celebrate-spin: 360deg;
  }
}
@keyframes celebrate-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* 登場で弾み、そのあと 2 回跳ねて喜ぶ */
@keyframes celebrate-hop {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(-25deg);
  }
  22% {
    opacity: 1;
    transform: scale(1.12) rotate(4deg);
  }
  34% {
    transform: none;
  }
  50% {
    transform: translateY(-14%) rotate(-6deg);
  }
  62% {
    transform: none;
  }
  76% {
    transform: translateY(-7%) rotate(4deg);
  }
  88%,
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes celebrate-telop {
  0% {
    opacity: 0;
    transform: translateX(140%) skewX(-30deg);
  }
  70% {
    opacity: 1;
    transform: translateX(-5%) skewX(-4deg);
  }
  100% {
    opacity: 1;
    transform: skewX(-8deg);
  }
}
@keyframes celebrate-jump {
  0%,
  100% {
    transform: none;
  }
  40% {
    transform: translateY(-0.22em);
  }
}
@keyframes celebrate-band {
  from {
    clip-path: polygon(10px 0, 10px 0, 0 100%, 0 100%);
  }
  to {
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  }
}
/* スマホ: 開始の吹き出しと同じく、アバターと文字を画面幅に連動して縮める */
@media (max-width: 900px) {
  .entry.celebrate {
    --size: clamp(56px, 18vw, 88px);
    --pad: 12px;
    /* 「正解！！」（4 文字）が 320px でも 1 行に収まる大きさ */
    --telop: clamp(28px, 9vw, 44px);
    --band: clamp(13px, 4.2vw, 17px);
    gap: 10px;
    padding: 18px 14px 16px var(--pad);
    border-radius: 16px;
  }
}
