/* Five Daily - shared styles. Mobile first, light/dark from the OS. */
:root {
  --bg: #fbf8f3; --card: #ffffff; --ink: #1d1a16; --muted: #6b6359; --line: #e6dfd4;
  --accent: #e8590c; --accent-ink: #ffffff; --good: #2f9e44; --close: #f08c00; --bad: #c92a2a; --tint: #fff1e6;
  --radius: 14px; --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 16px rgb(0 0 0 / 5%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #15130f; --card: #1f1c17; --ink: #f3eee6; --muted: #a39a8e; --line: #34302a; --tint: #2b2118;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%); }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* a component's display rule must never un-hide it */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: var(--accent); }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 48px; }
header.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; max-width: 640px; margin: 0 auto; }
.logo { font-weight: 800; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); font-size: 1.15rem; }
.logo b { color: var(--accent); }
nav.top a { margin-left: 14px; color: var(--muted); text-decoration: none; font-size: .95rem; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 8px 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 1.1rem; margin: 28px 0 10px; }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.btn { appearance: none; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 1rem var(--font);
  padding: 11px 20px; cursor: pointer; min-height: 44px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#modes { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 6px 0 18px; font-size: .92rem; }
#modes a { color: var(--muted); }
.pill { background: var(--tint); color: var(--accent); border-radius: 999px; padding: 3px 10px; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.tile:hover { border-color: var(--accent); }
.tile-emoji { font-size: 1.6rem; }
.tile .muted { font-size: .88rem; }
.board { padding-left: 1.4em; margin: 0; }
.board li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.board li > span:first-child { font-weight: 600; }
.board .score { float: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.nameform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.nameform label { width: 100%; font-weight: 600; }
.nameform input { flex: 1; min-width: 0; font: 1rem var(--font); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); min-height: 44px; }
.result { text-align: center; }
.result .big { font-size: 2.2rem; font-weight: 800; }
.statrow { display: flex; justify-content: center; gap: 22px; margin: 10px 0 14px; }
.statrow div { display: flex; flex-direction: column; align-items: center; font-size: .82rem; color: var(--muted); }
.statrow b { font-size: 1.4rem; color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; opacity: 0; transition: .2s; pointer-events: none; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.ad-slot { display: none; }
.ads-on .ad-slot { display: block; min-height: 100px; margin: 20px 0; }
footer.bottom { max-width: 640px; margin: 0 auto; padding: 24px 16px 40px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); }
footer.bottom a { color: var(--muted); margin-right: 14px; }
.howto { font-size: .95rem; color: var(--muted); margin: 0 0 14px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
