/* 바다거북수프 하루한숟갈 — 청화백자 한 그릇: 흰 유약 위 코발트 선, 판정은 인주 도장.
   그라데이션·빛번짐·흐림·부드러운 그림자는 쓰지 않는다. 면은 납작하게, 경계는 선으로. */

:root {
  --bg: #f1f2ef;
  --surface: #fcfcfa;
  --ink: #15233a;
  --ink-soft: #3e4b5e;
  --muted: #5f6a7c;
  --line: #d8dcdf;
  --line-strong: #b6bec8;
  --accent: #2b4aa8;
  --accent-ink: #ffffff;
  --yes: #1f7a55;
  --no: #c4372c;
  --meh: #5f6a7c;
  --mild: #2f7d4b;
  --medium: #9a6a12;
  --hot: #c4372c;
  --rim-1: #fbfcfc;
  --rim-2: #e4e9ee;
  --rim-line: #c6cfd8;
  --band: #2b4aa8;
  --piece: #f2e4c4;
  --shadow-bowl: rgb(21 35 58 / 0.1);
  --shadow-soft: none;

  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif: 'Gowun Batang', 'Nanum Myeongjo', 'AppleMyungjo', serif;
  --fs-1: 13px;
  --fs-2: 16px;
  --fs-3: 20px;
  --fs-4: 28px;
  --fs-5: 40px;
  --r-1: 8px;
  --r-2: 14px;
  --r-3: 18px;
  --bar-h: 60px;

  --drops: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g fill='rgb(255 238 200 / .3)' stroke='rgb(255 255 255 / .5)' stroke-width='.8'><circle cx='62' cy='58' r='7'/><circle cx='78' cy='71' r='3.5'/><circle cx='121' cy='50' r='5'/><circle cx='137' cy='63' r='2.5'/><circle cx='151' cy='96' r='8'/><circle cx='141' cy='121' r='3'/><circle cx='112' cy='141' r='6'/><circle cx='88' cy='152' r='3'/><circle cx='60' cy='128' r='9'/><circle cx='43' cy='100' r='3'/><circle cx='71' cy='101' r='2.5'/><circle cx='100' cy='84' r='4'/><circle cx='128' cy='92' r='2'/><circle cx='96' cy='119' r='2.5'/><circle cx='160' cy='136' r='4'/><circle cx='52' cy='150' r='2'/><circle cx='108' cy='38' r='2.5'/><circle cx='150' cy='152' r='2'/><circle cx='84' cy='32' r='2'/><circle cx='168' cy='80' r='2.5'/></g></svg>");
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c121d;
    --surface: #131b2a;
    --ink: #e6ebf2;
    --ink-soft: #b5bfce;
    --muted: #8591a5;
    --line: #243049;
    --line-strong: #364563;
    --accent: #86a3f2;
    --accent-ink: #0c121d;
    --yes: #5cc39d;
    --no: #f0705f;
    --meh: #8591a5;
    --mild: #7cc08a;
    --medium: #e2ad57;
    --hot: #f0705f;
    --rim-1: #cbd3de;
    --rim-2: #b2bccb;
    --rim-line: #94a1b4;
    --band: #2f4fae;
    --piece: #efdcb2;
    --shadow-bowl: rgb(0 0 0 / 0.35);
    --shadow-soft: none;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-2) / 1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── 그릇 ─────────────────────────────────────────── */

.stage {
  position: relative;
  aspect-ratio: 300 / 310;
}

.bowl {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bowl-shadow {
  fill: var(--shadow-bowl);
}

.rim {
  fill: var(--rim-1);
  stroke: var(--rim-line);
  stroke-width: 1.5;
}

/* 청화 띠: 굵은 선 하나, 가는 선 하나 */
.rim-band {
  stroke: var(--band);
  stroke-width: 4;
}

.rim-band-thin {
  stroke: var(--band);
  stroke-width: 1.2;
}

.rim-in {
  fill: var(--rim-2);
  stroke: var(--rim-line);
  stroke-width: 1;
}

.soup-edge {
  stroke: var(--rim-line);
  stroke-width: 1.5;
}

.empty-floor {
  fill: var(--rim-1);
}

/* 국물 위 기름방울. 그릇 안 국물 원과 같은 자리에 겹쳐 천천히 돈다. */
.sheen {
  position: absolute;
  left: 14.667%;
  top: 13.548%;
  width: 70.667%;
  height: 68.387%;
  border-radius: 50%;
  background: var(--drops) center / cover;
  opacity: 0.85;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: swirl 120s linear infinite;
}

@keyframes swirl {
  to {
    transform: rotate(360deg);
  }
}

/* 건더기: 가라앉은 그림자(shade)와 떠오른 조각(pc) */
.shade {
  transition: opacity 0.5s ease;
}

.shade.on {
  opacity: 0;
}

.pc {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  transform: translateY(10px) scale(0.6);
  transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.35);
}

.pc.on {
  opacity: 1;
  transform: none;
}

.pc.ghost {
  opacity: 0.5;
}

.pc .bob {
  transform-box: fill-box;
  transform-origin: center;
  animation: bob 6s ease-in-out infinite;
}

.pc-body {
  fill: var(--piece);
  stroke-width: 1.5;
}

@keyframes bob {
  50% {
    transform: translateY(-2.5px) rotate(4deg);
  }
}

.ripple {
  fill: none;
  stroke: rgb(255 255 255 / 0.6);
  stroke-width: 2;
  transform-box: view-box;
  transform-origin: 150px 148px;
  opacity: 0;
}

.stage.ping .ripple {
  animation: ripple 1.1s ease-out;
}

.stage.busy .ripple {
  animation: ripple 1.3s ease-out infinite;
}

@keyframes ripple {
  from {
    opacity: 0.85;
    transform: scale(0.12);
  }
  to {
    opacity: 0;
    transform: scale(1);
  }
}

.tag {
  position: absolute;
  right: 2%;
  bottom: 9%;
  padding: 2px 10px;
  border-radius: 4px;
  background: var(--surface);
  border: 1.5px solid currentColor;
  font-size: var(--fs-1);
  font-weight: 700;
  transform: rotate(-5deg);
}

.taste-mild {
  color: var(--mild);
}

.taste-medium {
  color: var(--medium);
}

.taste-hot {
  color: var(--hot);
}

/* 판정 도장 */
.stamp {
  position: absolute;
  left: 27%;
  top: 25%;
  width: 46%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 5px double currentColor;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  font-family: var(--font-serif);
  font-size: var(--fs-4);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transform: rotate(-12deg) scale(1.5);
  pointer-events: none;
}

.stamp.long {
  font-size: var(--fs-3);
}

.stamp.show {
  animation: stamp 2.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.stamp.stay {
  animation: stamp-stay 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes stamp {
  0% {
    opacity: 0;
    transform: rotate(-12deg) scale(1.5);
  }
  10% {
    opacity: 1;
    transform: rotate(-12deg) scale(1);
  }
  78% {
    opacity: 1;
    transform: rotate(-12deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: rotate(-12deg) scale(0.96);
  }
}

@keyframes stamp-stay {
  from {
    opacity: 0;
    transform: rotate(-12deg) scale(1.5);
  }
  to {
    opacity: 1;
    transform: rotate(-12deg) scale(1);
  }
}

.tone-yes {
  color: var(--yes);
}

.tone-no {
  color: var(--no);
}

.tone-meh {
  color: var(--meh);
}

.tone-done {
  color: var(--accent);
}

/* ── 버튼 ─────────────────────────────────────────── */

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 32px;
  border-radius: 12px;
  font-size: var(--fs-3);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  transition: transform 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-ghost {
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
  font-size: var(--fs-2);
}

/* ── 게임 화면 ─────────────────────────────────────── */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: calc(var(--bar-h) + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.back {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex: none;
}

.back:hover {
  background: var(--surface);
}

.brand {
  flex: 1;
  min-width: 0;
  margin: 0;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-left: 4px;
  font-family: var(--font-serif);
  font-size: var(--fs-3);
  font-weight: 700;
}

.brand img {
  width: 30px;
  height: 30px;
}

.bar-side {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip {
  padding: 2px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: var(--fs-1);
  color: var(--muted);
  white-space: nowrap;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
}

.icon-btn:hover {
  background: var(--surface);
}

.bar {
  padding-inline: max(12px, calc((100% - 1120px) / 2 + 8px));
}

.game {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 16px 0;
  display: grid;
  gap: 24px;
}

.table {
  display: grid;
  gap: 20px;
  justify-items: center;
}

/* 휴대폰: 제목과 문제는 머리 막대 바로 아래에 붙어 있고, 그릇과 대화가 그 밑으로 지나간다.
   .left는 상자를 만들지 않아서(.pin이 화면 전체 높이 동안 붙어 있을 수 있게) 데스크톱에서만 단이 된다. */
.left {
  display: contents;
}

.pin {
  position: sticky;
  top: calc(var(--bar-h) + env(safe-area-inset-top));
  z-index: 5;
  display: grid;
  gap: 10px;
  justify-items: center;
  margin: 0 -16px;
  padding: 0 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}


/* 다 푼 뒤에는 진실과 순위를 넓게 읽도록, 화면이 아주 낮으면 대화할 자리가 모자라니 고정하지 않는다 */
.game.is-done .pin {
  position: static;
  background: none;
  border-bottom: 0;
}

@media (max-height: 560px) {
  .pin {
    position: static;
    background: none;
    border-bottom: 0;
  }
}

.soup-title {
  margin: 8px 0 0;
  font-family: var(--font-serif);
  font-size: var(--fs-4);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.story-card {
  width: 100%;
  padding: 14px 18px 16px;
  border-radius: var(--r-2);
  background: var(--surface);
  border: 1.5px solid var(--line);
}

.story-card .soup-title {
  margin: 0 0 4px;
  font-size: var(--fs-3);
  line-height: 1.35;
  text-align: left;
}

.story {
  margin: 0;
  font-family: var(--font-serif);
  line-height: 1.75;
}

/* 문제 끝 질문("여자는 왜 도망쳤을까?"): 무엇을 밝혀야 하는지. 줄을 바꿔 굵게 */
.story-ask {
  display: block;
  margin-top: 2px;
  font-weight: 700;
  color: var(--accent);
}

/* 휴대폰 단(899px까지) */
@media (max-width: 899px) {
  /* 입력창이 처음부터 화면 맨 아래(엄지 자리)에 오도록 대화 칸이 남은 높이를 채운다 */
  .game {
    padding-top: 0;
    min-height: calc(100dvh - var(--bar-h) - env(safe-area-inset-top));
    grid-template-rows: auto auto 1fr;
  }

  /* 고정된 문제 카드: 머리 막대에 바로 붙고, 아래는 선 하나로 끊는다 */
  .pin {
    padding: 10px 16px 12px;
  }

  /* 머리 막대와 고정 카드는 한 덩어리: 사이 선은 빼고 카드 아래 선만 */
  .bar:has(+ .game:not(.is-done)) {
    border-bottom-color: transparent;
  }

  /* 자판이 올라와 있는 동안은 제목을 접어 대화 자리를 넓힌다 */
  .game.typing .story-card .story-head {
    display: none;
  }
}

@media (max-width: 899px) and (max-height: 560px) {
  .bar:has(+ .game:not(.is-done)) {
    border-bottom-color: var(--line);
  }
}

.table .stage {
  width: min(56vw, 230px);
}

.count {
  margin: -4px 0 0;
  font-size: var(--fs-1);
  color: var(--muted);
}

.count b {
  color: var(--ink);
  font-weight: 700;
}

.talk {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (min-width: 900px) {
  .game {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 56px;
    padding-top: 16px;
  }

  .left {
    display: grid;
    gap: 20px;
    justify-items: center;
    position: sticky;
    top: 76px;
    align-self: start;
  }

  .pin {
    position: static;
    width: 100%;
    margin: 0;
    padding: 0;
    background: none;
    border-bottom: 0;
  }

  /* 데스크톱: 제목은 카드 밖에 크게, 문제는 카드로 */
  .story-card {
    display: contents;
  }

  .story-card .soup-title {
    margin: 8px 0 0;
    font-size: var(--fs-5);
    line-height: 1.25;
    text-align: center;
  }

  .story {
    width: 100%;
    padding: 26px 28px;
    border-radius: var(--r-2);
    background: var(--surface);
    border: 1.5px solid var(--line);
    font-size: var(--fs-3);
    line-height: 1.85;
  }

  .table .stage {
    width: 340px;
  }

  .stamp {
    font-size: var(--fs-5);
  }

  .stamp.long {
    font-size: var(--fs-4);
  }

  .talk {
    min-height: calc(100dvh - 76px);
  }
}

/* 주고받은 말 */
.log {
  list-style: none;
  margin: 0;
  padding: 0;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 2px 16px;
  padding: 14px 6px;
  scroll-margin-bottom: 220px;
  border-bottom: 1px solid var(--line);
  animation: row-in 0.35s ease;
}

.row p {
  margin: 0;
  overflow-wrap: anywhere;
}

.ans {
  display: inline-block;
  font-family: var(--font-serif);
  font-weight: 700;
  white-space: nowrap;
}

.row.fresh .ans {
  animation: ans-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1.25);
}

@keyframes ans-in {
  from {
    opacity: 0;
    transform: scale(1.7) rotate(-10deg);
  }
}

.row small {
  grid-column: 1 / -1;
  font-size: var(--fs-1);
  color: var(--muted);
}

.row.is-key {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.key {
  margin-right: 8px;
  font-size: var(--fs-1);
  font-weight: 700;
  color: var(--accent);
}

.row-g p {
  font-family: var(--font-serif);
}

.row-h {
  grid-template-columns: auto 1fr;
}

.row-h .label {
  font-size: var(--fs-1);
  font-weight: 700;
  color: var(--accent);
}

.row-h p {
  color: var(--ink-soft);
}

.log-empty {
  padding: 28px 8px;
  text-align: center;
  color: var(--muted);
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* 입력 */
.dock {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.dock.is-end {
  position: static;
  background: none;
  border-top: 0;
  scroll-margin-top: 72px;
}

.composer {
  display: grid;
  gap: 10px;
}

.composer-top {
  display: flex;
  flex-wrap: wrap; /* 아주 좁은 화면에서는 추리 방법·힌트·정답 보기가 다음 줄 오른쪽으로 */
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
}

.seg {
  justify-self: start;
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.seg button {
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-1);
  font-weight: 600;
}

.seg button[aria-selected='true'] {
  background: var(--ink);
  color: var(--bg);
}

.field {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 6px 6px 20px;
  border-radius: var(--r-2);
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  transition: border-color 0.2s ease;
}

.field:focus-within {
  border-color: var(--ink);
}

.field textarea {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  max-height: 200px;
  padding: 14px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
}

.field textarea::placeholder {
  color: var(--muted);
}

.send {
  flex: none;
  min-width: 92px;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--fs-3);
  font-weight: 700;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.send:active {
  transform: scale(0.96);
}

.send:disabled {
  opacity: 0.55;
  cursor: progress;
}

.composer[data-mode='guess'] .send {
  background: var(--accent);
  color: var(--accent-ink);
}

.notice {
  margin: 0;
  padding: 0 8px;
  font-size: var(--fs-1);
  color: var(--no);
}

.notice:empty {
  display: none;
}

.aux {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.aux button {
  min-height: 40px;
  padding: 0 10px;
  white-space: nowrap;
  border-radius: 8px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: var(--fs-1);
}

.aux button:hover:not(:disabled) {
  color: var(--ink);
}

.aux button:disabled {
  opacity: 0.4;
  cursor: default;
}

.aux button.armed {
  color: var(--no);
  font-weight: 700;
}

/* 휴대폰: 질문/추리 탭과 추리 방법·힌트·정답 보기를 한 줄에 넣으려고 여백을 줄인다 */
@media (max-width: 430px) {
  .composer-top .seg button {
    padding: 0 12px;
  }

  .aux {
    gap: 0;
  }

  .aux button {
    padding: 0 7px;
  }
}

/* 320px 휴대폰: "정말 볼까요?"로 길어져도 줄이 넘어가지 않게 조금 더 */
@media (max-width: 340px) {
  .composer-top .seg button {
    padding: 0 10px;
  }

  .aux button {
    padding: 0 5px;
  }
}

/* 결말 */
.ending {
  padding: 8px 0 24px;
  animation: row-in 0.5s ease;
}

.ending-title {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: var(--fs-4);
  color: var(--accent);
}

.truth {
  margin: 0 0 22px;
  font-family: var(--font-serif);
  line-height: 1.9;
}

.pieces-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.pieces-list li {
  padding: 12px 16px;
  border-radius: var(--r-1);
  background: var(--surface);
  color: var(--muted);
}

.pieces-list li.got {
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--accent);
}

.ending-act {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* 기록 숫자 */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 24px;
  padding: 18px 8px;
  border-radius: var(--r-2);
  background: var(--surface);
  text-align: center;
}

.stats dt {
  font-size: var(--fs-1);
  color: var(--muted);
}

.stats dd {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-4);
  font-weight: 700;
  line-height: 1.3;
}

.ending-act {
  align-items: center;
  justify-content: space-between;
}

/* 끝낸 뒤: 오늘은 여기까지라는 한 줄 */
.done-note {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: var(--fs-2);
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink);
}

.next {
  margin: 0;
  font-size: var(--fs-1);
  color: var(--muted);
}

.next b {
  display: block;
  font-size: var(--fs-3);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* 기록 창 */
.sheet {
  width: min(92vw, 440px);
  max-height: 86dvh;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-3);
  background: var(--bg);
  color: var(--ink);
}

.sheet::backdrop {
  background: rgb(12 18 29 / 0.5);
}

.sheet[open] {
  animation: row-in 0.25s ease;
}

.sheet-body {
  padding: 12px 20px 22px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sheet-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-3);
}

.shelf {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}

.shelf li {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.shelf-bowl {
  width: 100%;
  max-width: 52px;
  aspect-ratio: 300 / 310;
  display: grid;
  place-items: center;
}

.ghost-bowl {
  width: 84%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px dashed var(--line);
}

.shelf-no {
  font-size: var(--fs-1);
  color: var(--muted);
}

.shelf-state {
  min-height: 1.4em;
  font-size: var(--fs-1);
  font-weight: 700;
  color: var(--muted);
}

.shelf .solved .shelf-state {
  color: var(--accent);
}

.shelf .today .shelf-state {
  color: var(--ink);
}

.sheet-note {
  margin: 18px 0 0;
  font-size: var(--fs-1);
  color: var(--muted);
  text-align: center;
}

/* ── 차림표 (골라 풀기) ───────────────────────────────── */

.menu {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 16px 96px;
}

.menu-title {
  margin: 8px 0 20px;
  font-family: var(--font-serif);
  font-size: var(--fs-4);
  text-align: center;
}

.dishes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 16px;
}

@media (min-width: 640px) {
  .dishes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .menu-title {
    font-size: var(--fs-5);
    margin-bottom: 36px;
  }

  .dishes {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 40px 24px;
  }
}

.dish {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 4px 12px;
  border-radius: var(--r-2);
  text-align: center;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.dish:hover {
  background: var(--surface);
}

.dish:active {
  transform: scale(0.98);
}

.dish-bowl {
  position: relative;
  width: min(100%, 150px);
  aspect-ratio: 300 / 310;
  margin-bottom: 6px;
}

.dish-stamp {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 52%;
  height: 52%;
  display: grid;
  place-items: center;
  border: 3px double var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: var(--fs-2);
  font-weight: 700;
  transform: rotate(-12deg);
  top: -6%;
}

.dish-name {
  font-family: var(--font-serif);
  font-size: var(--fs-3);
  font-weight: 700;
  line-height: 1.3;
}

.dish-meta {
  display: flex;
  gap: 8px;
  font-size: var(--fs-1);
  font-weight: 600;
}

.dish-mark {
  color: var(--muted);
  font-weight: 400;
}

.redo {
  display: block;
  margin: 20px 0 0;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: var(--fs-1);
}

.redo:hover {
  color: var(--ink);
}

/* 끝난 뒤: 직접 만든 문제 보내기 (결과 나누기보다 한 단계 낮게) */
.submit-puzzle {
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  color: var(--ink-soft);
}

.fail {
  max-width: 28em;
  margin: 18vh auto 0;
  padding: 0 16px;
  text-align: center;
  color: var(--muted);
}

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

  .pc.on,
  .stamp.show,
  .stamp.stay {
    opacity: 1;
    transform: rotate(-12deg);
  }

  .pc.on {
    transform: none;
  }
}

/* ── 오늘의 기록: 순위, 숟갈 그림, 질문 개수별 정답자 ───────── */

.board {
  margin: 4px 0 24px;
  padding: 24px 20px 20px;
  border-radius: var(--r-3);
  background: var(--surface);
  border: 1.5px solid var(--line);
}

.board:empty {
  display: none;
}

.rank {
  text-align: center;
  margin-bottom: 18px;
}

.rank-hero {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 56px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--accent);
}

.rank-hero span {
  margin-left: 2px;
  font-size: var(--fs-4);
}

.rank-sub {
  margin: 6px 0 0;
  color: var(--muted);
}

.board .stats {
  margin-bottom: 8px;
  background: var(--bg);
}

.score-note {
  margin: 0 0 18px;
  font-size: var(--fs-1);
  color: var(--muted);
  text-align: center;
}

.spoon-grid {
  display: grid;
  justify-content: center;
  gap: 2px;
  margin: 0 0 22px;
  font-size: var(--fs-3);
  line-height: 1.3;
  letter-spacing: 0.12em;
}

.dist {
  margin: 0;
}

.dist figcaption {
  margin-bottom: 10px;
  font-size: var(--fs-1);
  font-weight: 700;
  color: var(--ink-soft);
}

.dist-chart {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.dist-row {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 24px;
  border-radius: 6px;
  outline-offset: 2px;
}

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

.me-tag {
  padding: 0 6px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  line-height: 18px;
}

.dist-track {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 20px;
  border-left: 1px solid var(--line);
}

.dist-bar {
  display: block;
  height: 20px;
  min-width: 4px;
  border-radius: 0 4px 4px 0;
  background: color-mix(in srgb, var(--ink) 42%, var(--surface));
  transition: filter 0.15s ease;
}

.dist-row.is-mine .dist-bar {
  background: var(--accent);
}

.dist-row:hover .dist-bar,
.dist-row:focus-visible .dist-bar {
  filter: brightness(1.12);
}

.dist-val {
  font-size: var(--fs-1);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

/* 값이 적혀 있지 않은 막대는 손을 대면 값이 뜬다 */
.dist-row[data-tip]:hover::after,
.dist-row[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--fs-1);
  font-weight: 700;
  pointer-events: none;
}

.ending .stats:last-child {
  margin-top: 28px;
}

/* 사이트 이름: 바다거북수프(가볍게) 하루한숟갈(굵게) */
.brand-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 영어판 좁은 화면: 장르 이름(Lateral Thinking Puzzle)만 굵게 남긴다 */
@media (max-width: 480px) {
  html[lang='en'] .brand-main {
    display: none;
  }

  html[lang='en'] .brand-sub {
    display: inline;
    font-weight: 700;
    color: var(--ink);
  }
}

.brand-sub {
  font-weight: 400;
  color: var(--ink-soft);
}

@media (max-width: 480px) {
  .brand {
    font-size: var(--fs-2);
    gap: 8px;
  }

  .brand img {
    width: 26px;
    height: 26px;
  }
}

/* 영어판 순위 서수(st, nd, rd, th)는 작게 */
html[lang='en'] .rank-hero span {
  font-size: var(--fs-3);
  margin-left: 1px;
}

/* 게임 방법 창 (? 단추) */
.howto {
  overflow: auto;
}

.howto-lead {
  margin: 0 0 14px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.howto-rules {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  padding-left: 1.2em;
  line-height: 1.6;
}

.howto-eg {
  border-top: 1px solid var(--line);
}

.howto-eg .row {
  padding: 10px 6px;
  animation: none;
}

.howto .howto-note {
  margin-top: 14px;
  text-align: left;
  line-height: 1.6;
}

/* 힌트 확인 창 */
.ask-sheet {
  width: min(92vw, 380px);
}

.ask-sheet .sheet-body {
  padding: 26px 20px 20px;
}

.ask-text {
  margin: 0 0 22px;
  text-align: center;
  font-size: var(--fs-2);
  line-height: 1.7;
}

.ask-act {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ask-act button {
  width: 100%;
  padding: 0 12px;
}

button.btn-primary {
  border: 0;
}

button.btn-ghost {
  background: transparent;
  color: var(--ink);
}

/* 320px 휴대폰: 머리 막대 여백을 조금 줄여 이름이 들어가게 */
@media (max-width: 340px) {
  .bar {
    gap: 4px;
    padding-inline: 8px;
  }

  .bar-side {
    gap: 4px;
  }

  .bar .icon-btn {
    width: 40px;
  }
}

/* 360px 이하: ? 단추가 들어가도 사이트 이름이 잘리지 않게 오른쪽 단추들을 붙인다 (누르는 높이 44px은 그대로) */
@media (max-width: 360px) {
  .bar-side {
    gap: 0;
  }

  .bar .icon-btn {
    width: 32px;
  }

  .bar .chip {
    padding: 2px 7px;
  }
}

/* 같이 풀기: 문제 카드 제목 옆의 작은 버튼 */
.story-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.story-head .soup-title {
  margin: 0;
  min-width: 0;
}

.invite {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: var(--fs-1);
  font-weight: 600;
  white-space: nowrap;
}

.invite:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
}

@media (min-width: 900px) {
  .story-head {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 0;
  }
}

/* 바닥글: 작고 흐리게 */
.site-foot {
  max-width: 1120px;
  margin: 56px auto 0;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: var(--fs-1);
  line-height: 1.6;
  color: var(--muted);
}

.site-foot nav,
.site-foot p {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 16px;
  margin: 0 0 6px;
}

.site-foot a {
  color: var(--muted);
  text-decoration: none;
}

.site-foot a:hover {
  color: var(--ink-soft);
  text-decoration: underline;
}

/* 제보·한마디 페이지 */
.fb {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.fb h1 {
  margin: 8px 0 6px;
  font-family: var(--font-serif);
  font-size: var(--fs-4);
}

.fb-sub {
  margin: 0 0 22px;
  color: var(--muted);
}

.fb form {
  display: grid;
  gap: 12px;
}

.fb [hidden] {
  display: none !important;
}

/* 문제 제보: 칸이 여럿이라 이름을 위에 작게 단다 */
.fb-label {
  margin: 8px 0 -6px;
  font-size: var(--fs-1);
  font-weight: 600;
  color: var(--ink-soft);
}

.fb-label:first-child {
  margin-top: 0;
}

.fb-opt {
  margin-left: 4px;
  font-weight: 400;
  color: var(--muted);
}

.fb textarea,
.fb input[type='text'] {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-2);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.fb textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.6;
}

.fb #story {
  min-height: 104px;
}

.fb textarea:focus,
.fb input[type='text']:focus {
  outline: none;
  border-color: var(--ink-soft);
}

.fb-note {
  margin: -4px 0 4px;
  font-size: var(--fs-1);
  color: var(--muted);
}

.fb .btn-primary {
  width: 100%;
}

.fb .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.fb-done {
  padding: 40px 0;
  text-align: center;
}

.fb-done p {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: var(--fs-3);
}

.fb-done a {
  color: var(--ink-soft);
}

@media (min-width: 600px) {
  .fb .btn-primary {
    width: auto;
    justify-self: end;
  }
}
