:root {
  color-scheme: dark;
  --night: #111a22;
  --panel: #213546;
  --text: #f0f5f8;
  --muted: #b0c2cf;
  --cyan: #82d9f6;
  --focus: #99ebff;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  color: var(--text);
  background: var(--night);
}
* { box-sizing: border-box; }
body, h1, h2, h3, p, ul, dl, dd { margin: 0; }
body { display: flex; flex-direction: column; min-height: 100svh; line-height: 1.65; background: radial-gradient(ellipse 85% 540px at 39% 140px, #294959, transparent 94%), #152432; }
a { color: inherit; text-decoration: none; }
button, input, summary { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button { border: 0; }
img { display: block; max-width: 100%; }
ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.play:focus-visible { outline-color: #132d41; }
.wrap { width: min(calc(100% - 80px), 1192px); margin-inline: auto; }
.icon, .search svg { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: fixed; top: 4px; left: 4px; z-index: 10; transform: translateY(-150%); border-radius: 4px; padding: 10px 16px; background: var(--night); }
.skip:focus { transform: none; }
.top { padding-top: env(safe-area-inset-top); background: #111a22; }
.header-inner, .brand, .menu, .search { display: flex; align-items: center; }
.header-inner { min-height: 76px; gap: clamp(24px,4vw,64px); }
.brand { gap: 9px; white-space: nowrap; font-weight: 900; font-size: 1.38rem; letter-spacing: -.07em; line-height: 1; }
.brand em { margin-left: .28em; font-family: system-ui,sans-serif; font-weight: 850; font-style: normal; font-size: .76em; letter-spacing: .015em; color: var(--cyan); }
.menu { gap: 5px; }
.menu a { display: inline-grid; place-items: center; min-height: 44px; padding: 5px 15px; border-radius: 4px; color: #b6c6d2; font-size: .91rem; font-weight: 700; }
.menu a:hover, .menu a[aria-current] { background: #23394a; color: var(--cyan); }
.search { width: min(29%,260px); gap: 10px; margin-left: auto; padding: 0 14px; border-radius: 5px; background: #223341; color: var(--muted); }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: -2px; }
.search input { width: 100%; min-width: 0; height: 42px; padding: 0; border: 0; outline: none; background: transparent; font-size: 1rem; }
.search input::placeholder { color: #b5c6d2; font-size: .9rem; }
main { flex: 1; padding-top: 30px; }
.poster { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); overflow: hidden; border-radius: 8px; background: #152533; box-shadow: 0 8px 30px #08152273; }
.poster-art { position: relative; min-height: clamp(338px,31vw,420px); background: #263b47; }
.poster-art img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.poster-content { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 24px clamp(20px,2.7vw,42px); background: radial-gradient(ellipse at 0 0,#254253,transparent 85%),#162633; }
.poster-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--cyan); font-size: .86rem; font-weight: 700; letter-spacing: .09em; }
.poster-kicker .icon { width: 17px; height: 17px; }
.poster h1 { max-width: 100%; margin: 12px 0 14px; font-size: clamp(1.85rem,4vw,3rem); line-height: 1.15; }
.poster-logo { width: auto; height: clamp(124px,11.5vw,165px); max-width: 100%; object-fit: contain; object-position: left; }
.poster-catch { color: #e3ecf3; font-size: 1rem; }
.poster-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.play, .details-link, .clear-search, dialog button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 15px; border-radius: 4px; font-size: .94rem; font-weight: 700; }
.control-label { display: block; text-align: center; line-height: 1.3; transform: translateY(.05em); }
.play { position: relative; padding-inline: 30px; background: linear-gradient(105deg,#c3e875,#98d362); color: #1b321c; }
.play:hover { background: #d3f696; }
.play .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; }
.details-link, .clear-search, dialog button { background: #2b4355; color: #e3f1f7; }
.details-link:hover, .clear-search:hover, dialog button:hover { background: #38596d; }
.stat { margin-top: 11px; color: var(--muted); font-size: .82rem; }
.discovery, .detail-layout { display: grid; grid-template-columns: 1fr 1.07fr; gap: clamp(24px,3.2vw,44px); align-items: start; margin-top: 32px; }
.discovery.filtered { grid-template-columns: minmax(0,760px); }
.library, .gallery { min-width: 0; }
.library { scroll-margin-top: 20px; }
.section-heading, h2 { display: flex; align-items: center; }
.section-heading { gap: 10px; min-height: 40px; margin-bottom: 12px; }
h2 { gap: 9px; font-size: clamp(1.18rem,2vw,1.38rem); line-height: 1.4; letter-spacing: .01em; }
h2 .icon { color: var(--cyan); width: 21px; height: 21px; }
.count, .published { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.clear-search { margin-left: auto; }
.cards { display: grid; gap: 10px; }
.game-card { position: relative; display: grid; grid-template-columns: 40% 1fr; min-height: 152px; background: var(--panel); border-radius: 5px; overflow: hidden; }
.card-image { position: relative; min-height: 100%; }
.card-image img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.card-body { align-self: center; padding: 15px clamp(12px,1.5vw,23px); }
.published { display: flex; align-items: center; gap: 5px; }
.card-body h3 { margin: 3px 0 5px; font-size: 1.25rem; line-height: 1.4; }
.card-body h3 a::after { content: ""; position: absolute; inset: 0; }
.game-card:focus-within { outline: 3px solid var(--focus); outline-offset: -3px; }
.card-body a:focus-visible { outline: 0; }
.game-card:hover { background: #2b4456; }
.card-copy { color: #d4e0e8; font-size: .91rem; }
.empty { padding: 20px; border-radius: 5px; background: var(--panel); }
.shots { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px; }
.shot { display: grid; grid-template-rows: auto 1fr; min-width: 0; padding: 0; border-radius: 4px; background: #1e303e; text-align: center; font-size: .84rem; font-weight: 650; }
.shot-caption { display: grid; place-items: center; min-height: 36px; padding: 5px; }
.shot-image { display: block; overflow: hidden; position: relative; border-radius: 4px 4px 0 0; }
.shot-image img { width: 100%; aspect-ratio: 1.16; object-fit: cover; object-position: 50% 46%; }
.enlarge { display: grid; place-items: center; position: absolute; right: 5px; bottom: 5px; width: 23px; height: 23px; border-radius: 4px; color: white; background: #101d28cb; }
.enlarge .icon { width: 14px; height: 14px; }
.shot:hover { background: #304e60; }
.crumb { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; color: var(--muted); font-size: .875rem; }
.crumb a, footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.detail-layout { grid-template-columns: minmax(0,1.5fr) minmax(270px,1fr); }
.detail-layout .shot-image img { aspect-ratio: .9; }
.description { margin: 28px 0 0; max-width: 68ch; }
.description p, details p { margin-top: 9px; color: #d6e1e8; line-height: 1.85; }
.game-info { padding: 22px; background: #203240; border-radius: 5px; }
.game-info h2 { font-size: 1.16rem; }
.game-info dl { margin: 12px 0; }
.game-info dl div { display: grid; grid-template-columns: 4em 1fr; gap: 10px; padding: 3px 0; }
.game-info dt { color: var(--muted); }
.game-info details { margin-top: 8px; }
.game-info summary { position: relative; display: grid; place-items: center; min-height: 44px; padding: 6px 28px; border-radius: 4px; background: #2b4355; color: var(--cyan); font-weight: 700; }
.game-info summary::-webkit-details-marker { display: none; }
.game-info summary::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-65%) rotate(45deg); }
.game-info details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
footer { margin-top: 50px; padding: 20px 0 calc(20px + env(safe-area-inset-bottom)); background: #111c25; color: var(--muted); font-size: .82rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; }
dialog { padding: 0; margin: auto; width: min(92vw,700px); max-height: 96vh; max-height: 96dvh; border: none; border-radius: 7px; color: var(--text); background: #172632; }
dialog::backdrop { background: #08121ce3; }
dialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.close-photo { justify-self: end; margin: 6px; }
.full-photo { width: 100%; height: min(69vh,720px); height: min(69dvh,720px); object-fit: contain; background: #0e1822; }
.photo-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 8px; text-align: center; }
.photo-controls button:first-child { justify-self: start; }
.photo-controls button:last-child { justify-self: end; }
#photo-caption { grid-column: 2; }
.photo-controls p { font-size: .9rem; }
@media (max-width: 900px) {
  .wrap { width: calc(100% - 40px); }
  .poster { grid-template-columns: 1.28fr 1fr; }
  .poster-content { padding: 20px; }
  .discovery { grid-template-columns: 1fr 1fr; gap: 22px; }
  .shots { gap: 6px; }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { justify-content: space-between; flex-wrap: wrap; gap: 8px 10px; padding-block: 11px; }
  .brand { gap: 6px; font-size: 1.18rem; }
  .brand img { width: 36px; height: 36px; }
  .menu { gap: 2px; }
  .menu a { padding: 8px 10px; font-size: .875rem; }
  .search { width: 100%; }
  main { padding-top: 18px; }
  .poster { display: block; }
  .poster-art { min-height: 0; aspect-ratio: 2.05; }
  .poster-content { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; column-gap: 12px; padding: 14px 16px 18px; }
  .poster h1 { grid-column: 1; grid-row: 1 / 3; margin: 0; }
  .poster-logo { width: auto; height: clamp(78px,23vw,100px); }
  .poster-kicker { grid-column: 2; grid-row: 1; align-self: end; font-size: .8rem; }
  .poster-catch { grid-column: 2; grid-row: 2; align-self: start; max-width: 19em; margin-top: 3px; }
  .poster-actions, .poster-content .stat { grid-column: 1 / -1; }
  .poster-actions { margin-top: 14px; }
  .poster-actions a { flex-grow: 1; }
  .discovery, .detail-layout { grid-template-columns: 1fr; gap: 24px; margin-top: 22px; }
  .section-heading { margin-bottom: 8px; }
  .game-card { min-height: 116px; grid-template-columns: 36% 1fr; }
  .card-body { padding: 13px; }
  .shots { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
  .description { margin-top: 24px; }
  .game-info { padding: 18px; }
  footer { margin-top: 34px; }
}
@media (max-width: 460px) {
  .shots { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .shot-image img { aspect-ratio: 1.4; }
  .detail-layout .shot-image img { aspect-ratio: 1.2; }
}
