/* Each card now has one destination, and new activities unfold beneath it. */
.living-nook .shelf-detail {
  margin-top: 26px;
  padding: clamp(18px, 3vw, 32px);
  min-width: 0;
  border: 1px solid var(--nook-rule);
  border-top: 3px solid var(--nook-cloth-edge);
  border-radius: 5px;
  background: var(--nook-page-shade);
  color: var(--ink);
  scroll-margin-top: calc(var(--inkwig-header-height) + 18px);
}
.living-nook .shelf-detail[hidden] { display: none !important; }
.living-nook .shelf-detail h3 {
  margin: 7px 0 12px;
  color: var(--ink);
  font: 400 clamp(25px, 3.4vw, 33px)/1.2 var(--serif);
  letter-spacing: -.025em;
}
.living-nook .shelf-detail h4 { margin: 18px 0 10px; font: 400 23px/1.3 var(--serif); }
.living-nook .shelf-detail p { max-width: 70ch; line-height: 1.65; overflow-wrap: anywhere; }
.living-nook .shelf-detail label { display: block; color: var(--ink); font: 14px/1.5 var(--sans); }
.living-nook .shelf-detail :is(input, textarea, select) {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--nook-rule);
  border-radius: 4px;
  background: var(--nook-page);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  padding: 10px 12px;
}
.living-nook .shelf-detail textarea { width: 100%; resize: vertical; }
.living-nook .shelf-detail button { min-height: 44px; max-width: 100%; white-space: normal; }
.living-nook .shelf-detail :is(button, input, select, textarea):focus-visible {
  outline: 3px solid var(--rust);
  outline-offset: 3px;
}
.living-nook .shelf-detail button:disabled { cursor: default; }
.living-nook .shelf-detail > [data-extra-close] { display: block; margin: 26px 0 0 auto; padding: 8px 0; color: var(--rust); text-decoration: underline; text-underline-offset: 4px; }
.living-nook [data-extra-open][aria-expanded="true"] { border-color: var(--nook-cloth-edge); box-shadow: 0 0 0 2px var(--nook-cloth-edge); }
.living-nook .inline-hub .game-hub-tag { overflow-wrap: anywhere; }
.living-nook .recipe-kept { align-self: center; color: var(--muted); font: italic 15px/1.5 var(--serif); }
.living-nook .curio-source-note, .living-nook .story-finished-note { font-size: 14px; color: var(--muted); }
.living-nook .workbench-materials .material-source,
.living-nook .journal-preview .journal-word,
.living-nook .room-display .display-slot { cursor: default; }
.living-nook .readory-ribbon-brand { display: flex; align-items: center; flex: 0 0 auto; }
.living-nook .header-tools .support-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  padding-inline: 11px;
  border-radius: 22px;
  color: var(--rust);
  opacity: 1;
  cursor: default;
}
.living-nook .support-button .ico { fill: currentColor; fill-opacity: .12; }
.living-nook .support-label { font: 13px/1 var(--sans); }
.living-nook .support-button:disabled:hover { background: transparent; transform: none; }
@media (max-width: 700px) {
  .living-nook .shelf-detail { padding: 18px 14px; margin-inline: -2px; }
}
@media (max-width: 520px) {
  .living-nook .header-tools .support-button { width: 42px; padding-inline: 0; justify-content: center; }
  .living-nook .support-label { display: none; }
}
@media (max-width: 420px) {
  .living-nook .inline-hub .game-hub-card { grid-template-columns: minmax(0, 1fr); }
  .living-nook .inline-hub .game-hub-art { height: 120px; min-height: 0; aspect-ratio: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .living-nook .shelf-detail * { scroll-behavior: auto; }
}

/* Three quiet games, with their own controls and no modal layout rules. */
.shelf-game-detail { min-width: 0; }
.shelf-game-detail h4 { margin: 0 0 12px; color: var(--ink); font: 400 21px/1.3 var(--serif); }
.shelf-game-detail .shelf-game-context { margin: 16px 0; color: var(--rust); font: 14px/1.5 var(--sans, sans-serif); }
.shelf-game-detail .shelf-game-note { margin: 14px 0 0; color: var(--muted, var(--ink)); font: 14px/1.6 var(--sans, sans-serif); }
.shelf-game-detail .shelf-game-feedback { min-height: 1.6em; margin: 16px 0 0; color: var(--ink); font: 16px/1.6 var(--serif); overflow-wrap: anywhere; }
.shelf-game-detail .shelf-game-feedback[data-state="correct"] { padding-left: 12px; border-left: 3px solid var(--rust); }
.shelf-game-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: 20px; }
.shelf-game-actions > button { min-height: 44px; max-width: 100%; }
.shelf-game-detail .shelf-game-back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 18px; }

.shelf-sort-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.shelf-sort-clue-box { min-width: 0; padding: 18px; border: 1px solid var(--nook-rule); border-radius: 6px; background: var(--paper); }
.shelf-sort-clues { display: grid; gap: 12px; margin: 0; padding-left: 22px; color: var(--ink); font: 16px/1.6 var(--serif); }
.shelf-sort-clues li { padding-left: 3px; overflow-wrap: anywhere; }
.shelf-sort-order { min-width: 0; }
.shelf-sort-slots { display: grid; gap: 12px; min-width: 0; }
.shelf-sort-slot { display: grid; gap: 5px; min-width: 0; }
.shelf-sort-slot > label { color: var(--muted, var(--ink)); font: 14px/1.4 var(--sans, sans-serif); }
.shelf-sort-slot > select { display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 44px; padding: 9px 12px; color: var(--ink); border: 1px solid var(--nook-rule); border-radius: 5px; background: var(--nook-page); font: 16px/1.5 var(--serif); }

.shelf-game-pairs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 720px; min-width: 0; }
.shelf-game-pairs > .shelf-pair-card { display: grid; place-items: center; width: 100%; min-width: 0; min-height: 96px; padding: 12px 8px; border: 1px solid var(--nook-rule); border-radius: 7px; background: var(--paper); color: var(--wine); font: 400 18px/1.35 var(--serif); text-align: center; overflow-wrap: anywhere; }
.shelf-game-pairs > .shelf-pair-card:hover:not(:disabled) { border-color: var(--rust); }
.shelf-game-pairs > .shelf-pair-card:focus-visible { outline: 3px solid var(--rust); outline-offset: 3px; }
.shelf-game-pairs > .shelf-pair-card:disabled { opacity: 1; }
.shelf-game-pairs > .shelf-pair-card.is-open { background: var(--nook-page); color: var(--ink); }
.shelf-game-pairs > .shelf-pair-card.is-matched { background: var(--wine); border-color: var(--wine); color: #fff3df; }
.shelf-pair-mark { font: 30px/1 var(--serif); }

.shelf-riddle-clue { margin: 20px 0 18px; padding: 16px 18px; border-left: 3px solid var(--rust); background: var(--paper); }
.shelf-game-detail .shelf-riddle-clue > .shelf-game-context { margin: 0 0 8px; }
.shelf-game-detail .shelf-riddle-clue > p:last-child { margin: 0; color: var(--ink); font: 19px/1.6 var(--serif); }
.shelf-riddle-pattern { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; margin: 18px 0 22px; }
.shelf-riddle-letter { display: grid; place-items: center; flex: 0 0 34px; width: 34px; min-height: 43px; border-bottom: 2px solid var(--nook-rule); color: var(--ink); font: 400 26px/1.2 var(--serif); }
.shelf-riddle-alphabet { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 6px; width: 100%; max-width: 660px; min-width: 0; }
.shelf-riddle-alphabet > .shelf-letter-button { display: grid; place-items: center; width: 100%; min-width: 44px; min-height: 44px; padding: 6px; border: 1px solid var(--nook-rule); border-radius: 5px; background: var(--nook-page); color: var(--ink); font: 16px/1.2 var(--sans, sans-serif); }
.shelf-riddle-alphabet > .shelf-letter-button:hover:not(:disabled) { border-color: var(--rust); }
.shelf-riddle-alphabet > .shelf-letter-button:disabled { opacity: 1; color: var(--muted, var(--ink)); background: var(--paper); }
.shelf-riddle-alphabet > .shelf-letter-button.is-miss { text-decoration: line-through; }
.shelf-riddle-alphabet > .shelf-letter-button.is-hit { background: var(--wine); border-color: var(--wine); color: #fff3df; text-decoration: none; }
.shelf-riddle-guess { max-width: 660px; min-width: 0; margin: 22px 0 0; }
.shelf-riddle-guess > label { display: block; margin-bottom: 7px; color: var(--ink); font: 14px/1.5 var(--sans, sans-serif); }
.shelf-riddle-guess-row { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.shelf-riddle-guess-row > input { flex: 1 1 180px; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--nook-rule); border-radius: 5px; background: var(--nook-page); color: var(--ink); font: 16px/1.4 var(--sans, sans-serif); }
.shelf-riddle-guess-row > button { flex: 0 0 auto; min-height: 44px; }

@media (max-width: 640px) {
  .shelf-sort-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .shelf-sort-clue-box { padding: 16px; }
}
@media (max-width: 480px) {
  .shelf-game-pairs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .shelf-game-pairs > .shelf-pair-card { min-height: 88px; padding: 10px 6px; font-size: 16px; }
  .shelf-riddle-clue { padding: 14px; }
  .shelf-riddle-letter { flex-basis: 28px; width: 28px; min-height: 38px; font-size: 23px; }
  .shelf-riddle-pattern { gap: 4px; }
}

/* Creative play; all selectors stay within these four panels. */
.creative-detail { color: var(--ink); }
.creative-detail * { box-sizing: border-box; }
.creative-detail .creative-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.creative-detail .creative-heading > div { min-width: 0; }
.creative-detail .creative-kicker { margin: 0 0 7px; color: var(--rust); font: 11px/1.5 var(--sans, sans-serif); letter-spacing: .12em; }
.creative-detail h3 { margin: 0; font: 400 31px/1.2 var(--serif); letter-spacing: -.035em; }
.creative-detail h3:focus-visible { outline: 2px solid var(--rust); outline-offset: 6px; }
.creative-detail .creative-intro { max-width: 72ch; margin: 0 0 25px; color: var(--muted, var(--ink)); font: 16px/1.75 var(--sans, sans-serif); }
.creative-detail .creative-close { flex: 0 0 auto; min-height: 44px; padding: 8px 4px; color: var(--rust); background: transparent; border: 0; font: 14px/1.4 var(--sans, sans-serif); text-decoration: underline; text-underline-offset: 4px; }
.creative-detail .creative-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 28px; }
.creative-detail .creative-columns > * { min-width: 0; }
.creative-detail label { display: block; min-width: 0; margin: 0 0 17px; color: var(--ink); font: 14px/1.5 var(--sans, sans-serif); }
.creative-detail input[type="text"], .creative-detail select { display: block; width: 100%; min-width: 0; min-height: 46px; margin-top: 7px; padding: 11px 12px; border: 1px solid var(--nook-rule); border-radius: 5px; background: var(--nook-page); color: var(--ink); font: 16px/1.5 var(--sans, sans-serif); }
.creative-detail input::placeholder { color: var(--muted, var(--ink)); opacity: .8; }
.creative-detail .creative-optional { margin-left: 5px; color: var(--muted, var(--ink)); font-size: 12px; }
.creative-detail .creative-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 13px; margin-top: 17px; }
.creative-detail .creative-primary, .creative-detail .creative-secondary, .creative-detail .creative-icon { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 10px 15px; border: 1px solid var(--nook-rule); border-radius: 5px; font: 14px/1.4 var(--sans, sans-serif); text-align: center; }
.creative-detail .creative-primary { background: var(--nook-cloth, var(--wine)); color: #fff3df; border-color: var(--nook-cloth-edge, var(--wine)); }
.creative-detail .creative-secondary, .creative-detail .creative-icon { background: var(--nook-page); color: var(--ink); }
.creative-detail .creative-primary:not(:disabled):hover { filter: brightness(1.1); }
.creative-detail .creative-secondary:not(:disabled):hover, .creative-detail .creative-icon:not(:disabled):hover { border-color: var(--rust); background: var(--paper); }
.creative-detail button:disabled { opacity: .45; cursor: default; }
.creative-detail button:focus-visible, .creative-detail input:focus-visible, .creative-detail select:focus-visible { outline: 3px solid var(--rust); outline-offset: 3px; }
.creative-detail .creative-note { margin: 10px 0 0; color: var(--muted, var(--ink)); font: 13px/1.6 var(--sans, sans-serif); }
.creative-detail .creative-status { min-height: 1.6em; margin: 13px 0 0; color: var(--rust); font: 14px/1.6 var(--sans, sans-serif); overflow-wrap: anywhere; }
.creative-detail .creative-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.creative-detail .poem-line-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-bottom: 15px; }
.creative-detail .poem-line-row > label { margin: 0; }
.creative-detail .poem-order { display: flex; gap: 4px; }
.creative-detail .creative-icon { padding: 8px; font-size: 19px; }
.creative-detail .poem-paper { position: relative; margin: 0; padding: 28px 25px 45px; border: 1px solid var(--nook-rule); border-left: 3px solid var(--nook-cloth-edge, var(--wine)); background: var(--nook-page); box-shadow: 0 3px 0 var(--paper), 0 4px 0 var(--nook-rule); }
.creative-detail .poem-paper figcaption { margin-bottom: 20px; color: var(--muted, var(--ink)); font: 10px/1.5 var(--sans, sans-serif); letter-spacing: .13em; }
.creative-detail .poem-paper blockquote { margin: 0; }
.creative-detail .poem-paper blockquote p { margin: 0; color: var(--ink); font: italic 20px/1.8 var(--serif); white-space: pre-line; overflow-wrap: anywhere; }
.creative-detail .poem-paper-mark { position: absolute; right: 22px; bottom: 15px; color: var(--rust); }
.creative-detail .wordwalk-trail { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; margin: 0 0 24px; padding: 0; list-style: none; color: var(--muted, var(--ink)); font: italic 15px/1.55 var(--serif); }
.creative-detail .wordwalk-trail li:not(:last-child)::after { content: '→'; margin-left: 8px; color: var(--rust); font-style: normal; }
.creative-detail .wordwalk-trail li:last-child { color: var(--ink); }
.creative-detail .wordwalk-now { margin-bottom: 24px; padding: 23px 24px; border: 1px solid var(--nook-rule); border-left: 3px solid var(--nook-cloth-edge, var(--wine)); border-radius: 5px; background: var(--nook-page); }
.creative-detail .wordwalk-now > p:first-of-type { margin: 8px 0 6px; color: var(--ink); font: 400 clamp(34px, 4vw, 48px)/1.2 var(--serif); letter-spacing: -.03em; overflow-wrap: anywhere; }
.creative-detail .wordwalk-now > p:last-of-type { margin: 0; color: var(--muted, var(--ink)); font: italic 16px/1.6 var(--serif); }
.creative-detail .wordwalk-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.creative-detail .wordwalk-choice { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 88px; padding: 16px; border: 1px solid var(--nook-rule); border-radius: 5px; background: var(--nook-page); color: var(--ink); text-align: left; }
.creative-detail .wordwalk-choice:hover { border-color: var(--rust); background: var(--paper); }
.creative-detail .wordwalk-choice strong { font: 400 23px/1.25 var(--serif); }
.creative-detail .wordwalk-choice span { color: var(--muted, var(--ink)); font: 13px/1.5 var(--sans, sans-serif); }
.creative-detail .bookplate-preview, .creative-detail .constellation-preview { margin: 0; min-width: 0; }
.creative-detail .bookplate-preview svg, .creative-detail .constellation-preview svg { display: block; width: 100%; height: auto; }
.creative-detail .bookplate-preview > div { overflow: hidden; border: 1px solid var(--nook-rule); border-radius: 7px; box-shadow: 0 3px 0 var(--paper), 0 4px 0 var(--nook-rule); }
.creative-detail .bookplate-preview figcaption, .creative-detail .constellation-preview figcaption { margin-top: 11px; color: var(--muted, var(--ink)); font: italic 14px/1.6 var(--serif); overflow-wrap: anywhere; }
.creative-detail .constellation-preview svg { border: 1px solid var(--nook-rule); border-radius: 8px; touch-action: manipulation; }
.creative-detail .constellation-star { cursor: pointer; outline: none; }
.creative-detail .constellation-star .star-halo { fill: none; stroke: transparent; stroke-width: 2; }
.creative-detail .constellation-star:focus-visible .star-halo { stroke: #fff3df; }
.creative-detail .constellation-star:hover .star-marker { stroke: #fff3df; }
.creative-detail .constellation-star .star-number { pointer-events: none; font-family: Arial, sans-serif; text-anchor: middle; dominant-baseline: central; }
@media (max-width: 760px) {
  .creative-detail .creative-columns { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .creative-detail .poem-paper { padding: 24px 21px 42px; }
  .creative-detail .bookplate-preview, .creative-detail .constellation-preview { max-width: 480px; width: 100%; margin-inline: auto; }
  .creative-detail .wordwalk-choices { grid-template-columns: minmax(0, 1fr); }
  .creative-detail .wordwalk-choice { min-height: 76px; padding: 14px 16px; }
}
@media (max-width: 430px) {
  .creative-detail .creative-heading { gap: 9px; }
  .creative-detail h3 { font-size: 27px; }
  .creative-detail .creative-kicker { font-size: 10px; letter-spacing: .09em; }
  .creative-detail .creative-intro { font-size: 15px; }
  .creative-detail .poem-line-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .creative-detail .poem-order { justify-content: flex-end; }
  .creative-detail .poem-paper blockquote p { font-size: 18px; }
  .creative-detail .creative-actions { align-items: stretch; }
  .creative-detail .creative-actions > button { flex: 1 1 145px; }
  .creative-detail .wordwalk-now { padding: 20px 18px; }
}
