/* Editorial surfaces: a sheet, a ruled ledger, a collection, a daily stamp. */
.today { display: grid; grid-template-columns: 15rem 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; padding-block: var(--space-6) var(--space-7); }
.today__sheet { position: relative; background: var(--surface); border: 1px solid var(--line); border-top: .5rem solid var(--stamp); text-align: center; padding: 1.5rem 1rem 1rem; box-shadow: 0 5px 0 -1px var(--surface), 0 6px 0 -1px var(--line), 0 10px 0 -2px var(--surface), 0 11px 0 -2px var(--line); }
.today__sheet::before, .today__sheet::after { content: ""; position: absolute; top: .6rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); }
.today__sheet::before { left: 1.4rem; } .today__sheet::after { right: 1.4rem; }
.today__year { font-size: var(--text-xs); letter-spacing: .18em; color: var(--muted); }
.today__month { font-size: var(--text-lg); font-weight: 700; }
.today__day { font: 700 clamp(5rem, 10vw, 8rem)/1.15 var(--font-editorial); letter-spacing: -.06em; margin-left: -.06em; font-variant-numeric: lining-nums; }
.today__weekday { color: var(--stamp); font-weight: 700; letter-spacing: .12em; }
.today__season { border-top: 1px solid var(--line); margin-top: .75rem; padding-top: .65rem; font-size: var(--text-sm); color: var(--muted); letter-spacing: .1em; }
.today__body { min-width: 0; }
.today__title { font: 700 var(--text-hero)/1.65 var(--font-editorial); letter-spacing: .06em; }
.today__lead { margin-top: 1.1rem; max-width: 35rem; color: var(--muted); }
.today__body .cluster { margin-top: 1.5rem; }
.puzzle-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.puzzle-card { --kind: var(--indigo); --kind-soft: var(--indigo-soft); display: grid; grid-template-columns: 1fr auto; gap: .65rem 1rem; padding: var(--space-5); border: 1px solid var(--line); border-top: 4px solid var(--kind); border-radius: var(--radius); color: var(--ink); background: var(--surface); text-decoration: none; box-shadow: var(--shadow); transition: box-shadow var(--duration), transform var(--duration); }
.puzzle-card--nanpure { --kind: var(--indigo); --kind-soft: var(--indigo-soft); }
.puzzle-card--crossword { --kind: var(--madder); --kind-soft: var(--madder-soft); }
.puzzle-card--nonogram { --kind: var(--leaf); --kind-soft: var(--leaf-soft); }
.puzzle-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--kind); }
.puzzle-card__icon { grid-column: 1 / -1; width: 3rem; height: 3rem; padding: .55rem; border: 1px solid currentColor; border-radius: var(--radius); color: var(--kind); background: var(--kind-soft); margin-bottom: .4rem; }
.puzzle-card__icon .icon { width: 100%; height: 100%; }
.puzzle-card__kind { grid-column: 1 / -1; font: 700 var(--text-xl)/1.5 var(--font-editorial); }
.puzzle-card__meta { grid-column: 1 / -1; font-size: var(--text-sm); color: var(--muted); padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.puzzle-card__status { color: var(--kind); font-size: var(--text-sm); font-weight: 700; display: flex; align-items: center; gap: .4rem; }
.puzzle-card__points { font-size: var(--text-sm); align-self: center; color: var(--gold); font-weight: 700; }
.puzzle-card.is-progress .puzzle-card__status { text-decoration: underline; text-underline-offset: .3em; }
.puzzle-card.is-todo .puzzle-card__status { font-weight: 700; }
.puzzle-card.is-done { background: var(--kind-soft); }
.hanamaru { padding: 1.25rem 1.5rem; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: var(--space-5); }
.hanamaru.is-empty { border-style: dashed; }
.hanamaru.is-empty .stamp { color: var(--muted); border-style: dashed; transform: none; }
.stamp { display: inline-grid; place-items: center; width: 4.5rem; height: 4.5rem; flex-shrink: 0; border: 3px double currentColor; outline: 1px solid currentColor; outline-offset: -7px; border-radius: 50%; color: var(--stamp); font: 700 1rem/1.25 var(--font-editorial); transform: rotate(-9deg); text-align: center; letter-spacing: .05em; }
.stamp--hanamaru { width: 5.25rem; height: 5.25rem; border-style: solid; border-width: 2px; border-radius: 42% 48% 43% 49%; }
.stamp--hanamaru::before { content: "◎"; font: 700 1.5rem/1 var(--font-ui); align-self: end; }
.stamp--hanamaru { padding-block: .35rem .8rem; font-size: .85rem; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.stat-tile { border: 1px solid var(--line); background: var(--surface); padding: var(--space-5); border-radius: var(--radius); }
.stat-tile__label { color: var(--muted); font-size: var(--text-sm); }
.stat-tile__value { display: block; font-size: var(--text-2xl); font-weight: 700; font-variant-numeric: tabular-nums; margin-block: .3rem; line-height: 1.5; }
.stat-tile__value small { font-weight: 400; margin-left: .2rem; }
.stat-tile__sub { color: var(--muted); font-size: var(--text-xs); }
.level-card { padding: var(--space-5); border: 1px solid var(--line); border-left: 4px solid var(--leaf); background: var(--surface); border-radius: var(--radius); }
.level-card .progress { margin-block: 1rem .5rem; }
.keyword-box, .keyword { padding: var(--space-5); background: var(--madder-soft); border: 1px solid var(--line); border-radius: var(--radius); }
.keyword-box__cells, .keyword__cells { display: flex; gap: .5rem; flex-wrap: wrap; margin-block: 1rem; }
.kw-cell { display: grid; grid-template-rows: auto 1fr; width: 3.25rem; min-height: 4.25rem; text-align: center; border: 1px solid var(--madder); border-radius: var(--radius-sm); background: var(--surface); }
.kw-cell i { font-size: .75rem; line-height: 1.5; font-style: normal; color: var(--madder); background: var(--madder-soft); }
.kw-cell b { font-size: 1.5rem; line-height: 1.8; color: var(--ink); }
.kw-cell.is-empty { border-style: dashed; }
.kw-cell.is-empty b { color: var(--muted); }
.zukan-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.zukan-strip > * { min-width: 0; }
.mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.mode-card { padding: var(--space-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 1rem; }
.mode-card h3 { display: flex; align-items: center; gap: .5rem; font-size: var(--text-lg); }
.modal { width: min(34rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-dialog); overflow-y: auto; }
.modal__box { padding: clamp(1.25rem, 4vw, 2rem); }
.modal__title { font: 700 var(--text-xl)/1.6 var(--font-editorial); margin-bottom: 1rem; }
.modal__body { margin-bottom: 1.5rem; }
.modal__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .75rem; }
.result { text-align: center; }
.result__stamp { display: flex; justify-content: center; margin: 1.25rem auto; }
.result.is-entering .result__stamp { animation: stamp-in 360ms var(--ease); }
.result__time { color: var(--muted); font-variant-numeric: tabular-nums; }
.result__badges { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; margin-block: 1rem; }
.points-list { list-style: none; padding: 0; margin-block: 1.25rem; text-align: left; }
.points-list li { display: flex; justify-content: space-between; gap: 1rem; padding-block: .55rem; border-bottom: 1px solid var(--line); }
.points-list b { color: var(--gold); white-space: nowrap; }
.result__total { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--text-lg); font-weight: 700; }
.result__total b { color: var(--gold); }
.toast-area { position: fixed; right: var(--gutter); bottom: 1rem; z-index: 40; width: min(24rem, calc(100% - 2 * var(--gutter))); display: grid; gap: .75rem; pointer-events: none; }
.toast { padding: 1rem 1.25rem; background: var(--ink); color: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; align-items: center; gap: .75rem; pointer-events: auto; }
.toast .icon-btn { color: inherit; background: transparent; border-color: currentColor; margin-left: auto; }
.slot { margin-block: var(--space-7); padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-sunken); }
.slot__label { display: block; font-size: var(--text-xs); color: var(--muted); letter-spacing: .1em; margin-bottom: .5rem; }
.prose { max-width: 44rem; line-height: 2; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font: 700 var(--text-xl)/1.6 var(--font-editorial); padding-bottom: .5rem; border-bottom: 2px solid var(--line); margin-top: 2em; }
.prose h3 { font-size: var(--text-lg); margin-top: 1.6em; }
.prose li + li { margin-top: .5em; }
.prose th, .prose td { padding: .75rem; border: 1px solid var(--line); }
.prose th { background: var(--surface-sunken); }
.prose table { table-layout: fixed; font-size: var(--text-sm); }
.game-guide .prose table th:first-child { width: 7.25rem; }
.prose blockquote { padding-left: 1.25rem; border-left: 3px solid var(--line-strong); color: var(--muted); }
.prose figure { padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.prose figcaption { font-size: var(--text-sm); color: var(--muted); margin-top: .75rem; }
.note-box { padding: 1rem 1.25rem; border-left: 3px solid var(--indigo); background: var(--indigo-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.calendar { padding: var(--space-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.calendar__head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.calendar__title { font: 700 var(--text-xl)/1.4 var(--font-editorial); }
.calendar__progress { margin-bottom: 1.25rem; display: grid; gap: .5rem; font-size: var(--text-sm); color: var(--muted); }
.calendar__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .375rem; }
.calendar__dow { text-align: center; font-size: var(--text-xs); color: var(--muted); padding-block: .5rem; }
.calendar__day { position: relative; min-width: 0; min-height: 5.5rem; padding: .5rem .25rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: .25rem; font-variant-numeric: tabular-nums; }
.calendar__day .stamp { width: 2.3rem; height: 2.3rem; font-size: .6875rem; border-width: 2px; outline-offset: -5px; }
.calendar__day.is-today { border: 2px solid var(--stamp); font-weight: 700; }
.calendar__day.is-done { background: var(--leaf-soft); }
.calendar__day.is-partial::after { content: ""; width: .35rem; height: .35rem; background: var(--indigo); border-radius: 50%; }
.calendar__day.is-selected { box-shadow: inset 0 0 0 2px var(--indigo); background: var(--indigo-soft); }
.calendar__day.is-future { color: var(--muted); background: var(--surface-sunken); border-style: dashed; }
.calendar__day.is-blank { border-color: transparent; background: transparent; pointer-events: none; }
.trophies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.trophy-card { text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: var(--space-5); background: var(--surface-sunken); color: var(--muted); }
.trophy-card.is-earned { color: var(--gold); background: var(--gold-soft); border: 1px solid var(--gold); }
.trophy-card img, .trophy-card > .icon { width: 5rem; height: 5rem; margin: .5rem auto 1rem; object-fit: contain; }
.zukan { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.zukan-card { padding: var(--space-5); text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.zukan-card .pixel-art { width: 7rem; height: 7rem; margin: 0 auto 1rem; object-fit: contain; }
.zukan-card__name { font-weight: 700; margin-bottom: .25rem; }
.zukan-card__meta { color: var(--muted); font-size: var(--text-xs); }
.zukan-card.is-locked { background: var(--surface-sunken); border-style: dashed; }
.zukan-card.is-locked .pixel-art { visibility: hidden; }
.zukan-card__mystery { display: grid; place-items: center; width: min(100%, 5.5rem); aspect-ratio: 1; margin: 0 auto .75rem; color: var(--muted); font: 700 2.5rem/1 var(--font-editorial); border: 1px dashed var(--line-strong); }
.ledger { background: var(--surface); border-block: 1px solid var(--line-strong); }
.ledger__row { display: grid; grid-template-columns: 6rem 1fr auto; gap: 1rem; align-items: baseline; padding: 1rem; border-bottom: 1px solid var(--line); }
.ledger__date { color: var(--muted); font-size: var(--text-sm); }
.ledger__what { min-width: 0; }
.ledger__pt { color: var(--gold); font-weight: 700; white-space: nowrap; }
.stats-table { table-layout: fixed; font-size: var(--text-sm); }
.stats-table th, .stats-table td { border-bottom: 1px solid var(--line); padding: .9rem .6rem; text-align: right; font-variant-numeric: tabular-nums; }
.stats-table th:first-child { text-align: left; width: 34%; }
.stats-table thead { background: var(--surface-sunken); }
.settings { background: var(--surface); padding: 0 var(--space-5); border: 1px solid var(--line); border-radius: var(--radius); }
.settings .setting:last-child { border-bottom: 0; }
/* Styleguide-only wrappers: demo dialogs stay in normal flow. */
.sg-intro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: 1.25rem; margin-bottom: 2rem; }
.sg-kicker { color: var(--stamp); font-size: var(--text-xs); font-weight: 700; letter-spacing: .16em; }
.sg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
.sg-panel { padding: var(--space-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.sg-panel > h3 { margin-bottom: 1rem; }
.sg-palette { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.sg-swatch { border: 1px solid #85877c; min-height: 4.7rem; padding: .6rem .4rem; font-size: .75rem; line-height: 1.6; border-radius: .25rem; }
.sg-swatch b { display: block; font-size: .8125rem; }
.sg-type { font: 700 var(--text-2xl)/1.7 var(--font-editorial); }
.sg-index { display: flex; flex-wrap: wrap; gap: .35rem 1.2rem; margin-top: 1rem; }
.sg-index a { min-height: 44px; display: flex; align-items: center; font-size: var(--text-sm); }
.sg-label { font-size: var(--text-xs); color: var(--muted); letter-spacing: .08em; margin-bottom: 1rem; }
.sg-demo-dialog.modal, .sg-demo-dialog.drawer { position: relative; inset: auto; display: block; margin: 0; width: 100%; max-width: 100%; height: auto; max-height: none; box-shadow: var(--shadow); }
.sg-demo-toast.toast-area { position: static; width: 100%; }
.sg-icons { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .75rem; }
.sg-icon { display: grid; justify-items: center; gap: .5rem; padding: 1rem .3rem; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .75rem; }
.sg-state-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.sg-state-list span { padding: .2rem .5rem; border: 1px solid var(--line); border-radius: .25rem; font-size: var(--text-xs); }
.sg-pixel { image-rendering: pixelated; }
.sg-print-note { padding: 1rem; background: var(--surface-sunken); font-size: var(--text-sm); }
.print-sheet { max-width: 48rem; margin: 1.5rem auto; padding: clamp(1rem, 3vw, 2.5rem); background: var(--surface); border: 1px solid var(--line); }
.print-sheet__head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 1rem; border-bottom: 2px solid var(--ink); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.print-sheet__head h2 { font: 700 var(--text-xl)/1.5 var(--font-editorial); }
.print-sheet > p { margin-top: 1rem; }
@keyframes stamp-in { from { opacity: 0; transform: scale(1.3) rotate(-8deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@media (max-width: 52rem) {
  .puzzle-cards, .mode-cards { grid-template-columns: 1fr; }
  .puzzle-card { grid-template-columns: 3rem 1fr auto; align-items: center; }
  .puzzle-card__icon { grid-column: 1; grid-row: 1 / 3; margin: 0; }
  .puzzle-card__kind { grid-column: 2 / -1; font-size: 1.3rem; }
  .puzzle-card__meta { grid-column: 2 / -1; border: 0; padding: 0; }
  .puzzle-card__status { grid-column: 2; } .puzzle-card__points { grid-column: 3; }
  .sg-grid { grid-template-columns: 1fr; }
  .zukan { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 36rem) {
  .today { grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1.1rem; padding-block: 1rem 2rem; align-items: start; }
  .today__sheet { padding: 1.2rem .35rem .65rem; }
  .today__year { font-size: .625rem; } .today__month { font-size: .9rem; } .today__day { font-size: 3.75rem; }
  .today__weekday, .today__season { font-size: .75rem; } .today__season { letter-spacing: 0; }
  .today__title { font-size: 1.65rem; letter-spacing: .01em; } .today__lead { font-size: .9375rem; margin-top: .75rem; }
  .today__body .cluster { margin-top: .75rem; } .today__body .badge { font-size: .6875rem; }
  .puzzle-card { padding: 1rem; gap: .4rem .75rem; }
  .stat-tiles { gap: .5rem; } .stat-tile { padding: .75rem .5rem; } .stat-tile__label { font-size: .75rem; } .stat-tile__value { font-size: 1.4rem; }
  .stat-tile__sub { font-size: .6875rem; }
  .zukan-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar { padding: .3rem; } .calendar__grid { gap: 1px; } .calendar__day { min-height: 4.25rem; padding: .3rem 0; font-size: .875rem; }
  .calendar__day .stamp { width: 1.7rem; height: 1.7rem; font-size: .5rem; outline-offset: -4px; }
  .calendar__title { font-size: 1.25rem; }
  .trophies { gap: .5rem; } .trophy-card { padding: .75rem .4rem; font-size: .75rem; } .trophy-card > .icon { width: 3rem; height: 3rem; }
  .zukan-card { padding: 1rem .5rem; }
  .ledger__row { grid-template-columns: 4rem 1fr auto; gap: .5rem; padding: .85rem .5rem; font-size: .8125rem; } .ledger__date { font-size: .75rem; }
  .stats-table { font-size: .75rem; } .stats-table th, .stats-table td { padding: .65rem .3rem; }
  .sg-panel { padding: 1rem; } .sg-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-swatch { min-height: 3.5rem; }
}
