@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/courier-prime-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/courier-prime-latin-700-normal.woff2") format("woff2"); }
/* Doplic palette (same variables as every Doplic app) plus the board colours for each theme. */
:root { --bg:#fdf4e8; --card:#fffaf2; --ink:#17302c; --muted:#516761; --line:#ead9c4; --accent:#f58a2c; --link:#a84a0e;
  --red:#b3261e; --green:#1f6b3a; --type:"Courier Prime","Courier New",monospace; --ui:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; color-scheme: light dark;
  --frame:#c9b394; --cell:#f1e6d3; --cellink:#4a3d2b; --tw:#7c3aed; --dw:#e0601a; --tl:#0f9d6e; --dl:#b8860b; --tlink:#0a6b4b; --dlink:#7a5a08;
  --S:#0b84d1; --W:#d6385a; --N:#5f8a10; --E:#7c5cd6; --tile:#fffdf7; --tileink:#1b2240; --gold:#ffd84d; --pendtile:#ffe48a;
  --block1:#97a2d6; --block2:#6a77ad; --blockshadow:#4b5688; --ok:#1f6b3a; --bad:#b3261e; }
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg:#1c1633; --card:#281f47; --ink:#f1ecf8; --muted:#b6acca; --line:#40356a; --accent:#ff9f6e; --link:#c9baff; --red:#ff8a80; --green:#7be0a3;
  --frame:#0b0f22; --cell:#212a4c; --cellink:#e6e9f7; --tlink:#6ee7b7; --dlink:#fcd34d; --S:#38bdf8; --W:#fb7185; --N:#bef264; --E:#c4b5fd; --block1:#5a67a3; --block2:#38437a; --blockshadow:#05081a; --ok:#6ee7b7; --bad:#fda4af; } }
:root[data-theme="dark"] { color-scheme: dark; --bg:#1c1633; --card:#281f47; --ink:#f1ecf8; --muted:#b6acca; --line:#40356a; --accent:#ff9f6e; --link:#c9baff; --red:#ff8a80; --green:#7be0a3;
  --frame:#0b0f22; --cell:#212a4c; --cellink:#e6e9f7; --tlink:#6ee7b7; --dlink:#fcd34d; --S:#38bdf8; --W:#fb7185; --N:#bef264; --E:#c4b5fd; --block1:#5a67a3; --block2:#38437a; --blockshadow:#05081a; --ok:#6ee7b7; --bad:#fda4af; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--ui); font-size: 16px; line-height: 1.4; -webkit-text-size-adjust: 100%; }
a { color: var(--link); }
h1, h2, h3 { font-family: var(--type); margin: 0; }
.wrap { max-width: 640px; margin: 0 auto; padding: 12px 12px 48px; }
.head { text-align: center; padding: 4px 0 8px; }
.head h1 { font-size: 2.1rem; letter-spacing: -.01em; }
.tag { color: var(--muted); margin: 6px 0 0; }
.hero { width: min(100%, 620px); aspect-ratio: 1828 / 664; margin: 8px auto 4px; background: var(--ink);
  -webkit-mask: url("/hero.png") center / contain no-repeat; mask: url("/hero.png") center / contain no-repeat; }
:root[data-theme="dark"] .hero { -webkit-mask-image: url("/hero-dark.png"); mask-image: url("/hero-dark.png"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { -webkit-mask-image: url("/hero-dark.png"); mask-image: url("/hero-dark.png"); } }
@media (forced-colors: active) { .hero { background: CanvasText; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 1rem var(--ui); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: #0a3cff; border-color: #0a3cff; color: #fff; }
.btn.go { background: var(--gold); border-color: var(--gold); color: #1b2240; font-weight: 800; }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 0 0 12px; }
.card h2 { font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; font-weight: 700; font-family: var(--ui); }
.card h3 { font-size: 1.05rem; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 4px 0; font-size: .92rem; }
.stack { display: grid; gap: 8px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.opts { display: grid; gap: 8px; }
.opts.three { grid-template-columns: repeat(3, 1fr); } .opts.two { grid-template-columns: repeat(2, 1fr); }
.opt { border: 1.5px solid var(--line); background: transparent; color: var(--ink); border-radius: 12px; padding: 10px 6px; text-align: center; font: inherit; cursor: pointer; }
.opt b { display: block; font-size: 16px; } .opt span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.opt.on { border-color: var(--gold); background: rgba(255,216,77,.18); box-shadow: inset 0 0 0 1px var(--gold); }
input[type=text] { font: inherit; padding: 8px 10px; min-height: 44px; border-radius: 10px; border: 2px solid var(--muted); background: #fff; color: #17110a; width: 100%; text-transform: uppercase; letter-spacing: .12em; }
details { margin: 8px 2px; color: var(--muted); } summary { cursor: pointer; color: var(--ink); font-weight: 600; }
details ul { padding-left: 18px; margin: 8px 0; } details li { margin: 5px 0; }
.back { margin: 2px 0 8px; }
.code { font: 700 2rem var(--type); letter-spacing: .25em; text-align: center; padding: 8px; border: 2px dashed var(--line); border-radius: 12px; }
.seat { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 2px solid var(--c); border-radius: 10px; margin: 4px 0; }
.seat.empty { border-style: dashed; color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.pill { background: var(--accent); color: #17110a; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
/* ---- game ---- */
.score { display: grid; grid-template-columns: repeat(var(--np), 1fr); gap: 6px; margin: 4px 0 8px; }
.chip { border: 2px solid var(--c); border-radius: 11px; padding: 5px 8px; background: var(--card); min-width: 0; }
.chip b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip em { font-style: normal; font-size: 19px; font-weight: 800; }
.chip small { display: block; color: var(--muted); font-size: 11px; }
.chip.turn { background: var(--c); color: #fff; } .chip.turn small { color: #fff; opacity: .85; }
.chip.turn[data-ink="dark"] { color: #10152a; } .chip.turn[data-ink="dark"] small { color: #10152a; }
.meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin: 0 2px 6px; }
.bwrap { container-type: inline-size; width: 100%; }
.board { --cw: calc(100cqw / var(--n)); display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--n), minmax(0, 1fr)); gap: 2px; padding: 5px; background: var(--frame); border-radius: 14px; aspect-ratio: 1; }
.sq { position: relative; border-radius: 16%; background: var(--cell); display: flex; align-items: center; justify-content: center; font-size: calc(var(--cw)*.34); font-weight: 800; color: var(--cellink); opacity: 1; user-select: none; cursor: pointer; min-width: 0; min-height: 0; }
.sq.tw { background: var(--tw); color: #fff; } .sq.dw { background: var(--dw); color: #fff; }
.sq.tl { background: color-mix(in srgb, var(--tl) 26%, var(--cell)); box-shadow: inset 0 0 0 2px var(--tl); color: var(--tlink); }
.sq.dl { background: color-mix(in srgb, var(--dl) 24%, var(--cell)); box-shadow: inset 0 0 0 2px var(--dl); color: var(--dlink); }
.sq.home { background: var(--c); color: #fff; font-size: calc(var(--cw)*.6); } .sq.homeoff { background: var(--tw); color: #fff; }
.sq.dia { box-shadow: inset 0 0 0 2px var(--c); color: var(--c); font-size: calc(var(--cw)*.5); }
.sq.dead { background: linear-gradient(180deg, var(--block1), var(--block2)); box-shadow: 0 3px 0 var(--blockshadow), inset 0 1px 0 rgba(255,255,255,.35); transform: translateY(-1px); cursor: default; }
.t { position: absolute; inset: 6%; border-radius: 15%; background: var(--tile); color: var(--tileink); display: flex; align-items: center; justify-content: center; font-size: calc(var(--cw)*.52); font-weight: 800; box-shadow: inset 0 calc(var(--cw)*-.09) 0 var(--c); }
.t i { position: absolute; right: 9%; top: 4%; font-style: normal; font-size: .36em; font-weight: 700; opacity: .75; }
.t.pend { background: var(--pendtile); outline: 2px solid #fff; z-index: 2; } .t.last { outline: 2px solid var(--c); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11px; color: var(--muted); margin: 8px 2px; }
.legend span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; background: var(--k); box-shadow: var(--sh, none); }
.msg { min-height: 44px; margin: 8px 2px; font-size: 14px; } .msg .ok { color: var(--ok); font-weight: 800; } .msg .bad { color: var(--bad); } .msg .dim { color: var(--muted); }
.rack { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 10px; border-radius: 14px; background: var(--card); border: 2px solid var(--me); }
.rt { position: relative; aspect-ratio: 1; border-radius: 11px; background: var(--tile); color: var(--tileink); display: flex; align-items: center; justify-content: center; font-size: clamp(18px, 7vw, 32px); font-weight: 800; cursor: pointer; box-shadow: inset 0 -5px 0 var(--me), 0 1px 0 rgba(0,0,0,.15); }
.rt i { position: absolute; right: 7%; top: 3%; font-style: normal; font-size: 11px; font-weight: 700; opacity: .75; }
.rt.sel { transform: translateY(-6px); outline: 3px solid var(--gold); } .rt.used { opacity: .2; pointer-events: none; } .rt.swap { outline: 3px solid var(--bad); transform: translateY(-11px); box-shadow: inset 0 -5px 0 var(--me), 0 9px 12px rgba(0,0,0,.28); }
.rt { transition: transform .12s ease, box-shadow .12s ease; }
.btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.btns button { min-height: 44px; border-radius: 11px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: 600 13px var(--ui); cursor: pointer; }
.btns button:disabled { opacity: .4; } .btns button.play { grid-column: 1/-1; background: var(--gold); color: #1b2240; border: 0; font: 800 17px var(--ui); min-height: 52px; }
.log { color: var(--muted); font-size: 12px; margin: 6px 2px; min-height: 34px; }
.modal { position: fixed; inset: 0; background: rgba(5,8,20,.7); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.sheet { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 16px; width: 100%; max-width: 420px; } .sheet h2 { font-size: 22px; margin: 0 0 8px; }
.res { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 10px; margin: 4px 0; border: 2px solid var(--c); } .res.win { background: var(--c); color: #fff; } .res small { opacity: .85; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; z-index: 60; max-width: 90vw; }
.toast:empty { display: none; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* button labels spelled in letter tiles */
.two > .btn.tilebtn, .two > .btn.tilebtn ~ .btn { grid-column: 1 / -1; }
.btn.tilebtn { padding: 10px 8px; } .btns button.play.tilebtn { padding: 6px; } .btns button.play:disabled .tw-t { opacity: .9; }
.tword { display: inline-flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: nowrap; }
.tw-word { display: inline-flex; gap: 3px; } .tw-word + .tw-word { margin-left: 14px; }
.tw-t { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 25px; height: 27px; border-radius: 5px;
  background: var(--tile); color: var(--tileink); font: 800 16px/1 Inter, system-ui, sans-serif; box-shadow: inset 0 -3px 0 rgba(0,0,0,.22), 0 1px 0 rgba(0,0,0,.15); }
.tw-t i { position: absolute; right: 2px; top: 2px; font-style: normal; font-size: 7.5px; font-weight: 700; opacity: .75; }

/* home heading in letter tiles (EDGE on a rack, WORDS scattered), sized to the page headings */
/* spans the hero from Crispin's inner ear to Billy Ray's inner ear: the hero and heading share a width, so tiles scale with the art */
.brand { width: min(100%, 620px); margin: 6px auto 0; container-type: inline-size; }
.brand-in { --bt: var(--btsize, 5.76cqw); position: relative; left: -1.6cqw; display: flex; justify-content: center; align-items: flex-start; gap: calc(var(--bt) * .7); padding-bottom: calc(var(--bt) * .6); }
.bt { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--bt); height: var(--bt); border-radius: calc(var(--bt) * .17);
  background: var(--tile); color: var(--tileink); border: 2px solid var(--ink); box-shadow: 1.5px 2.5px 0 var(--ink);
  font: 700 calc(var(--bt) * .62)/1 var(--type); transform: translateY(calc(var(--dy, 0) * var(--bt))) rotate(var(--rot, 0deg)); }
.bt i { position: absolute; right: 10%; top: 6%; font: 700 calc(var(--bt) * .24)/1 var(--type); font-style: normal; }
.b-edge { position: relative; display: inline-flex; gap: calc(var(--bt) * .14); padding: 0 calc(var(--bt) * .28); }
.b-edge::after { content: ""; position: absolute; left: 0; right: 0; bottom: calc(var(--bt) * -.54); height: calc(var(--bt) * .6); border: 2px solid var(--ink); border-radius: 5px;
  background: repeating-linear-gradient(180deg, transparent 0 4px, color-mix(in srgb, var(--ink) 30%, transparent) 4px 5px), var(--card); box-shadow: 0 3px 4px color-mix(in srgb, var(--ink) 18%, transparent); }
.b-words { display: inline-flex; gap: calc(var(--bt) * .15); transform: rotate(-3deg); margin-top: calc(var(--bt) * -.1); }
