/* Palette choices share layout and retain distinct correct/incorrect states. */
:root[data-palette="lilac"] { --bg:#faf8ff; --surface:#ffffff; --ink:#302744; --muted:#70677c; --line:#e1dbea; --tile:#e8e0f4; --accent:#6542a0; --hit:#6542a0; --exact:#6542a0; --near:#6542a0; --fill-bg:#e9def8; --fill-ink:#513278; --fill-line:#d7c5ee; --fill-tile:#cdb5e9; --quiz-bg:#fff0b9; --quiz-ink:#634b16; --quiz-line:#ecdc9b; --quiz-tile:#e5ce7e; }
:root[data-palette="ocean"] { --bg:#f4f9fc; --surface:#ffffff; --ink:#20384a; --muted:#5c7180; --line:#d5e1e9; --tile:#dceaf3; --accent:#215f87; --hit:#215f87; --exact:#215f87; --near:#215f87; --fill-bg:#dceef9; --fill-ink:#204f72; --fill-line:#bdd9ec; --fill-tile:#a8cde5; --quiz-bg:#fce0df; --quiz-ink:#843d48; --quiz-line:#edc2c5; --quiz-tile:#e5b0b5; }
:root[data-palette="sunset"] { --bg:#fff8f3; --surface:#fffdfb; --ink:#49302b; --muted:#80665e; --line:#ebd9cf; --tile:#f1ddd1; --accent:#a34334; --hit:#a34334; --exact:#a34334; --near:#a34334; --fill-bg:#f8d8c9; --fill-ink:#823c2d; --fill-line:#ecc0aa; --fill-tile:#e6ad91; --quiz-bg:#e2e7fb; --quiz-ink:#3e4d89; --quiz-line:#c6cfef; --quiz-tile:#b5c1e9; }
:root[data-palette]:not([data-palette="meadow"]) .card { --card-ink:var(--fill-ink); --card-tile:var(--fill-tile); background:var(--fill-bg); border-color:var(--fill-line); }
:root[data-palette]:not([data-palette="meadow"]) .quiz-card { --card-ink:var(--quiz-ink); --card-tile:var(--quiz-tile); background:var(--quiz-bg); border-color:var(--quiz-line); }
:root[data-palette]:not([data-palette="meadow"]) .game-quiz { --tile:var(--quiz-bg); --exact:var(--quiz-ink); --near:var(--quiz-ink); --line:var(--quiz-line); }
:root[data-palette]:not([data-palette="meadow"]) a:focus-visible,:root[data-palette]:not([data-palette="meadow"]) button:focus-visible { outline-color:var(--accent); }
/* A restrained, shared palette for both daily games. */
:root[data-palette="cobalt"] { --bg:#faf9f6; --surface:#ffffff; --ink:#202124; --muted:#64666d; --line:#dededb; --tile:#e8e9ec; --accent:#244ed8; --hit:#244ed8; --exact:#244ed8; --near:#244ed8; --fill-bg:#ffffff; --fill-ink:#202124; --fill-line:#dededb; --fill-tile:#dce3fb; --quiz-bg:#ffffff; --quiz-ink:#202124; --quiz-line:#dededb; --quiz-tile:#dce3fb; }
:root[data-palette="cobalt"] .card .btn { background:var(--accent); }
:root[data-palette="cobalt"] .preview-panel { background:#f4f5f8; border-color:#e8e9ef; }
:root[data-palette="cobalt"] .tag { color:#244ed8; border-color:#d2dafa; background:#eef2ff; }
:root[data-palette="cobalt"] .game-quiz { --exact:#244ed8; --near:#244ed8; --tile:#e8e9ec; }
:root[data-palette="cobalt"] .dots i { border-color:#bcc9f1; }
:root[data-palette="cobalt"] .primary { background:#244ed8; color:#fff; }

/* Brighter directions: purple, teal and yellow, with readable dark ink. */
:root[data-palette="electric"],:root[data-palette="sunshine"],:root[data-palette="lagoon"],:root[data-palette="festival"],:root[data-palette="midnight"] {
  --bg:#faf9ff; --surface:#ffffff; --ink:#242343; --muted:#64617a; --line:#dedcec; --tile:#e8e5f5;
  --accent:#5549db; --hit:#5549db; --exact:#087b6b; --near:#087b6b; --miss:#b53c42;
  --fill-bg:#64dec7; --fill-ink:#123e3c; --fill-line:#38c8ad; --fill-tile:#26b79d;
  --quiz-bg:#ffdf70; --quiz-ink:#493613; --quiz-line:#edc94e; --quiz-tile:#dfb735;
  --button-bg:#4438bd; --button-ink:#ffffff; --hero-accent:#635bff;
}
:root[data-palette="sunshine"] { --bg:#fffdf4; --fill-bg:#ffda58; --fill-ink:#483412; --fill-line:#e8bd33; --fill-tile:#dab032; --quiz-bg:#d9d4ff; --quiz-ink:#30246c; --quiz-line:#bcb3fa; --quiz-tile:#a89bec; --hero-accent:#ca9400; }
:root[data-palette="lagoon"] { --bg:#f3fffc; --accent:#087b6b; --hit:#087b6b; --fill-bg:#43cdb2; --fill-ink:#103e36; --fill-line:#20b79b; --fill-tile:#15947e; --quiz-bg:#f7ed83; --quiz-ink:#413b14; --quiz-line:#ddd15c; --quiz-tile:#c6b83d; --button-bg:#075e52; --hero-accent:#087b6b; }
:root[data-palette="festival"] { --bg:#fff8fa; --fill-bg:#dcd5ff; --fill-ink:#382576; --fill-line:#bfb1f5; --fill-tile:#ac98ee; --quiz-bg:#ffaaa0; --quiz-ink:#59292d; --quiz-line:#ef8c81; --quiz-tile:#e5786e; --hero-accent:#635bff; }
:root[data-palette="midnight"] { --bg:#17172d; --surface:#24243f; --ink:#f7f5ff; --muted:#c0bcd5; --line:#41405d; --tile:#3b3a57; --accent:#a59dff; --hit:#7165d9; --fill-bg:#66e3c1; --fill-ink:#143e35; --fill-line:#40caa5; --fill-tile:#28b78f; --quiz-bg:#ffe56b; --quiz-ink:#463815; --quiz-line:#dcc24c; --quiz-tile:#d2b83c; --button-bg:#3e329e; --hero-accent:#aaa2ff; --off:#49485f; --off-ink:#e6e3f4; }
:root:is([data-palette="electric"],[data-palette="sunshine"],[data-palette="lagoon"],[data-palette="festival"],[data-palette="midnight"]) .card .btn { background:var(--button-bg); color:var(--button-ink); }
:root:is([data-palette="electric"],[data-palette="sunshine"],[data-palette="lagoon"],[data-palette="festival"],[data-palette="midnight"]) .hero h1 em { color:var(--hero-accent); }
:root:is([data-palette="electric"],[data-palette="sunshine"],[data-palette="lagoon"],[data-palette="festival"],[data-palette="midnight"]) .hero::after { content:""; display:block; width:74px; height:6px; margin:26px auto 0; border-radius:10px; background:linear-gradient(90deg,#635bff 0% 33%,#17b89d 33% 66%,#ffd447 66%); }
:root:is([data-palette="electric"],[data-palette="sunshine"],[data-palette="lagoon"],[data-palette="festival"],[data-palette="midnight"]) .game-quiz { --tile:var(--quiz-bg); --exact:#087b6b; --exact-ink:#ffffff; --near:#087b6b; --line:var(--quiz-line); --off:#d7d4e3; --off-ink:#413d55; }
:root:is([data-palette="electric"],[data-palette="sunshine"],[data-palette="lagoon"],[data-palette="festival"],[data-palette="midnight"]) .dots i { border-color:var(--quiz-ink); }
:root[data-palette="midnight"] .game-quiz { --near:#54d7ba; --off:#49485f; --off-ink:#eeeafa; }
/* Playroom: saturated colour blocks and graphic shapes, inspired by the reference. */
:root[data-palette="playroom"] {
  --bg:#ffffff; --surface:#ffffff; --ink:#111111; --muted:#545454; --line:#cececa; --tile:#e0e0dc;
  --accent:#165cc5; --hit:#176533; --hit-ink:#ffffff; --exact:#176533; --exact-ink:#ffffff; --near:#176533;
  --miss:#bd3818; --off:#d4d4d0; --off-ink:#333333;
  --fill-bg:#ffe32b; --fill-ink:#111111; --fill-line:#111111; --fill-tile:#d7b900;
  --quiz-bg:#ffb59c; --quiz-ink:#111111; --quiz-line:#111111; --quiz-tile:#e98160;
}
:root[data-palette="playroom"] .brand { color:#111; font-size:2.2rem; }
:root[data-palette="playroom"] .brand span { color:#111; }
:root[data-palette="playroom"] .hero { position:relative; isolation:isolate; padding:62px 0 48px; }
:root[data-palette="playroom"] .hero h1 { position:relative; z-index:1; font-size:clamp(3.4rem,7.5vw,6rem); letter-spacing:-.07em; }
:root[data-palette="playroom"] .hero h1 em { font-family:inherit; font-style:normal; font-weight:800; color:#111; background:#ffe32b; padding:0 .1em; display:inline-block; transform:rotate(-4deg); }
:root[data-palette="playroom"] .hero::before { content:""; position:absolute; z-index:-1; width:112px; height:112px; border:32px solid #4dcb48; border-left-color:transparent; border-bottom-color:transparent; border-radius:50%; left:0; top:68px; transform:rotate(25deg); }
:root[data-palette="playroom"] .hero::after { content:""; position:absolute; z-index:-1; width:72px; height:72px; border-radius:50%; background:#ff8427; right:18px; top:168px; }
:root[data-palette="playroom"] .eyebrow { color:#111; letter-spacing:.14em; }
:root[data-palette="playroom"] .card { border:2px solid #111; border-radius:16px; box-shadow:5px 5px 0 #111; }
:root[data-palette="playroom"] .card h2 { font-size:2.4rem; }
:root[data-palette="playroom"] .card .btn { background:#111; color:white; border:2px solid #111; border-radius:8px; }
:root[data-palette="playroom"] .card .btn:hover { background:#fff; color:#111; box-shadow:3px 3px 0 #111; }
:root[data-palette="playroom"] .preview-panel { background:#ffffff80; border:1px solid #1113; }
:root[data-palette="playroom"] .dots i { background:#111; border-color:#111; }
:root[data-palette="playroom"] .tag { border-color:#111; background:#fff6; }
:root[data-palette="playroom"] .how .n { background:#65b5f6; color:#111; border-radius:50%; display:inline-grid; place-items:center; width:25px; height:25px; }
:root[data-palette="playroom"] .game-quiz { --tile:#cce6ff; --exact:#176533; --near:#176533; --line:#b5c7d8; }
:root[data-palette="playroom"] .game-intro h1 { display:inline-block; background:#ffe32b; padding:4px 10px; transform:rotate(-2deg); }
:root[data-palette="playroom"] .game-quiz .game-intro h1 { background:#ffb59c; }
:root[data-palette="playroom"] .board,
:root[data-palette="playroom"] .game-quiz .grid { border:2px solid #111; box-shadow:4px 4px 0 #399af0; }
:root[data-palette="playroom"] .ch.hid { background:#ffe32b; border-bottom-color:#111; }
:root[data-palette="playroom"] .primary { background:#ffe32b; color:#111; border:2px solid #111; box-shadow:3px 3px 0 #111; }
:root[data-palette="playroom"] .key { border:1px solid #1112; border-bottom:3px solid #1115; }
:root[data-palette="playroom"] .key.wide { background:#399af0; color:#111; }
:root[data-palette="playroom"] .sheet { border:2px solid #111; box-shadow:6px 6px 0 #399af0; }
@media(max-width:640px) { :root[data-palette="playroom"] .hero::before { width:52px; height:52px; border-width:16px; left:-8px; top:42px; opacity:.75; } :root[data-palette="playroom"] .hero::after { width:34px; height:34px; right:0; top:225px; } :root[data-palette="playroom"] .hero { padding:48px 0 36px; } :root[data-palette="playroom"] .card h2 { font-size:2.1rem; } }
/* Keyboard caps: cream letters, blue correct guesses, yellow Quiz action keys. */
:root[data-palette] .game-fill .key,
:root[data-palette] .game-quiz .key {
  border:1px solid #111111;
  box-shadow:2px 3px 0 #111111;
}
:root[data-palette] .game-fill .key:not(.hit):not(.miss):not(.wide),
:root[data-palette] .game-quiz .key:not(.exact):not(.near):not(.off):not(.wide),
:root[data-palette] .game-fill .key.wide {
  background:#fff3d6; color:#111111;
}
:root[data-palette] .game-fill .key.hit,
:root[data-palette] .game-quiz .key.exact {
  background:#01a4ff; color:#111111;
}
:root[data-palette] .game-quiz .key.wide {
  background:#ffe32b; color:#111111;
}
:root[data-palette] .game-quiz .key.near { box-shadow:inset 0 0 0 3px var(--near),2px 3px 0 #111111; }
:root[data-palette] .key:active:not(:disabled) { transform:translate(1px,2px); box-shadow:1px 1px 0 #111111; }
/* Light teal answer spaces stay distinct from the peach Quiz heading. */
:root[data-palette] .game-quiz .grid .cell:not(.exact):not(.near):not(.off) {
  background:#c6eee7;
}
/* Quiz shares Fill's yellow puzzle palette. */
:root[data-palette="playroom"] .game-quiz .game-intro h1 { background:#ffe32b; }
:root[data-palette] .game-quiz .grid .cell:not(.exact):not(.near):not(.off) {
  background:#ffe32b;
}
/* Selected blank and Quiz feedback share the brighter keyboard palette. */
:root[data-palette] .game-fill .ch.selected-cell { outline:3px solid #01a4ff; outline-offset:2px; background:#d9eeff; }
.game-fill .ch[role="button"] { cursor:pointer; }
:root[data-palette] .game-quiz .cell.exact { background:#01a4ff; color:#111; }
:root[data-palette] .game-quiz .cell.off,
:root[data-palette] .game-quiz .key.off { background:#7c8287; color:#111111; opacity:1; }
:root[data-palette] .game-quiz .cell.near { background:#fff; border-color:#01a4ff; color:#155e9c; }
:root[data-palette] .game-quiz .key.near { background:#fff3d6; color:#155e9c; box-shadow:inset 0 0 0 3px #01a4ff,2px 3px 0 #111; }
/* Empty guesses are outlined; typed characters use golden yellow. */
:root[data-palette] .game-quiz .grid .cell:not(.exact):not(.near):not(.off) {
  background:#ffffff; border:2px solid #111111; color:#111111;
}
:root[data-palette] .game-quiz .grid .cell.typed:not(.exact):not(.near):not(.off) {
  background:#e2c65b; border:2px solid #111111; color:#111111;
}

/* Neutral grey for absent characters, including the legend sample. */
:root[data-palette] .game-quiz .cell.off,
:root[data-palette] .game-quiz .key.off { background:#7c8287; color:#111111; }
