/* dangochains.com: one stylesheet for the site and its games. Plain CSS on purpose (GitHub Pages
   builds with an old Sass that mangles min()/clamp()). The system is described in DESIGN.md. */

/* ---------- fonts ---------- */
/* Arial/Roboto sized to Nunito's metrics, Latin only: text keeps its line breaks when Nunito arrives,
   and this face can never catch a Japanese character. */
@font-face {
  font-family: "Nunito Fallback"; font-weight: 400 600;
  src: local("Arial"), local("ArialMT"), local("Roboto"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 102%; ascent-override: 99%; descent-override: 34.6%; line-gap-override: 0%;
  unicode-range: U+0000-024F, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212;
}
@font-face {
  font-family: "Nunito Fallback"; font-weight: 700 900;
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Roboto Bold"), local("Helvetica Neue Bold"), local("Helvetica Bold");
  size-adjust: 101%; ascent-override: 100%; descent-override: 35%; line-gap-override: 0%;
  unicode-range: U+0000-024F, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: light dark;
  --bg: #FBF7EF; --surface: #FFFFFF; --surface-2: #F4EFE4;
  --tile: #ECE6D8; --tile-hover: #E2DBCA;
  --ink: #25241F; --ink-2: #4E4D43; --muted: #6A685C;
  --line: #E2DBCC; --line-strong: #8D8676;
  --primary: #5A594E; --primary-hover: #48473D; --on-primary: #FFFDF8;
  --accent: #FFAD5C; --accent-hover: #FF9F40; --on-accent: #25241F;
  --link: #A3470A;
  --good: #256B3B; --good-bg: #E3F3E4; --bad: #AD3B12; --bad-bg: #FDEBE4; --near-bg: #FFE9C7;
  --gold: #F2C230; --gold-ring: #96690A;
  --focus: #1F5FD1;
  --g1: #FF9FB2; --g2: #FFAD5C; --g3: #B6CF6A; --g4: #C8C8C8; --on-g: #25241F;
  --g1-soft: #FFE5EA; --g2-soft: #FFEBD6; --g3-soft: #EAF2D3; --g4-soft: #EEEDEA;
  --lip: inset 0 -2px 0 rgba(60, 50, 25, .13);
  --shadow-1: 0 1px 2px rgba(60, 50, 25, .07), 0 6px 20px -8px rgba(60, 50, 25, .16);
  --shadow-2: 0 2px 6px rgba(60, 50, 25, .10), 0 18px 40px -12px rgba(60, 50, 25, .28);

  --font: "Nunito", "Nunito Fallback", "M PLUS Rounded 1c", system-ui, -apple-system, "Segoe UI", Roboto,
    "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --font-ja: "M PLUS Rounded 1c", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI",
    Meiryo, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: .75rem; --fs-sm: .8125rem; --fs-s: .875rem; --fs-md: 1rem; --fs-lg: 1.125rem; --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem; --fs-3xl: clamp(1.75rem, 1.45rem + 1.5vw, 2.25rem); --fs-display: clamp(2.125rem, 1.4rem + 3.6vw, 3.5rem);

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 48px; --s-9: 72px;
  --gutter: 16px;
  --w-game: 34rem; --w-prose: 44rem; --w-page: 68rem;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;
  --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --tile-h: clamp(62px, 18.5vw, 84px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B1A17; --surface: #25241F; --surface-2: #2D2C26;
    --tile: #35342D; --tile-hover: #403F37;
    --ink: #F4F0E6; --ink-2: #D2CEC1; --muted: #A9A698;
    --line: #3A3932; --line-strong: #7C796C;
    --primary: #EFEADC; --primary-hover: #FFFFFF; --on-primary: #25241F;
    --link: #FFB870;
    --good: #8FD6A0; --good-bg: #1F3A26; --bad: #FF9E80; --bad-bg: #43261D; --near-bg: #4A3622;
    --gold-ring: #F2C230;
    --focus: #8DB8FF;
    --g1: #F892A7; --g2: #F7A654; --g3: #ACC662; --g4: #BFBFBA; --on-g: #1B1A17;
    --g1-soft: #4B2E35; --g2-soft: #4A3622; --g3-soft: #333C1D; --g4-soft: #3A3A36;
    --lip: inset 0 -2px 0 rgba(0, 0, 0, .28);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px -8px rgba(0, 0, 0, .5);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .4), 0 18px 40px -12px rgba(0, 0, 0, .7);
  }
}
@media (max-width: 380px) { :root { --gutter: 12px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font: 500 1rem/1.55 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
main { flex: 1 0 auto; display: block; }
h1, h2, h3, h4, p, ul, ol, dl, figure, blockquote, pre, table, fieldset { margin: 0; }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 800; text-wrap: balance; }
b, strong { font-weight: 800; }
img, svg { max-width: 100%; vertical-align: middle; }
img { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .14em; }
:focus:not(:focus-visible) { outline: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }

/* Japanese text: its own stack, strict line breaking (no line starts with ゃ ゅ ょ っ ー), readable ruby. */
:lang(ja) { font-family: var(--font-ja); line-break: strict; font-feature-settings: normal; }
ruby { ruby-align: center; }
rt { font-size: 55%; font-weight: 500; line-height: 1; letter-spacing: 0; user-select: none; -webkit-user-select: none; }

.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary); font-weight: 800; text-decoration: none; }
.skip:focus { top: 8px; }

/* ---------- header ---------- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header__in { max-width: var(--w-page); margin: 0 auto; padding: 6px var(--gutter); min-height: 58px; display: flex; align-items: center; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--ink); text-decoration: none; font-weight: 900; font-size: 1.1875rem; letter-spacing: -.015em; border-radius: var(--r-md); }
.brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); background: #fff; }
.brand__name { display: none; }
.switcher { display: flex; gap: 2px; padding: 2px; margin: 0 auto; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.switcher a { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 13px; border-radius: var(--r-pill); color: var(--ink-2); font-weight: 800; font-size: .9375rem; text-decoration: none; white-space: nowrap; transition: background-color .15s, color .15s; }
.switcher a::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--dot, var(--g1)); box-shadow: 0 0 0 1.5px var(--ink); flex: none; }
.switcher a:nth-child(2) { --dot: var(--g3); }
.switcher a:nth-child(3) { --dot: var(--g2); }
.switcher a:hover { color: var(--ink); }
.switcher a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.switcher__ja { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* read out, but only shown when there is room */
.site-nav { display: none; align-items: center; gap: 4px; }
.site-nav a { padding: 8px 12px; border-radius: var(--r-pill); color: var(--ink-2); font-weight: 700; font-size: .9375rem; text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.site-menu { position: relative; flex: none; }
.site-menu > summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; color: var(--ink); }
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu > summary:hover, .site-menu[open] > summary { background: var(--surface-2); }
.site-menu__panel { position: absolute; z-index: 30; right: 0; top: calc(100% + 6px); min-width: 15rem; padding: 8px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2), 0 0 0 1px var(--line); display: grid; }
.site-menu__panel a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--r-md); color: var(--ink); font-weight: 700; text-decoration: none; }
.site-menu__panel a:hover { background: var(--surface-2); }
.site-menu__panel a[aria-current="page"] { background: var(--surface-2); }
.site-menu__panel hr { width: 100%; margin: 6px 0; border: 0; border-top: 1px solid var(--line); }
@media (max-width: 400px) {
  .site-header__in { gap: 6px; }
  .switcher a { padding: 0 10px; gap: 5px; font-size: .875rem; }
  .brand img { width: 34px; height: 34px; }
}
@media (max-width: 340px) { .switcher a { padding: 0 8px; } .switcher a::before { display: none; } }
@media (min-width: 420px) { .switcher__ja { position: static; width: auto; height: auto; overflow: visible; clip: auto; } }
@media (min-width: 560px) { .brand__name { display: inline; } .switcher { margin: 0 0 0 8px; } .site-menu { margin-left: auto; } }
@media (min-width: 900px) {
  .site-header__in { min-height: 66px; gap: 16px; }
  .switcher { margin-left: 12px; }
  .site-nav { display: flex; margin-left: auto; }
  .site-menu { display: none; }
}

/* ---------- footer ---------- */
.site-footer { margin-top: var(--s-9); border-top: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-s); }
.site-footer__in { max-width: var(--w-page); margin: 0 auto; padding: var(--s-7) var(--gutter) var(--s-6); display: grid; gap: var(--s-6) var(--s-5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-footer h2 { font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 800; margin-bottom: 6px; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li a { display: inline-block; padding: 5px 0; color: var(--ink); font-weight: 700; text-decoration: none; }
.site-footer li a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.site-footer__brand { grid-column: 1 / -1; }
.site-footer__brand p { max-width: 26rem; margin-top: 8px; }
.site-footer__fine { grid-column: 1 / -1; padding-top: var(--s-4); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; color: var(--muted); font-size: var(--fs-sm); }
.site-footer__fine a { color: inherit; }
@media (min-width: 760px) {
  .site-footer__in { grid-template-columns: repeat(6, minmax(0, 1fr)); padding-top: var(--s-8); }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .site-footer__in { grid-template-columns: 1.4fr repeat(6, minmax(0, 1fr)); }
  .site-footer__brand { grid-column: auto; }
}

/* ---------- buttons, cards, chips ---------- */
.btn, .dc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 20px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 800; font-size: 1rem; line-height: 1.2; text-align: center; text-decoration: none; white-space: nowrap;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  transition: transform .12s var(--ease-out), background-color .15s, border-color .15s, box-shadow .12s, opacity .15s;
}
@media (hover: hover) { .btn:hover, .dc-btn:hover { background: var(--surface-2); text-decoration: none; } }
.btn:active, .dc-btn:active { transform: translateY(1px) scale(.985); }
.btn-accent, .dc-btn-primary { background: var(--accent); border-color: transparent; color: var(--on-accent); box-shadow: var(--lip); }
@media (hover: hover) { .btn-accent:hover, .dc-btn-primary:hover { background: var(--accent-hover); } }
.btn-accent:active, .dc-btn-primary:active { box-shadow: none; }
.btn-primary { background: var(--primary); border-color: transparent; color: var(--on-primary); }
@media (hover: hover) { .btn-primary:hover { background: var(--primary-hover); } }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-lg { min-height: 54px; padding: 13px 28px; font-size: var(--fs-lg); }
.btn[disabled], .dc-btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: default; box-shadow: none; transform: none; }
/* the main action sleeps in neutral and wakes up in colour (Submit with four words picked) */
.btn-accent[disabled], .dc-btn-primary[disabled] { opacity: 1; background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); }
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.eyebrow { font-size: var(--fs-sm); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stores { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stores a { display: inline-block; border-radius: 9px; line-height: 0; transition: transform .12s var(--ease-out); }
.stores a:hover { transform: translateY(-1px); }
.stores img { height: 48px; width: auto; border-radius: 8px; }
@media (prefers-color-scheme: dark) { .stores img { box-shadow: 0 0 0 1px #6b695e; } }

/* ---------- difficulty colours + their second cue (pips) ---------- */
.dc-easy { --g: var(--g1); --g-soft: var(--g1-soft); --pips: 1; }
.dc-medium { --g: var(--g2); --g-soft: var(--g2-soft); --pips: 2; }
.dc-hard { --g: var(--g3); --g-soft: var(--g3-soft); --pips: 3; }
.dc-expert { --g: var(--g4); --g-soft: var(--g4-soft); --pips: 4; }
.dc-group::before, .dc-rv-group::before, .dc-make-group::before {
  content: ""; display: block; height: 7px; width: calc(var(--pips, 1) * 10px - 3px);
  background: radial-gradient(circle at 3.5px 3.5px, currentColor 3.5px, transparent 4px) 0 0 / 10px 7px repeat-x;
  opacity: .75;
}

/* ---------- prose: text pages and the generated study pages ---------- */
.prose { width: 100%; max-width: calc(var(--w-prose) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s-7) var(--gutter) 0; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: var(--fs-3xl); font-weight: 900; letter-spacing: -.02em; line-height: 1.12; margin: 0 0 var(--s-4); }
.prose h2 { font-size: var(--fs-2xl); letter-spacing: -.01em; margin: 2em 0 .5em; }
.prose h3 { font-size: var(--fs-xl); margin: 1.6em 0 .4em; }
.prose h4 { font-size: var(--fs-md); margin: 1.4em 0 .3em; }
.prose p, .prose ul, .prose ol, .prose table, .prose blockquote, .prose pre { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--muted); font-weight: 800; }
.prose hr { margin: var(--s-7) 0; border: 0; border-top: 1px solid var(--line); }
.prose small { font-size: var(--fs-sm); color: var(--muted); }
.prose code { padding: .12em .4em; border-radius: 6px; background: var(--surface-2); font: 600 .9em var(--font-mono); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.prose th, .prose td { padding: .5em .6em; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose thead th { font-size: var(--fs-sm); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 800; border-bottom-color: var(--line-strong); }
.prose .lede { font-size: var(--fs-lg); color: var(--ink-2); }
.prose .btn { margin: 4px 6px 4px 0; }
.prose--inset { max-width: none; padding: 0; } /* prose inside a game column (Bridge's how-to) */
.prose--inset h2 { font-size: var(--fs-xl); }

/* ---------- home ---------- */
.home { overflow: hidden; }
.wrap { max-width: var(--w-page); margin: 0 auto; padding: 0 var(--gutter); }
.hero { display: grid; gap: var(--s-7); align-items: center; padding-block: var(--s-6) var(--s-8); }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.hero__eyebrow::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--g1); box-shadow: 0 0 0 1.5px var(--ink), 14px 0 0 0 var(--g2), 14px 0 0 1.5px var(--ink), 28px 0 0 0 var(--g3), 28px 0 0 1.5px var(--ink); margin-right: 30px; }
.hero h1 { font-size: var(--fs-display); font-weight: 900; letter-spacing: -.03em; line-height: 1.04; margin: var(--s-3) 0 var(--s-4); }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--g1) 62%, var(--g1) 92%, transparent 92%); }
.hero__lede { font-size: var(--fs-lg); color: var(--ink-2); max-width: 31rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--s-6); }
.hero__tiers { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: var(--s-5); font-size: var(--fs-s); color: var(--muted); font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); font-weight: 800; font-size: var(--fs-s); text-decoration: none; }
a.chip:hover { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.chip[data-done] { background: var(--surface-2); }
.hero__board { position: relative; display: block; width: 100%; max-width: 27rem; margin: 0 auto; padding: 14px; border-radius: var(--r-xl); background: var(--surface); color: inherit; text-decoration: none; box-shadow: var(--shadow-2), 0 0 0 1px var(--line); transform: rotate(1.2deg); }
@media (max-width: 899px) { .hero__board { transform: rotate(.8deg); max-width: 25rem; } }
.hero__board::before { content: ""; position: absolute; inset: -22px -30px auto auto; width: 120px; height: 120px; border-radius: 50%; background: var(--g2-soft); z-index: -1; }
.hero__board::after { content: ""; position: absolute; inset: auto auto -26px -34px; width: 150px; height: 150px; border-radius: 50%; background: var(--g1-soft); z-index: -1; }
.hero__board .dc-tries { margin-top: 12px; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: var(--s-8); padding-block: var(--s-9); }
}
/* a still board (home hero, How to Play): real tile styles, text sized from --n without script */
.demo { --tile-h: 60px; }
.demo .dc-tile { container-type: inline-size; cursor: default; pointer-events: none; }
.demo .dc-w { font-size: 16px; font-size: min(20px, calc(92cqi / var(--n, 3))); white-space: nowrap; }
.demo .dc-group { padding: 7px 10px 8px; }
.demo .dc-group > b { font-size: .9375rem; }
.demo .dc-group-words { font-size: var(--fs-sm); margin-top: 1px; line-height: 1.5; }
.chip--more { background: transparent; box-shadow: none; color: var(--link); text-decoration: underline; padding-inline: 6px; }
.dango-mark { display: block; margin: 0 auto var(--s-3); }

.section { padding-block: var(--s-8); }
.section__head { max-width: 40rem; margin-bottom: var(--s-6); }
.section__head h2 { font-size: var(--fs-3xl); font-weight: 900; letter-spacing: -.02em; margin-top: 6px; }
.section__head p { margin-top: 8px; color: var(--ink-2); font-size: var(--fs-lg); }
.games { display: grid; gap: var(--s-4); }
.game-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: var(--s-5); color: var(--ink); text-decoration: none; transition: transform .2s var(--ease-out), box-shadow .2s; }
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2), 0 0 0 1px var(--line); }
.game-card__art { height: 132px; border-radius: var(--r-md); background: var(--art, var(--g1-soft)); display: grid; place-items: center; overflow: hidden; }
.game-card h3 { font-size: var(--fs-xl); font-weight: 900; letter-spacing: -.01em; }
.game-card p { color: var(--ink-2); flex: 1; }
.game-card__go { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.game-card__go::after { content: "→"; font-family: system-ui, sans-serif; transition: transform .2s var(--ease-out); }
.game-card:hover .game-card__go::after { transform: translateX(4px); }
.game-card__tag { align-self: flex-start; padding: 3px 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.game-card__status { font-size: var(--fs-s); color: var(--muted); font-weight: 700; min-height: 1.4em; }
.art-bars { display: grid; gap: 6px; width: 62%; }
.art-bars i { display: block; height: 20px; border-radius: 7px; background: var(--g); color: var(--on-g); box-shadow: var(--lip); position: relative; }
.art-bars i::before { content: ""; position: absolute; left: 8px; top: 6.5px; height: 7px; width: calc(var(--pips) * 10px - 3px); background: radial-gradient(circle at 3.5px 3.5px, currentColor 3.5px, transparent 4px) 0 0 / 10px 7px repeat-x; opacity: .7; }
.art-cross { display: grid; grid-template: repeat(3, 34px) / repeat(3, 34px); gap: 5px; font-weight: 700; font-size: 20px; }
.art-cross b { display: grid; place-items: center; border-radius: 9px; background: var(--surface); color: var(--ink); box-shadow: var(--lip); font-weight: 700; }
.art-cross b:nth-child(1) { grid-area: 1 / 2; } .art-cross b:nth-child(2) { grid-area: 2 / 1; } .art-cross b:nth-child(3) { grid-area: 2 / 3; } .art-cross b:nth-child(4) { grid-area: 3 / 2; }
.art-cross b:nth-child(5) { grid-area: 2 / 2; background: transparent; box-shadow: inset 0 0 0 2px var(--ink); border-radius: 9px; font-family: var(--font); }
.art-form { display: grid; gap: 6px; width: 64%; }
.art-form i { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 5px; border-radius: 8px; background: var(--g-soft); }
.art-form i::before, .art-form i::after, .art-form i b, .art-form i s { content: ""; height: 11px; border-radius: 4px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
@media (min-width: 760px) { .games { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); } }

.band { background: var(--surface-2); border-block: 1px solid var(--line); }
.study { display: grid; gap: var(--s-5); align-items: center; }
.study__topics { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
@media (min-width: 900px) { .study { grid-template-columns: 1fr 1fr; gap: var(--s-8); } }

.app { display: grid; gap: var(--s-7); align-items: center; }
.app__list { list-style: none; padding: 0; margin: var(--s-5) 0; display: grid; gap: 10px; }
.app__list li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; color: var(--ink-2); }
.app__list li::before { content: ""; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: var(--dot, var(--g1)); box-shadow: 0 0 0 1.5px var(--ink); }
.app__list li:nth-child(4n+2) { --dot: var(--g2); } .app__list li:nth-child(4n+3) { --dot: var(--g3); } .app__list li:nth-child(4n) { --dot: var(--g4); }
.app__list b { color: var(--ink); }
.app__note { margin-top: var(--s-4); font-size: var(--fs-s); color: var(--muted); }
.phone { justify-self: center; width: min(270px, 70vw); padding: 9px; border-radius: 40px; background: #1d1c19; box-shadow: var(--shadow-2), inset 0 0 0 1.5px #55534a; transform: rotate(-2deg); }
.phone img { display: block; width: 100%; border-radius: 31px; aspect-ratio: 1125 / 2436; background: #fdf9ec; }
@media (min-width: 900px) { .app { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); } .phone { width: 290px; } }

.features { display: grid; gap: var(--s-4); list-style: none; padding: 0; }
.feature { padding: var(--s-5); }
.feature__icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: var(--s-3); border-radius: 14px; background: var(--tint, var(--g1-soft)); color: var(--ink); font-weight: 800; font-size: 20px; }
.features li:nth-child(4n+2) .feature__icon { --tint: var(--g2-soft); } .features li:nth-child(4n+3) .feature__icon { --tint: var(--g3-soft); } .features li:nth-child(4n) .feature__icon { --tint: var(--g4-soft); }
.feature__icon svg { width: 24px; height: 24px; }
.feature h3 { font-size: var(--fs-lg); }
.feature p { margin-top: 6px; color: var(--ink-2); font-size: .9375rem; }
@media (min-width: 620px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .features { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); } }
.closing { text-align: center; padding-block: var(--s-8) 0; }
.closing h2 { font-size: var(--fs-3xl); font-weight: 900; letter-spacing: -.02em; }
.closing p { margin: 8px auto var(--s-5); color: var(--ink-2); max-width: 30rem; }

/* ---------- the games: shared frame ---------- */
.game { width: 100%; max-width: calc(var(--w-game) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s-4) var(--gutter) 0; }
@media (min-width: 600px) { .game { padding-top: var(--s-6); } }
.game-extra { margin-top: var(--s-8); }
.dc-app, .br { max-width: var(--w-game); margin: 0 auto; }
.dc-title, .br-title { font-size: clamp(1.5rem, 1.3rem + 1vw, 1.875rem); font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
.dc-sub { margin-top: 2px; color: var(--muted); font-size: .9375rem; font-weight: 600; }
.dc-sub a { white-space: nowrap; font-weight: 800; }
.dc-intro, .br-lede { margin-top: 6px; color: var(--ink-2); font-size: .9375rem; line-height: 1.45; }
.dc-note { margin-top: 10px; text-align: center; font-size: var(--fs-sm); color: var(--muted); }
.dc-small { font-size: var(--fs-sm); color: var(--muted); }

/* tabs: Easy / Normal / Hard */
.dc-tiers, .br-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 3px; margin: var(--s-3) 0 var(--s-3); border-radius: var(--r-pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.dc-tiers button, .br-tiers button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 8px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2); font-weight: 800; font-size: .9375rem; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s, color .15s; }
.dc-tiers button:hover, .br-tiers button:hover { color: var(--ink); }
.dc-tiers button[aria-selected="true"], .br-tiers button[aria-selected="true"] { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-1); }
.dc-badge { font-size: .9em; line-height: 1; }
.br-tick { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--good); color: var(--surface); font-size: 11px; font-weight: 900; line-height: 1; font-family: system-ui, sans-serif; }
.br-tick[aria-label="missed"] { background: var(--muted); }

/* notices, loading */
.dc-notice, .br-notice { margin: var(--s-3) 0 var(--s-4); padding: var(--s-4); border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); text-align: center; }
.dc-notice p + p { margin-top: 10px; }
.dc-notice a { font-weight: 800; }
.br-notice { padding: 10px 14px; background: var(--near-bg); box-shadow: none; font-size: var(--fs-s); font-weight: 600; }
.dc-skeleton { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap, 8px); }
.dc-skeleton i { height: var(--tile-h); border-radius: var(--r-md); background: var(--tile); opacity: .6; }

/* the board */
.dc-board { --gap: 8px; position: relative; }
.dc-solved { display: grid; gap: var(--gap); }
.dc-solved:not(:empty) { margin-bottom: var(--gap); }
.dc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.dc-tile {
  position: relative; min-width: 0; min-height: var(--tile-h); margin: 0; padding: 4px 3px; border: 0; border-radius: var(--r-md);
  background: var(--tile); color: var(--ink); box-shadow: var(--lip);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--font-ja); font-weight: 700; font-size: 18px; line-height: 1.14;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  transition: background-color .14s, color .14s, box-shadow .14s, transform .12s var(--ease-out);
}
.dc-w { display: block; max-width: 100%; }
.dc-ln { display: block; white-space: nowrap; }
.dc-tile rt { font-size: 50%; }
.dc-nofuri rt { display: none; }
@media (hover: hover) { .dc-tile:hover { background: var(--tile-hover); } }
.dc-tile:active { transform: translateY(1px) scale(.975); box-shadow: none; }
.dc-tile.sel { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.dc-tile:focus-visible { z-index: 1; }

.dc-group { position: relative; display: grid; align-content: center; justify-items: center; min-height: var(--tile-h); padding: 9px 12px 10px; border-radius: var(--r-md); background: var(--g); color: var(--on-g); text-align: center; line-height: 1.3; box-shadow: var(--lip); }
.dc-group::before { position: absolute; left: 10px; top: 9px; }
.dc-group > b { display: block; font-size: 1.0625rem; font-weight: 700; padding: 0 22px; }
.dc-group > span { display: block; font-size: var(--fs-sm); font-weight: 700; opacity: .82; }
.dc-group > b:only-of-type:not([lang]) { font-weight: 800; }
.dc-group-words { margin-top: 3px; font-size: .9375rem; font-weight: 500; line-height: 1.9; }
.dc-nofuri .dc-group-words { line-height: 1.45; }

/* status line, tries, controls */
/* The daily keeps its status on one line: the pill (when there is one) sits beside the tries. */
.dc-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; min-height: 36px; margin-top: 10px; }
.dc-msg, .br-msg { padding: 5px 16px; border-radius: var(--r-pill); font-weight: 800; font-size: .9375rem; text-align: center; background: var(--surface-2); color: var(--ink); }
.dc-msg:empty { display: none; }
.dc-msg:not(:empty) + .dc-tries .dc-tries-label { display: none; }
.br-msg { display: block; width: fit-content; max-width: 100%; min-height: 32px; margin: 10px auto 6px; }
.br-msg:empty { visibility: hidden; }
.dc-msg-good { background: var(--good-bg); color: var(--good); }
.dc-msg-bad { background: var(--bad-bg); color: var(--bad); }
.dc-msg-near { background: var(--near-bg); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--accent); }
.dc-tries { display: flex; justify-content: center; align-items: center; gap: 12px; color: var(--muted); font-size: var(--fs-sm); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.dc-dots, .br-tries { position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px 0 14px; }
.dc-dots::before, .br-tries::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: var(--line-strong); }
.dc-dot { position: relative; width: 17px; height: 17px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1.5px var(--bg); transition: transform .25s var(--ease-spring), background-color .2s; }
.dc-dot-gold { background: var(--gold); box-shadow: 0 0 0 1.5px var(--bg), inset 0 0 0 1.5px var(--gold-ring); }
.dc-dot-used { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line-strong); transform: scale(.72); }
.dc-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.dc-actions .dc-btn { flex: 1 1 0; max-width: 11rem; padding-inline: 10px; }
.dc-actions .dc-submit { flex-grow: 1.25; }
.dc-furigana { display: flex; width: fit-content; align-items: center; gap: 10px; margin: 14px auto 0; padding: 6px 10px; border-radius: var(--r-pill); color: var(--ink-2); font-size: .9375rem; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dc-furigana input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 42px; height: 26px; margin: 0; border-radius: 999px; background: var(--line-strong); cursor: pointer; transition: background-color .2s; }
.dc-furigana input::before { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .2s var(--ease-spring); }
.dc-furigana input:checked { background: var(--good); }
@media (prefers-color-scheme: dark) { .dc-furigana input:checked { background: #4FA868; } }
.dc-furigana input:checked::before { transform: translateX(16px); }

/* after the game */
.dc-end { margin-top: var(--s-6); text-align: center; }
.dc-end:focus { outline: 0; }
.dc-end-card, .br-end-card { padding: var(--s-5) var(--s-4); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.dc-result { font-size: var(--fs-2xl); font-weight: 900; letter-spacing: -.01em; line-height: 1.2; }
.dc-result-sub { margin-top: 2px; color: var(--ink-2); }
.dc-rows { width: fit-content; margin: 14px auto 0; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface-2); font: 400 1.25rem/1.25 system-ui, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; letter-spacing: .08em; white-space: pre; }
.dc-rows:empty { display: none; }
.dc-streak { width: fit-content; margin: 12px auto 0; padding: 4px 14px; border-radius: var(--r-pill); background: var(--g2-soft); color: var(--ink); font-weight: 800; font-size: .9375rem; }
.dc-streak::before { content: "🔥 "; }
.dc-share { min-width: 12rem; margin-top: 16px; }
.dc-share-status, .br-share-msg { min-height: 1.5em; margin-top: 6px; font-size: var(--fs-s); font-weight: 700; color: var(--good); }
.dc-share-fallback { display: block; width: 100%; min-height: 9em; margin-top: 8px; padding: 10px; border: 1.5px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); font: 14px/1.4 var(--font-mono); }
.dc-next { margin-top: 10px; color: var(--ink-2); font-size: .9375rem; }
.dc-next b { display: inline-block; padding: 1px 9px; border-radius: 8px; background: var(--surface-2); color: var(--ink); font-size: 1.0625rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.dc-more { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; color: var(--ink-2); font-weight: 700; font-size: .9375rem; }
.dc-next:empty, .dc-more:empty, .dc-streak:empty, .dc-result-sub:empty { display: none; }
.dc-section { margin-top: var(--s-7); text-align: left; }
.dc-section > h2, .dc-section > h3, .br-h { margin-bottom: var(--s-3); font-size: var(--fs-xl); font-weight: 900; text-align: center; }
.dc-rv-group { position: relative; margin-bottom: 10px; padding: 12px 14px 6px; border-radius: var(--r-lg); background: var(--g-soft); box-shadow: inset 5px 0 0 var(--g); }
.dc-rv-group::before { position: absolute; left: 16px; top: 13px; }
.dc-rv-title { padding: 0 34px 8px; text-align: center; line-height: 1.3; }
.dc-rv-title b { display: block; font-size: 1.0625rem; font-weight: 700; }
.dc-rv-title b:not([lang]) { font-weight: 800; }
.dc-rv-title span { display: block; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
.dc-rv-group ul { list-style: none; margin: 0; padding: 0; }
.dc-rv-group li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; padding: 7px 2px; border-top: 1px solid rgba(128, 128, 128, .25); border-top-color: color-mix(in srgb, var(--ink) 12%, transparent); line-height: 1.35; }
.dc-rv-word { font-size: 1.1875rem; font-weight: 700; }
.dc-rv-reading { font-size: .9375rem; color: var(--ink-2); }
.dc-rv-gloss { flex-basis: 100%; font-size: .9375rem; color: var(--ink-2); }
.dc-cta { margin-top: var(--s-6); padding: var(--s-5) var(--s-4); border-radius: var(--r-xl); background: var(--surface-2); text-align: center; }
.dc-cta p { max-width: 26rem; margin: 0 auto; font-weight: 600; }
.dc-stores { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin-top: 12px; }
.dc-cta .dc-stores { max-width: none; margin-top: 14px; }
.dc-notice .dc-stores { margin-top: 0; }
.dc-store { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 10px; background: #111; color: #fff; font-weight: 700; font-size: .9375rem; text-decoration: none; line-height: 0; transition: transform .12s var(--ease-out); }
.dc-store:hover { transform: translateY(-1px); }
.dc-store-badge { padding: 0; background: none; border-radius: 8px; }
.dc-store-badge img { height: 46px; width: auto; border-radius: 8px; }
@media (prefers-color-scheme: dark) { .dc-store { box-shadow: 0 0 0 1px #6b695e; } }
.dc-links { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: center; margin-top: var(--s-5); font-weight: 800; }

/* ---------- the maker ---------- */
.dc-form { margin-top: var(--s-5); }
.dc-form label { display: block; margin-bottom: 4px; font-size: var(--fs-s); font-weight: 800; }
.dc-form input[type="text"], .dc-result-box input[type="text"] { width: 100%; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: 1rem; line-height: 1.3; transition: border-color .15s, box-shadow .15s; }
.dc-form input::placeholder { color: var(--muted); opacity: 1; }
.dc-form input[type="text"]:focus-visible { outline-offset: 0; border-color: var(--focus); }
.dc-form input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-bg); }
.dc-form input.dc-auto { background: var(--g2-soft); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.dc-field { margin-bottom: var(--s-4); }
.dc-make-group { position: relative; min-width: 0; margin: var(--s-4) 0; padding: 14px 14px 16px 18px; border: 0; border-radius: var(--r-lg); background: var(--g-soft); box-shadow: inset 5px 0 0 var(--g); }
.dc-make-group::before { position: absolute; right: 14px; top: 20px; }
.dc-make-group legend { float: left; width: 100%; margin-bottom: 10px; padding: 0 44px 0 0; font-size: var(--fs-md); font-weight: 900; }
.dc-make-group legend + * { clear: both; }
.dc-make-head { display: grid; grid-template-columns: 1.1fr 1fr 1.3fr; gap: 6px; margin-top: 12px; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.dc-make-words { display: grid; gap: 8px; margin-top: 6px; }
.dc-make-word { display: grid; grid-template-columns: 1.1fr 1fr 1.3fr; gap: 6px; }
@media (max-width: 560px) {
  .dc-make-head { display: none; }
  .dc-make-words { margin-top: 12px; gap: 10px; }
  .dc-make-word { grid-template-columns: 1fr 1fr; }
  .dc-make-word .dc-in-gloss { grid-column: 1 / -1; }
  .dc-make-word + .dc-make-word { padding-top: 10px; border-top: 1px dashed rgba(128, 128, 128, .4); border-top-color: color-mix(in srgb, var(--ink) 22%, transparent); }
}
.dc-errors { margin: var(--s-4) 0; padding: 12px 16px; border-radius: var(--r-md); background: var(--bad-bg); color: var(--bad); font-weight: 800; }
.dc-errors ul { margin: 4px 0 0; padding-left: 1.2em; font-weight: 600; }
.dc-make-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dc-result-box { margin-top: var(--s-5); padding: var(--s-5) var(--s-4); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.dc-result-box label { display: block; margin-bottom: 6px; font-size: var(--fs-lg); }
.dc-result-box input[type="text"] { font: 14px/1.3 var(--font-mono); background: var(--surface-2); }
.dc-result-box .dc-make-actions { margin-top: 12px; }
.dc-result-box .dc-small { margin-top: 10px; }
.dc-make-foot { margin-top: var(--s-6); }

/* ---------- 熟語 Bridge ---------- */
.br-head { text-align: left; }
.br-meta { text-align: center; color: var(--muted); font-size: var(--fs-s); font-weight: 700; }
.br-game { margin-top: var(--s-3); }
.br-board { --t: 68px; --a: 26px; display: grid; justify-content: center; grid-template-columns: var(--t) var(--a) var(--t) var(--a) var(--t); grid-template-rows: var(--t) var(--a) var(--t) var(--a) var(--t); margin: 6px auto 12px; }
.br-tile { position: relative; display: flex; align-items: center; justify-content: center; border-radius: var(--r-md); background: var(--tile); color: var(--ink); box-shadow: var(--lip); font-size: 36px; font-weight: 700; line-height: 1; }
.br-center { background: var(--surface); box-shadow: none; border: 2.5px dashed var(--line-strong); color: var(--muted); font-family: var(--font-ja); }
.br-center.is-wrong { border-style: solid; border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.br-center.is-right { border-style: solid; border-color: var(--good); background: var(--good-bg); color: var(--good); }
.br-center.is-lost { border-style: solid; border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.br-arrow { display: flex; align-items: center; justify-content: center; color: var(--muted); font: 800 18px/1 system-ui, sans-serif; }
.br-badge { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 900 12px/1 system-ui, sans-serif; color: var(--surface); box-shadow: 0 0 0 2px var(--bg); }
.br-badge.ok { background: var(--good); }
.br-badge.no { background: var(--muted); }
.br-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.br-slot { display: inline-flex; align-items: center; gap: 1px; padding: 4px 10px; border-radius: var(--r-sm); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 18px; font-weight: 500; line-height: 1.3; }
.br-slot .br-blank { color: var(--muted); }
.br-slot.ok { background: var(--good-bg); box-shadow: inset 0 0 0 1.5px var(--good); }
.br-slot.ok .br-blank { color: var(--good); font-weight: 700; }
.br-slot.no { background: var(--bad-bg); box-shadow: inset 0 0 0 1.5px var(--bad); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bad) 45%, transparent); text-decoration: line-through; text-decoration-color: var(--bad); }
.br-slot.no .br-blank { color: var(--bad); }
.br-msg { margin-top: 12px; font-weight: 700; border-radius: var(--r-lg); }
.br-tries-row { display: flex; justify-content: center; }
.br-tries { gap: 6px; margin: 4px auto 8px; }
.br-tries i { position: relative; width: 17px; height: 17px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1.5px var(--bg); }
.br-tries i.used { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line-strong); transform: scale(.72); }
.br-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 22rem; margin: 10px auto 6px; }
.br-opt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 62px; padding: 2px 0; border: 0; border-radius: var(--r-md); background: var(--tile); color: var(--ink); box-shadow: var(--lip); font-family: var(--font-ja); font-size: 30px; font-weight: 700; line-height: 1.1; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background-color .14s, transform .12s var(--ease-out), box-shadow .14s; }
@media (hover: hover) { .br-opt:hover:not(:disabled) { background: var(--tile-hover); } }
.br-opt:active:not(:disabled) { transform: translateY(1px) scale(.975); box-shadow: none; }
.br-opt:disabled { cursor: default; box-shadow: none; }
.br-opt:disabled:not(.is-wrong):not(.is-right):not(.is-answer) { opacity: .55; }
.br-opt.is-wrong { background: var(--bad-bg); color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bad) 45%, transparent); }
.br-opt.is-right { background: var(--good); color: var(--surface); }
.br-opt.is-answer { background: var(--good-bg); color: var(--good); box-shadow: inset 0 0 0 2.5px var(--good); }
.br-opt small { margin-top: 2px; font: 800 11px/1 var(--font); }
.br-history { list-style: none; max-width: 22rem; margin: 8px auto 0; padding: 0; color: var(--ink-2); font-size: var(--fs-s); }
.br-history li { padding: 2px 0; }
.br-end { margin-top: var(--s-5); }
.br-end-title { text-align: center; font-size: var(--fs-xl); font-weight: 900; }
.br-h { margin-top: var(--s-5); text-align: left; font-size: var(--fs-md); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.br-words, .br-near { list-style: none; margin: 0; padding: 0; }
.br-words li { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.br-w { font-size: 26px; font-weight: 700; line-height: 1.2; }
.br-r { font-size: .9375rem; color: var(--ink-2); }
.br-g { font-size: var(--fs-s); color: var(--ink-2); }
.br-lv { display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 800; line-height: 18px; vertical-align: 1px; }
.br-kanji { margin-top: 12px; font-size: var(--fs-s); color: var(--ink-2); }
.br-kanji b { margin-right: 8px; font-size: 24px; color: var(--ink); vertical-align: -3px; }
.br-near-box { margin-top: 12px; font-size: var(--fs-s); }
.br-near-box summary { cursor: pointer; padding: 6px 0; color: var(--ink); font-weight: 800; }
.br-near li { padding: 5px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.br-near .br-nk { margin-right: 8px; font-size: 18px; font-weight: 700; color: var(--ink); }
.br-share-text { margin: var(--s-4) 0 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); font: 13px/1.5 var(--font-mono); white-space: pre-wrap; word-break: break-all; text-align: left; }
.br-share-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; }
.br-share { min-width: 12rem; }
.br-share-msg { margin: 0; min-width: 1em; }
.br-next { margin-top: 10px; text-align: center; color: var(--ink-2); font-size: .9375rem; }
.br-week { margin-top: var(--s-6); }
.br-week-h { margin-bottom: 8px; text-align: center; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.br-week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; max-width: 26rem; margin: 0 auto; }
.br-day { display: flex; flex-direction: column; align-items: center; padding: 6px 0 5px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink-2); font-size: 11px; font-weight: 700; line-height: 1.35; text-decoration: none; }
.br-day:hover { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.br-day b { font-size: 15px; color: var(--ink); }
.br-day.is-current { background: var(--primary); box-shadow: none; color: var(--on-primary); }
.br-day.is-current b { color: var(--on-primary); }
.br-day .br-dot { font-size: 11px; line-height: 1.3; }
.br-streak { margin-top: 12px; text-align: center; color: var(--ink-2); font-size: var(--fs-s); font-weight: 700; }
.br-cross { margin-top: 8px; text-align: center; font-size: var(--fs-s); color: var(--ink-2); }
.br-credits { margin-top: var(--s-7); padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: var(--fs-xs); line-height: 1.55; color: var(--muted); }
.br-credits p { margin: 0 0 8px; }
.br-credits a { color: inherit; }
@media (min-width: 600px) { .br-board { --t: 78px; --a: 30px; } .br-tile { font-size: 42px; } .br-opt { min-height: 68px; font-size: 34px; } }

/* ---------- how to play ---------- */
.steps { list-style: none; counter-reset: step; padding: 0 !important; display: grid; gap: 10px; }
.steps > li { counter-increment: step; position: relative; margin: 0; padding: 14px 16px 14px 58px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.steps > li::before { content: counter(step); position: absolute; left: 14px; top: 13px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--g, var(--g1)); color: var(--on-g); font-weight: 900; box-shadow: 0 0 0 1.5px var(--ink); }
.steps > li:nth-child(4n+2) { --g: var(--g2); } .steps > li:nth-child(4n+3) { --g: var(--g3); } .steps > li:nth-child(4n) { --g: var(--g4); }
.legend { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.legend li { position: relative; margin: 0; padding: 26px 12px 10px; border-radius: var(--r-md); background: var(--g); color: var(--on-g); font-weight: 800; line-height: 1.25; box-shadow: var(--lip); }
.legend li::before { content: ""; position: absolute; left: 12px; top: 11px; height: 7px; width: calc(var(--pips) * 10px - 3px); background: radial-gradient(circle at 3.5px 3.5px, currentColor 3.5px, transparent 4px) 0 0 / 10px 7px repeat-x; opacity: .75; }
.legend small { display: block; font-size: var(--fs-sm); font-weight: 700; color: inherit; opacity: .8; }
@media (min-width: 620px) { .legend { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.example { max-width: 26rem; margin: 0 0 1em; padding: 12px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.tiers-list { list-style: none; padding: 0 !important; display: grid; gap: 8px; }
.tiers-list li { margin: 0; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
@media (min-width: 620px) { .tiers-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- changelog ---------- */
.release { margin: var(--s-5) 0; padding: var(--s-5); border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.release h2 { margin: 6px 0 2px; font-size: var(--fs-2xl); }
.release .tag { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); background: var(--g2-soft); color: var(--ink); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.release > p { color: var(--muted); font-size: var(--fs-s); font-weight: 700; }
.release ul { margin: 12px 0 0; }

/* ---------- study pages (markup comes from scripts/build_study.py; its inline <style> is overridden here) ---------- */
.prose .st-board { margin: var(--s-6) 0; padding: var(--s-5) var(--s-4); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.prose .st-board h2 { margin: 0 0 8px; font-size: var(--fs-2xl); }
.prose .st-board h2 small { display: block; margin-top: 2px; font-size: var(--fs-s); font-weight: 700; color: var(--muted); }
.prose .st-words { font-size: 1.0625rem; line-height: 2.5; color: var(--muted); font-family: var(--font); }
.prose .st-words > span { padding: .28em .55em; border-radius: var(--r-sm); background: var(--tile); color: var(--ink); font-weight: 700; white-space: nowrap; }
.prose .st-play { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 20px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); box-shadow: var(--lip); font-weight: 800; text-decoration: none; }
.prose .st-play:hover { background: var(--accent-hover); }
.prose .st-answers { margin: 0; border-radius: var(--r-md); background: var(--surface-2); }
.prose .st-answers summary { padding: 12px 14px; color: var(--ink); font-weight: 800; cursor: pointer; border-radius: var(--r-md); }
.prose .st-answers[open] { padding: 0 14px 6px; }
.prose .st-answers[open] summary { margin: 0 -14px; border-bottom: 1px solid var(--line); }
.prose .st-answers h3 { font-size: var(--fs-lg); margin-top: 1.1em; }
.prose .st-table { width: 100%; margin: .3em 0 1em; border-collapse: collapse; }
.prose .st-table th, .prose .st-table td { padding: .45em .5em; border-bottom: 1px solid var(--line); }
.prose .st-table thead th { border-bottom-color: var(--line-strong); }
.prose .st-table td[lang=ja] { font-size: 1.0625rem; white-space: nowrap; }
.prose .st-table td[lang=ja]:first-child { font-weight: 700; }
.prose .st-table td small.rmj { display: block; margin-top: 1px; font-size: .8125rem; font-weight: 400; color: var(--muted); white-space: normal; }
.prose .st-table td:last-child { color: var(--ink-2); }
.prose .st-src { margin-top: -.4em; font-size: var(--fs-s); color: var(--muted); }
.prose .st-group { margin-top: 1.8em; font-size: var(--fs-xl); }
.prose .st-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: var(--s-7) 0 var(--s-4); }
.prose .st-nav > :nth-child(2) { grid-area: 2 / 1 / 3 / 3; justify-self: center; }
.prose .st-nav > :nth-child(1) { justify-self: start; }
.prose .st-nav > :nth-child(3) { grid-area: 1 / 2; justify-self: end; }
.prose .st-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); color: var(--ink); font-weight: 800; text-decoration: none; white-space: nowrap; }
@media (min-width: 620px) {
  .prose .st-nav { grid-template-columns: 1fr auto 1fr; }
  .prose .st-nav > :nth-child(2) { grid-area: auto; }
  .prose .st-nav > :nth-child(3) { grid-area: auto; }
}
.prose .st-nav a:hover { background: var(--surface-2); }
@media (max-width: 360px) { .prose .st-nav a { padding: 0 10px; font-size: var(--fs-s); } } /* "November 15 →" fit 320 px phones */
.prose .st-cta { margin: var(--s-6) 0; padding: var(--s-5); border-radius: var(--r-xl); background: var(--surface-2); }
.prose .st-cta p { margin: 0; }
.prose .st-months h2 { margin: 1.6em 0 .6em; font-size: var(--fs-xl); }
.prose .st-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 6px; padding: 0; list-style: none; }
.prose .st-days li { margin: 0; }
.prose .st-days a { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 8px; border-radius: var(--r-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-weight: 700; font-size: var(--fs-s); text-decoration: none; white-space: nowrap; }
.prose .st-days a:hover { box-shadow: inset 0 0 0 1.5px var(--line-strong); background: var(--surface-2); }
.prose .st-topics { list-style: none; padding: 0; display: grid; gap: 8px; }
.prose .st-topics li { margin: 0; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: var(--fs-s); font-weight: 700; }
.prose .st-topics a { display: block; color: var(--ink); font-size: var(--fs-md); font-weight: 800; text-decoration: none; }
.prose .st-topics a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
@media (min-width: 620px) { .prose .st-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  /* phones: word over reading on the left, meaning on the right (three columns do not fit long words) */
  .prose .st-board { margin-inline: calc(var(--gutter) * -.5); padding-inline: 12px; }
  .prose .st-table, .prose .st-table tbody { display: block; }
  .prose .st-table thead { display: none; }
  .prose .st-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); column-gap: 14px; padding: .5em .2em; border-bottom: 1px solid var(--line); }
  .prose .st-table td { padding: 0; border: 0; }
  .prose .st-table td:nth-child(1) { grid-area: 1 / 1; white-space: normal; }
  .prose .st-table td:nth-child(2) { grid-area: 2 / 1; font-size: var(--fs-s); color: var(--ink-2); white-space: normal; }
  .prose .st-table td:nth-child(3) { grid-area: 1 / 2 / 3 / 3; align-self: center; }
  .prose .st-table td:nth-child(n+4) { grid-column: 1 / 3; white-space: normal; } /* 4th+ columns (examples, translations) get their own full-width line */
  .prose .st-table td[lang=ja] { white-space: normal; } /* long readings and keigo forms wrap instead of pushing the page sideways */
}

/* ---------- listen buttons (assets/js/say.js; only added when the device has a Japanese voice) ---------- */
.say-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-left: 6px; padding: 0; border: 0; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); vertical-align: middle; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s, color .15s; }
.say-btn:hover { background: var(--tile-hover); color: var(--ink); }
.say-btn.is-speaking { background: var(--accent); color: var(--on-accent); }
.prose .say-kana { cursor: pointer; border-radius: var(--r-sm); -webkit-tap-highlight-color: transparent; transition: background-color .15s; }
.prose .say-kana:hover { background: var(--surface-2); }
.prose .say-kana.is-speaking { background: var(--near-bg); }
.prose .say-hint { margin: 0 0 .4em; font-size: var(--fs-s); color: var(--muted); }
.dc-rv-group .say-btn { align-self: center; margin-left: -6px; background: color-mix(in srgb, var(--surface) 70%, transparent); }

/* ---------- 404 ---------- */
.lost { text-align: center; padding: var(--s-8) 0 0; }
.lost h1 { font-size: var(--fs-display); }

/* ---------- motion (only for people who haven't asked for less) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .dc-tile.sel { animation: dc-pop .22s var(--ease-spring); }
  .dc-tile.is-wrong { animation: dc-shake .4s var(--ease-out); }
  .dc-tile.is-right { animation: dc-hop .42s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
  .dc-group.is-new { animation: dc-band .38s var(--ease-spring) both; }
  .dc-board.is-won .dc-group { animation: dc-wave .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms); }
  .dc-msg:not(:empty), .br-just .br-msg { animation: dc-toast .28s var(--ease-spring); }
  .dc-msg-near:not(:empty) { animation: dc-near .5s var(--ease-out); }
  .dc-dot.is-lost { animation: dc-eat .4s var(--ease-out); }
  .dc-end:not([hidden]) .dc-end-card { animation: dc-rise .45s var(--ease-out) both; }
  .dc-share.is-done, .br-share.is-done { animation: dc-pop .3s var(--ease-spring); }
  .dc-skeleton i { animation: dc-pulse 1.1s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * 40ms); }
  .br-just .br-center.is-wrong { animation: dc-shake .4s var(--ease-out); }
  .br-just .br-center.is-right { animation: dc-hop .45s var(--ease-out); }
  .br-just .br-badge { animation: dc-band .3s var(--ease-spring) both; }
  .br-just .br-end { animation: dc-rise .45s var(--ease-out) both; }
  .dc-confetti i { animation: dc-burst .95s var(--ease-out) forwards; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@keyframes dc-pop { 0% { transform: scale(.94); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes dc-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes dc-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } 70% { transform: translateY(2px); } }
@keyframes dc-band { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes dc-wave { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-7px); } }
@keyframes dc-toast { from { transform: translateY(6px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dc-near { 0% { transform: scale(.9); opacity: 0; } 35% { transform: scale(1.08); opacity: 1; } 55% { transform: scale(1) rotate(-2deg); } 75% { transform: rotate(2deg); } 100% { transform: none; } }
@keyframes dc-eat { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(.72); } }
@keyframes dc-rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dc-pulse { from { opacity: .35; } to { opacity: .7; } }
@keyframes dc-burst { 0% { transform: translate(0, 0) scale(.4); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 0; } }
.dc-confetti { position: absolute; left: 50%; top: 30%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.dc-confetti i { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--c, var(--g1)); box-shadow: 0 0 0 1.5px var(--ink); opacity: 0; }

@media print { .site-header, .site-footer, .dc-actions, .dc-furigana { display: none; } }
