main { max-width: 1040px; }
.game-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; margin-bottom: 8px; }
.game-header h1 { margin: 0; }
.game-header p { margin: 0; color: #445d71; font-size: .875rem; font-weight: 700; }
#records-open {
  position: absolute;
  right: clamp(3px, 1vw, 10px);
  bottom: 4px;
  z-index: 3;
  display: grid;
  align-content: end;
  justify-items: end;
  min-width: 44px;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
#records-open svg { filter: drop-shadow(0 2px 0 #533c3150); }
#records-open:not(:disabled):hover svg { filter: drop-shadow(0 0 3px #fff2b5); }
.basket-food:not([hidden]) { display: flex; gap: 2px; justify-content: flex-end; margin-bottom: -5px; z-index: 1; }
.basket-food span { padding: 1px 3px; border-radius: 7px; color: #34261a; background: #fff2c3; font-size: clamp(.68rem, 1.6vw, .88rem); font-weight: 800; white-space: nowrap; }
.basket-reward { position: absolute; z-index: 4; pointer-events: none; font-size: 1.25rem; animation: into-basket .65s ease-in forwards; }
@keyframes into-basket {
  from { transform: translate(-50%, -50%) scale(1.2); }
  to { left: calc(100% - 26px); top: calc(100% - 33px); transform: translate(-50%, -50%) scale(.6); opacity: 0; }
}
.quiz-site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; margin-bottom: 12px; font: 500 1rem/1.5 'Noto Sans KR', sans-serif; }
.quiz-site-nav a { display: inline-flex; align-items: center; gap: .3em; min-height: 44px; padding: .35rem .6rem; border-radius: 4px; color: #495057; text-decoration: none; }
.quiz-site-nav a:hover { background: rgba(187,225,250,.35); color: #0f4c75; }
.quiz-site-nav .quiz-site-brand { margin-right: .5rem; padding-left: 0; font-size: 1.4rem; font-weight: 700; color: #3282b8; white-space: nowrap; }
.quiz-site-nav svg { width: 1em; height: 1em; flex: none; fill: currentColor; }
.layout {
  grid-template-columns: minmax(0, 32%) minmax(0, 1fr);
  gap: clamp(12px, 2.4vw, 24px);
  padding: clamp(10px, 2.4vw, 24px);
  background: linear-gradient(155deg, #f7fcff, #e7f6fd);
  border: 2px solid #244e72;
  border-radius: 25px;
  box-shadow: 0 5px 0 #c9e4f2;
}
.puzzle-panel { min-width: 0; }
.puzzle-panel .controls { padding: 0; border: 0; background: transparent; }
.clue-console {
  padding: clamp(12px, 2vw, 18px);
  border: 2px solid #21496d;
  border-radius: 21px;
  background: linear-gradient(125deg, #fff 70%, #e8f8ff);
  box-shadow: 0 4px 0 #cbdfea;
}
#score { flex: none; margin-inline-end: auto; padding: 6px 12px; border-radius: 999px; background: #e3f2fa; font-weight: 750; white-space: nowrap; }
.first-visit-tip { margin: 0 0 10px; font-size: .875rem; line-height: 1.5; }
.clue-row { display: flex; align-items: center; gap: 8px; margin: 0; }
#clues { display: flex; flex-wrap: wrap; min-width: 0; gap: 5px; margin: 0; padding: 0; list-style: none; }
#clues li { max-width: 100%; padding: 6px 10px; border: 1px solid #dcae50; border-radius: 14px 14px 14px 5px; background: #fff3bc; font-weight: 750; overflow-wrap: anywhere; }
#more { min-width: 44px; flex: 0 0 auto; font-size: 1.25rem; padding: 4px; border-style: dashed; border-color: #4289a8; }
#choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(7px, 1.5vw, 13px);
  margin-top: 14px;
  padding: clamp(9px, 2vw, 16px);
  border: 2px solid #102f58;
  border-radius: 21px;
  background: #173f64;
  box-shadow: 0 4px 0 #c3d9e7, inset 0 0 0 3px #214c70;
}
#choices button {
  min-width: 0;
  min-height: clamp(46px, 7vw, 63px);
  padding: 7px 4px;
  font-size: clamp(.84rem, 3.6vw, 1.05rem);
  font-weight: 750;
  border: 2px solid #d7ac4a;
  border-radius: 20px 17px 22px 17px;
  color: #18334b;
  background: linear-gradient(164deg, #fffdf0 72%, #ffedaa 73%);
  box-shadow: 0 3px 0 #966e27;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
#choices button:not(:disabled):not([aria-pressed="true"]):hover { background: #fff1b9; }
#choices button[aria-pressed="true"] { background: #ffd76e; border-color: #ffedb0; box-shadow: 0 0 0 2px #1a3050, 0 3px 0 #8e611f; }
#choices button.eliminated { position: relative; color: #544c47; background: #efede5; border-color: #aba195; text-decoration: line-through; }
#choices button.eliminated::after { content: '×'; position: absolute; right: 5px; top: 1px; color: #9c332d; font-size: .95rem; }
#choices button:disabled { opacity: 1; }
#choices button[draggable="true"] { cursor: grab; touch-action: none; user-select: none; }
#choices button[draggable="true"]:active { cursor: grabbing; }
#choices button.drag-target { outline: 3px dashed #35a6ca; outline-offset: 2px; }
#choices button:focus-visible, #more:focus-visible, #records-open:focus-visible { outline: 3px solid #35a6ca; outline-offset: 2px; }
.puzzle-panel .buttons { align-items: center; justify-content: flex-end; margin-top: 14px; }
#confirm, #next { background: #ffd66b; border-color: #a77624; box-shadow: 0 3px 0 #c29337; font-weight: 800; }
#confirm:disabled { box-shadow: none; }
#eliminate, #confirm, #next { flex: 0 0 48px; min-height: 46px; padding: 2px; font-size: 1.45rem; line-height: 1; }
#eliminate { background: #f5fafc; border-color: #8ba4b7; color: #5c3c3a; font-weight: 750; }
.status { min-height: 1.5em; margin: 8px 0 0; font-weight: 700; }
.status:empty { min-height: 0; margin: 0; }
.guest-save-prompt { margin-top: 10px; padding: 12px; border: 1px solid #d8b565; border-radius: 14px; background: #fff7df; }
.guest-save-prompt p { margin: 0 0 8px; }
.save-record-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.save-record-primary { background: #ffd66b; border-color: #a77624; font-weight: 750; }
.save-record-actions a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 10px; border: 1px solid #82b8dc; border-radius: 12px; background: #eaf7ff; color: #183b52; font-weight: 700; }
.save-record-note { font-size: .9rem; }
.report-tools { display: flex; align-items: center; gap: 8px; margin: 4px 0; color: #445d71; font-size: .84rem; }
#report-open { background: transparent; color: inherit; border: 0; box-shadow: none; padding: 4px 0; min-height: 32px; text-decoration: underline; }
#discussion-open { margin-left: auto; min-height: 36px; padding: 4px 9px; font-size: .85rem; }
.game-dialog { width: min(24rem, calc(100% - 2rem)); padding: 1rem; border: 2px solid #26536f; border-radius: 17px; color: #183b52; background: #f8fcff; }
.game-dialog.discussion-dialog { width: min(42rem, calc(100% - 1.5rem)); padding: 8px; }
.discussion-dialog[data-moved] { position: fixed; inset: auto; margin: 0; }
.discussion-dialog-toolbar { display: flex; gap: 8px; margin-bottom: 4px; }
#discussion-drag-handle { flex: 1; display: grid; place-items: center; padding: 4px; color: #3e657b; cursor: grab; touch-action: none; }
#discussion-drag-handle:active { cursor: grabbing; }
.discussion-dialog iframe { display: block; width: 100%; height: min(68dvh, 36rem); border: 0; border-radius: 10px; }
.record-new-discussion { position: absolute; right: -4px; bottom: -4px; white-space: nowrap; background: #fff0b3; color: #60410b; border: 1px solid #9c6d24; border-radius: 8px; padding: 2px 4px; font-size: .68rem; font-weight: 800; }
.record-discussion-link { margin: 10px 0; }
.record-discussion-link strong { font-size: .8rem; color: #7e4600; }
.game-dialog::backdrop { background: #102b40a8; }
.game-dialog h2 { margin: 0 0 .5rem; font-size: 1.2rem; }
#report-form { display: grid; gap: .5rem; }
#report-form h2 { margin: 0 0 .25rem; font-size: 1.2rem; }
#report-form select, #report-form textarea { width: 100%; padding: .55rem; font: inherit; border: 1px solid #7695aa; border-radius: 8px; }
#report-form textarea { resize: vertical; }
#report-error { margin: 0; color: #9c2c35; }
#report-error:empty { display: none; }
.report-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.record-food:not([hidden]) { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; font-size: 1.3rem; }
.record-food span { padding: 2px 4px; border-radius: 7px; background: #fff4cb; }
.record-stats { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 12px 0; }
.record-stats dd { margin: 0; font-weight: 700; }
.record-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.record-actions form { margin-left: auto; }
.record-account { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: .6rem; font-size: .88rem; overflow-wrap: anywhere; }
.record-account button { min-height: 32px; padding: 3px 8px; }
.record-goal { margin: 10px 0; padding: 8px 10px; border-radius: 10px; background: #e7f3e8; }
.record-goal span { margin-right: 4px; color: #3d6350; font-size: .875rem; }
.home-heading { margin: 10px 0 6px; font-size: 1rem; }
.home-scene-frame { position: relative; overflow: hidden; border-radius: 12px; }
.home-scene { display: block; width: 100%; height: auto; }
.home-scene [data-home-layer] { display: none; }
.home-scene [hidden] { display: none; }
.home-scene:not([data-home-stage="0"]) [data-home-layer="basket"],
.home-scene:is([data-home-stage="3"], [data-home-stage="4"], [data-home-stage="5"]) [data-home-layer="furnishings"] { display: inline; }
.home-scene-frame .home-cliff {
  position: absolute; left: .5%; top: 3%; width: 23%; aspect-ratio: 2 / 3;
  background: none; border: 0; box-shadow: none;
}
.home-cliff .hold {
  width: 11%; height: 3.6%; min-height: 0; border-width: 1px;
  box-shadow: 0 1px 0 #17242c, 0 0 3px var(--color);
}
.home-scene-frame .home-marmot { left: 16%; bottom: 14%; width: 11%; transform: none; filter: none; }
.home-marmot::before {
  content: ''; position: absolute; left: 8%; bottom: 0; width: 80%; height: 18%;
  background: radial-gradient(ellipse, #1e342478, #1e34243b 48%, transparent 73%);
  transform: rotate(-8deg);
}
.home-marmot .art {
  position: relative;
  filter: saturate(.86) brightness(.98) drop-shadow(.65px -.65px .3px #dfedffa3);
}
.flower-goal { margin: 5px 0 0; color: #3d6350; font-size: .875rem; }
#records-open[data-new-reward]::after {
  content: ''; position: absolute; right: 4px; top: 4px; width: 8px; height: 8px;
  border-radius: 50%; background: #ffe48b; box-shadow: 0 0 0 1px #8a5c21;
}
.home-reward-spark {
  position: absolute; width: 18px; height: 18px; z-index: 4; pointer-events: none;
  transform: translate(-50%, -50%); background: #ffc841;
  clip-path: polygon(50% 0, 62% 37%, 100% 50%, 62% 63%, 50% 100%, 38% 63%, 0 50%, 38% 37%);
  animation: home-spark 1.9s ease-out both;
}
@keyframes home-spark {
  0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(.65); }
  25%, 70% { opacity: .95; transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .home-reward-spark { animation: none; } }
@media (max-width: 520px) {
  main { padding: 10px; }
  .quiz-site-nav { gap: 0 4px; margin-bottom: 4px; }
  .quiz-site-nav .quiz-site-brand { flex-basis: 100%; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 10px; border-radius: 20px; }
  .stage { width: min(43vw, 152px); }
  .puzzle-panel .clue-console { border-radius: 16px; }
  .puzzle-panel #choices { border-radius: 16px; }
}
.family-basket-card { display:grid; gap:5px; margin:18px 0; padding:16px; border:2px solid #d1b86f; border-radius:18px; background:#fff7dc; color:#193d50; text-decoration:none; text-align:left; }
.family-basket-card[hidden] { display:none; }
.family-basket-card strong { font-size:1rem; }
.family-basket-card span { font-size:.85rem; overflow-wrap:anywhere; }
