:root {
  --bg: #fbf7f2;
  --card: #ffffff;
  --ink: #16120f;
  --muted: #6f6660;
  --line: #ece4db;
  --accent: #ff4d2e;
  --accent-ink: #ffffff;
  --accent-soft: #ffe4dc;
  --sun: #ffb020;
  --shadow: 0 1px 2px rgba(22, 18, 15, .06), 0 8px 24px rgba(22, 18, 15, .06);
  --radius: 18px;
  --t-local: #ffe4dc; --t-nation: #dfe9ff; --t-sports: #dcf5e4; --t-fun: #efe3ff; --t-wx: #fff1cc;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121012; --card: #1c191b; --ink: #f5efe9; --muted: #a79d96; --line: #2d282b;
    --accent-soft: #3a1d17; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --t-local: #3a1d17; --t-nation: #1a2440; --t-sports: #16301f; --t-fun: #2a1d3d; --t-wx: #3a2e12;
  }
}
:root[data-theme="dark"] {
  --bg: #121012; --card: #1c191b; --ink: #f5efe9; --muted: #a79d96; --line: #2d282b;
  --accent-soft: #3a1d17; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --t-local: #3a1d17; --t-nation: #1a2440; --t-sports: #16301f; --t-fun: #2a1d3d; --t-wx: #3a2e12;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---- top bar ---- */
.bar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent);
  color: var(--accent-ink); font: 800 18px/1 var(--display); transform: rotate(-6deg); }
.logo-word { font: 800 22px/1 var(--display); letter-spacing: -.02em; }
.chips { display: flex; gap: 8px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 60vw; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 14px/1 var(--body); white-space: nowrap; }
.chip span { overflow: hidden; text-overflow: ellipsis; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--accent); }
.chip svg { width: 16px; height: 16px; fill: var(--accent); flex: none; }
.chip-wx { background: var(--accent-soft); border-color: transparent; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 1; }
@media (max-width: 420px) { .chip-wx { display: none; } }

/* ---- greeting ---- */
.hello { padding: 28px 0 8px; }
.date { margin: 0 0 4px; color: var(--muted); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
h1 { margin: 0; font: 800 clamp(30px, 6vw, 48px)/1.05 var(--display); letter-spacing: -.03em; }
h1 em { font-style: normal; color: var(--accent); }

/* ---- top: lead story + weather ---- */
.top { display: grid; gap: 16px; margin: 18px 0 8px; }
@media (min-width: 900px) { .top { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); align-items: start; } .top.solo { grid-template-columns: 1fr; } }
.lead { display: flex; flex-direction: column; overflow: hidden; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; min-width: 0; }
.lead .ph { aspect-ratio: 16 / 9; background: var(--line); overflow: hidden; }
.lead .ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.lead:hover .ph img { transform: scale(1.03); }
.lead .tb { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.lead h2 { margin: 0; font: 800 clamp(22px, 3.4vw, 32px)/1.12 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.lead p { margin: 0; color: var(--muted); }
.kicker { color: var(--accent); font: 700 12px/1 var(--body); text-transform: uppercase; letter-spacing: .08em; }

.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.wxhero { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; padding: 22px; border-radius: var(--radius);
  color: #1b120c; background: linear-gradient(150deg, #ffe08a 0%, #ffab5e 50%, #ff6a3d 100%); box-shadow: var(--shadow); min-width: 0; border: 0; text-align: left; }
.wxhero.night { color: #f3f0ff; background: linear-gradient(150deg, #23275e 0%, #46368a 55%, #8a4fb0 100%); }
.wx-main { display: flex; align-items: center; gap: 16px; }
.wx-ico { font-size: 64px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .15)); }
.wx-temp { font: 800 64px/1 var(--display); letter-spacing: -.04em; }
.wx-desc { font: 800 20px/1.2 var(--display); }
.wx-sub { opacity: .8; font-size: 14px; }
.wx-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(74px, 1fr); gap: 8px; overflow-x: auto; scrollbar-width: none; }
.wx-strip::-webkit-scrollbar { display: none; }
.wx-strip div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; background: rgba(255, 255, 255, .28); text-align: center; }
.wxhero.night .wx-strip div { background: rgba(255, 255, 255, .1); }
.wx-strip small { font-size: 12px; font-weight: 600; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wx-strip span { font-size: 24px; line-height: 1; }
.wx-strip b { font: 800 17px/1 var(--display); }
.empty-wx { flex-direction: row; align-items: center; cursor: pointer; font: inherit; }
.empty-wx b { display: block; font: 800 22px/1.2 var(--display); }
.empty-wx small { display: block; opacity: .8; font-size: 15px; margin-top: 4px; }

/* ---- filter chips (sticky under the bar) ---- */
.filters { position: sticky; top: 60px; z-index: 4; margin: 0 -16px; padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.filters-in { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.filters-in::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 600 15px/1 var(--body); cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s; }
.tab:hover { transform: translateY(-1px); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-score { background: var(--t-fun); border-color: transparent; }

/* ---- the board ---- */
.board { display: flex; gap: 16px; align-items: flex-start; padding-top: 8px; min-height: 60vh; }
.col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.tile { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; min-width: 0; overflow: hidden;
  animation: pop .35s ease-out both; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
a.tile { transition: transform .15s, border-color .15s; }
a.tile:hover { transform: translateY(-3px) rotate(-.3deg); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.tile a { color: inherit; }
.tile h3 { margin: 0; font: 700 18px/1.28 var(--display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.tile p { margin: 0; color: var(--muted); font-size: 15px; }
.pill { align-self: flex-start; max-width: 100%; padding: 5px 10px; border-radius: 999px; background: var(--bg); font: 700 12px/1.2 var(--body);
  letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta b { color: var(--ink); font-weight: 600; }
.credit { color: var(--muted); font-size: 12px; }
.credit a { text-decoration: underline; text-decoration-color: var(--line); }

.ph { display: block; background: var(--line); overflow: hidden; }
.ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile.photo { padding: 0; gap: 0; }
.tile.photo .ph { aspect-ratio: 16 / 10; }
.tile .tb { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tile.photo .tb, .tile.otd .tb, .tile.pic .tb, .tile.feat .tb { padding: 14px 16px 16px; }

.tile.quote h3 { font-size: 21px; line-height: 1.22; }
.tile.quote.k-local { background: var(--t-local); border-color: transparent; }
.tile.quote.k-national { background: var(--t-nation); border-color: transparent; }
.tile.quote.k-sports { background: var(--t-sports); border-color: transparent; }
.tile.quote .pill { background: var(--card); }
.k-local .pill { color: var(--accent); }
.k-national .pill { color: #3563e9; }
.k-sports .pill { color: #138a4a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .k-national .pill { color: #8fb0ff; } :root:not([data-theme="light"]) .k-sports .pill { color: #6fdc9a; } }

/* fun */
.tile.fun { background: var(--t-fun); border-color: transparent; }
.tile.fun .pill { background: var(--card); color: #7b3fe4; }
.tile.otd, .tile.pic, .tile.feat { padding: 0; gap: 0; }
.tile.otd .ph, .tile.feat .ph { aspect-ratio: 16 / 9; }
.tile.otd .ph img { object-fit: contain; background: #fff; }
.tile.otd ul, .tile.dyk ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.tile.otd li a, .tile.dyk li a { text-decoration: none; display: block; font-size: 15px; line-height: 1.4; }
.tile.otd li a:hover, .tile.dyk li a:hover, .trend li a:hover b { text-decoration: underline; }
.tile.otd b { display: inline-block; margin-right: 4px; padding: 1px 7px; border-radius: 6px; background: #7b3fe4; color: #fff; font: 800 13px/1.5 var(--display); }
.tile.dyk li { padding-left: 14px; border-left: 3px solid #7b3fe4; }
.trend ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.trend li a { display: grid; grid-template-columns: 26px 44px minmax(0, 1fr); align-items: center; gap: 10px; text-decoration: none; }
.trend .rank { font: 800 22px/1 var(--display); color: #7b3fe4; text-align: center; }
.trend .tn { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--card); }
.trend b { display: block; font: 700 15px/1.25 var(--display); overflow-wrap: anywhere; }
.trend small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.pic .ph { aspect-ratio: 3 / 2; max-height: 520px; }
.tile.feat h3 a { text-decoration: none; }

.trivia { background: linear-gradient(160deg, #6d3ff0 0%, #a347d9 100%) !important; color: #fff; }
.trivia .pill { color: #6d3ff0 !important; background: #fff !important; }
.trivia h3 { font-size: 19px; }
.opts { display: grid; gap: 8px; }
.opt { padding: 11px 14px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); color: #fff;
  font: 600 15px/1.25 var(--body); text-align: left; cursor: pointer; transition: background .15s, transform .1s; }
.opt:hover:not(:disabled) { background: rgba(255, 255, 255, .25); }
.opt:active:not(:disabled) { transform: scale(.98); }
.opt:disabled { cursor: default; opacity: .6; }
.opt.right { background: #22c55e; border-color: #22c55e; opacity: 1; }
.opt.wrong { background: #ef4444; border-color: #ef4444; opacity: 1; animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.verdict { color: #fff !important; font: 800 17px/1.3 var(--display) !important; min-height: 0; }
.verdict:empty { display: none; }
.trivia .credit, .trivia .credit a { color: rgba(255, 255, 255, .75); }

/* weather tiles */
.wxcard { background: var(--t-wx); border-color: transparent; }
.wxcard .pill { background: var(--card); color: #b26a00; }
.wxcard ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.wxcard li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.wxcard .ci { font-size: 22px; text-align: center; }
.wxcard li span small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wxcard li b { font: 800 18px/1 var(--display); }
.moon { background: linear-gradient(160deg, #1c1f4a 0%, #3b2c6e 100%); color: #f1ecff; }
.moon .pill { color: #3b2c6e; }
.moon p { color: rgba(241, 236, 255, .8); }
.moon-row { display: flex; align-items: center; gap: 16px; }
.moon-ico { font-size: 64px; line-height: 1; filter: drop-shadow(0 0 18px rgba(255, 245, 200, .45)); }

.tile.info { background: var(--ink); color: var(--bg); border-color: transparent; }
.tile.info p { color: color-mix(in srgb, var(--bg) 80%, transparent); }
.tile.info .credit, .tile.info .credit a { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.tile.info .pill { background: var(--accent); color: #fff; }

/* ---- loading more / the end ---- */
.more { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 0 60px; text-align: center; color: var(--muted); }
.more .btn-ghost { opacity: .7; }
.dots { display: flex; gap: 8px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: bounce 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; background: #7b3fe4; }
.dots i:nth-child(3) { animation-delay: .3s; background: #ffb020; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-10px); opacity: 1; } }
.more.end p { margin: 0; max-width: 460px; font-size: 16px; color: var(--ink); }

.to-top { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 6; width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: var(--accent); color: #fff; font: 800 22px/1 var(--display); box-shadow: 0 8px 24px rgba(0, 0, 0, .2); cursor: pointer; }

.skel { border-radius: var(--radius); background: linear-gradient(90deg, var(--line) 0%, var(--card) 50%, var(--line) 100%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel.tall { height: 300px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- picker ---- */
.picker { border: none; border-radius: 20px; padding: 24px; width: min(420px, calc(100vw - 32px)); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.picker::backdrop { background: rgba(0, 0, 0, .45); }
.picker h2 { margin: 0 0 6px; font: 800 24px/1.2 var(--display); }
.picker p { margin: 0 0 16px; color: var(--muted); }
.picker select { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 500 16px var(--body); }
.picker-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.btn, .btn-ghost { padding: 11px 18px; border-radius: 999px; font: 600 15px/1 var(--body); cursor: pointer; border: 1px solid var(--line); }
.btn { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); }

/* ---- footer ---- */
.foot { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
.foot p { margin: 0 0 6px; }
.foot .small { font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .skel, .tile, .dots i, .opt.wrong { animation: none; }
  a.tile, .tab, .lead .ph img { transition: none; }
}
