:root { color-scheme: light; font-family: ui-rounded, 'Trebuchet MS', system-ui, sans-serif; color: #203b42; background: #f5f4ec; --teal: #14645b; --line: #d5ded8; }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, .button, select { font: inherit; font-weight: 700; color: inherit; min-height: 46px; border: 1px solid #bdcec5; border-radius: 12px; background: #fff; padding: 10px 14px; touch-action: manipulation; }
button, .button { cursor: pointer; }
button:hover, .button:hover { background: #edf5f1; }
button:disabled { opacity: .42; cursor: default; }
button:focus-visible, a:focus-visible, select:focus-visible, [role=button]:focus-visible { outline: 3px solid #b65b0d; outline-offset: 3px; }
.button { text-decoration: none; display: inline-flex; align-items: center; }
.primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.primary:hover { background: #0c5149; }
.topbar { min-height: 72px; display: flex; align-items: center; gap: 16px; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); background: #183d37; color: #fff; }
.topbar button, .topbar .button { background: #285147; color: #fff; border-color: #668278; }
.brand { font-size: 15px; font-weight: 900; letter-spacing: 2px; }
.brand small { display: block; font-size: 11px; font-weight: 400; letter-spacing: .6px; opacity: .8; margin-top: 4px; }
#mode-name { margin-left: auto; font-size: 13px; color: #d5e9df; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 46px); line-height: 1.12; margin-bottom: 12px; letter-spacing: -1px; }
h2 { font-size: clamp(19px, 2.3vw, 27px); margin: 6px 0 8px; }
.eyebrow { font-size: 11px; letter-spacing: 1.7px; font-weight: 900; color: #4d7466; }
.hub { max-width: 1200px; padding: 60px 24px; margin: auto; }
.hub > h1 { margin-top: 14px; }
.hub > p { color: #546b65; line-height: 1.7; }
.mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 32px 0; }
.mode-card { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; text-align: left; border-radius: 24px; padding: 28px; box-shadow: 0 6px 0 #dce5db; }
.mode-card:nth-child(2) { background: #eaf4ff; }.mode-card:nth-child(3) { background: #fff0d6; }
.mode-card strong { font-size: 27px; letter-spacing: -.6px; }
.mode-card > span:not(.mode-icon):not(.eyebrow) { font-weight: 400; line-height: 1.6; }
.mode-card b { margin-top: auto; font-size: 14px; }
.mode-icon { display: grid; place-items: center; height: 72px; width: 72px; background: #fff; border: 1px solid #d2dfd4; border-radius: 20px; font-size: 44px; color: var(--teal); }
.hub-note { text-align: center; font-size: 14px; }
.workspace { height: calc(100vh - 72px); height: calc(100dvh - 72px); min-height: 420px; display: flex; flex-direction: column; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #f8faf7; }
.tool-group { display: flex; gap: 4px; }
.toolbar label, .game-options label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.toolbar select { padding: 8px; max-width: 120px; }
[aria-pressed=true] { background: #d9f0e5; border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.whiteboard-body { flex: 1; min-height: 0; display: flex; }
.supply { width: 112px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; padding: 14px 8px; overflow-y: auto; border-right: 1px solid var(--line); background: #f8faf7; }
.supply > p { font-size: 11px; margin: -2px 0 4px; color: #61746e; }
.supply-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; padding: 8px 4px; touch-action: none; }
.supply-item img { width: 40px; height: 42px; object-fit: contain; pointer-events: none; }.supply-item[data-value="10"] img { height: 60px; }
.supply-item span { font-size: 11px; }.supply-item b { display: block; }
.paper { background: #fff; flex: 1; min-width: 0; position: relative; overflow: hidden; touch-action: none; isolation: isolate; }
#ink-layer, #block-layer { position: absolute; width: 100%; height: 100%; inset: 0; }
#ink-layer { z-index: 2; pointer-events: none; overflow: visible; }
#ink-layer polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.paper[data-tool=pen] #block-layer, .paper[data-tool=erase] #block-layer { pointer-events: none; }
.paper[data-tool=pen] { cursor: crosshair; }.paper[data-tool=erase] #ink-layer { pointer-events: auto; }.paper[data-tool=erase] polyline { pointer-events: stroke; cursor: crosshair; }
.board-block { position: absolute; padding: 0; border: 0; border-radius: 0; background: transparent !important; min-height: 0; touch-action: none; user-select: none; }
.board-block img { display: block; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.board-block.selected { outline: 3px dashed #526b61; outline-offset: 5px; }
.board-block[data-value="1"] { width: 20px; height: 20px; min-width: 44px; min-height: 44px; padding: 12px; }
.board-block[data-value="10"] { width: 20px; height: 200px; min-width: 44px; padding: 0 12px; }
.board-block[data-value="100"] { width: 200px; height: 200px; }.board-block[data-value="1000"] { width: 180px; height: 201px; }
#paper-hint { position: absolute; top: 40%; left: 0; right: 0; text-align: center; color: #abb9b2; font-size: 25px; pointer-events: none; line-height: 1.5; }#paper-hint small { font-size: 14px; }
.footnote { margin: 0; padding: 8px 14px max(8px, env(safe-area-inset-bottom)); font-size: 12px; background: #f8faf7; border-top: 1px solid var(--line); }
.game { max-width: 1280px; margin: auto; padding: 24px; }
.game-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }.game-heading h1 { margin: 6px 0; }
.game-options { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }.badge { font-weight: 800; color: #8a5b07; background: #fff1c9; padding: 10px; border-radius: 20px; font-size: 13px; }
.instructions { color: #526b61; margin: 12px 0; font-size: 15px; }
.sort-supply { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 12px; min-height: 132px; max-height: 230px; overflow-y: auto; background: #e7ece6; border: 2px dashed #bacbc0; border-radius: 16px; margin-bottom: 16px; }
.sort-token { min-width: 52px; height: 104px; padding: 8px; display: grid; place-items: center; touch-action: none; }
.sort-token img, .mini-block { display: inline-block; object-fit: contain; width: 60px; height: 72px; pointer-events: none; }
.sort-token[data-value="1"] img, .mini-block[data-value="1"] { width: 18px; height: 18px; }.sort-token[data-value="10"] img, .mini-block[data-value="10"] { width: 8px; height: 80px; }
.sort-token[aria-pressed=true] { outline: 3px solid #b65b0d; outline-offset: 2px; }
.game-columns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }.game-columns.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }.game-columns.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.place-column { min-width: 0; background: #fff; border: 2px solid #bfd1c5; border-radius: 16px; overflow: hidden; text-align: center; }
.place-column[data-value="1000"] { --tint: #fce2df; }.place-column[data-value="100"] { --tint: #e0efdc; }.place-column[data-value="10"] { --tint: #dceeff; }.place-column[data-value="1"] { --tint: #fff3c2; }
.column-title { margin: 0; padding: 12px 6px; font-size: 18px; background: var(--tint); }.column-title small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; }
.sort-drop { cursor: pointer; touch-action: manipulation; }.sort-drop:hover, .sort-drop.drag-over { border-color: var(--teal); background: #f0faf5; }
.block-bin { min-height: 150px; height: clamp(150px, 26vh, 290px); overflow-y: auto; display: flex; align-content: flex-start; align-items: flex-start; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 12px; }
.column-count { padding: 10px 4px; font-size: 13px; font-weight: 700; background: #f7faf6; border-top: 1px solid #e4ebe4; }
.feedback-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 72px; }.feedback-row p { margin: 12px 0; line-height: 1.6; }.success { color: #116142; font-weight: 700; }
.drag-ghost { position: fixed; z-index: 100; pointer-events: none; opacity: .85; transform: translate(-50%, -50%); border-radius: 10px; background: #fff9; padding: 8px; box-shadow: 0 5px 20px #183d3733; }.drag-ghost img { display: block; width: 64px; height: 84px; object-fit: contain; }
.trail { display: flex; align-items: center; justify-content: space-around; gap: 10px; padding: 12px; border-radius: 24px; background: repeating-linear-gradient(170deg,#d9eceb 0 14px,#e8f3ef 14px 28px); margin: 16px 0; }
.stone { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 45%; background: #fff; border: 2px solid #c3d6ce; color: #526b61; font-weight: 800; }.stone.current { background: #ffdd81; border-color: #ae7805; transform: rotate(-5deg); }.stone.done { background: #206452; color: #fff; border-color: #206452; }
.mission { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fff6df; border: 1px solid #e6d9b6; padding: 16px 20px; border-radius: 18px; margin-bottom: 16px; }.mission p { margin: 0; line-height: 1.5; font-size: 14px; }
.value-badge { display: flex; flex-direction: column; text-align: center; gap: 3px; flex-shrink: 0; font-size: 12px; }.value-badge strong { font-size: 34px; }
.exchange-columns .block-bin { height: 140px; min-height: 100px; }.exchange-actions { display: grid; gap: 6px; padding: 8px; background: #f7faf6; }.exchange-actions button { padding: 8px 4px; font-size: 13px; }
.bridge-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }.bridge-actions .primary { margin-left: auto; }.bridge-feedback { line-height: 1.6; margin: 12px 0 0; min-height: 48px; }
@media (max-width: 900px) { .hub { padding: 36px 20px; }.mode-cards { gap: 12px; }.mode-card { padding: 20px 16px; }.mode-card strong { font-size: 24px; }.game { padding: 16px; }.toolbar { gap: 6px; padding: 8px; }.toolbar button { padding: 10px; }.game-options { max-width: 330px; }.column-title { font-size: 16px; } }
@media (orientation: landscape) and (max-height: 850px) { .game { padding-top: 12px; }.game-heading h1 { font-size: 28px; }.sort-supply { min-height: 100px; max-height: 136px; }.sort-token { height: 92px; }.block-bin { height: 150px; }.trail { margin: 10px 0; padding: 6px; }.stone { width: 32px; height: 32px; }.mission { padding: 10px 16px; margin-bottom: 10px; }.exchange-columns .block-bin { height: 104px; }.bridge-actions { margin-top: 10px; }.supply { padding-top: 8px; gap: 6px; }.supply-item { min-height: 66px; flex-direction: row; }.supply-item img { width: 32px; height: 36px; }.supply-item[data-value="10"] img { height: 44px; } }
@media (max-width: 600px) { .topbar { gap: 8px; padding: 8px; }.brand { font-size: 12px; letter-spacing: 1px; }#mode-name { display: none; }.mode-cards { grid-template-columns: 1fr; }.mode-card { gap: 10px; }.mode-icon { height: 52px; width: 52px; }.game-heading { align-items: flex-start; flex-direction: column; }.game-options { max-width: none; justify-content: flex-start; }.game-columns { gap: 6px; }.column-title { font-size: 12px; padding: 10px 2px; }.column-count { font-size: 11px; }.block-bin { padding: 8px 2px; gap: 4px; }.mini-block { width: 44px; height: 48px; }.exchange-actions { padding: 4px; }.exchange-actions button { font-size: 11px; }.mission { padding: 12px; }.supply { width: 84px; }.supply-item { min-height: 74px; }.toolbar label { font-size: 11px; }.toolbar select { max-width: 86px; }.toolbar button { font-size: 12px; }.footnote { font-size: 11px; }#paper-hint { font-size: 20px; }#paper-hint small { display: block; padding: 0 20px; } }
@media (prefers-reduced-motion: no-preference) { .mode-card { transition: transform .15s; }.mode-card:hover { transform: translateY(-4px); }.stone.done { animation: celebrate .35s; }@keyframes celebrate { 50% { transform: translateY(-5px); } } }
