:root {
  color-scheme: light;
  --ink: #252b29;
  --muted: #69736f;
  --line: #e4e5df;
  --surface: #fff;
  --canvas: #faf9f6;
  --teal: #16756a;
  --teal-dark: #105d55;
  --teal-pale: #e9f3ef;
  --warning: #9a4427;
  font-family: "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-shell { width: min(100% - 48px, 1120px); margin: 0 auto; }
.site-shell--editor { width: min(100% - 48px, 1210px); }
.site-header { display: flex; min-height: 86px; align-items: center; justify-content: space-between; gap: 25px; border-bottom: 1px solid var(--line); }
.brand { display: flex; flex: 0 0 auto; align-items: center; text-decoration: none; }
.brand img { display: block; width: 186px; height: auto; }
.site-nav { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 3vw, 38px); }
.site-nav a { color: #505a55; font-size: 14px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.site-nav a:hover, .breadcrumbs a:hover, .editor-back a:hover { color: var(--teal); }
.language-picker select { min-width: 132px; height: 40px; padding: 0 31px 0 12px; border: 1px solid #d9dbd4; border-radius: 9px; color: var(--ink); background: var(--surface); font-size: 13px; }
.language-picker select:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #75b9a8; outline-offset: 2px; }

.hero { max-width: 780px; margin: 88px auto 75px; text-align: center; }
.hero__eyebrow, .eyebrow { margin: 0 0 11px; color: var(--teal); font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.hero h1 { margin: 0; font-size: clamp(34px, 5vw, 56px); letter-spacing: -.045em; line-height: 1.2; }
.hero__lead { margin: 19px 0 8px; color: #3a4540; font-size: clamp(17px, 2vw, 21px); }
.hero__copy { max-width: 650px; margin: 0 auto; color: var(--muted); font-size: 15px; line-height: 1.7; }
.button { display: inline-flex; min-height: 45px; align-items: center; justify-content: center; gap: 12px; padding: 0 18px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 14px; font-weight: 720; line-height: 1.2; text-decoration: none; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.button--primary { color: #fff; background: var(--teal); }
.button--primary:hover:not(:disabled) { background: var(--teal-dark); }
.button--primary:disabled { cursor: not-allowed; opacity: .5; }
.button--quiet { border-color: var(--line); color: var(--ink); background: var(--surface); }
.button--quiet:hover { border-color: #c5d1cb; background: #f6f7f3; }
.hero__cta { min-width: 230px; min-height: 54px; margin-top: 28px; font-size: 16px; }
.hero__cta span, .game-card .button span { font-size: 19px; font-weight: 500; }

.content-section { margin: 0 auto 68px; scroll-margin-top: 24px; }
.section-title-row { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.section-title-row .eyebrow, .content-section > .eyebrow { margin-bottom: 7px; }
.content-section h2 { margin: 0; font-size: 26px; letter-spacing: -.025em; }
.support-count { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 50%; color: var(--teal-dark); background: var(--teal-pale); font-size: 14px; font-weight: 750; }
.game-card { display: grid; grid-template-columns: 212px minmax(0,1fr); gap: 25px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 5px 20px rgb(37 43 41 / 3%); }
.game-card__thumbnail { min-height: 190px; overflow: hidden; border: 1px solid #e5e8e1; border-radius: 10px; background: #f0f1eb; }
.game-card__thumbnail-fallback { display: grid; width: 100%; height: 100%; min-height: inherit; place-items: center; padding: 16px; color: #4a5851; text-align: center; }
.game-card__thumbnail-fallback span { max-width: 155px; font-size: 18px; font-weight: 700; line-height: 1.55; }
.game-card__body { align-self: center; padding: 2px 4px 2px 0; }
.game-card__meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.status-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 99px; color: var(--teal-dark); background: var(--teal-pale); font-size: 11px; font-weight: 750; }
.game-card h3 { margin: 10px 0 7px; font-size: 23px; }
.game-card p { max-width: 720px; margin: 0 0 9px; color: #525c56; font-size: 14px; line-height: 1.65; }
.game-card .game-card__note { margin: 0 0 17px; color: #7a837d; font-size: 12px; }
.content-section--compact { max-width: 820px; padding: 25px 0; border-top: 1px solid var(--line); }
.steps { display: grid; gap: 9px; margin: 17px 0 0; padding-left: 25px; color: #515b55; font-size: 15px; line-height: 1.6; }
.steps li { padding-left: 5px; }
.editor-reference h2:not(:first-of-type) { margin-top: 24px; }
.editor-reference > p { color: #515b55; font-size: 14px; line-height: 1.65; }
.editor-reference__list { display: grid; gap: 6px; margin: 14px 0 0; padding-left: 22px; color: #515b55; font-size: 14px; line-height: 1.6; }
.editor-reference .editor-reference__tested { margin: 11px 0 0; color: var(--muted); font-size: 12px; }
.faq-list { display: grid; gap: 10px; margin-top: 19px; }
.faq-list details { padding: 15px 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.faq-list summary { cursor: pointer; font-size: 14px; font-weight: 700; }
.faq-list p { margin: 11px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.site-footer { display: flex; align-items: baseline; gap: 18px; padding: 22px 0 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer a { color: var(--teal-dark); font-weight: 750; text-decoration: none; white-space: nowrap; }
.site-footer p { margin: 0; line-height: 1.5; }

.breadcrumbs { display: flex; align-items: center; gap: 10px; margin: 22px 0 15px; color: #747e78; font-size: 12px; }
.breadcrumbs a { color: var(--teal-dark); text-decoration: none; }
.game-heading { max-width: 840px; margin: 34px auto 22px; }
.game-heading .eyebrow { margin-bottom: 6px; }
.game-heading h1 { margin: 0 0 9px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.035em; }
.game-heading > p:last-child { max-width: 790px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.ad-slot { border: 1px dashed #d8ddd6; border-radius: 4px; background: #f3f3ef; }
.ad-slot--top, .ad-slot--bottom { width: min(100%, 728px); aspect-ratio: 728 / 90; margin: 17px auto 23px; }
.editor-layout { display: block; }
.editor-layout--with-sidebar { display: grid; grid-template-columns: minmax(0,1fr) 300px; align-items: start; gap: 24px; }
.ad-slot--sidebar { width: 300px; height: 600px; margin-top: 0; }
.editor-main { width: min(100%, 850px); margin: 0 auto; }
.editor-layout--with-sidebar .editor-main { width: 100%; }
.file-card, .editor-card, .download-success { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 4px 16px rgb(37 43 41 / 3%); }
.file-card { position: relative; display: flex; align-items: flex-start; gap: 16px; padding: 22px; transition: border-color .15s ease, background-color .15s ease; }
.file-card.is-dragging { border-color: var(--teal); background: #f4faf7; }
.file-card__icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 11px; color: var(--teal); background: var(--teal-pale); }
.file-card__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.file-card__body { min-width: 0; flex: 1; }
.file-card h2, .editor-card h2 { margin: 1px 0 6px; font-size: 17px; letter-spacing: -.02em; }
.file-card__body > p:not(.file-help) { margin-bottom: 14px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.file-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.file-picker { position: relative; overflow: hidden; }
.file-picker__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-picker:focus-within { outline: 3px solid #75b9a8; outline-offset: 2px; }
.file-help { margin: 9px 0 0; color: #858e88; font-size: 12px; }
.file-card__selected { min-width: 100%; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.file-card__selected-name { display: block; overflow: hidden; color: var(--ink); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.file-card__selected-size { display: block; margin-top: 3px; }
.status-line { min-height: 22px; gap: 8px; margin: 10px 3px; color: var(--muted); font-size: 12px; }
.status-line__dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #a4ada7; }
.status-line[data-state="busy"] .status-line__dot { background: #bd8b37; }
.status-line[data-state="error"] { color: var(--warning); }
.status-line[data-state="error"] .status-line__dot { background: #c15b41; }
.status-line[data-state="ready"] .status-line__dot { background: var(--teal); }
.editor-card { margin-top: 17px; padding: 20px 22px 17px; }
.editor-card__header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 15px; border-bottom: 1px solid #eceee9; }
.editor-card__header .eyebrow { margin: 0 0 5px; }
.editor-card__header h2 { margin: 0; }
.field-count { display: inline-grid; min-width: 32px; height: 29px; place-items: center; padding: 0 9px; border-radius: 20px; color: var(--teal-dark); background: var(--teal-pale); font-size: 12px; font-weight: 750; }
.editor-tabs { display: flex; gap: 4px; margin: 12px 0 14px; border-bottom: 1px solid var(--line); }
.editor-tab { min-height: 43px; padding: 0 17px; border: 0; border-bottom: 3px solid transparent; color: #65706a; background: transparent; cursor: pointer; font-size: 13px; font-weight: 700; }
.editor-tab[aria-selected="true"] { border-bottom-color: var(--teal); color: var(--teal-dark); }
.tab-panel { min-height: 160px; }
.filter-row { display: grid; align-items: end; gap: 10px; }
.resource-controls { grid-template-columns: minmax(0,1.5fr) minmax(130px,1fr) auto; }
.growth-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
.filter-control { display: grid; min-width: 0; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 650; }
.filter-control input, .filter-control select { width: 100%; min-width: 0; height: 39px; padding: 0 10px; border: 1px solid #d9ddd7; border-radius: 8px; color: var(--ink); background: #fff; font-size: 12px; font-weight: 450; }
.owned-filter { display: flex; min-height: 39px; align-items: center; gap: 7px; color: #46514b; font-size: 11px; white-space: nowrap; }
.owned-filter input { width: 16px; height: 16px; accent-color: var(--teal); }
.original-names-note, .section-help { margin: 9px 0 5px; color: #737d77; font-size: 11px; line-height: 1.5; }
.resource-list { max-height: 390px; margin-top: 11px; overflow: auto; border-top: 1px solid #eceee9; scrollbar-color: #c8d1cb transparent; scrollbar-width: thin; }
.field-list { display: grid; }
.edit-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(75px,105px) minmax(120px,160px); align-items: center; gap: 14px; min-height: 58px; padding: 8px 3px 8px 0; border-bottom: 1px solid #eceee9; }
.edit-row__label { display: grid; min-width: 0; gap: 3px; }
.edit-row__name { overflow-wrap: anywhere; font-size: 13px; font-weight: 680; }
.edit-row__category { color: var(--muted); font-size: 10px; }
.edit-row__current, .edit-row__new { display: grid; gap: 3px; color: var(--muted); font-size: 10px; }
.edit-row__current strong { color: #46514b; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.edit-row__new input { width: 100%; height: 36px; padding: 0 9px; border: 1px solid #d9ddd7; border-radius: 7px; color: var(--ink); background: white; font-size: 13px; font-variant-numeric: tabular-nums; }
.edit-row__new input[aria-invalid="true"] { border-color: #bd5a40; }
.empty-filter { margin: 16px 0 5px; color: var(--muted); font-size: 12px; }
.inline-error { margin: 11px 0 0; color: var(--warning); font-size: 12px; }
.changes-panel { margin-top: 13px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfa; font-size: 12px; }
.changes-panel summary { color: var(--teal-dark); cursor: pointer; font-weight: 700; }
.changes-panel ul { display: grid; gap: 6px; margin: 10px 0 0; padding-left: 20px; color: var(--ink); }
.changes-panel li { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.editor-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding-top: 15px; border-top: 1px solid #eceee9; }
.privacy-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.backup-note { margin: 12px 0 0; color: #7d8780; font-size: 11px; line-height: 1.5; }
.download-success { display: grid; justify-items: center; margin-top: 17px; padding: 48px 24px; text-align: center; }
.success-mark { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; color: var(--teal-dark); background: var(--teal-pale); font-size: 29px; font-weight: 600; }
.download-success h2 { margin: 17px 0 8px; font-size: 23px; }
.download-success p { max-width: 500px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.success-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 25px; }
.editor-help { max-width: 740px; margin: 28px auto 0; padding-top: 17px; border-top: 1px solid var(--line); }
.editor-help h2 { margin: 0 0 9px; font-size: 15px; }
.editor-help ol { display: grid; gap: 5px; margin: 0; padding-left: 22px; color: #59635d; font-size: 12px; line-height: 1.5; }
.editor-back { margin: 22px 0 0; font-size: 12px; }
.editor-back a { color: var(--teal-dark); text-decoration: none; }

@media (max-width: 900px) {
  .site-shell--editor { width: min(100% - 32px, 850px); }
  .editor-layout--with-sidebar { display: block; }
  .ad-slot--sidebar { display: none !important; }
}
@media (max-width: 650px) {
  .site-shell, .site-shell--editor { width: min(100% - 28px, 100%); }
  .site-header { min-height: 72px; flex-wrap: wrap; justify-content: space-between; gap: 8px 15px; padding: 10px 0; }
  .brand img { width: 145px; }
  .site-nav { order: 3; width: 100%; justify-content: space-between; gap: 7px; padding: 4px 0 1px; }
  .site-nav a { font-size: 12px; }
  .language-picker select { min-width: 105px; height: 36px; font-size: 12px; }
  .hero { margin: 53px auto 55px; }
  .hero h1 { font-size: clamp(31px, 9vw, 43px); }
  .hero__lead { font-size: 17px; line-height: 1.5; }
  .hero__copy { font-size: 13px; }
  .hero__cta { width: 100%; max-width: 340px; }
  .content-section { margin-bottom: 48px; }
  .content-section h2 { font-size: 22px; }
  .game-card { grid-template-columns: 1fr; gap: 16px; padding: 14px; }
  .game-card__thumbnail { min-height: 115px; }
  .game-card__thumbnail-fallback { min-height: 115px; }
  .game-card__thumbnail-fallback span { font-size: 16px; }
  .game-card h3 { font-size: 20px; }
  .game-card p { font-size: 13px; }
  .site-footer { display: grid; gap: 7px; }
  .breadcrumbs { margin-top: 16px; }
  .game-heading { margin-top: 24px; }
  .game-heading h1 { font-size: 31px; }
  .file-card { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 12px; padding: 16px; }
  .file-card__body { grid-column: 1 / -1; }
  .file-card__icon { grid-column: 1 / -1; }
  .file-help { font-size: 11px; }
  .editor-card { padding: 17px 14px 14px; }
  .editor-tab { min-height: 42px; flex: 1; padding: 0 7px; font-size: 12px; }
  .resource-controls { grid-template-columns: minmax(0,1fr) minmax(112px,.8fr); }
  .filter-control--search { grid-column: 1 / -1; }
  .owned-filter { grid-column: 1 / -1; min-height: 25px; }
  .edit-row { grid-template-columns: minmax(0,1fr) minmax(54px,68px) minmax(94px,116px); gap: 8px; min-height: 55px; }
  .edit-row__name { font-size: 12px; }
  .edit-row__current strong { font-size: 12px; }
  .edit-row__new input { height: 35px; font-size: 12px; }
  .editor-card__footer { align-items: stretch; flex-direction: column; }
  .editor-card__footer .button { width: 100%; }
  .download-success { padding: 36px 18px; }
  .success-actions { width: 100%; flex-direction: column; }
  .success-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
