/* Hallmark · shape: app screen · genre: playful · theme: Hum (deal 1/3, seed chinese-cultural-browser-games-7e59·f67fad78·2026-11-29·r0)
 * nav: wordmark and two quiet destinations · footer: credits and event control · signature: playable seven-piece tangram
 * states: ready, selected, mismatch, fitted, completed, network-error · axes: light/rounded-sans/chromatic-yellow · posture: full-palette · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V4 · weakest: R, kept the real puzzle and removed decorative cards */
/* Hallmark · waive 80 · every polygon is a selectable tangram target · interactive geometry is the working game rather than a decorative illustration */
/* Hallmark · waive 39b · puzzle buttons contain a shape preview and label · larger tangram selection surfaces improve recognition and touch placement */
/* Hallmark · finish-review: subagent · 2 findings · 2 resolved: paper surface and completion grammar */
@import url("./tokens.css");
@import url("./base.css");
:root { --color-piece-1: oklch(70% .19 26); --color-piece-2: oklch(76% .14 58); --color-piece-3: oklch(70% .12 160); --color-piece-4: oklch(70% .12 240); --color-piece-5: oklch(83% .14 100); --color-piece-6: oklch(70% .10 330); --color-piece-7: oklch(64% .12 198); --color-outline: oklch(56% .025 95); --color-success: oklch(35% .09 155); --color-transparent: transparent; --layout-width: 1240px; }
:root { --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.84' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.05' filter='url(%23n)'/%3E%3C/svg%3E"); }
html, body { overflow-x: clip; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-weight: 500; }
button, select, input { font-family: var(--font-body); }
h1, h2, h3 { min-width: 0; overflow-wrap: break-word; text-wrap: balance; font-weight: 600; }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.08; margin: 0; max-width: 18ch; }
h2 { font-size: 1.4rem; line-height: 1.25; margin: 0 0 var(--space-sm); }
p { line-height: 1.6; text-wrap: pretty; max-width: 65ch; }
a { color: var(--color-accent-2); text-underline-offset: .2em; }
button, select, summary, a, input { -webkit-tap-highlight-color: var(--color-transparent); }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 4px; transition: none; }
.wrap { width: calc(100% - 48px); max-width: var(--layout-width); margin-inline: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; min-height: 84px; gap: var(--space-lg); }
.wordmark { display: flex; align-items: center; gap: var(--space-sm); font-size: 1.2rem; font-weight: 600; color: var(--color-ink); text-decoration: none; white-space: nowrap; }
.wordmark span { color: var(--color-muted); font-size: .9rem; }
nav { display: flex; gap: var(--space-lg); }
nav a { color: var(--color-ink-2); font-size: .9rem; white-space: nowrap; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: var(--space-lg); padding-block: var(--space-lg); }
.intro p { margin: var(--space-sm) 0 0; }
.mode-control { display: grid; gap: var(--space-xs); padding-bottom: var(--space-xs); }
label { font-size: .9rem; }
select { min-height: 48px; max-width: 100%; border: 1px solid var(--color-muted); border-radius: var(--radius-input); background: var(--color-card); color: var(--color-ink); font-size: 1rem; padding: var(--space-xs) var(--space-lg) var(--space-xs) var(--space-sm); appearance: none; }
.mode-control { position: relative; }
.mode-control::after { content: "⌄"; position: absolute; right: 10px; bottom: 20px; pointer-events: none; }
.game { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; column-gap: var(--space-2xl); padding-block: var(--space-lg) var(--space-xl); }
.board-column { position: relative; background: var(--color-paper-2); background-image: var(--paper-grain); border-radius: var(--radius-card); padding: var(--space-lg); }
.board-column::after { content: ""; position: absolute; height: 8px; bottom: -3px; left: 20px; right: 20px; background: var(--color-paper-2); background-image: var(--paper-grain); clip-path: polygon(0 0,100% 0,100% 60%,95% 80%,89% 55%,82% 85%,76% 60%,70% 95%,63% 65%,56% 90%,48% 55%,40% 80%,32% 60%,25% 95%,18% 70%,11% 90%,5% 60%,0 80%); }
.board-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); font-size: .9rem; }
#board { display: block; width: 100%; max-width: 460px; margin: var(--space-md) auto; aspect-ratio: 1; touch-action: manipulation; overflow: hidden; }
.target { fill: var(--color-paper-3); stroke: var(--color-outline); stroke-width: .012; cursor: pointer; }
.target:hover { fill: var(--color-rule); }
#board.no-outlines .target { stroke: var(--color-paper-3); }
/* SVG outlines are measured in board units. Use a screen-sized stroke on the shape itself. */
#board .target:focus, #board.no-outlines .target:focus {
  outline: none;
  stroke: var(--color-focus);
  stroke-width: 3px;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  fill: color-mix(in oklab, var(--color-focus) 12%, var(--color-paper-3));
}
@media (forced-colors: active) {
  #board .target:focus, #board.no-outlines .target:focus { stroke: Highlight; }
}
.target.is-filled { pointer-events: none; }
.fitted-piece { stroke: var(--color-paper-2); stroke-width: .025; pointer-events: none; }
.board-caption { font-size: .9rem; margin: 0; text-align: center; color: var(--color-ink-2); }
.instruction { margin: 0 0 var(--space-md); }
.pieces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-sm); }
.piece { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2xs); border: 2px solid var(--color-transparent); border-radius: var(--radius-stock); background: var(--color-paper-2); min-height: 100px; cursor: pointer; padding: var(--space-xs); color: var(--color-ink); }
.piece svg { width: 65px; max-width: 100%; height: 65px; overflow: visible; }
.piece span { font-size: .875rem; }
.piece:hover { background: var(--color-paper-3); }
.piece[aria-pressed="true"] { border-color: var(--color-ink); background: var(--color-card); }
.piece:active { transform: translateY(1px); }
.piece:disabled { opacity: .45; cursor: not-allowed; background: var(--color-paper-3); color: var(--color-muted); }
.piece:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.selection { display: flex; justify-content: space-between; gap: var(--space-sm); margin-block: var(--space-md); font-size: .9rem; }
#angle, #progress { font-variant-numeric: tabular-nums; }
.turn-controls { display: flex; gap: var(--space-sm); }
.btn { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: var(--space-sm) var(--space-lg); border: 1px solid var(--color-rule); border-radius: var(--radius-stock); font-size: 1rem; font-weight: 600; background: var(--color-transparent); color: var(--color-ink); cursor: pointer; text-decoration: none; transition: transform var(--dur-micro) var(--ease-out); }
.btn.primary { background: var(--color-accent); border-color: var(--color-accent-deep); }
.btn:hover { background: var(--color-paper-3); }
.btn.primary:hover { background: var(--color-accent-deep); }
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .5; cursor: not-allowed; background: var(--color-paper-3); color: var(--color-muted); }
.piece, .btn.primary { background-image: var(--paper-grain); box-shadow: 0 3px 0 var(--color-edge); }
.btn.primary { box-shadow: 0 3px 0 var(--color-accent-deep); }
.text-button { border: 0; padding: var(--space-xs) 0; background: var(--color-transparent); color: var(--color-ink-2); font-size: .9rem; cursor: pointer; text-decoration: underline; text-underline-offset: .25em; min-height: 44px; }
.text-button:hover { color: var(--color-accent-2); }
.message { min-height: 3.2em; font-size: .95rem; margin: var(--space-md) 0 0; }
.bottom-controls { display: flex; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; }
.keyboard-help { font-size: .9rem; margin-top: var(--space-sm); }
summary { cursor: pointer; min-height: 32px; }
.win { padding-block: var(--space-md); color: var(--color-success); }
.win p { margin: 0 0 var(--space-md); }
.win[hidden] { display: none; }
.story { border-top: 1px solid var(--color-rule); padding-block: var(--space-2xl); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2xl); }
.story p { margin: var(--space-sm) 0; }
.story a { display: inline-block; margin-top: var(--space-sm); }
.vote-options { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-lg); }
#vote-message { min-height: 1.6em; }
footer { border-top: 1px solid var(--color-rule); padding-block: var(--space-lg); display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-lg); font-size: .9rem; }
footer p { margin: 0; }
.analytics-choice { display: flex; align-items: center; gap: var(--space-xs); margin-left: auto; }
.analytics-choice input { width: 18px; height: 18px; accent-color: var(--color-accent-2); }
.skip { position: absolute; transform: translateY(-160%); background: var(--color-card); padding: var(--space-sm); z-index: 10; }
.skip:focus { transform: none; }
.prose { max-width: 70ch; padding-block: var(--space-xl); }
.prose h1 { margin-bottom: var(--space-lg); }
.prose h2 { margin-top: var(--space-xl); }
.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-xl); align-items: center; padding-block: var(--space-xl); }
.studio-layout video { width: 100%; max-width: 360px; max-height: 640px; display: block; border-radius: var(--radius-card); margin-inline: auto; background: var(--color-paper-3); }
@media (max-width: 800px) { .game { gap: var(--space-lg); } .pieces { gap: var(--space-xs); } .piece { min-height: 86px; } .piece svg { height: 52px; } .board-column { padding: var(--space-md); } }
@media (max-width: 640px) { .wrap { width: calc(100% - 32px); } .site-header { min-height: 72px; gap: var(--space-sm); } .wordmark { font-size: 1rem; } .wordmark span { display: none; } nav { gap: var(--space-sm); } nav a { font-size: .875rem; } .intro { align-items: start; flex-direction: column; gap: var(--space-md); padding-top: var(--space-sm); } .intro h1 br { display: none; } .intro h1 { max-width: 22ch; } .mode-control { width: 100%; } .game, .story, .studio-layout { grid-template-columns: minmax(0, 1fr); } .game { padding-top: var(--space-xs); } #board { max-width: 360px; margin-block: var(--space-sm); } .tools h2 { margin-top: var(--space-xs); } .pieces { grid-template-columns: repeat(4, minmax(0, 1fr)); } .piece { min-height: 92px; } .piece svg { height: 56px; } .story { gap: var(--space-xl); padding-block: var(--space-xl); } .analytics-choice { margin-left: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 640px) { .site-header { flex-wrap: wrap; padding-block: var(--space-sm); } nav { margin-left: auto; } .board-column { position: sticky; top: 0; z-index: 10; } #board { max-width: 230px; } .board-caption { font-size: .875rem; } .piece { min-height: 78px; } .piece svg { height: 44px; } }
