:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --ink: #203d39;
  --muted: #607871;
  --line: #dce8e2;
  --accent: #087c70;
  --accent-hover: #06665c;
  --soft: #e5f4ed;
  font-family: system-ui, 'Hiragino Sans', 'Yu Gothic UI', Meiryo, sans-serif;
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
input, select, button { font: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled, input:disabled { cursor: default; opacity: .6; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: absolute; z-index: 6; padding: 14px 20px; background: var(--accent); color: #fff; border-radius: 0 0 12px 0; }
.header { border-bottom: 1px solid var(--line); background: #ffffff; }
.topbar { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; letter-spacing: -.045em; line-height: 1.1; white-space: nowrap; }
.brand > img { flex: none; display: block; width: 32px; height: 32px; }
.brand small { display: block; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .1em; margin-top: 3px; }
.nav-link, .back { display: inline-flex; align-items: center; gap: 8px; color: #46645b; font-size: 13px; font-weight: 700; }
.nav-link { white-space: nowrap; padding: 10px 0; }
.nav-icon { display: block; flex: none; width: 18px; height: 18px; }
.nav-link .nav-icon { color: var(--accent); }
.nav-link:hover, .back:hover, .footer a:hover { color: var(--accent); }
.language-picker { position: relative; z-index: 5; font-size: 13px; }
.language-picker summary { cursor: pointer; list-style: none; min-height: 36px; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.language-picker summary:hover { border-color: #9fc7b8; }
.language-picker summary::-webkit-details-marker { display: none; }
.language-picker summary::after { content: ''; width: 7px; height: 7px; margin-inline-start: 5px; margin-block-start: -4px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.language-picker nav { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); width: 215px; padding: 6px; border: 1px solid #bfd8cb; border-radius: 6px; background: var(--panel); }
.language-picker a { display: block; padding: 10px 12px; border-radius: 3px; }
.language-picker a:hover, .language-picker a[aria-current="true"] { color: var(--accent); background: var(--soft); }
.language-picker a[aria-current="true"] { font-weight: 750; }
.eyebrow { font-size: 11px; font-weight: 750; letter-spacing: .13em; color: var(--accent); margin: 0; line-height: 1.45; }
h1, h2, h3, p { overflow-wrap: anywhere; }
.primary, .secondary { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 11px 18px; border-radius: 6px; border: 1px solid transparent; font-size: 13px; font-weight: 750; transition: background-color .16s, border-color .16s; }
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-hover); }
.secondary { background: var(--panel); border-color: #ccdfd5; color: var(--ink); }
.secondary:hover:not(:disabled) { background: #f0f8f4; border-color: #8fb7a7; }
.catalog { padding-block: 28px 48px; scroll-margin-top: 16px; }
.section-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 340px) auto; align-items: end; gap: 16px; }
.section-label span { color: var(--accent); margin-right: 4px; }
.catalog-heading h1 { margin: 0; font-size: clamp(26px, 3vw, 32px); line-height: 1.3; letter-spacing: -.035em; }
.catalog-intro { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.search, .sort select { min-height: 44px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--muted); }
.search { min-width: 0; width: 100%; display: flex; align-items: center; padding: 0 13px; gap: 9px; }
.search svg { flex: none; fill: none; stroke: #718b80; stroke-width: 1.8; stroke-linecap: round; }
.search input { min-width: 0; width: 100%; color: var(--ink); padding-block: 12px; border: 0; background: transparent; font-size: 13px; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search input:focus-visible { outline: none; }
.toolbar { margin-top: 20px; }
.filters, .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.filter, .tag { padding: 8px 14px; background: #f1f6f3; border: 1px solid transparent; border-radius: 4px; color: #526d62; font-size: 12px; font-weight: 650; line-height: 1.5; }
.filter { min-height: 38px; }
.filter:hover { border-color: #8fb7a7; }
.filter[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.tag { background: #edf5f0; border-color: transparent; }
.sort { flex: none; }
.sort select { max-width: 220px; min-height: 44px; padding: 7px 10px; font-size: 12px; }
.count { font-size: 12px; color: var(--muted); margin: 12px 0 10px; }
.notice { text-align: center; padding: 32px 20px; border-radius: 6px; border: 1px solid var(--line); background: #f0f8f3; }
.notice-icon { padding: 8px; fill: none; stroke: var(--accent); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.notice h2 { margin: 12px 0 6px; font-size: 17px; }
.notice p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.notice .secondary { margin-top: 16px; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 20px; }
.game-card { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; min-width: 0; overflow: hidden; transition: border-color .16s; }
.game-card:hover { border-color: var(--accent); }
.game-card a { display: flex; flex-direction: column; height: 100%; }
.game-card a:focus-visible { outline-offset: -3px; border-radius: 6px; }
.cover { display: grid; place-items: center; aspect-ratio: 16/9; background: #e4f2ea; overflow: hidden; }
.cover img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.cover span { color: var(--accent); font-size: 42px; }
.game-copy { flex: 1; display: flex; flex-direction: column; padding: 14px; }
.game-copy h2 { margin: 0 0 12px; font-size: 17px; line-height: 1.45; letter-spacing: -.025em; }
.game-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-top: auto; }
.game-meta .eyebrow { color: var(--muted); font-size: 11px; letter-spacing: 0; font-weight: 500; }
.play-link { color: var(--accent); margin-inline-start: auto; font-size: 12px; font-weight: 750; white-space: nowrap; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 28px; color: var(--muted); font-size: 13px; }
.footer { border-top: 1px solid var(--line); background: #f0f7f3; }
.footer-inner { min-height: 80px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 11px; letter-spacing: .03em; }
.footer b { color: #ce7947; margin-inline: 6px; }
.player { padding-block: 30px 54px; }
.back { margin-bottom: 30px; }
.player h1 { font-size: clamp(30px, 5vw, 50px); line-height: 1.3; letter-spacing: -.035em; margin: 10px 0 14px; }
.player-status, .game-description, .help, .noscript { color: var(--muted); line-height: 1.8; }
.game-description { max-width: 75ch; font-size: 14px; }
.player-poster { position: relative; isolation: isolate; display: grid; place-items: center; width: 100%; aspect-ratio: 16/9; overflow: hidden; margin-top: 28px; border: 1px solid #c6ddd0; border-radius: 6px; background: #e1f1e8; }
.player-poster > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.player-poster-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 22px; background: #123c351a; }
.player-poster[data-game="afterbell"] .player-poster-overlay { align-items: end; padding-block-end: clamp(12px, 3vw, 28px); }
.player-start { min-width: min(260px, 100%); min-height: 70px; padding: 20px 36px; border: 1px solid #ffffff; font-size: clamp(20px, 3vw, 28px); line-height: 1.3; }
.player-start:focus-visible { outline: 3px solid #fff; outline-offset: 6px; }
body.player-open { overflow: hidden; }
.player-box { display: flex; flex-direction: column; background: #f5fbfa; overflow: hidden; }
.player-box.is-expanded, .player-box:fullscreen { position: fixed; inset: 0; z-index: 1000; width: 100%; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; }
.player-box::backdrop { background: #f5fbfa; }
.close-game-dialog { position: fixed; inset: 0; width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 30px; overflow-y: auto; border: 1px solid #d1e4d9; border-radius: 8px; background: var(--panel); color: var(--ink); }
.close-game-dialog::backdrop { background: #183e3777; }
.close-game-dialog h2 { margin: 0; font-size: clamp(20px, 4vw, 25px); line-height: 1.5; }
.close-game-dialog p { margin: 12px 0 26px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.close-game-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
.close-game-actions button { min-height: 48px; font-size: 14px; line-height: 1.5; }
.close-game-actions .close-game-confirm { background: #fff; border-color: #cfddd5; color: #52685f; }
.close-game-actions .close-game-confirm:hover { background: #f0f6f2; border-color: #a9c5b7; }
.player-stage-toolbar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid #dce8e2; background: #ffffff; }
.player-stage-home { display: inline-flex; align-items: center; gap: 9px; min-height: 38px; padding: 6px 12px 6px 9px; border-radius: 4px; color: var(--accent); font-size: 15px; font-weight: 800; }
.player-stage-home:hover { background: var(--soft); }
#close-player { flex: none; min-height: 38px; padding: 7px 12px; gap: 10px; font-size: 12px; }
.player-stage-body { position: relative; flex: 1 1 auto; min-height: 0; }
.player-frame { width: 100%; height: 100%; min-width: 0; min-height: 0; }
.player-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: #f5fbfa; }
.player-loading { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 28px 20px; overflow: auto; background: #f5fbfa; color: var(--ink); }
.player-loading[hidden] { display: none; }
.player-loading-card { width: min(420px, 100%); margin: auto; text-align: center; }
.player-loading-card img { display: block; margin: 0 auto 12px; }
.player-loading-brand { margin: 0 0 24px; color: var(--accent); font-weight: 800; letter-spacing: .02em; }
.player-loading h2 { margin: 0; font-size: clamp(20px, 4vw, 26px); line-height: 1.5; overflow-wrap: anywhere; }
.player-loading-card p { font-size: 13px; line-height: 1.8; }
#player-loading-detail { min-height: 3.6em; margin: 14px 0 20px; color: var(--muted); }
.player-loading progress { display: block; width: 100%; height: 9px; border: 0; border-radius: 9px; overflow: hidden; accent-color: var(--accent); background: #d9eae0; }
.player-loading progress::-webkit-progress-bar { background: #d9eae0; }
.player-loading progress::-webkit-progress-value { background: var(--accent); border-radius: 9px; }
.player-loading progress::-moz-progress-bar { background: var(--accent); border-radius: 9px; }
.player-loading-count { color: var(--muted); font-variant-numeric: tabular-nums; }
#player-loading-retry { margin-top: 20px; min-height: 48px; white-space: normal; line-height: 1.5; }
.help { font-size: 12px; }
@media (max-width: 900px) {
  .section-top { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px 10px; }
  .catalog-heading { grid-column: 1 / -1; }
}
@media (max-width: 770px) {
  .wrap { width: calc(100% - 40px); }
  .header-actions { gap: 16px; }
  .game-grid { gap: 18px; }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 32px); }
  .topbar { min-height: 54px; gap: 10px; padding-block: 7px; flex-wrap: wrap; }
  .brand { font-size: 18px; }
  .brand > img { width: 30px; height: 30px; }
  .header-actions { margin-inline-start: auto; }
  .header-actions > .nav-link { display: none; }
  .language-picker summary { max-width: 180px; padding-inline: 12px; }
  .catalog { padding-block: 20px 32px; }
  .search { width: 100%; }
  .toolbar { margin-top: 12px; }
  .filter { flex: none; min-height: 34px; padding: 6px 10px; }
  .sort { max-width: 124px; }
  .sort select { max-width: 100%; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .game-copy { padding: 12px; }
  .game-copy h2 { font-size: 14px; margin-bottom: 10px; }
  .game-meta { gap: 5px 8px; }
  .game-meta .eyebrow, .play-link { font-size: 11px; }
  .footer-inner { min-height: 76px; font-size: 10px; }
  .player { padding-top: 24px; }
  .back { margin-bottom: 24px; }
  .player-start { min-width: min(220px, 100%); min-height: 64px; padding: 16px 24px; }
  .player-stage-toolbar { gap: 8px; padding-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right)); }
  .player-stage-home { padding-inline: 6px; font-size: 14px; }
}
@media (max-width: 359px) {
  .topbar { flex-wrap: nowrap; }
  .brand { gap: 7px; font-size: 17px; }
  .language-picker summary { max-width: 154px; padding-inline: 8px; gap: 6px; font-size: 11px; }
  .language-picker summary::after { margin-inline-start: 2px; }
  .game-grid { grid-template-columns: 1fr; }
  .game-copy h2 { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .game-card:hover, .player-start:hover, .player-start:active { transform: none; }
}
