:root {
  --background: #f7f4ed;
  --surface: #fffef9;
  --text: #263d35;
  --muted: #586653;
  --accent: #204f48;
  --accent-hover: #31665c;
  --on-accent: #fff8e9;
  --line: #d9dfd0;
  --wash: #e7ece2;
  --focus: #a36512;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
  font-synthesis: none;
  color-scheme: light;
}
:root[data-theme="ocean"] { --background: #edf4f7; --surface: #f8fcff; --text: #213c4c; --muted: #536f7b; --accent: #22637b; --accent-hover: #174c63; --line: #cbdde5; --wash: #dfedf3; }
:root[data-theme="forest"] { --background: #eaf0e5; --surface: #f6f9f1; --text: #2d422c; --muted: #596f50; --accent: #3c663c; --accent-hover: #2c522e; --line: #ccd8c1; --wash: #dbe6d2; }
:root[data-theme="rose"] { --background: #f8efed; --surface: #fff9f7; --text: #533b43; --muted: #806470; --accent: #875265; --accent-hover: #713e51; --line: #e6cfd4; --wash: #f0e0e3; }
:root[data-theme="midnight"] { --background: #202932; --surface: #2c3742; --text: #e4ebec; --muted: #b1bec5; --accent: #94c8bf; --accent-hover: #b6ded5; --on-accent: #172c2b; --line: #485763; --wash: #354650; --focus: #f2ba59; color-scheme: dark; }
* { box-sizing: border-box; }
html { scroll-padding-top: 2rem; }
body { margin: 0; font-size: 1rem; line-height: 1.65; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
a, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }
[hidden] { display: none !important; }
img { display: block; width: 100%; height: auto; }
p { margin: 0 0 1rem; }
h1, h2, h3, .brand-name { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1, h2, h3 { line-height: 1.12; }
h1 { font-size: clamp(2.5rem, 4.8vw, 4rem); letter-spacing: -.045em; margin: 0 0 1.1rem; }
h2 { font-size: 2rem; letter-spacing: -.025em; margin: 0; }
h3 { font-size: 1.55rem; margin: 0 0 .9rem; }
.shell { width: min(100% - 6rem, 1160px); margin-inline: auto; }
.skip-link { position: absolute; top: .75rem; left: .75rem; transform: translateY(-180%); padding: .5rem 1rem; background: var(--surface); z-index: 10; }
.skip-link:focus { transform: none; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 88px; display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; padding-block: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; flex-shrink: 0; }
.brand-mark { display: block; width: 40px; height: 40px; flex-shrink: 0; }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-name { font-size: 2.25rem; letter-spacing: -.045em; line-height: 1; }
.brand-detail { color: var(--muted); font-size: .75rem; font-weight: 650; letter-spacing: .16em; margin-left: .4rem; }
.header-nav { display: flex; gap: 1.75rem; margin-left: auto; }
.header-nav a { text-decoration: none; font-size: .875rem; }
.theme-control { display: flex; align-items: center; gap: .6rem; font-size: .875rem; color: var(--muted); }
.header-preferences { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }
.language-nav { display: flex; gap: .15rem; }
.language-nav a { display: grid; place-items: center; font-size: .75rem; min-width: 32px; min-height: 44px; border-radius: 7px; text-decoration: none; color: var(--muted); }
.language-nav a:hover { background: var(--wash); }
.language-nav a[aria-current="page"] { color: var(--accent); background: var(--wash); font-weight: 650; }
select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: .55rem .6rem; min-height: 44px; }
.intro { padding-block: 1rem; }
.intro h1 { font-size: clamp(2rem, 3.5vw, 2.75rem); margin-bottom: .5rem; }
.eyebrow { font-size: .75rem; font-weight: 650; letter-spacing: .17em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.intro-copy { font-size: 1.125rem; color: var(--muted); max-width: 550px; margin-bottom: 0; }
.copy-compact { display: none; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.35rem; }
.section-heading h2 { font-size: 1.625rem; }
.section-note { font-size: .875rem; color: var(--muted); margin: 0; }
.game-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.game-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.card-image { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: var(--background); }
.card-image img { height: 100%; object-fit: contain; transition: transform .35s ease; }
.card-image:hover img { transform: scale(1.025); }
.image-caption { position: absolute; bottom: 1rem; left: 1rem; background: var(--surface); color: var(--text); border-radius: 7px; padding: .35rem .7rem; font-size: .75rem; }
.card-copy { padding: 1.25rem; display: flex; flex: 1; flex-direction: column; align-items: start; }
.card-copy .actions { margin-top: auto; gap: .4rem 1rem; }
.card-copy .eyebrow { margin-bottom: .7rem; }
.card-copy h3 { font-size: 2.65rem; letter-spacing: -.035em; }
.card-copy h3 a { text-decoration: none; }
.card-copy p:not(.eyebrow) { color: var(--muted); }
.tags { list-style: none; padding: 0; margin: .25rem 0 1.65rem; display: flex; flex-wrap: wrap; gap: .5rem .6rem; }
.tags li { border: 1px solid var(--line); border-radius: 30px; padding: .25rem .65rem; font-size: .75rem; }
.card-copy .tags { margin: 1.25rem 0 0; }
.actions { display: flex; gap: 1.3rem; align-items: center; flex-wrap: wrap; }
.button { display: inline-block; background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); border-radius: 9px; padding: .7rem 1.25rem; font-size: .875rem; font-weight: 600; text-decoration: none; min-height: 44px; }
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.text-link { font-size: .875rem; padding-block: .65rem; }
.collection-note { margin: 1.25rem 0 0; font-size: .875rem; color: var(--muted); }
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 4rem; padding-block: 2.5rem; border-top: 1px solid var(--line); }
.about h2 { font-size: 2.15rem; margin-bottom: .8rem; }
.about-copy { color: var(--muted); max-width: 520px; }
.dictionary-entry { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.dictionary-entry .word { color: var(--text); }
.about-copy p:last-child { margin-bottom: 0; }
.word { color: var(--accent); font-family: Georgia, serif; font-style: italic; font-size: 1.25rem; }
.site-footer { border-top: 1px solid var(--line); margin-top: 1rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.75rem; color: var(--muted); font-size: .875rem; }
.footer-inner p { margin: 0; }
.footer-inner a { padding-block: .5rem; }
.breadcrumbs { font-size: .875rem; padding-top: 2rem; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; gap: .7rem; }
.breadcrumbs li + li::before { content: "/"; margin-right: .7rem; color: var(--muted); }
.detail-hero { display: grid; grid-template-columns: 1fr 1.08fr; gap: 3rem; align-items: center; padding-block: 2.75rem 3.5rem; }
.detail-copy h1 { font-size: clamp(2.5rem, 4.7vw, 3.75rem); }
.detail-copy > p:not(.eyebrow) { color: var(--muted); font-size: 1.125rem; }
.detail-image { border-radius: 18px; overflow: hidden; margin: 0; background: var(--surface); border: 1px solid var(--line); }
.detail-image img { aspect-ratio: 3 / 2; object-fit: cover; }
.detail-image figcaption { padding: .75rem 1rem; font-size: .875rem; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; border-block: 1px solid var(--line); padding-block: 2.5rem; }
.features p { margin: 0; color: var(--muted); }
.feature-title { font-size: 1.55rem; margin-bottom: .9rem; }
.how-to { padding-block: 3rem; max-width: 760px; }
.how-to h2 { margin-bottom: 1.25rem; }
.steps { padding-left: 1.5rem; color: var(--muted); }
.steps li { padding-left: .5rem; margin-bottom: 1rem; }
.steps li::marker { color: var(--accent); font-weight: 600; }
.language-note { color: var(--muted); font-size: .875rem; margin-block: 1.5rem; }
.not-found { padding-block: 6rem; max-width: 650px; min-height: 65vh; }
@media (max-width: 850px) {
  .shell { width: min(100% - 3rem, 1160px); }
  .header-inner { gap: 1.5rem; }
  .brand-detail { display: none; }
  .game-list { grid-template-columns: 1fr; }
  .game-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .detail-hero { gap: 1.75rem; }
  .features { gap: 1.5rem; }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 2.5rem); }
  .header-inner { min-height: 90px; flex-wrap: wrap; gap: 1rem; padding-block: 1.2rem; }
  .brand-name { font-size: 2rem; }
  .brand-mark { width: 35px; height: 35px; }
  .header-nav { gap: 1rem; }
  .header-preferences { width: 100%; justify-content: space-between; border-top: 1px solid var(--line); padding-top: .8rem; gap: .6rem; }
  .theme-control { flex-wrap: wrap; gap: .4rem; }
  .intro { padding-block: 1.5rem; }
  .intro-copy { font-size: 1rem; }
  .copy-full, .intro .eyebrow, .card-copy .eyebrow, .about .eyebrow,
  .image-caption, .collection-note, .section-note { display: none; }
  .copy-compact { display: inline; }
  .section-heading { align-items: center; }
  .section-heading h2 { font-size: 1.4rem; }
  .game-card, .about, .detail-hero, .features { grid-template-columns: 1fr; }
  .card-image { height: clamp(180px, 55vw, 300px); aspect-ratio: auto; }
  .card-image img { height: 100%; object-fit: contain; }
  .card-copy { padding: 1.25rem; }
  .about { gap: 1rem; margin-top: 2.5rem; padding-block: 2rem; }
  .detail-hero { padding-block: 2rem; }
  .features { gap: 2rem; }
  .footer-inner { align-items: start; flex-direction: column; gap: .5rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Shared game identity: cream artwork, teal tiles, and quiet depth. */
body { background: radial-gradient(ellipse at 85% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 38rem); }
.site-header { background: color-mix(in srgb, var(--background) 92%, transparent); }
.brand-mark { width: 48px; height: 48px; filter: drop-shadow(0 3px 5px #082e291a); }
.brand-name { font-size: 2.5rem; }
.brand-detail { letter-spacing: .12em; }
.header-nav a { padding-block: .6rem; }
.section-heading { margin-bottom: 1rem; }
.game-card { border-radius: 24px; box-shadow: 0 8px 28px #082e290a; }
.game-identity { display: flex; align-items: center; gap: .75rem; margin-bottom: .85rem; width: 100%; }
.game-identity > div { min-width: 0; }
.game-icon { width: 48px; height: 48px; flex: 0 0 auto; filter: drop-shadow(0 4px 5px #082e2924); }
.game-identity .eyebrow { font-size: .65rem; letter-spacing: .13em; margin-bottom: .4rem; }
.game-identity h3 { font-size: 1.65rem; margin: 0; }
.card-copy > p { margin-bottom: 1rem; font-size: .9375rem; }
.tags { gap: .45rem; }
.tags li { border: 0; background: var(--wash); padding: .3rem .7rem; }
.button { border-radius: 12px; padding: .8rem 1.3rem; box-shadow: 0 3px 0 #082e2914; transition: background .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.image-caption { border-radius: 10px; background: var(--surface); }
.about { margin-top: 4.5rem; padding-block: 3rem; }
.detail-icon { width: 88px; height: 88px; margin-bottom: 1.5rem; }
.detail-image { border-radius: 24px; box-shadow: 0 12px 28px #082e2910; }
@media (max-width: 1000px) {
  .game-identity { gap: .8rem; }
  .game-identity .game-icon { width: 44px; height: 44px; }
}
@media (max-width: 620px) {
  .brand-mark { width: 40px; height: 40px; }
  .brand-name { font-size: 2.15rem; }
  .intro { padding-block: 1.5rem; }
  .game-card, .detail-image { border-radius: 20px; }
  .game-list { gap: 1.5rem; }
  .game-identity { margin-bottom: 1rem; }
  .card-copy { padding: 1.35rem; }
  .card-copy .tags { margin-top: 1rem; }
  .detail-icon { width: 80px; height: 80px; }
  .about { margin-top: 2.5rem; padding-block: 2rem; }
}
@media (prefers-reduced-motion: reduce) { .button { transition: none; } .button:hover { transform: none; } }
@media (max-width: 620px) {
  .theme-control label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .header-preferences { flex-wrap: nowrap; }
  .theme-control select { max-width: 150px; }
}

/* Keep the catalog named for assistive technology without a visible heading. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.card-image-mahjong img { object-fit: contain; }
.detail-image .game-preview-mahjong { aspect-ratio: auto; }
.offline strong { color: var(--text); }

@media (min-width: 621px) and (max-width: 850px) {
  .card-image { align-self: center; }
}
