/* Layout idea: a single quiet column, like a well-made app on a phone. Black type on white,
   hairline borders, one black action per screen. Results are the only place color appears. */
:root {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --sub: #6b6b6b;
  --line: #e8e8e8;
  --soft: #f6f6f6;
  --good: #1f8a4c;     /* semantic: correct */
  --bad: #d23f31;      /* semantic: wrong */
  --font: "Geist", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.app { max-width: 480px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom)); min-height: 100%; display: grid; gap: 18px; align-content: start; }

/* top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; background: none; border: 0; padding: 0; }
.brand svg { width: 22px; height: 22px; }
.ghost { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 500; min-height: 40px; }
.ghost:hover { border-color: var(--ink); }
.back { display: flex; align-items: center; gap: 6px; background: none; border: 0; padding: 8px 4px; font-weight: 500; font-size: 15px; min-height: 44px; }
.back svg { width: 18px; height: 18px; }

/* type */
h1, h2, h3 { margin: 0; letter-spacing: -0.025em; text-wrap: balance; }
.hero h1 { font-size: 34px; line-height: 1.05; font-weight: 700; }
.hero p { margin: 8px 0 0; color: var(--sub); font-size: 15.5px; line-height: 1.45; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--sub); }
.title { font-size: 26px; line-height: 1.12; font-weight: 700; }
.lede { color: var(--sub); font-size: 15px; line-height: 1.5; margin: 0; }
.muted { color: var(--sub); }

/* home list */
.games { display: grid; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.game { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; padding: 16px; background: var(--bg); border: 0; border-bottom: 1px solid var(--line); text-align: left; min-height: 76px; }
.game:last-child { border-bottom: 0; }
.game:active { background: var(--soft); }
.glyph { width: 44px; height: 44px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; }
.glyph svg { width: 22px; height: 22px; }
.game b { display: block; font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; }
.game span.d { display: block; color: var(--sub); font-size: 13.5px; margin-top: 2px; line-height: 1.35; }
.status { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: #fff; white-space: nowrap; }
.status.done { background: var(--soft); color: var(--ink); font-family: var(--mono); font-weight: 500; letter-spacing: .02em; }
.status.go { background: var(--bg); color: var(--ink); border: 1px solid var(--ink); }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { flex: 1 1 auto; min-height: 52px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font-weight: 600; font-size: 16px; padding: 0 20px; }
.btn.alt { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn.alt:hover { border-color: var(--ink); }
.btn:disabled { opacity: .35; cursor: default; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; color: var(--sub); }
.chip.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.foot { color: var(--sub); font-size: 13px; line-height: 1.5; text-align: center; }

/* shared game pieces */
.panel { border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 10px; }
.progress { display: flex; gap: 6px; }
.progress i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.progress i.on { background: var(--ink); }
.progress i.g { background: var(--good); } .progress i.r { background: var(--bad); }

/* Alibi */
.rule { background: var(--soft); border-radius: 14px; padding: 14px 16px; font-size: 15px; line-height: 1.5; }
.rule b { font-weight: 700; }
.suspects { display: grid; gap: 10px; }
.sus { border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; transition: border-color .2s, background .2s; }
.sus.culprit { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.sus.cleared { opacity: .55; }
.sushead { display: flex; align-items: center; gap: 12px; }
.pos { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--ink); display: grid; place-items: center; font-family: var(--mono); font-size: 13px; flex: none; }
.sus .nm { font-weight: 600; font-size: 16.5px; }
.sus .rl { color: var(--sub); font-size: 13.5px; }
.quote { font-size: 16.5px; line-height: 1.4; margin: 0; }
.sus.liar .quote { text-decoration: line-through; text-decoration-color: var(--bad); }
.verdict { font-size: 13px; font-weight: 600; }
.verdict.lie { color: var(--bad); } .verdict.true { color: var(--good); }
.susbtns { display: flex; gap: 8px; }
.tog { flex: 1; min-height: 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; font-weight: 500; }
.tog[aria-pressed="true"].t { background: #eaf5ee; border-color: var(--good); color: var(--good); }
.tog[aria-pressed="true"].l { background: #fbecea; border-color: var(--bad); color: var(--bad); }
.accuse { flex: 1.2; min-height: 42px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; }
.accuse:disabled { background: var(--soft); color: var(--sub); border-color: var(--line); }
.tries { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--sub); }
.tries i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.tries i.used { background: var(--line); }

/* Rank It */
.ends { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--sub); text-transform: uppercase; letter-spacing: .04em; }
.ranklist { display: grid; gap: 8px; }
.ritem { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); text-align: left; font-size: 16px; font-weight: 500; }
.ritem .slot { width: 30px; height: 30px; border-radius: 50%; border: 1px dashed #c9c9c9; display: grid; place-items: center; font-family: var(--mono); font-size: 13px; }
.ritem.set { border-color: var(--ink); }
.ritem.set .slot { background: var(--ink); color: #fff; border: 0; }
.ritem .val { font-size: 13px; color: var(--sub); font-weight: 400; text-align: right; }
.ritem.ok { border-color: var(--good); } .ritem.ok .slot { background: var(--good); }
.ritem.no { border-color: var(--bad); } .ritem.no .slot { background: var(--bad); }
.ritem .you { display: block; font-size: 12px; color: var(--bad); font-weight: 500; }

/* Five Clues */
.clues { display: grid; gap: 8px; counter-reset: c; }
.clue { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; font-size: 16px; line-height: 1.4; }
.clue .n { font-family: var(--mono); font-size: 13px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; }
.clue.locked { color: #b3b3b3; background: var(--soft); border-color: var(--soft); }
.clue.locked .n { background: #d9d9d9; }
.guessbox { position: relative; display: grid; gap: 8px; }
.guessbox input { width: 100%; min-height: 54px; border-radius: 14px; border: 1px solid var(--ink); padding: 0 16px; font-size: 17px; background: var(--bg); }
.sugg { display: grid; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.sugg button { text-align: left; background: var(--bg); border: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; font-size: 16px; min-height: 50px; }
.sugg button:last-child { border-bottom: 0; }
.sugg button:active { background: var(--soft); }
.wrongs { display: flex; flex-wrap: wrap; gap: 6px; }
.wrongs span { font-size: 14px; padding: 6px 12px; border-radius: 999px; background: #fbecea; color: var(--bad); text-decoration: line-through; }
.answer { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }

/* Odd One Out */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { min-height: 104px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); padding: 14px; font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; display: grid; place-items: center; text-align: center; }
.tile:active { background: var(--soft); }
.tile.ok { border-color: var(--good); background: #eaf5ee; color: #13542f; }
.tile.no { border-color: var(--bad); background: #fbecea; color: #7d221a; }
.tile.dim { opacity: .5; }
.why { background: var(--soft); border-radius: 14px; padding: 14px 16px; font-size: 15.5px; line-height: 1.45; }

/* result card */
.result { border: 1px solid var(--ink); border-radius: 18px; padding: 18px; display: grid; gap: 12px; }
.result .big { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.grid { font-family: var(--mono); font-size: 18px; line-height: 1.25; white-space: pre; }
.copybox { width: 100%; min-height: 140px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: 14px/1.45 var(--mono); display: none; resize: vertical; }

/* sheets */
.sheet { position: fixed; inset: 0; background: rgba(10,10,10,.38); display: none; align-items: flex-end; justify-content: center; z-index: 30; }
.sheet.open { display: flex; }
.sheetin { width: 100%; max-width: 480px; background: var(--bg); border-radius: 22px 22px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); display: grid; gap: 14px; max-height: 88vh; overflow-y: auto; }
.sheetin h2 { font-size: 22px; }
.sheetin ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.5; font-size: 15.5px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--soft); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat span { font-size: 12.5px; color: var(--sub); }
.days { display: grid; gap: 6px; }
.dayrow { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); text-align: left; min-height: 56px; }
.dayrow b { font-weight: 600; }
.dots { display: flex; gap: 5px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--ink); }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 999px; padding: 12px 18px; font-size: 14.5px; font-weight: 500; z-index: 40; display: none; max-width: calc(100% - 32px); text-align: center; }
.toast.show { display: block; }
.loading { padding: 60px 0; text-align: center; color: var(--sub); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Liar Lane */
.street { display: grid; grid-template-columns: 16px repeat(4, 1fr); gap: 6px; }
.street .lbl { font-family: var(--mono); font-size: 12px; color: var(--sub); display: grid; place-items: center; }
.house { position: relative; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 8px 7px 9px; min-height: 84px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.house .hn { font-weight: 600; font-size: clamp(13.5px, 3.8vw, 16px); line-height: 1.1; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.house .ht { font-family: var(--mono); font-size: 10.5px; color: var(--sub); text-transform: uppercase; letter-spacing: .04em; }
.house .hc { font-size: clamp(10.5px, 2.75vw, 12.5px); line-height: 1.28; }
.house.honest { background: var(--ink); color: #fff; border-color: var(--ink); }
.house.honest .ht { color: #9fd8b6; }
.house.liar { background: #fbecea; border-color: var(--bad); }
.house.liar .ht { color: var(--bad); }
.house.liar .hc { text-decoration: line-through; text-decoration-color: var(--bad); }
.house.sel { box-shadow: 0 0 0 2px var(--ink); outline: 2px solid #fff; outline-offset: -4px; }
.house.honest.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); outline: 0; }
.house.ref::after { content: ""; position: absolute; inset: 3px; border: 1.5px dashed #8a8a8a; border-radius: 9px; pointer-events: none; }
.house.honest.ref::after { border-color: #d0d0d0; }
.house.oops::before { content: ""; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.house.hint { animation: hintpulse 1s ease-in-out 3; }
.house.shake { animation: shake .35s ease; }
@keyframes hintpulse { 50% { box-shadow: 0 0 0 3px var(--ink); } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.said { border-left: 3px solid var(--ink); padding: 4px 0 4px 14px; display: grid; gap: 4px; }
.said.lie { border-left-color: var(--bad); }
.said .who { font-size: 13.5px; color: var(--sub); }
.said q { font-size: 17.5px; line-height: 1.35; font-weight: 500; quotes: "“" "”"; }
.said.lie q { text-decoration: line-through; text-decoration-color: var(--bad); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.honestbtn { background: var(--ink); }
.btn.liarbtn { background: var(--bg); color: var(--bad); border-color: var(--bad); }

/* site pages */
.seo { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 22px; display: grid; gap: 12px; }
.seo h2 { font-size: 21px; }
.seo h3 { font-size: 16.5px; margin-top: 6px; }
.seo p, .seo li { color: #333; font-size: 15.5px; line-height: 1.6; margin: 0; max-width: 65ch; }
.seo ul, .seo ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.seo a, .prose a { color: var(--ink); }
.prose { display: grid; gap: 12px; }
.prose p, .prose li { font-size: 15.5px; line-height: 1.6; margin: 0; color: #333; }
.prose h2 { font-size: 20px; margin-top: 8px; }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.sitefoot { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; font-size: 13.5px; }
.sitefoot a { color: var(--sub); text-decoration: none; padding: 6px 2px; }
.sitefoot a:hover { color: var(--ink); text-decoration: underline; }
.sitefoot .copy { width: 100%; text-align: center; color: var(--sub); font-size: 12.5px; }
.ans { border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 8px; }
.ans h3 { font-size: 17px; }
.ans ol, .ans ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 15px; line-height: 1.45; }
.minigrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; font-size: 13px; }
.minigrid span { border: 1px solid var(--line); border-radius: 8px; padding: 6px; text-align: center; }
.minigrid small { opacity: .75; }
.minigrid span.l { background: #fbecea; border-color: var(--bad); color: #7d221a; }
.minigrid span.h { background: var(--ink); color: #fff; border-color: var(--ink); }
.spoiler { background: var(--soft); border-radius: 14px; padding: 14px 16px; font-size: 14.5px; line-height: 1.5; }
#app { display: grid; gap: 18px; align-content: start; }
#app > .bar { margin-bottom: -4px; }

.said .truth { font-size: 16px; line-height: 1.4; font-weight: 600; color: var(--ink); }
.house .hr { font-size: clamp(10.5px, 2.75vw, 12.5px); line-height: 1.28; font-weight: 600; color: #7d221a; }
.house.liar .hc { color: #9a5b55; font-size: clamp(9.5px, 2.5vw, 11px); }
.sheetin ul li b { font-weight: 600; }

/* v3: switcher, streak, bigger street */
.barright { display: flex; align-items: center; gap: 8px; }
.ghost.sm { padding: 6px 12px; min-height: 36px; font-size: 13.5px; }
.streak { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 14px; font-weight: 500; padding: 6px 10px 6px 8px; border: 1px solid var(--line); border-radius: 999px; }
.streak svg { width: 15px; height: 15px; }
.switch { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px 4px; -webkit-overflow-scrolling: touch; }
.switch::-webkit-scrollbar { display: none; }
.pill2 { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; min-height: 38px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.pill2.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill2 .ok { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.pill2.on .ok { background: #8fe0b0; }
.lprog { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: -8px; }
.lprog i { display: block; height: 100%; background: var(--ink); transition: width .3s ease; }
.street.big .house { min-height: 92px; }
.house .hj { font-size: 10.5px; color: var(--sub); text-transform: lowercase; font-weight: 500; margin-top: -2px; }
.house.honest .hj { color: #bdbdbd; }
.house.liar .hj { color: #a8665e; }
.house.pop, .result.pop { animation: popin .35s ease; }
@keyframes popin { 0% { transform: scale(.94); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
.bars { display: grid; gap: 6px; }
.barrow { display: grid; grid-template-columns: 52px 1fr 28px; align-items: center; gap: 8px; font-size: 13px; }
.barrow i { display: block; height: 18px; background: var(--ink); border-radius: 4px; }
.barrow b { font-family: var(--mono); font-weight: 500; }
.sheetin h3 { font-size: 15px; margin-top: 4px; }

/* Liar Lane v3: whole street on one phone screen */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body:is([data-page="home"], [data-page="liar"]) #app { gap: 10px; }
body:is([data-page="home"], [data-page="liar"]) #app > .bar { margin-bottom: 0; }
.lmeta { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; overflow: hidden; }
.lmeta .chip { font-size: 11.5px; padding: 3px 8px; white-space: nowrap; }
.lcount { margin-left: auto; font-family: var(--mono); font-size: 12px; font-weight: 600; white-space: nowrap; }
.lmeta + .lprog { margin-top: -4px; }
#app .said { min-height: 100px; align-content: center; padding: 2px 0 2px 12px; gap: 3px; }
.said .tag { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.said .tag.ok { color: var(--good); } .said .tag.bad { color: var(--bad); }
#app .said q { font-size: 16px; line-height: 1.32; }
#app .said .truth { font-size: 15px; line-height: 1.32; }
.said .truth span { color: var(--bad); font-weight: 600; }
.said q.noq { quotes: none; text-decoration: none; }
.said.ask { border-left-color: #8a8a8a; }
.street.lane { gap: 5px; grid-template-columns: 14px repeat(4, 1fr); }
.street.lane .lbl { font-size: 11px; }
.street.lane .house { min-height: 0; height: clamp(46px, calc((100svh - 430px) / 5), 68px); padding: 6px 7px; justify-content: center; gap: 1px; border-radius: 10px; }
.street.lane .house .hn { font-size: clamp(13px, 3.7vw, 15.5px); }
.street.lane .house .hj { margin: 0; font-size: 10.5px; }
.house .hx { position: absolute; top: 5px; right: 5px; width: 14px; height: 14px; }
.house .hx svg { width: 100%; height: 100%; display: block; }
.house.honest .hx { color: #8fe0b0; } .house.liar .hx { color: var(--bad); }
.street.lane .house.oops::before { top: auto; bottom: 6px; }
.lact { display: flex; gap: 8px; align-items: center; }
.lact .btn { min-height: 50px; }
.lact .xbtn { flex: none; width: 50px; min-height: 50px; padding: 0; font-size: 16px; }
.lstat { flex: none; font-size: 12px; line-height: 1.35; color: var(--sub); text-align: right; min-width: 72px; }
@media (max-height: 620px) {
  body:is([data-page="home"], [data-page="liar"]) #app { gap: 7px; }
  body:is([data-page="home"], [data-page="liar"]) .pill2 { min-height: 32px; padding: 5px 12px; }
  #app .said { min-height: 78px; }
  #app .said q { font-size: 15px; }
  .street.lane .house { height: clamp(40px, calc((100svh - 350px) / 5), 68px); padding: 4px 6px; }
  .lact .btn, .lact .xbtn { min-height: 44px; }
}
