/* Header tools (header-tools.js): 설명서 dialog and full-screen button. */
html:root[data-design] .header-tool[hidden] {display:none}

/* ---- 설명서 ---- */
html:root[data-design] #manual-dialog {
  --manual-cell:var(--cc-cell);--manual-edge:var(--cc-cell-line);--manual-ink:var(--cc-ink);
  --manual-badge:var(--cc-ink);--manual-badge-ink:var(--cc-panel);
  --cc-preview-cell:var(--cc-cell);--cc-preview-edge:var(--cc-cell-line);
  width:min(760px,calc(100vw - 24px));padding:0;overflow:hidden;
}
html:root[data-design] #manual-dialog[open] {display:flex;flex-direction:column;gap:0;height:min(820px,calc(100dvh - 24px))}
html:root[data-design] #manual-dialog .lobby-sheet-head {padding:16px 18px 10px}
html:root[data-design] .manual-tabs {display:flex;gap:4px;padding:0 18px;border-bottom:1px solid var(--cc-line)}
html:root[data-design] .manual-tab {min-height:42px;padding:6px 14px;border:0;border-bottom:3px solid transparent;background:none;color:var(--cc-muted);font:inherit;font-weight:750;cursor:pointer;white-space:nowrap}
html:root[data-design] .manual-tab[aria-selected="true"] {border-bottom-color:var(--cc-accent);color:var(--cc-ink)}
html:root[data-design] .manual-body {flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding:6px 18px 22px}
html:root[data-design] .manual-page {display:grid;gap:4px}
html:root[data-design] .manual-page section {padding:12px 0;border-bottom:1px solid color-mix(in srgb,var(--cc-line) 70%,transparent)}
html:root[data-design] .manual-page section:last-child {border-bottom:0}
html:root[data-design] .manual-row {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:center}
html:root[data-design] .manual-page h3 {display:flex;align-items:center;gap:8px;margin:0 0 6px;font-size:1.02rem;letter-spacing:-.02em}
html:root[data-design] .manual-page h3 > span {display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--cc-accent);color:var(--cc-accent-ink);font-size:.75rem}
html:root[data-design] .manual-page p {margin:0 0 6px;font-size:.9rem;line-height:1.6}
html:root[data-design] .manual-page ul {margin:0;padding-left:1.1em;font-size:.88rem;line-height:1.65}
html:root[data-design] .manual-page b {font-weight:750}
html:root[data-design] .manual-note {color:var(--cc-muted);font-size:.8rem!important}
html:root[data-design] .manual-figures {display:flex;gap:10px}
html:root[data-design] .manual-figure {display:grid;justify-items:center;gap:4px;margin:0;width:150px}
html:root[data-design] .manual-figure svg {display:block;width:100%;height:auto;overflow:visible}
html:root[data-design] .manual-figure figcaption {font-size:.74rem;color:var(--cc-muted);text-align:center;line-height:1.35}
html:root[data-design] .manual-lead {display:grid;gap:3px;margin-top:10px;padding:14px 16px!important;border:0!important;border-radius:var(--design-radius);background:color-mix(in srgb,var(--cc-accent) 9%,var(--cc-panel))}
html:root[data-design] .manual-lead strong {font-size:1.12rem}
html:root[data-design] .manual-lead span {font-size:.86rem;color:var(--cc-muted)}

/* flow diagrams */
html:root[data-design] .manual-flow {display:grid;justify-items:center;gap:4px;padding:10px 0 14px}
html:root[data-design] .flow-step {display:grid;gap:2px;justify-items:center;min-width:min(100%,260px);padding:9px 14px;border:1px solid var(--cc-line);border-radius:var(--design-radius);background:var(--cc-bg);text-align:center}
html:root[data-design] .flow-step b {font-size:.9rem}
html:root[data-design] .flow-step span {font-size:.78rem;color:var(--cc-muted)}
html:root[data-design] .flow-arrow {color:var(--cc-muted);font-size:1.1rem;line-height:1}
html:root[data-design] .flow-split {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%;max-width:560px}
html:root[data-design] .flow-split > .flow-step {min-width:0}
html:root[data-design] .flow-branch {display:grid;gap:6px;align-content:start;padding:10px;border:1px dashed var(--cc-line);border-radius:var(--design-radius)}
html:root[data-design] .flow-branch .flow-step {min-width:0}
/* Both branches share the rows (tag, who proves, success, failure) so their boxes line up. */
html:root[data-design] .flow-split-branches {grid-template-rows:repeat(4,auto);row-gap:0}
html:root[data-design] .flow-split-branches > .flow-branch {grid-row:span 4;grid-template-rows:subgrid;align-items:stretch}
html:root[data-design] .flow-split-branches .flow-sub {align-self:center}
html:root[data-design] .flow-tag {justify-self:center;padding:2px 10px;border-radius:999px;background:var(--cc-ink);color:var(--cc-panel);font-size:.76rem;font-weight:750}
html:root[data-design] .flow-sub {text-align:center;font-size:.8rem;font-weight:650}
html:root[data-design] .flow-good {border-color:color-mix(in srgb,#2e9d62 45%,var(--cc-line));background:color-mix(in srgb,#2e9d62 8%,var(--cc-bg))}
html:root[data-design] .flow-bad {border-color:color-mix(in srgb,#d0566a 45%,var(--cc-line));background:color-mix(in srgb,#d0566a 7%,var(--cc-bg))}
html:root[data-design] .manual-page .manual-pt,html:root[data-design] .flow-step span.manual-pt {display:inline-block;min-width:26px;padding:0 5px;border-radius:6px;font-weight:800;font-size:.78rem;text-align:center;color:#fff}
html:root[data-design] .manual-pt-plus {background:#2e9d62}
html:root[data-design] .manual-pt-minus {background:#d0566a}
html:root[data-design] .manual-seats {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:8px;max-width:420px}
html:root[data-design] .manual-seats .seat {display:grid;gap:2px;justify-items:center;padding:10px 6px;border:1px solid var(--cc-line);border-radius:var(--design-radius);background:var(--cc-bg)}
html:root[data-design] .manual-seats .seat b {font-size:.95rem}
html:root[data-design] .manual-seats .seat span {font-size:.74rem;color:var(--cc-muted)}
html:root[data-design] .manual-seats .seat-declare {border:2px solid var(--cc-accent);background:color-mix(in srgb,var(--cc-accent) 10%,var(--cc-bg))}
html:root[data-design] .manual-seats .seat-declare span {color:var(--cc-ink);font-weight:700}

@media(max-width:620px) {
  html:root[data-design] .manual-row {grid-template-columns:1fr;gap:8px}
  html:root[data-design] .manual-row > .manual-figure,html:root[data-design] .manual-figures {justify-self:center}
  html:root[data-design] .manual-figure {width:132px}
  html:root[data-design] .manual-tabs {padding:0 10px}
  html:root[data-design] .manual-tab {padding:6px 10px;font-size:.88rem}
  html:root[data-design] .manual-body {padding:4px 14px 18px}
  html:root[data-design] .flow-split {gap:6px}
  html:root[data-design] .flow-branch {padding:7px}
}
html:root[data-design] .manual-flow-note {margin:0 0 4px!important;text-align:center}

/* ---- full screen: the whole interface grows with the screen ------------------------
   Sizes are in rem, so one root size scales them all (16px in a window). Entered with the
   button (is-fullscreen, header-tools.js) or the browser's own key (display-mode). */
@media(min-width:900px) and (min-height:621px) {
  :root.is-fullscreen {font-size:clamp(16px,min(.95vw,1.75vh),30px)}
  html:root[data-design] .site-header .brand-hero {min-height:4.375rem}
  html:root[data-design] .lobby-icon-button {flex:0 0 2.75rem;width:2.75rem;height:2.75rem;min-width:2.75rem;min-height:2.75rem}
  html:root[data-design] .lobby-icon-button svg {width:1.25rem;height:1.25rem}
  html:root[data-design] .site-header .brand-mark {width:2rem;height:2rem}
  html:root[data-design] .site-header .lobby-settings-panel {width:min(22.5rem,calc(100vw - 40px))}
  html:root[data-design] .lobby-sheet {width:min(40rem,calc(100vw - 24px))}
  html:root[data-design] #puzzle-dialog {width:min(48.75rem,calc(100vw - 24px))}
  html:root[data-design] #match-choice-dialog.match-choice-three {--match-choice-width:min(45rem,calc(100vw - 24px))}
  html:root body.game-screen-active #colorlink-game #cl-palette .btn {min-height:2.5rem}
  html:root body.game-screen-active #colorlink-game #cl-actions .btn {min-height:2.75rem}
  html:root body.game-screen-active #colorlink-game .gl-toolbar {min-height:3.25rem}
  html:root body.game-screen-active .gl-menu-button {min-height:2.5rem;min-width:4.9rem}
  html:root body.game-screen-active #colorlink-game .turn-badge {min-height:3.6rem}
  html:root body.game-screen-active #colorlink-game .turn-portrait {width:2.6rem;height:2.6rem}
  html:root .sp-color {min-height:2.7rem}
  html:root .sp-color .sp-marker {width:1.56rem}
  html:root .sp-icon {min-width:2.6rem;min-height:2.6rem}
}
@media(min-width:1200px) and (min-height:521px) {html:root body.game-screen-active #colorlink-game .gl-play-area {grid-template-columns:minmax(0,1fr) clamp(20.6rem,21vw,27rem)}}
@media(min-width:900px) and (min-height:621px) and (display-mode:fullscreen) {:root {font-size:clamp(16px,min(.95vw,1.75vh),30px)}}
