@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/generated/noto-sans-thai-thai.0558c7649eb1.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/generated/noto-sans-thai-latin.65739977a044.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --border: #d3d6da;
  --key: #e9ebee;
  --key-text: #1a1a2e;
  --correct: #6aaa64;
  --present: #c9b458;
  --absent: #787c7e;
  --primary: #6aaa64;
  --primary-d: #5a9456;
  --shadow: 0 4px 18px rgba(0,0,0,.08);
  --radius: 14px;
}
[data-theme="dark"] {
  --bg: #121213;
  --surface: #1e1e22;
  --text: #f2f2f5;
  --muted: #9aa0a6;
  --border: #3a3a3c;
  --key: #2b2b30;
  --key-text: #f2f2f5;
  --absent: #3a3a3c;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
/* กัน double-tap zoom ทั้งเว็บ (ทุก OS) แต่ยังเปิด pinch-zoom เพื่ออ่าน (accessibility);
   canvas เกม real-time ที่ตั้ง touch-action:none เองจะ override เฉพาะจุด */
html { touch-action: manipulation; }
body {
  font-family: 'Noto Sans Thai', 'Sarabun', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background .25s, color .25s;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand { font-size: 26px; font-weight: 800; letter-spacing: .5px; text-decoration: none; color: var(--text); }
.brand span { color: var(--correct); }

/* game switcher nav (on game pages) */
.game-switch { display: flex; gap: 6px; }
.game-switch a {
  text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap;
}
.game-switch a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .game-switch { order: 3; flex-basis: 100%; justify-content: center; }
  .brand { font-size: 22px; }
  .game-switch a { padding: 6px 12px; font-size: 13px; }
  /* declutter: the "all games" 🎮 button is redundant with the brand link → hide on phones */
  .top-right a.icon-btn[href="index.html"] { display: none; }
  .top-right { gap: 3px; }
  .coin-chip { padding: 5px 9px; }
}
.top-right { display: flex; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  border: none; background: transparent; color: var(--text);
  font-size: 19px; font-weight: 700; cursor: pointer;
  display: grid; place-items: center; transition: background .15s;
}
.icon-btn:hover { background: var(--key); }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 8px; justify-content: center;
  padding: 12px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.tab {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  padding: 9px 18px; border-radius: 999px; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

main { flex: 1; display: flex; flex-direction: column; align-items: center; width: 100%; }
/* Thai text has no word spaces, so flex items must be allowed to shrink below their
   min-content width, otherwise a long phrase widens the whole page past the viewport. */
main > * { min-width: 0; max-width: 100%; }
.game {
  display: none; flex-direction: column; align-items: center; width: 100%; max-width: 560px; padding: 14px;
  /* No accidental text-select / iOS long-press "copy" callout anywhere in the
     play area — a per-class allowlist (see .key/.icon-btn/... below) keeps
     missing new elements every time a game adds its own canvas/tile class
     (this is what let the callout cover snooker's canvas). user-select and
     -webkit-touch-callout inherit, so setting them here covers every current
     and future game's title/score/canvas/custom controls in one place. Inputs
     keep their own native text editing regardless of an ancestor's user-select. */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.game.active { display: flex; }
.game > * { min-width: 0; max-width: 100%; }
.game-sub { color: var(--muted); font-size: 15px; text-align: center; margin: 4px 0 14px; overflow-wrap: anywhere; }
.howto, .type-result, .passage, .hub-info, .hero p, .card p, .game-sub { overflow-wrap: anywhere; }

/* ---------- Wordle board ---------- */
.board { display: grid; grid-template-rows: repeat(6, 1fr); gap: 6px; margin-bottom: 6px; }
#board { min-height: 378px; }
#keyboard { min-height: 306px; }
.row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tile {
  width: 58px; height: 58px;
  border: 2px solid var(--border);
  display: grid; place-items: center;
  font-size: 26px; font-weight: 700; line-height: 1;
  border-radius: 8px; background: var(--surface);
  user-select: none; text-transform: none;
}
.tile.filled { border-color: var(--muted); animation: pop .1s ease; }
.tile.correct { background: var(--correct); border-color: var(--correct); color: #fff; }
.tile.present { background: var(--present); border-color: var(--present); color: #fff; }
.tile.absent  { background: var(--absent);  border-color: var(--absent);  color: #fff; }
.tile.reveal { animation: flip .5s ease forwards; }
.row.shake { animation: shake .5s; }
.row.win .tile { animation: bounce .6s; }

@keyframes pop { 0%{transform:scale(.9)} 100%{transform:scale(1)} }
@keyframes flip { 0%{transform:rotateX(0)} 50%{transform:rotateX(90deg)} 100%{transform:rotateX(0)} }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }
@keyframes bounce { 0%,100%{transform:translateY(0)} 30%{transform:translateY(-14px)} 50%{transform:translateY(4px)} }

/* ---------- Toast ---------- */
.toast {
  min-height: 0; position: relative; width: 100%; display: flex; justify-content: center;
}
.toast .bubble {
  position: absolute; top: 6px;
  background: var(--text); color: var(--bg);
  padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); animation: fadein .15s; z-index: 50; white-space: nowrap;
}
@keyframes fadein { from{opacity:0; transform:translateY(-6px)} to{opacity:1} }

/* ---------- Keyboard ---------- */
.keyboard { width: 100%; margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.kb-row { display: flex; gap: 4px; justify-content: center; }
.key {
  flex: 1; min-width: 0; height: 46px;
  border: none; border-radius: 6px;
  background: var(--key); color: var(--key-text);
  font-family: inherit; font-size: 17px; font-weight: 600;
  cursor: pointer; display: grid; place-items: center; padding: 0;
  transition: transform .05s, background .2s;
}
.key:active { transform: scale(.92); }
.key.wide { flex: 1.7; font-size: 13px; font-weight: 700; }
.key.correct { background: var(--correct); color: #fff; }
.key.present { background: var(--present); color: #fff; }
.key.absent  { background: var(--absent);  color: #fff; }

/* ---------- Typing ---------- */
.typing-controls { display: flex; gap: 10px; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--key); border-radius: 999px; padding: 3px; }
.seg-btn { border: none; background: transparent; color: var(--muted); padding: 6px 16px; border-radius: 999px; font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.ghost-btn { border: 1px solid var(--border); background: transparent; color: var(--text); padding: 8px 14px; border-radius: 10px; font-family: inherit; font-weight: 600; cursor: pointer; }

.type-stats, .stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 4px; text-align: center; }
.stat .num { display: block; font-size: 22px; font-weight: 800; color: var(--primary); }
.stat .lbl { font-size: 12px; color: var(--muted); }

.passage {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; font-size: 20px; line-height: 1.9;
  margin-bottom: 12px; min-height: 90px; word-break: break-word;
}
.passage .ch { transition: background .08s; border-radius: 3px; }
.passage .ch.correct { color: var(--correct); }
.passage .ch.wrong { color: #fff; background: #e06c5e; }
.passage .ch.current { background: rgba(106,170,100,.25); box-shadow: 0 2px 0 var(--primary); }
.passage .ch.space.wrong { background: #e06c5e; }

.type-input {
  width: 100%; background: var(--surface); color: var(--text);
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: 14px; font-family: inherit; font-size: 18px; line-height: 1.7; resize: none;
}
.type-input:focus { outline: none; border-color: var(--primary); }
.type-input:disabled { opacity: .6; }

.typing-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 14px; width: 100%; }
.type-result { font-weight: 700; text-align: center; color: var(--text); white-space: pre-line; }

.primary-btn { background: var(--primary); color: #fff; border: none; padding: 12px 28px; border-radius: 12px; font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer; transition: background .15s; }
.primary-btn:hover { background: var(--primary-d); }
.primary-btn.full { width: 100%; }

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,10,20,.62); display: none; z-index: 9995;
  -webkit-backdrop-filter: blur(6px) saturate(.9); backdrop-filter: blur(6px) saturate(.9);
}
.modal-backdrop.show { display: block; animation: bdfade .2s ease both; }
@keyframes bdfade { from { opacity: 0; } to { opacity: 1; } }
body.modal-open { overflow: hidden; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(.96);
  background: var(--surface); color: var(--text);
  border-radius: 18px; padding: 26px 22px; width: min(440px, 92vw);
  max-height: 86vh; overflow-y: auto; box-shadow: var(--shadow);
  display: none; z-index: 9996; opacity: 0; transition: opacity .15s, transform .15s;
}
.modal.show { display: block; opacity: 1; transform: translate(-50%,-50%) scale(1); animation: modalpop .26s cubic-bezier(.18,.9,.32,1.2) both; }
@keyframes modalpop { from { opacity: 0; transform: translate(-50%,-46%) scale(.9); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
.modal h2 { margin-bottom: 12px; font-size: 22px; }
.modal h3 { margin: 18px 0 8px; font-size: 17px; color: var(--primary); }
.modal p { color: var(--muted); line-height: 1.7; margin-bottom: 8px; }
.modal-close {
  position: absolute; top: 8px; right: 8px; width: 40px; height: 40px;
  background: none; border: none; font-size: 28px; color: var(--muted);
  cursor: pointer; line-height: 1; border-radius: 10px; display: grid; place-items: center;
  z-index: 2; transition: background .15s;
}
.modal-close:hover { background: var(--key); }
/* Full-width bottom close — primary way to dismiss tall modals on mobile,
   where the corner × scrolls out of view. */
.modal-close-btn {
  display: block; width: 100%; margin-top: 18px; padding: 13px;
  background: var(--key); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background .15s;
}
.modal-close-btn:hover { background: var(--border); }
.modal-close-btn:active { transform: translateY(1px); }
.legend { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.legend li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.ex { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; color: #fff; font-weight: 700; flex-shrink: 0; }
.ex.correct { background: var(--correct); } .ex.present { background: var(--present); } .ex.absent { background: var(--absent); }

.dist { display: flex; flex-direction: column; gap: 5px; }
.dist-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.dist-row .n { width: 14px; font-weight: 700; }
.dist-row .bar { background: var(--absent); color: #fff; padding: 3px 8px; border-radius: 4px; text-align: right; min-width: 26px; font-weight: 700; font-size: 13px; transition: width .4s; }
.dist-row .bar.hl { background: var(--correct); }

/* ---------- Hub / landing page ---------- */
.hub { width: 100%; max-width: 720px; padding: 14px 16px 30px; }
.hero { text-align: center; padding: 26px 10px 22px; }
.hero h1 { font-size: 34px; font-weight: 800; margin-bottom: 10px; }
.hero h1 span { color: var(--correct); }
.hero p { color: var(--muted); font-size: 16px; line-height: 1.7; max-width: 480px; margin: 0 auto; }
/* auto-fill (not auto-fit) so a single search result stays one column instead of stretching full-width */
/* Denser game-portal grid (thumbnail tiles, no description) like Poki/CrazyGames */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 8px; }
@media (min-width: 700px) { .game-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; } }
/* Wider hub on larger screens so the 50-game grid uses more columns */
@media (min-width: 900px) { .hub { max-width: 1100px; } .hero p { max-width: 850px; } }
.card {
  position: relative;
  display: flex; flex-direction: column; align-items: stretch; gap: 0;
  text-align: left; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card .new-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: var(--correct, #6aaa64); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .5px;
  padding: 3px 9px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.card:hover { transform: translateY(-4px); border-color: var(--primary); }
.card-thumb { display: block; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: var(--key); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .28s ease; }
.card:hover .card-thumb img { transform: scale(1.07); }
.card h2 { font-size: 16px; font-weight: 700; margin: 10px 12px 2px; line-height: 1.25; }
.card .tag { font-size: 12px; color: var(--muted); font-weight: 700; margin: 0 12px 12px; }
.hub-info { margin-top: 26px; color: var(--muted); line-height: 1.8; font-size: 14px; }
.hub-info h3 { color: var(--text); font-size: 17px; margin-bottom: 8px; }

/* compact inline help on game pages */
.howto {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 12px;
  color: var(--muted); font-size: 14.5px; line-height: 1.75;
}
.howto b { color: var(--text); }
.chip { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; color: #fff; font-weight: 700; font-size: 13px; vertical-align: middle; }
.chip.correct { background: var(--correct); } .chip.present { background: var(--present); } .chip.absent { background: var(--absent); }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 16px 50px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ---------- Informational / legal pages ---------- */
.info-page { width: 100%; max-width: 820px; padding: 36px 18px 56px; }
.info-hero { margin-bottom: 24px; }
.info-kicker { color: var(--primary); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.info-hero h1 { margin: 5px 0 8px; font-size: clamp(30px, 6vw, 46px); line-height: 1.2; }
.info-lead { color: var(--muted); font-size: 17px; line-height: 1.8; }
.info-updated { margin-top: 10px; color: var(--muted); font-size: 13px; }
.info-card { margin-top: 16px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.info-card h2 { margin-bottom: 10px; font-size: 21px; }
.info-card h3 { margin: 18px 0 7px; font-size: 17px; }
.info-card p, .info-card li { color: var(--muted); font-size: 15px; line-height: 1.85; }
.info-card p + p { margin-top: 10px; }
.info-card ul, .info-card ol { padding-left: 23px; }
.info-card a { color: var(--primary-d); font-weight: 700; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.info-grid .info-card { margin-top: 0; }
.info-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.info-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; }
.info-actions .primary-btn { color: #fff; }
.info-actions .ghost-btn { color: var(--text); }
.info-note { border-left: 4px solid var(--primary); }
.faq-list { display: grid; gap: 10px; }
.faq-list details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.faq-list summary { padding: 16px 18px; color: var(--text); font-weight: 700; cursor: pointer; }
.faq-list details p { padding: 0 18px 16px; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px 14px; margin-bottom: 8px; }
.footer-nav a { font-size: 13px; font-weight: 700; }
@media (max-width: 620px) {
  .info-page { padding-top: 26px; }
  .info-grid { grid-template-columns: 1fr; }
  .info-card { padding: 18px; }
}
/* Buy-me-a-coffee / donate chip */
.donate-link {
  display: inline-block;
  margin-top: 14px;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd27a, #f5a623);
  color: #5a3a00 !important;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 3px 12px rgba(245, 166, 35, .28);
  transition: transform .12s ease, box-shadow .12s ease;
}
.donate-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 166, 35, .42);
  text-decoration: none !important;
}
@media (prefers-reduced-motion: reduce) { .donate-link { transition: none; } }

@media (max-width: 420px) {
  .tile { width: 50px; height: 50px; font-size: 22px; }
  #board { min-height: 330px; }
  .key { height: 44px; font-size: 16px; }
  .stat .num { font-size: 18px; }
}


/* ============================================================
   World-class polish: a11y, safe-areas, sticky header, motion
   ============================================================ */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: rgba(106,170,100,.3); }

/* sticky, glassy header with iOS safe-area insets */
.topbar {
  position: sticky; top: 0; z-index: 60;
  padding-top: calc(10px + env(safe-area-inset-top));
  padding-left: calc(14px + env(safe-area-inset-left));
  padding-right: calc(14px + env(safe-area-inset-right));
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
}
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .topbar { background: var(--surface); }
}
main { padding-bottom: calc(env(safe-area-inset-bottom)); }
.foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }

/* keyboard-accessible focus ring (mouse clicks stay clean) */
a:focus-visible, button:focus-visible, input:focus-visible, .card:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 8px;
}
:focus:not(:focus-visible) { outline: none; }

/* comfortable tap targets, no accidental text selection / double-tap zoom on controls.
   -webkit-touch-callout:none stops the iOS long-press "select + copy" callout menu on
   buttons whose label is a text glyph (arrows ▲◀▶ etc.); tap-highlight kills the flash. */
.key, .icon-btn, .dpad button, .numpad button, .sudoku-pad button, .seg-btn, .ghost-btn,
.big-btn, .primary-btn, .hole, .simon-pad, .mcell, .scell, .tab, .quiz-choices button {
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.icon-btn { min-width: 44px; min-height: 44px; }

/* tactile press feedback */
.big-btn:active, .primary-btn:active, .ghost-btn:active { transform: translateY(1px) scale(.99); }
.card { -webkit-tap-highlight-color: transparent; }
.card:active { transform: translateY(-1px) scale(.995); }

/* respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}



/* ============================================================
   Accent themes (cosmetic — unlocked with coins) + Coins/Daily UI
   ============================================================ */
:root[data-accent="blue"]   { --primary:#3b82f6; --primary-d:#2563eb; --correct:#3b82f6; }
:root[data-accent="purple"] { --primary:#8b5cf6; --primary-d:#7c3aed; --correct:#8b5cf6; }
:root[data-accent="pink"]   { --primary:#ec4899; --primary-d:#db2777; --correct:#ec4899; }
:root[data-accent="orange"] { --primary:#f59e0b; --primary-d:#d97706; --correct:#f59e0b; }
:root[data-accent="teal"]   { --primary:#14b8a6; --primary-d:#0d9488; --correct:#14b8a6; }
:root[data-accent="red"]     { --primary:#ef4444; --primary-d:#dc2626; --correct:#ef4444; }
:root[data-accent="lime"]    { --primary:#84cc16; --primary-d:#65a30d; --correct:#84cc16; }
:root[data-accent="cyan"]    { --primary:#06b6d4; --primary-d:#0891b2; --correct:#06b6d4; }
:root[data-accent="indigo"]  { --primary:#6366f1; --primary-d:#4f46e5; --correct:#6366f1; }
:root[data-accent="fuchsia"] { --primary:#d946ef; --primary-d:#c026d3; --correct:#d946ef; }
:root[data-accent="slate"]   { --primary:#64748b; --primary-d:#475569; --correct:#64748b; }

.coin-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--key); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 11px; font-weight: 800; font-size: 14px;
  cursor: pointer; font-family: inherit; line-height: 1; white-space: nowrap;
}
.coin-chip:active { transform: scale(.96); }
.coin-chip.claimable::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #e23b3b; display: inline-block; }
.coin-float {
  position: fixed; z-index: 120; font-weight: 800; font-size: 18px;
  color: var(--correct); pointer-events: none; animation: coinup 1s ease-out forwards;
}
@keyframes coinup { 0%{opacity:0;transform:translateY(6px) scale(.8)} 20%{opacity:1;transform:translateY(0) scale(1.1)} 100%{opacity:0;transform:translateY(-32px)} }

/* Daily reward modal — full-bleed gradient "reward" banner so it reads as a
   game popup, clearly distinct from the page behind it. */
.modal-daily { padding: 0; overflow: hidden auto; }
.modal-daily .modal-close { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.modal-daily .modal-close:hover { background: rgba(255,255,255,.18); }
.daily-hero {
  position: relative; text-align: center; color: #fff;
  padding: 26px 22px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-d) 70%, color-mix(in srgb, var(--primary-d) 70%, #000) 100%);
  overflow: hidden;
}
.daily-hero::after { /* soft sheen */
  content: ''; position: absolute; top: -60%; left: -20%; width: 80%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.25), transparent 60%);
  transform: rotate(18deg); pointer-events: none;
}
.daily-hero h2 { margin: 0 0 4px; font-size: 22px; color: #fff; }
.daily-hero-emoji { font-size: 52px; line-height: 1; animation: giftbob 2.4s ease-in-out infinite; }
@keyframes giftbob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
.daily-body { padding: 18px 22px 22px; }
.daily-streak { text-align: center; font-size: 26px; font-weight: 800; margin: 6px 0 2px; }
.daily-sub { text-align: center; color: rgba(255,255,255,.9); font-size: 14px; }
.claim-btn { box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 45%, transparent); }
.claim-btn:not(:disabled) { animation: claimpulse 1.6s ease-in-out infinite; }
@keyframes claimpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.025); } }
.chal { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--border); }
.chal-i { font-size: 22px; }
.chal-main { flex: 1; min-width: 0; font-size: 14px; }
.chal-bar { height: 7px; background: var(--key); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.chal-bar > i { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }
.chal-done { color: var(--correct); font-weight: 800; }
.chal-rew { font-weight: 800; white-space: nowrap; font-size: 14px; }
.shop-grid { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.shop-acc { width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--border); cursor: pointer; position: relative; padding: 0; }
.shop-acc.sel { border-color: var(--text); }
.shop-acc .lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; color: #fff; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.shop-acc.afford { animation: accpulse 1.3s ease-in-out infinite; }
@keyframes accpulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }



/* ---------- Blog ---------- */
.top-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
  color: var(--text); font-size: 14px; font-weight: 800; text-decoration: none;
}
.top-link:hover { color: var(--primary-d); }
.blog-home, .article-layout { width: 100%; }
.blog-home { max-width: 1080px; padding: 42px 18px 64px; }
.blog-hero { max-width: 760px; margin-bottom: 30px; }
.blog-hero h1 { margin: 5px 0 12px; font-size: clamp(32px, 6vw, 52px); line-height: 1.18; }
.blog-hero > p:last-child { color: var(--muted); font-size: 17px; line-height: 1.85; }
.blog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.blog-card {
  display: flex; flex-direction: column; min-width: 0; padding: 22px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.blog-card-category { margin-bottom: 7px; color: var(--primary-d) !important; font-size: 12px !important; font-weight: 800; }
.blog-card h2 { margin-bottom: 9px; font-size: 20px; line-height: 1.45; }
.blog-card h2 a { color: var(--text); text-decoration: none; }
.blog-card h2 a:hover { color: var(--primary-d); }
.blog-card p { color: var(--muted); font-size: 14px; line-height: 1.75; }
.blog-read { align-self: flex-start; margin-top: auto; padding-top: 16px; color: var(--primary-d); font-size: 14px; font-weight: 800; text-decoration: none; }
.article-layout { max-width: 860px; padding: 30px 18px 64px; }
.blog-article { width: 100%; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 25px; color: var(--muted); font-size: 13px; }
.breadcrumbs a { color: var(--primary-d); text-decoration: none; }
.article-hero { margin-bottom: 25px; padding-bottom: 25px; border-bottom: 1px solid var(--border); }
.article-hero h1 { margin: 5px 0 14px; font-size: clamp(31px, 6vw, 49px); line-height: 1.23; }
.article-summary { padding: 17px 19px; border-left: 4px solid var(--primary); border-radius: 0 12px 12px 0; background: var(--surface); color: var(--text); font-size: 17px; line-height: 1.8; }
.article-byline { margin-top: 13px; color: var(--muted); font-size: 13px; }
.article-intro { margin-bottom: 30px; }
.blog-article section { margin: 36px 0; scroll-margin-top: 90px; }
.blog-article h2 { margin-bottom: 12px; font-size: clamp(23px, 4vw, 29px); line-height: 1.4; }
.blog-article p, .blog-article li { color: var(--muted); font-size: 16px; line-height: 1.9; }
.blog-article p + p { margin-top: 13px; }
.blog-article ul { margin-top: 12px; padding-left: 25px; }
.article-game-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0 !important; list-style: none; }
.article-game-list a {
  display: block; height: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); color: var(--primary-d); font-size: 14px; font-weight: 700; line-height: 1.55; text-decoration: none;
}
.article-game-list a:hover { border-color: var(--primary); transform: translateY(-1px); }
.article-faq .faq-list p { font-size: 15px; }
.article-note { padding: 17px 19px; border: 1px solid var(--border); border-radius: 12px; background: var(--key); color: var(--muted); font-size: 14px; line-height: 1.75; }
.article-note strong { color: var(--text); }
.article-next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 34px; }
.article-next a { padding: 14px; border: 1px solid var(--border); border-radius: 12px; color: var(--primary-d); font-size: 13px; font-weight: 700; line-height: 1.55; text-decoration: none; }
.article-next a:last-child { text-align: right; }
@media (max-width: 680px) {
  .blog-home, .article-layout { padding-top: 26px; }
  .blog-grid, .article-game-list, .article-next { grid-template-columns: 1fr; }
  .blog-card { padding: 18px; }
  .article-summary { padding: 15px; font-size: 16px; }
  .article-next a:last-child { text-align: left; }
}
