/* Nestle: a sunny morning in the tree (light) and a moonlit one (dark). house.css loads first. */
@font-face { font-family: "Young Serif"; font-display: swap; src: url(../fonts/young-serif-latin-400-normal.woff2) format("woff2"); }

:root {
  --bg: #EAF3EA; --panel: #FFFFFF; --panel-2: #F1F5EC; --line: #DCE5D5; --text: #22301F; --muted: #66735F;
  --accent: #E58B5A; --accent-ink: #FFFFFF; --leaf: #6FA552; --bad: #C8483A;
  --display: "Young Serif", Georgia, serif;
  --h-bg: var(--panel-2); --h-panel: var(--panel); --h-panel2: var(--panel-2); --h-line: var(--line); --h-text: var(--text); --h-muted: var(--muted);
  --h-serif: var(--display);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #101827; --panel: #18223A; --panel-2: #1F2B47; --line: #2B3A5C; --text: #EEF1E8; --muted: #9AA6BD;
  --accent: #F2A65A; --accent-ink: #1A1408; --leaf: #7DBE6A; --bad: #FF7A6B;
  --h-on: #101827;
  --h-bg: var(--panel-2); --h-panel: var(--panel); --h-panel2: var(--panel-2); --h-line: var(--line); --h-text: var(--text); --h-muted: var(--muted);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--h-sans); line-height: 1.45; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.layout { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

/* header */
.hbrand .logo { font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: -.01em; }
.hbrand .logo .mark { width: 30px; height: 30px; flex: none; }
.mark .nest, .mark .nest2 { fill: none; stroke: #A9733F; stroke-width: 2.6; stroke-linecap: round; }
.mark .nest2 { stroke: #C79A63; stroke-width: 2; }
.mark .egg { fill: #BFE3F0; stroke: #8FB8C6; stroke-width: .8; }
.mark .bird { fill: #4F7CA8; } .mark .belly { fill: #F2A65A; } .mark .beak { fill: #2B2A26; }
:root[data-theme="dark"] .mark .bird { fill: #6FA2D8; } :root[data-theme="dark"] .mark .beak { fill: #E8E2D0; }

/* today's strip */
.today { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tchip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: .85rem; font-weight: 600; cursor: default; }
.tchip.pat { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }
.tchip.nest { border-style: dashed; color: var(--muted); }
.tchip.rule { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.tchip .ico { display: block; width: 26px; height: 18px; flex: none; margin: -2px -1px -2px -5px; }
.tchip.head { border-width: 2px; padding: 4px 10px; font-weight: 800; }
.tchip em { font-style: normal; font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 1px 6px; margin-left: -1px; }

.stage { display: grid; gap: 14px; }
@media (min-width: 820px) { .stage { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 24px; } }

/* the board */
.board-wrap { position: relative; width: min(100%, calc((100svh - 150px) * 5 / 7)); min-width: 280px; max-width: 470px; margin: 0 auto; }
#board { display: block; width: 100%; aspect-ratio: 5 / 7; border-radius: 22px; touch-action: none; box-shadow: 0 0 0 1px var(--line), 0 18px 40px -26px rgba(0,0,0,.45); background: var(--panel-2); cursor: crosshair; }
.hud { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; justify-content: space-between; pointer-events: none; }
.pill { background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px; font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.pill.bad { color: var(--bad); }
.banner { position: absolute; left: 12px; right: 12px; bottom: 14px; background: color-mix(in srgb, var(--panel) 94%, transparent); border: 1px solid var(--line); border-radius: 18px; padding: 10px 14px; text-align: center; box-shadow: 0 12px 30px -16px rgba(0,0,0,.4); animation: hUp .4s var(--h-ease) both; pointer-events: none; }
.banner[hidden] { display: none; }
.banner b { display: block; font: 400 1.25rem/1.2 var(--display); }
.banner span { color: var(--muted); font-size: .85rem; }
.speed { position: absolute; right: 10px; bottom: 12px; display: flex; gap: 6px; }
.speed[hidden] { display: none; }
.chipbtn { border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 90%, transparent); border-radius: 99px; padding: 6px 12px; font-weight: 800; font-size: .85rem; cursor: pointer; }
.chipbtn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* tools */
.tools { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 12px; }
.tools[hidden] { display: none; }
.tools.busy { opacity: .45; pointer-events: none; }
.mats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mat { border: 1.5px solid var(--line); background: var(--panel-2); border-radius: 14px; padding: 8px 4px 7px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .2s var(--h-spring), border-color .2s, background .2s; }
.mat[data-k="erase"] { display: none; }
.mat:active { transform: scale(.95); }
.mat b { font-size: .92rem; }
.mat small { color: var(--muted); font-size: .72rem; }
.mat.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.sw { display: block; width: 34px; height: 12px; border-radius: 1px; margin-bottom: 3px; }
.hint { color: var(--muted); font-size: .85rem; margin: 10px 2px 8px; text-align: center; min-height: 1.2em; }
.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tool { border: 1px solid var(--line); background: var(--panel-2); border-radius: 12px; padding: 9px 6px; font-weight: 700; font-size: .9rem; cursor: pointer; }
.tool:active { transform: scale(.96); }
.tool.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.row2 .hcta { height: 50px; }
#btn-lock { background: var(--accent); color: var(--accent-ink); }
#btn-lock.armed { animation: arm 1s ease-in-out infinite; }
@keyframes arm { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 35%, transparent); } }
.fine { color: var(--muted); font-size: .78rem; margin: 8px 0 0; text-align: center; }

.hsum .big small { font-family: var(--h-sans); font-size: 15px; color: var(--muted); }

/* ads + footer */
.ad-inline { margin-top: 26px; }
.ad-slot { display: block; margin: 0 auto; overflow: hidden; }
.ad-banner { width: 100%; max-width: 728px; min-height: 100px; }
.ad-slot.placeholder { border: 1.5px dashed var(--line); border-radius: 12px; display: grid; place-items: center; color: var(--muted); font-size: 0.85rem; }
.ad-slot.placeholder::before { content: "Ad space " attr(data-size); }
.ad-slot.collapsed { min-height: 0; }
.ad-slot ins[data-ad-status="unfilled"] { display: none !important; }
.ad-label { font-size: 11px; color: var(--muted); text-align: center; margin: 0 0 4px; }
.foot { display: flex; justify-content: center; gap: 22px; padding: 26px 0 40px; color: var(--muted); font-size: .9rem; }

/* dialogs */
.dlg { border: 1px solid var(--line); border-radius: 22px; padding: 22px; width: min(430px, calc(100vw - 32px)); background: var(--panel); color: var(--text); }
.dlg::backdrop { background: rgba(10, 20, 10, .5); }
.dlg h2 { font-family: var(--display); font-weight: 400; margin: 0 0 10px; font-size: 1.6rem; }
.dlg p { color: var(--muted); }
.dlg p b { color: var(--text); }
.dlg .x { position: absolute; right: 10px; top: 8px; border: 0; background: transparent; font-size: 26px; cursor: pointer; color: var(--muted); width: 40px; height: 40px; }
/* mobile pass: a long dialog (help on a phone, or landscape) scrolls; its × rides along at the top instead of
   scrolling away. The form that holds it sticks and takes no room; the × is 44px. */
.dlg > form:first-child { position: sticky; top: 16px; z-index: 2; height: 0; margin: 0; }
.dlg > form:first-child .x { top: -16px; right: -16px; width: 44px; height: 44px; border-radius: 50%; background: var(--panel); }
.dlg h3 { font-family: var(--display); font-weight: 400; font-size: 1.15rem; margin: 18px 0 8px; }
.flock { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.flock li { display: flex; gap: 10px; align-items: flex-start; background: var(--panel-2); border-radius: 12px; padding: 7px 10px; color: var(--muted); font-size: .88rem; line-height: 1.35; }
.flock li.now { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, var(--line)); }
.flock li.more { font-style: italic; justify-content: center; }
.flock .ico { display: block; width: 36px; height: 24px; flex: none; margin-top: 1px; }
.flock b { display: block; color: var(--text); font-size: .92rem; }
.dlg { max-height: calc(100svh - 32px); overflow-y: auto; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0; }
.stats div { display: flex; flex-direction: column-reverse; background: var(--panel-2); border-radius: 12px; padding: 10px; }
.stats dt { color: var(--muted); font-size: .85rem; }
.stats dd { margin: 0; font: 400 1.5rem/1.2 var(--display); font-variant-numeric: tabular-nums; }
@media (max-width: 380px) { .hbrand .logo { font-size: 25px; } .hbrand .logo .mark { width: 24px; height: 24px; } }
/* six header icons + the logo only just fit a 375px phone: tighten them so nothing pokes past the right gutter */
@media (max-width: 420px) { .hbar { gap: 8px; } .hicons { gap: 4px; } .hbrand .logo { font-size: 24px; } .hbrand .logo .mark { width: 22px; height: 22px; } }
@media (prefers-reduced-motion: reduce) { #btn-lock.armed, .banner { animation: none; } }

/* material swatches */
.sw.straw { background: repeating-linear-gradient(90deg, #D9C267 0 4px, #CDB55A 4px 8px); box-shadow: 2px -2px 0 #A88B38; height: 5px; margin-top: 5px; margin-bottom: 6px; }
.sw.wood { background: repeating-linear-gradient(90deg, #9A6738 0 7px, #A8743F 7px 14px); box-shadow: 3px -3px 0 #6E4A2B; height: 8px; margin-top: 4px; margin-bottom: 5px; }
.sw.steel { background: repeating-linear-gradient(90deg, #7E8994 0 7px, #8A96A2 7px 14px); box-shadow: 3px -3px 0 #56606C; height: 8px; margin-top: 4px; margin-bottom: 5px; }
.sw.rope { background: repeating-linear-gradient(90deg, #C2A26A 0 3px, #9C7A45 3px 6px); height: 3px; margin-top: 6px; margin-bottom: 7px; }
.sw.rubber { background: repeating-linear-gradient(90deg, #C9445F 0 5px, #D45470 5px 10px); box-shadow: 2px -2px 0 #93304A; height: 6px; margin-top: 4px; margin-bottom: 6px; }
.sw.foam { background: repeating-linear-gradient(90deg, #8EC6DC 0 8px, #9FD3E8 8px 16px); box-shadow: 3px -3px 0 #5F9DB5; height: 13px; margin-top: 2px; }
.mats { grid-template-columns: repeat(3, 1fr); }
.mat small { font-variant-numeric: tabular-nums; }
/* very narrow phones (320px): let the icon row drop under the logo instead of running off the screen */
@media (max-width: 350px) { .hbar { flex-wrap: wrap; row-gap: 6px; } }
/* seven header icons don't fit beside the logo below ~400px: let the icon row drop under it */
@media (max-width: 400px) { .hbar { flex-wrap: wrap; row-gap: 6px; } .hicons { flex-wrap: wrap; } }

/* Daily | Versus */
/* the modes row and the lobby (house/lobby.css) in Nestle's colours */
:root { --lb-panel: var(--panel); --lb-panel2: var(--panel-2); --lb-text: var(--text); --lb-muted: var(--muted); --lb-line: var(--line); --lb-accent: var(--accent);
  --lb-ink: var(--accent-ink); --lb-bad: var(--bad); --lb-font: var(--h-sans); --lb-head: var(--display); }
.lb-modes { margin: 2px 0 10px; max-width: none; }
.lb-h { font-weight: 400; font-size: 1.35rem; }
html.vsmode #today, html.vsmode #btn-paths, html.vsmode #tests-line, html.vsmode #sum { display: none; }
html.vsmode .tools .row { grid-template-columns: repeat(2, 1fr); }

/* the Versus panel */
.vs { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 14px; margin-top: 10px; }
.vs[hidden], .vs [hidden] { display: none !important; }
.vs-note, .vs-role { color: var(--muted); font-size: .88rem; margin: 6px 0; }
.vs-role { color: var(--text); }
.vs-wide { width: 100%; margin-top: 10px; }
.vs-top { display: flex; justify-content: space-between; align-items: baseline; }
.vs-clock { font-weight: 800; font-variant-numeric: tabular-nums; }
.vs-clock.low { color: var(--bad); }
.vs-score { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0; font-size: .9rem; }
.vs-score span { background: var(--panel-2); border-radius: 99px; padding: 3px 10px; }
.vs-score span.me { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, var(--line)); }
.vs-pts { font-weight: 700; color: var(--text); margin: 4px 0 8px; }
.vs-pal { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 5px; }
.vs-bird { border: 1.5px solid var(--line); background: var(--panel-2); border-radius: 12px; padding: 5px 3px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.vs-bird b { font-size: .8rem; }
.vs-bird small { color: var(--muted); font-size: .7rem; font-variant-numeric: tabular-nums; }
.vs-bird:disabled { opacity: .4; cursor: default; }
.vs-bird .ico, .vs-l1 .ico { display: block; width: 26px; height: 18px; }
.vs-flock { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.vs-row-b { background: var(--panel-2); border-radius: 12px; padding: 7px 9px; border: 1.5px solid transparent; cursor: pointer; }
.vs-row-b.sel { border-color: var(--accent); }
.vs-row-b.bad { border-color: var(--bad); }
.vs-l1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vs-l1 b { margin-right: auto; font-size: .9rem; }
.vs-l1 .chipbtn { padding: 4px 9px; font-size: .75rem; }
.vs-l2 { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: .78rem; color: var(--muted); }
.vs-l2 label { display: inline-flex; align-items: center; gap: 6px; }
.vs-l2 input[type="range"] { width: 96px; accent-color: var(--accent); }
.vs-l2 select { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; padding: 2px 4px; }
.vs-warn { color: var(--bad); font-size: .78rem; margin: 6px 0 0; }
.vs-empty { color: var(--muted); font-size: .85rem; font-style: italic; }
.vs-lock { height: 48px; }
.vs-hist { list-style: none; margin: 10px 0 0; padding-left: 0; color: var(--muted); font-size: .85rem; display: grid; gap: 3px; }
.vs-hist:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .vs-bird { transition: none; } }

/* the flock's chips: buttons with an ability line, and the card each opens */
.today-wrap { position: relative; }
button.tchip { font: inherit; color: inherit; cursor: pointer; text-align: left; }
.tchip.bird { flex-wrap: wrap; row-gap: 0; }
.tchip .tag { font-weight: 500; color: var(--muted); font-size: .78rem; }
.tchip .tag::before { content: "· "; }
.tchip.bird[aria-expanded="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.bcard { position: absolute; z-index: 20; background: var(--panel); border: 1.5px solid var(--line); border-left: 5px solid var(--bird, var(--accent)); border-radius: 16px; padding: 10px 12px 10px; box-shadow: 0 14px 36px -14px rgba(0,0,0,.45); font-size: .86rem; }
.bcard[hidden] { display: none; }
.bcard h3 { font: 400 1.05rem/1.2 var(--display); margin: 2px 30px 4px 0; }
.bcard p { margin: 4px 0; color: var(--muted); line-height: 1.35; }
.bcard .bc-counter { color: var(--text); }
.bcard .bc-when { font-size: .8rem; }
.bc-pic { float: right; margin: 22px 0 4px 8px; }
.bc-pic .trick { display: block; width: 112px; height: 64px; border-radius: 10px; background: var(--panel-2); }
.bc-x { position: absolute; right: 6px; top: 4px; border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); width: 32px; height: 32px; border-radius: 99px; }
.bc-x:hover { background: var(--panel-2); }
@media (max-width: 420px) { .bc-pic { float: none; margin: 4px 0; } }
/* the one-time "New bird" card over the board */
.newbird { position: absolute; left: 10px; right: 10px; top: 46px; z-index: 5; background: color-mix(in srgb, var(--panel) 96%, transparent); border: 1.5px solid var(--accent); border-radius: 18px; padding: 10px 12px; box-shadow: 0 14px 34px -16px rgba(0,0,0,.5); max-height: 70%; overflow-y: auto; }
.newbird[hidden] { display: none; }
.newbird h3 { font: 400 1.1rem/1.2 var(--display); margin: 0 0 6px; }
.nb-row { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; font-size: .85rem; }
.nb-row .ico { display: block; width: 36px; height: 24px; flex: none; }
.nb-row p { margin: 2px 0; color: var(--muted); line-height: 1.3; }
.nb-row .nb-counter { color: var(--text); }
.nb-ok { width: 100%; margin-top: 6px; height: 40px; }
/* the Versus picker's ability lines */
.vs-bird i { font-style: normal; color: var(--muted); font-size: .66rem; line-height: 1.15; text-align: center; padding: 0 2px; }
.vs-l1 .vs-tag { color: var(--muted); font-size: .75rem; margin-right: auto; }
.vs-l1 b { margin-right: 0; }
.vs-what { color: var(--muted); font-size: .76rem; margin: 6px 0 0; line-height: 1.3; }

/* runs left: three eggs on the Lock in button (and the end card), cracked once used */
#btn-lock { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.eggs { display: inline-flex; gap: 3px; align-items: flex-end; }
.eggs .egg { display: block; width: 10px; height: 13px; border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%; background: #F4F6F2; box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.25); }
.eggs .egg.safe { background: #F4F6F2; box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.25), 0 0 0 2px color-mix(in srgb, var(--leaf) 70%, transparent); }
.eggs .egg.cracked { background: linear-gradient(#F6C343, #F6B023); clip-path: polygon(0 42%, 22% 30%, 40% 46%, 60% 26%, 80% 44%, 100% 32%, 100% 100%, 0 100%); box-shadow: none; }
.eggs.big { justify-content: center; margin: 4px 0 2px; }
.eggs.big .egg { width: 16px; height: 21px; }
.eggs.big:empty { display: none; }
html.vsmode .tools .row2 { display: grid; grid-template-columns: 1fr; }
html.vsmode #btn-lock { display: none; }

/* a structure check's result sits at the top of the board, clear of the fort it describes */
.banner.top { top: 52px; bottom: auto; }
@media (max-width: 420px) { .banner { padding: 8px 11px; } .banner b { font-size: 1.05rem; } .banner span { font-size: .8rem; } }

/* ------------------------------------------------------------ mobile pass: fingers */
/* no double-tap zoom on controls (pinch zoom still works); the board already takes every touch itself */
button, select, input, label { touch-action: manipulation; }
@media (hover: none) { .bc-x:hover { background: transparent; } }
@media (pointer: coarse) {
  @media (max-width: 420px) { .hicon { width: 40px; height: 40px; } }   /* house.css shrinks them to 34px; the row wraps under the logo instead */
  .bc-x { width: 44px; height: 44px; right: 2px; top: 0; }
  .bcard h3 { margin-right: 40px; }
  button.tchip { min-height: 40px; }
  .chipbtn { min-height: 40px; }
  /* the Versus planner: chips, sliders and the gap picker big enough for a thumb */
  .vs-l1 .chipbtn { min-height: 38px; padding: 6px 12px; font-size: .8rem; }
  .vs-l2 { gap: 8px 14px; }
  .vs-l2 label { flex: 1 1 140px; }
  .vs-l2 input[type="range"] { flex: 1; width: auto; min-width: 96px; height: 36px; }
  .vs-bird { min-height: 44px; }
}
/* under 16px, iOS zooms the page when the gap picker opens */
.vs-l2 select { font-size: 16px; min-height: 36px; }
.lede{font-style:italic;opacity:.82;line-height:1.55}

/* cross-browser pass (2026-11-25): phone in landscape, keep the page clear of the notch side (viewport-fit=cover;
   0 everywhere else) */
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
