:root {
  color-scheme: dark;
  --bg: #101423;
  --panel: #1a2033;
  --line: #353e59;
  --text: #f5f6fd;
  --muted: #bcc5dc;
  --lime: #d3fa71;
  font: 16px/1.55 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--lime); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .14em; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #9ce9ff; outline-offset: 4px; }
h1, h2, h3, p { margin: 0 0 .65rem; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.035em; }
h1 { font-size: clamp(2.3rem, 7vw, 4.8rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h3 { font-size: 1.35rem; }
.wrap { width: min(100% - 2rem, 70rem); margin-inline: auto; }
.skip { position: absolute; top: -5rem; left: 1rem; z-index: 1; background: var(--bg); padding: .6rem; }
.skip:focus { top: .25rem; }
.site-header { border-bottom: 1px solid var(--line); }
.bar, .site-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; }
.brand { font-weight: 900; letter-spacing: -.04em; color: var(--text); font-size: clamp(1rem, 4vw, 1.45rem); text-decoration: none; white-space: nowrap; }
.brand span, .eyebrow span { color: var(--lime); }
.site-header nav a { padding: .65rem .15rem; display: inline-block; }
main { min-height: 62vh; }
.site-footer { color: var(--muted); border-top: 1px solid var(--line); margin-top: 3.5rem; padding: .75rem 0; flex-wrap: wrap; }
.hero { display: grid; gap: 2rem; align-items: center; grid-template-columns: 1.15fr .85fr; padding: clamp(2.5rem, 8vw, 6rem) 0; }
.hero h1 { font-size: clamp(3.15rem, 8.5vw, 7.1rem); line-height: .88; margin: .85rem 0 1.25rem; letter-spacing: -.082em; }
.hero h1 em { color: var(--lime); font-style: normal; }
.occasion-hero { padding-block: clamp(2.25rem, 6vw, 4.75rem) 1rem; }
.occasion-hero h1 { font-size: clamp(2.55rem, 6.5vw, 5.15rem); line-height: 1; letter-spacing: -.055em; }
.occasion-example { background: linear-gradient(145deg, #29332d, var(--panel) 75%); border-color: #526345; }
.occasion-example p:last-child, .occasion-steps p, .occasion-tip { color: var(--muted); margin-bottom: 0; }
.occasion-steps { padding: 0; margin: 0; list-style-position: inside; }
.occasion-steps li::marker { color: var(--lime); font-weight: 800; }
.occasion-steps h3 { margin-top: .3rem; }
.occasion-tip { border-left: .2rem solid var(--lime); padding-left: .85rem; margin-top: 1rem; }
.lead { color: var(--muted); max-width: 44rem; font-size: clamp(1.02rem, 3vw, 1.2rem); }
.eyebrow { color: var(--lime); font-size: .78rem; font-weight: 800; letter-spacing: .13em; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1rem; margin-top: 1rem; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .45rem; min-height: 2.75rem; padding: .65rem 1rem; border: 1px solid transparent; border-radius: .6rem; background: var(--lime); color: #18200d; text-decoration: none; font-weight: 800; }
.button:hover { background: #e5ffa5; }
.button.secondary { background: var(--bg); border-color: var(--line); color: var(--text); }
.button.secondary:hover { border-color: var(--lime); }
.button.small { padding: .45rem .75rem; }
.hero-art { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; max-width: 26rem; width: 100%; justify-self: end; transform: rotate(-7deg) scale(.92); }
.art { aspect-ratio: 1; display: grid; place-items: center; border-radius: 25%; color: var(--bg); font-size: clamp(2rem, 7vw, 5.25rem); font-weight: 900; box-shadow: 0 .45rem 0 #080912; }
.art-lime, .lime { background: #d3fa71; }
.art-rose, .rose { background: #ffa8db; }
.art-mango, .mango { background: #ffcb71; }
.art-ice, .ice { background: #9ce9ff; }
.mint { background: #99efc0; }
.library, .play-heading { padding-top: 2rem; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.library + .discovery { margin-top: 1.25rem; }
.occasion-list { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.occasion-list a[aria-current=true] { border-color: var(--lime); color: var(--lime); }
.discovery-search { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .55rem; max-width: 35rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr)); gap: 1rem; }
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: .95rem; min-width: 0; }
.card { overflow: hidden; display: flex; flex-direction: column; }
.tile { display: grid; place-items: center; min-height: 7rem; color: var(--bg); font-size: 3rem; }
.tile span { transform: rotate(-9deg); }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 1rem; }
.card-body p { color: var(--muted); flex: 1; }
.panel { padding: clamp(.85rem, 3vw, 1.7rem); }
.narrow { width: min(100%, 43rem); margin: 2rem auto 0; }
.narrow h1 { font-size: clamp(2rem, 7vw, 3.7rem); }
form { display: grid; gap: .95rem; margin-top: 1rem; }
form button { justify-self: start; }
label { display: grid; gap: .35rem; min-width: 0; font-weight: 650; }
input:not([type=radio]):not([type=hidden]), textarea, select { width: 100%; min-height: 2.85rem; border: 1px solid #69728b; border-radius: .5rem; background: var(--bg); color: var(--text); padding: .55rem .7rem; }
input[type=file] { max-width: 100%; }
input::placeholder, textarea::placeholder, .muted { color: var(--muted); }
.preview { max-width: 5rem; max-height: 4rem; object-fit: contain; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .65rem; }
.question, details { margin: 0; border: 1px solid var(--line); border-radius: .65rem; padding: .85rem; min-width: 0; }
.question + .question, .question label + label, .question .form-grid, .question .form-grid + label, details[open] > :not(summary) { margin-top: .65rem; }
.question .form-grid label + label { margin-top: 0; }
legend { max-width: 100%; padding-inline: .3rem; font-weight: 750; overflow-wrap: anywhere; }
summary { cursor: pointer; font-weight: 700; }
.errors, .key { background: var(--bg); border-radius: .55rem; padding: .8rem; overflow-wrap: anywhere; }
.errors { padding-left: 1.9rem; color: #ffb8c9; }
.key { margin: 1rem 0; border: 1px solid var(--line); }
.key code { color: var(--lime); }
.play-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, .55fr); align-items: start; gap: 1rem; }
.play-grid[data-wide] { grid-template-columns: minmax(0, 1fr) minmax(15rem, .42fr); }
.frame-box:not(:empty) { margin: 1rem auto 0; max-width: 420px; }
.frame-box[data-size=wide]:not(:empty) { max-width: 720px; }
.frame-box iframe { display: block; width: 100%; border: 0; border-radius: .45rem; aspect-ratio: 420 / 720; background: #0a0c15; }
.frame-box[data-size=wide] iframe { aspect-ratio: 720 / 420; }
.choice { display: flex; align-items: center; gap: .7rem; padding: .45rem; min-height: 2.75rem; border-radius: .45rem; background: var(--bg); cursor: pointer; overflow-wrap: anywhere; }
.choice input { width: 1.15em; height: 1.15em; accent-color: var(--lime); flex-shrink: 0; }
.share { display: grid; gap: .5rem; margin-top: 1rem; }
.share button { justify-self: start; }
.share output:empty { display: none; }
.challenge-share { margin-top: .85rem; }
.check-line { display: flex; align-items: center; }
.bestie-hint { margin-bottom: 0; }
.bestie-progress { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.bestie-progress h2 { font-size: clamp(1.45rem, 4vw, 2rem); margin: 0; }
.bestie-progress [role=timer] { white-space: nowrap; font-variant-numeric: tabular-nums; border-radius: .45rem; padding: .25rem .6rem; background: var(--bg); }
.bestie-progress .is-low { color: #ffb8c9; }
.bestie-round .choice { margin-top: .6rem; }
.bestie-photo { display: block; max-width: 100%; max-height: 14rem; margin: 0 auto .5rem; border-radius: .45rem; object-fit: contain; }
.bestie-answer-photo { max-width: min(10rem, 100%); max-height: 7rem; margin-left: 0; }
.bestie-review ol { padding-left: 1.5rem; overflow-wrap: anywhere; }
[data-photo-start][hidden] { display: none; }
.photo-reveal-board { position: relative; width: 100%; max-width: 30rem; aspect-ratio: 4 / 3; margin: 0 auto; border-radius: .65rem; overflow: hidden; background: var(--bg); }
.photo-reveal-board img { display: block; width: 100%; height: 100%; object-fit: contain; }
.photo-reveal-tiles { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--photo-grid), minmax(0, 1fr)); grid-template-rows: repeat(var(--photo-grid), minmax(0, 1fr)); }
.photo-reveal-tiles[data-grid="3"] { --photo-grid: 3; }
.photo-reveal-tiles[data-grid="4"] { --photo-grid: 4; }
.photo-reveal-tiles[data-grid="5"] { --photo-grid: 5; }
.photo-reveal-tiles span { background: #392747; box-shadow: inset 0 0 0 1px #594164; }
.photo-reveal-tiles span:nth-child(even) { background: #4a3157; }
.photo-reveal-tiles span.revealed { visibility: hidden; }
[data-scores] { padding-left: 2.6rem; max-height: 32rem; overflow-y: auto; overscroll-behavior: contain; }
[data-scores] li { padding: .35rem .2rem; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
[data-scores] strong { float: right; margin-left: .5rem; }
.aside-links { margin-top: 1rem; }
.result { text-align: center; padding: 1.5rem; }
.result strong { display: block; color: var(--lime); font-size: 3rem; }
.imgtool[open] {
  display: grid; grid-template-rows: auto minmax(9rem, 1fr) auto;
  width: min(52rem, calc(100% - 2rem)); max-width: none; height: min(47rem, calc(100dvh - 2rem)); max-height: none;
  padding: 0; border: 1px solid var(--line); border-radius: .9rem; background: var(--panel); color: var(--text);
  overflow: auto; overscroll-behavior: contain;
}
.imgtool::backdrop { background: #070911d9; }
.imgtool [hidden] { display: none; }
.imgtool button { touch-action: manipulation; }
.imgtool-head, .imgtool-controls { padding: .65rem 1rem; }
.imgtool-head h2 { font-size: 1.3rem; margin-bottom: .25rem; }
.imgtool-head p { font-size: .88rem; color: var(--muted); margin: 0; }
.imgtool-stage { background: #0a0d17; min-width: 0; }
.imgtool-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; outline-offset: -4px; }
.imgtool-controls, .imgtool-sliders { display: grid; gap: .4rem; }
.imgtool-sliders { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.imgtool-sliders label { display: flex; align-items: center; gap: .5rem; font-size: .88rem; }
.imgtool input[type=range] { width: 100%; min-width: 0; padding: 0; accent-color: var(--lime); }
.imgtool-row { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; }
.imgtool-row > span:not(.imgtool-spacer) { min-width: 2.8rem; font-size: .88rem; color: var(--muted); }
.imgtool .tool { min-height: 2.75rem; padding: .25rem .6rem; border: 1px solid var(--line); border-radius: .5rem; color: var(--text); background: var(--bg); }
.imgtool .tool[aria-pressed=true] { border-color: var(--lime); color: var(--lime); }
.imgtool .tool:disabled { opacity: .5; cursor: default; }
.imgtool-spacer { flex: 1; }
.imgtool-ingame { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); }
.imgtool-ingame canvas, .imgtool-result canvas {
  background: repeating-conic-gradient(#2a3045 0% 25%, #3d4560 0% 50%) 0 0 / 12px 12px;
}
.imgtool-ingame canvas { max-width: 2.75rem; max-height: 2.75rem; object-fit: contain; }
.imgtool-result { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; color: var(--muted); }
.imgtool-result canvas { width: auto; height: auto; max-width: 5rem; max-height: 4rem; border-radius: .25rem; }
.imgtool-error { color: #ffb8c9; }
@media (max-width: 40rem), (max-height: 42rem) {
  .imgtool[open] { width: 100%; height: 100vh; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .imgtool-head { padding-top: max(.65rem, env(safe-area-inset-top)); }
  .imgtool-controls { padding-bottom: max(.65rem, env(safe-area-inset-bottom)); }
  .imgtool-head, .imgtool-controls { padding-inline: max(.55rem, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .imgtool-row > span:not(.imgtool-spacer) { display: none; }
}
@media (max-width: 44rem) {
  .hero, .play-grid, .play-grid[data-wide] { grid-template-columns: 1fr; }
  .hero-art { max-width: 11rem; justify-self: center; gap: .55rem; }
  .section-head { align-items: start; }
}
@media (max-width: 25rem) {
  .discovery-search { grid-template-columns: 1fr; }
}
