/* Daily Word Hints: cinematic, playful, readable. Tokens first. */
:root {
  --bg: #fbf8f3; --bg2: #ffffff; --ink: #1b1d2a; --muted: #5d6275; --line: #e6e0d6;
  --brand: #ff6b4a; --brand2: #7c5cff; --gold: #ffb627; --mint: #20c997; --sky: #3aa0ff;
  --card: #ffffff; --shadow: 0 10px 30px rgba(27, 29, 42, .10); --radius: 18px;
  --display: "Fraunces", Georgia, serif; --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1020; --bg2: #151830; --ink: #eef0ff; --muted: #a6abc6; --line: #262a48; --card: #171a33; --shadow: 0 12px 34px rgba(0, 0, 0, .45); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.65 var(--sans); }
a { color: var(--brand2); text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
h1, h2 { font-family: var(--display); line-height: 1.15; letter-spacing: -.01em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin: 2rem 0 .75rem; }
.small { font-size: .875rem; color: var(--muted); }

/* header */
.top { position: absolute; inset: 0 0 auto; z-index: 5; }
.top .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font: 800 1.15rem var(--display); }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--gold)); color: #fff; font: 800 1.1rem var(--display); box-shadow: 0 4px 14px rgba(255, 107, 74, .5); transform: rotate(-6deg); }
.games { display: flex; flex-wrap: wrap; gap: .25rem; }
.games a { color: #fff; text-decoration: none; font-weight: 500; font-size: .92rem; padding: .3rem .7rem; border-radius: 999px; background: rgba(255, 255, 255, .12); backdrop-filter: blur(6px); transition: background .2s, transform .2s; }
.games a:hover { background: rgba(255, 255, 255, .28); transform: translateY(-1px); }

/* cinematic hero */
.hero { position: relative; isolation: isolate; color: #fff; min-height: clamp(380px, 62vh, 560px); display: grid; align-items: end; overflow: hidden;
  background: var(--hero) center 35% / cover no-repeat, #1b1d2a; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(10, 11, 26, .92) 0%, rgba(10, 11, 26, .72) 42%, rgba(10, 11, 26, .25) 100%),
              linear-gradient(0deg, var(--bg) 0%, rgba(14, 16, 32, 0) 34%); }
.hero-glow { position: absolute; inset: -20%; z-index: -1; pointer-events: none;
  background: radial-gradient(35% 40% at 20% 30%, rgba(124, 92, 255, .45), transparent 70%), radial-gradient(30% 35% at 80% 70%, rgba(255, 107, 74, .35), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate; mix-blend-mode: screen; }
@keyframes drift { to { transform: translate3d(6%, -4%, 0) scale(1.08); } }
.hero-in { padding: 120px 0 56px; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 4rem); font-weight: 800; margin: .35rem 0 .6rem; max-width: 18ch; text-shadow: 0 4px 30px rgba(0, 0, 0, .45); }
.hero-sub { font-size: clamp(1rem, 2vw, 1.2rem); max-width: 46ch; margin: 0; color: rgba(255, 255, 255, .9); }
.hero .crumbs, .hero .crumbs a { color: rgba(255, 255, 255, .78); font-size: .88rem; }
.hero-tiles { display: flex; gap: 8px; margin-bottom: .4rem; }
.hero-tiles span { display: grid; place-items: center; width: clamp(38px, 6vw, 52px); aspect-ratio: 1; border-radius: 10px; font: 800 clamp(1.1rem, 2.6vw, 1.6rem) var(--sans); color: #fff;
  background: linear-gradient(160deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .06)); border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(8px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .3); animation: pop .7s cubic-bezier(.2, 1.4, .4, 1) both, bob 4s ease-in-out infinite; animation-delay: calc(var(--i) * .12s), calc(var(--i) * .3s + .8s); }
.hero-tiles span:nth-child(2) { background: linear-gradient(160deg, var(--gold), #ff8f1f); border-color: transparent; }
.hero-tiles span:nth-child(4) { background: linear-gradient(160deg, var(--mint), #0e9f78); border-color: transparent; }
@keyframes pop { from { opacity: 0; transform: translateY(18px) rotateX(70deg); } }
@keyframes bob { 50% { transform: translateY(-5px); } }

/* content */
.content { padding: 8px 0 48px; }
.lede { font-size: 1.12rem; max-width: 62ch; }
.updated { display: inline-block; margin: 0 0 1rem; padding: .35rem .8rem; border-radius: 999px; background: color-mix(in srgb, var(--mint) 16%, transparent); color: var(--ink); font-size: .9rem; font-weight: 500; }
.prose { max-width: 70ch; }

/* hint cards */
.hints { display: grid; gap: 12px; margin: 1.2rem 0 1.8rem; }
.hint { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.hint:hover { transform: translateY(-2px); }
.hint summary { cursor: pointer; list-style: none; padding: 16px 52px 16px 20px; font-weight: 700; position: relative; }
.hint summary::-webkit-details-marker { display: none; }
.hint summary::after { content: "+"; position: absolute; right: 16px; top: 50%; translate: 0 -50%; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand2), var(--sky)); color: #fff; font-weight: 800; transition: rotate .25s; }
.hint[open] summary::after { rotate: 45deg; }
.hint[open] { border-color: color-mix(in srgb, var(--brand2) 45%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand2) 14%, transparent), var(--shadow); }
.hint-body { padding: 0 20px 18px; animation: reveal .35s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } }
.hint.answer summary { background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 18%, transparent), transparent); }
.hint.answer summary::after { background: linear-gradient(135deg, var(--brand), var(--gold)); }
.pattern, .big { font: 800 1.6rem/1.3 var(--sans); letter-spacing: .12em; }

/* answer tiles flip in */
.tiles { display: flex; gap: 8px; flex-wrap: wrap; margin: .4rem 0 .8rem; }
.tile { display: grid; place-items: center; width: 56px; aspect-ratio: 1; border-radius: 10px; font: 800 1.7rem var(--sans); color: #fff;
  background: linear-gradient(160deg, var(--mint), #0e9f78); box-shadow: 0 6px 16px rgba(14, 159, 120, .35); }
.hint[open] .tile { animation: flip .6s cubic-bezier(.3, 1.4, .5, 1) both; }
.hint[open] .tile:nth-child(2) { animation-delay: .12s; } .hint[open] .tile:nth-child(3) { animation-delay: .24s; }
.hint[open] .tile:nth-child(4) { animation-delay: .36s; } .hint[open] .tile:nth-child(5) { animation-delay: .48s; }
@keyframes flip { from { transform: rotateX(90deg); opacity: 0; } }

/* connections groups */
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.yellow { --c: #f7c948; } .green { --c: #6bd18e; } .blue { --c: #6aa9ff; } .purple { --c: #b58cff; }
.dot { background: var(--c); }
.group { background: color-mix(in srgb, var(--c) 30%, var(--card)); border-radius: 14px; padding: 10px 14px; margin: 8px 0; }
.group p { margin: 0; } .gtitle { font-weight: 800; }

/* spelling bee */
.bee { display: flex; gap: 8px; flex-wrap: wrap; margin: .5rem 0; }
.cell { display: grid; place-items: center; width: 52px; aspect-ratio: 1.15; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: color-mix(in srgb, var(--ink) 9%, var(--card)); font: 800 1.35rem var(--sans); }
.cell.center { background: linear-gradient(160deg, var(--gold), #ff9f1c); color: #1b1d2a; }
.stats { font-weight: 700; color: var(--muted); }
.letter { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--gold); color: #1b1d2a; font-weight: 800; margin-right: 6px; }

/* tables */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.grid th, .grid td, .list th, .list td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.list td:first-child, .list th:first-child { text-align: left; }
table.pips td { width: 44px; height: 44px; text-align: center; font: 800 1.2rem var(--sans); border: 2px solid var(--line); background: var(--card); }
table.pips td.off { border: 0; background: transparent; }
.level { margin-top: 1.4rem; }

/* home cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin: 1rem 0 2rem; }
.card { position: relative; isolation: isolate; display: grid; align-content: end; min-height: 190px; padding: 16px; border-radius: var(--radius); overflow: hidden; color: #fff; text-decoration: none;
  background: var(--img) center / cover, #2b2e4a; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; }
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(10, 11, 26, .88), rgba(10, 11, 26, .15) 70%); }
.card:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 18px 40px rgba(27, 29, 42, .28); }
.cname { font: 800 1.5rem var(--display); }
.cdate { font-size: .9rem; opacity: .85; }
.cgo { margin-top: .4rem; font-weight: 700; color: var(--gold); }

.play a { display: inline-block; margin: .5rem 0 1rem; padding: .7rem 1.2rem; border-radius: 999px; background: linear-gradient(135deg, var(--brand), var(--gold)); color: #1b1d2a; font-weight: 800; text-decoration: none; box-shadow: 0 8px 20px rgba(255, 107, 74, .35); transition: transform .2s; }
.play a:hover { transform: translateY(-2px); }
.facts, .recent, .more, .about { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px 14px; margin: 1.2rem 0; }
.archive { columns: 2 220px; padding-left: 1.1rem; }

.foot { background: #0b0c1a; color: #c9cce0; padding: 28px 0; margin-top: 24px; }
.foot a { color: #fff; }
.foot .small { color: #9aa0bf; }

@media (max-width: 560px) {
  .top .wrap { justify-content: center; }
  .games a { font-size: .82rem; padding: .25rem .55rem; }
  .hero-in { padding-top: 150px; }
  .tile { width: 48px; font-size: 1.45rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- v2: deep content, light up top ---- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: .2rem 0 1rem; }
.chips a { padding: .35rem .9rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: .9rem; box-shadow: var(--shadow); transition: transform .2s; }
.chips a:hover { transform: translateY(-2px); border-color: var(--brand2); }
.diff { margin: .2rem 0 1rem; color: var(--muted); }
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-weight: 800; font-size: .85rem; color: #1b1d2a; margin-right: .3rem; }
.badge.easy { background: #7fe0b0; } .badge.medium { background: #ffd36b; } .badge.hard { background: #ff9f7a; } .badge.very-hard { background: #ff7aa8; }
.ahead { margin: -.4rem 0 1rem; font-size: .92rem; }
.deep { margin: 2.2rem 0 1rem; padding-top: .4rem; border-top: 2px dashed var(--line); }
.deep h3 { font-size: 1.05rem; margin: 1rem 0 .4rem; }
.dd { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; margin: 10px 0; }
.dd summary { cursor: pointer; padding: 14px 18px; font-weight: 700; list-style: none; position: relative; padding-right: 44px; }
.dd summary::-webkit-details-marker { display: none; }
.dd summary::after { content: "▾"; position: absolute; right: 18px; top: 50%; translate: 0 -50%; color: var(--brand2); transition: rotate .2s; }
.dd[open] summary::after { rotate: 180deg; }
.dd-body { padding: 0 18px 14px; }
.starters { display: grid; gap: 8px; }
.starter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row { display: inline-flex; gap: 4px; }
.sq { display: grid; place-items: center; width: 34px; aspect-ratio: 1; border-radius: 6px; font-weight: 800; color: #fff; background: #787c8e; }
.sq.g { background: #20a96d; } .sq.y { background: #e0a91c; }
.sc { color: var(--muted); font-size: .92rem; }
.funnel { padding-left: 1.2rem; } .funnel li { margin: .2rem 0; }
.cols { columns: 2 200px; }
.defs li { margin: .25rem 0; }
.cboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: .4rem 0 1.2rem; max-width: 640px; }
.cboard span { display: grid; place-items: center; text-align: center; min-height: 58px; padding: 6px; border-radius: 10px; font: 800 clamp(.62rem, 2.4vw, .9rem)/1.15 var(--sans);
  background: color-mix(in srgb, var(--ink) 8%, var(--card)); border: 1px solid var(--line); text-transform: uppercase; word-break: break-word; }
.sboard { display: grid; grid-template-columns: repeat(6, 42px); gap: 6px; margin: .4rem 0 1.2rem; }
.sboard span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; font-weight: 800; background: color-mix(in srgb, var(--ink) 8%, var(--card)); }
.sboard.solved span.t { background: #6bd18e; color: #10291a; } .sboard.solved span.s { background: var(--gold); color: #1b1d2a; }
table.pipsb { border-collapse: separate; border-spacing: 3px; margin: .4rem 0 .6rem; }
table.pipsb td { width: 46px; height: 46px; border-radius: 8px; background: var(--rc, color-mix(in srgb, var(--ink) 7%, var(--card))); position: relative; text-align: center; vertical-align: middle; }
table.pipsb td.off { background: transparent; }
table.pipsb td i { position: absolute; top: 2px; left: 4px; font: 800 .7rem var(--sans); font-style: normal; color: #1b1d2a; }
table.pipsb td b { font: 800 1.25rem var(--sans); color: #1b1d2a; }
.doms { display: flex; flex-wrap: wrap; gap: 6px; margin: .2rem 0 .8rem; }
.dom { display: inline-flex; border-radius: 7px; overflow: hidden; border: 2px solid var(--ink); }
.dom b { display: grid; place-items: center; width: 26px; height: 26px; background: var(--card); font-weight: 800; }
.dom b + b { border-left: 2px solid var(--ink); }
.wordgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; padding: 0; list-style: none; }
.wordgrid li { padding: 6px; border-radius: 8px; text-align: center; font-weight: 700; letter-spacing: .06em; background: var(--bg2); border: 1px solid var(--line); }
.lchips { display: flex; flex-wrap: wrap; gap: 6px; }
.lchip { display: inline-flex; gap: 6px; align-items: center; padding: .3rem .7rem; border-radius: 10px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 800; }
.lchip span { color: var(--muted); font-weight: 500; font-size: .85rem; }
.faq { margin-top: 2rem; }
@media (max-width: 560px) { .sboard { grid-template-columns: repeat(6, 1fr); } table.pipsb td { width: 38px; height: 38px; } }

/* ---- v3: AI intro and riddle ---- */
.intro { font-size: 1.05rem; color: var(--muted); border-left: 4px solid var(--gold); padding: .2rem 0 .2rem .9rem; margin: -.2rem 0 1rem; max-width: 62ch; }
.riddle { font: 600 1.25rem/1.4 var(--display); font-style: italic; }
