/* Public-facing design and shared theme; editor controls remain in styles.css. */
:root { --text: #202923; --muted: #627067; --line: #dce1da; --surface: #fff; --accent-on: #fff; --play-on: #171c1a; }
:root {
  --post-text: #344039; --post-title: #202923; --post-date: #526056; --post-link: #27583e;
  --page-title: #202923; --page-text: #526056; --tagline-text: #465449;
  --header-text: #f8faf7; --nav-text: #506054; --footer-text: #d5ded2;
}
body { background: #f5f6f4; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
.site-header, .site-footer { flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -90px; z-index: 1000; padding: 12px 18px; background: #fff; color: #171c1a; border: 2px solid var(--accent); border-radius: 4px; }
.skip-link:focus { top: 12px; }
.site-topbar { padding: 16px max(24px, calc((100% - 1200px) / 2)); min-height: 82px; gap: 26px; background: #181d1b; color: var(--header-text); }
.site-brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; color: inherit; text-decoration: none; font-size: 21px; font-weight: 850; line-height: 1; }
.site-brand img { image-rendering: pixelated; width: 36px; height: 36px; border: 1px solid #5c6860; border-radius: 3px; }
.site-brand small { display: block; font-size: 9px; margin-top: 5px; }
.header-links { flex: 1 1 auto; justify-content: flex-end; gap: 8px; }
.header-links .platform-link { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 10px 13px; background: #252c28; color: var(--header-text); border: 1px solid #465047; border-radius: 5px; font-size: 13px; font-weight: 600; text-decoration: none; min-width: 0; transition: background .15s ease, border-color .15s ease; }
.platform-link > span { min-width: 0; overflow-wrap: anywhere; }
.platform-link .outbound-icon { width: 13px; height: 13px; opacity: .65; }
.platform-link .platform-icon { width: 18px; height: 18px; }
.header-links .platform-itch { border-color: #825a57; }
.platform-itch .platform-icon { color: #ff9c91; }
.header-links .platform-link:hover { background: #3b473e; border-color: #d9f078; }
.header-links .platform-link:focus-visible, .site-brand:focus-visible { outline-color: #d9f078; }
.language-picker { gap: 5px; border-left: 1px solid #475047; padding-left: 19px; color: var(--header-text); flex: 0 0 auto; }
.language-picker > svg { width: 16px; height: 16px; }
.language-picker select { background: transparent; color: var(--header-text); border: 0; max-width: 130px; font-size: 12px; cursor: pointer; padding: 5px 2px; }
.language-picker option { color: #1d251f; background: #fff; }
.hero-banner { position: relative; isolation: isolate; container-type: inline-size; display: block; height: auto; background: #56634a; overflow: hidden; }
.site-logo-image { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-inner { width: min(1200px, calc(100% - 48px)); margin: 0 auto; padding: var(--hero-top, 28px) 0 28px; min-height: var(--hero-height, 350px); display: flex; flex-direction: column; justify-content: center; align-items: center; }
.hero-banner[data-align="left"] .hero-inner { align-items: flex-start; }
.hero-banner[data-align="right"] .hero-inner { align-items: flex-end; }
.hero-sprite { position: relative; overflow: hidden; flex: 0 0 auto; max-width: 100%; }
.hero-sprite img { position: absolute; display: block; width: 100%; max-width: none; height: auto; left: 0; top: 0; }
.hero-logo { width: min(var(--hero-logo-width, 420px), 100%); aspect-ratio: 840 / 380; margin-top: var(--hero-logo-top, 0px); }
.hero-badge { width: min(var(--hero-badge-width, 144px), 100%); aspect-ratio: 205 / 45; margin-top: var(--hero-badge-gap, 12px); }
.hero-banner.pixel-art .hero-sprite img { image-rendering: pixelated; }
.hero-inner .play-button { margin-top: var(--hero-play-gap, 24px); flex: 0 0 auto; }
@container (max-width: 600px) {
  .hero-inner { width: calc(100% - 36px); min-height: min(var(--hero-height, 350px), 300px); }
  .hero-inner .play-button { font-size: 12px; padding: 10px 14px; min-height: 44px; }
}
.play-button { width: fit-content; max-width: 100%; min-height: 43px; display: flex; justify-content: flex-start; gap: 12px; padding: 12px 18px; background: var(--play-color); color: var(--play-on); font-size: 13px; font-weight: 750; border: 1px solid #19201a60; border-radius: 4px; box-shadow: 3px 3px 0 #1b261f; transition: box-shadow .15s ease, transform .15s ease; }
.play-button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #1b261f; }
.play-button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #1b261f; }
.play-button > svg { width: 17px; height: 17px; }
.nav-panel { width: 100%; margin: 0; flex-direction: row; justify-content: space-between; align-items: center; gap: 28px; padding: 0 max(24px, calc((100% - 1200px) / 2)); background: #fff; border-bottom: 1px solid var(--line); }
.tabs { width: auto; flex: 1 1 auto; justify-content: flex-start; align-items: stretch; gap: 0 28px; }
.tabs button { min-height: 62px; padding: 18px 0; background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 0; font-size: 13px; font-weight: 600; color: var(--nav-text); }
.tabs button:hover { color: var(--nav-text); border-bottom-color: #c8d9c5; background: transparent; }
.tabs button.is-active { background: transparent; color: var(--accent); border-color: transparent; border-bottom-color: var(--accent); }
.nav-signature { flex: 0 0 auto; color: var(--nav-text); font-size: 11px; font-weight: 600; white-space: nowrap; }
.nav-signature span { margin-left: 10px; font-weight: 400; }
.page-shell { position: relative; flex: 1 0 auto; min-height: 320px; width: min(1200px, calc(100% - 48px)); margin: 34px auto 0; padding-bottom: 64px; }
.page-shell.is-resizing { overflow: clip; }
.load-feedback { position: absolute; bottom: 100%; left: 0; width: 100%; min-height: 34px; display: flex; align-items: center; gap: 12px; font-size: 12px; line-height: 1.3; }
.load-feedback .load-status { margin: 0; min-width: 0; }
.load-feedback button { padding: 3px 8px; flex: 0 0 auto; }
.view-mode { transition: opacity .16s ease; }
.view-mode.is-loading { opacity: .45; }
@keyframes post-arrival { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.feed-card.is-entering { animation: post-arrival .32s ease-out var(--arrival-delay, 0ms) backwards; }
.feed-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
.section-kicker { font-size: 11px; line-height: 1.5; font-weight: 650; color: var(--page-text); margin: 0 0 5px; }
.feed-heading h2 { font-size: 31px; line-height: 1.2; font-weight: 750; margin: 0; overflow-wrap: anywhere; color: var(--page-title); }
.feed-heading-note { max-width: 220px; text-align: right; font-size: 12px; line-height: 1.6; color: var(--tagline-text); padding-bottom: 2px; }
body:not(.is-admin) .empty-state, body:not(.is-admin) .load-status { color: var(--page-text); }
.feed { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }
.feed-card { margin: 0; width: 100%; padding: 0; border: 1px solid #d6ded3; border-radius: 6px; overflow: hidden; background: var(--post-card-background); box-shadow: 0 3px 0 #e9ede6; }
.post-image-frame { position: relative; display: block; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: #e6eae4; cursor: zoom-in; }
.post-image-frame:focus-visible { outline-offset: -4px; outline-width: 3px; }
.image-expand { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 4px; background: #18231dcc; color: white; opacity: .8; }
.post-image-frame:hover .image-expand { opacity: 1; background: #18231d; }
.post-image-frame img { object-fit: contain; }
.post-content { padding: 24px 25px 27px; min-width: 0; }
.post-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 10px; line-height: 1.5; color: var(--post-date); }
.post-category { font-weight: 750; overflow-wrap: anywhere; }
.post-date { white-space: nowrap; }
.post-title { font-size: 24px; line-height: 1.25; font-weight: 750; margin-bottom: 12px; color: var(--post-title); }
.post-body { margin-top: 10px; font-size: 15px; line-height: 1.75; color: var(--post-text); }
.post-body:empty { display: none; }
.post-body h2, .post-body h3, .post-body h4 { color: var(--post-title); line-height: 1.3; }
.post-body blockquote { border-left: 3px solid #aabe8f; padding-left: 16px; margin: 18px 0; }
.post-body a { text-underline-offset: 3px; color: var(--post-link); }
.fallback-note { padding-left: 9px; border-left: 2px solid #c0cfae; font-size: 11px; margin-bottom: 12px; color: var(--post-date); }
.load-more { margin-top: 32px; border-color: #bccbbb; font-size: 13px; padding: 12px 24px; }
.empty-state { border-top: 1px solid var(--line); margin-top: 32px; padding: 50px 0; }
.site-footer { width: 100%; min-height: 136px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: 32px max(24px, calc((100% - 1200px) / 2)); background: #181d1b; border: 0; }
.footer-brand { color: var(--footer-text); font-size: 21px; font-weight: 850; line-height: 1; }
.footer-brand span { display: block; font-size: 9px; margin-top: 6px; }
.footer-links { gap: 18px; justify-content: flex-start; }
.footer-links a { display: flex; align-items: center; gap: 7px; color: var(--footer-text); font-size: 12px; }
.footer-links svg { width: 13px; height: 13px; }
.copyright { color: var(--footer-text); font-size: 11px; }
.image-modal { width: min(1400px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 48px 20px 20px; border: 1px solid #59695c; border-radius: 6px; background: #18201b; color: #e4ecdf; }
.image-modal::backdrop { background: #111713dc; }
.image-modal > img { display: block; width: 100%; max-height: calc(100dvh - 160px); object-fit: contain; }
.image-modal > p { margin: 14px 0 0; font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.image-close { position: absolute; right: 12px; top: 10px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid #73846a; border-radius: 4px; background: #2b382e; color: #fff; }

/* The editor is intentionally quieter and denser than the public page. */
.is-admin .hero-banner { display: none; }
.is-admin .page-shell { width: min(1360px, calc(100% - 48px)); margin-top: 24px; }
.is-admin .nav-panel { padding-inline: 24px; }
.is-admin .nav-signature { display: none; }
.is-admin .feed-heading { display: none; }
.admin-grid { grid-template-columns: minmax(280px, 310px) minmax(0, 1fr); gap: 32px; }
.admin-toolbar { font-size: 13px; border-bottom: 1px solid #d2dccf; padding-bottom: 20px; margin-bottom: 24px; }
.admin-toolbar > span { font-size: 21px; font-weight: 700; margin-right: auto; }
.admin-grid > aside { padding-right: 24px; border-right: 1px solid #d7dfd2; }
.settings-disclosure > summary { display: flex; gap: 9px; align-items: center; padding: 10px 0 18px; color: #2e4935; font-size: 14px; font-weight: 650; cursor: pointer; list-style: none; }
.settings-disclosure > summary::-webkit-details-marker { display: none; }
.settings-disclosure > summary svg:last-child { margin-left: auto; transition: transform .15s ease; }
.settings-disclosure[open] > summary svg:last-child { transform: rotate(180deg); }
.settings-content { padding-top: 4px; }
.settings-content > .panel-head { font-size: 12px; }
.panel-head { font-size: 19px; }
.settings-heading { font-size: 13px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 26px; }
.section-state { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-visibility { display: flex; align-items: center; gap: 7px; font-size: 12px; cursor: pointer; }
.section-visibility input { margin: 0; accent-color: var(--accent); }
.section-delete-hint { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.section-editor-row { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.panel-head .settings-heading { border: 0; }
.field { font-size: 12px; }
.field input, .field select, .field textarea { background: #fff; border-color: #cad4c7; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field small { color: #7a8776; font-size: 11px; }
.primary-small, .primary-button { background: var(--accent); color: var(--accent-on); font-size: 12px; }
.ghost-button, .danger-button { font-size: 12px; }
.text-button { font-size: 12px; color: var(--accent); }
.admin-tab-row, .translation-tabs { gap: 5px; }
.admin-tab-row button, .translation-tabs button { font-size: 12px; padding: 8px 12px; border-color: #d1dbcd; border-radius: 4px; }
.admin-tab-row button.is-active, .translation-tabs button.is-active { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
.post-editor { padding-top: 10px; gap: 15px; }
.editor-top { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.editor-top strong { font-size: 16px; }
.rich-editor { min-height: 300px; line-height: 1.7; }
.image-preview { max-width: 620px; background: #e9ede7; }
.admin-post { grid-template-columns: 84px minmax(0, 1fr) auto; gap: 16px; padding: 19px 0; }
.admin-post-thumb { width: 84px; border: 1px solid #d4ddcf; border-radius: 3px; }
.admin-post-title { font-size: 14px; line-height: 1.5; }
.admin-post-meta { font-size: 11px; }
.icon-button { border-color: #cad5c5; }
.icon-button:hover:not(:disabled), .ghost-button:hover { background: #e7eee2; border-color: #99ad8f; }
.icon-button.primary-button { background: var(--accent); color: var(--accent-on); }
.login-card { box-shadow: 0 4px 0 #e3e9dd; }

@media (max-width: 1020px) {
  .site-topbar { gap: 16px; }
  .site-brand { font-size: 18px; }
  .nav-signature { display: none; }
  .tabs { gap: 0 22px; }
}
@media (max-width: 820px) {
  .site-topbar { flex-wrap: wrap; gap: 14px; padding: 14px 24px; }
  .site-brand { order: 0; }
  .language-picker { order: 1; margin-left: auto; }
  .header-links { order: 2; flex-basis: 100%; justify-content: flex-start; }
  .header-links:empty { display: none; }
  .feed { gap: 20px; }
  .post-content { padding: 20px; }
  .post-title { font-size: 21px; }
  .feed-heading-note { max-width: 180px; }
  .admin-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .admin-grid > aside { padding: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-content { padding-bottom: 20px; }
}
@media (max-width: 600px) {
  .site-topbar { padding: 13px 18px; gap: 12px; }
  .site-brand img { width: 30px; height: 30px; }
  .header-links { gap: 7px; }
  .header-links .platform-link { flex: 1 1 auto; padding: 10px 11px; min-height: 44px; justify-content: center; }
  .header-links .platform-link span { flex: 1; }
  .play-button { font-size: 12px; padding: 10px 14px; min-height: 44px; }
  .nav-panel { padding-inline: 18px; }
  .tabs { gap: 0 19px; }
  .tabs button { min-height: 48px; padding: 14px 0; font-size: 12px; }
  .page-shell, .is-admin .page-shell { width: calc(100% - 36px); margin-top: 25px; padding-bottom: 36px; }
  .feed { grid-template-columns: minmax(0, 1fr); }
  .feed-heading { margin-bottom: 20px; }
  .feed-heading h2 { font-size: 27px; }
  .feed-heading-note { display: none; }
  .section-kicker { font-size: 10px; }
  .post-title { font-size: 23px; }
  .post-body { font-size: 14px; }
  .post-content { padding: 20px; }
  .site-footer { padding: 27px 18px; gap: 24px; }
  .copyright { width: 100%; text-align: left; }
  .admin-post { grid-template-columns: 56px minmax(0, 1fr); }
  .admin-post-thumb { width: 56px; }
  .admin-post-actions { grid-column: 2; }
}
@media (max-width: 360px) {
  .language-picker { padding-left: 10px; }
  .language-picker select { max-width: 105px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

.header-upload-thumb { display: block; width: 100%; height: 70px; object-fit: contain; border: 1px solid var(--line); background: #374338; image-rendering: pixelated; }
.page-background-preview { display: block; height: 96px; width: 100%; border: 1px solid var(--line); border-radius: 3px; background-color: #e5eae3; background-repeat: repeat; background-position: left top; }
.background-image-status { font-size: 11px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.background-image-status.is-error { color: var(--danger); }
.header-layout-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.header-editor { width: min(1160px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid #bfcabd; border-radius: 6px; background: #f8faf7; color: var(--text); }
.header-editor::backdrop { background: #101c16c9; }
.header-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.header-editor-heading h2 { margin: 0; font-size: 20px; }
.header-editor-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 26px; align-items: start; }
.header-editor-controls { min-width: 0; }
.header-align { display: flex; gap: 6px; border: 0; padding: 0; margin: 0 0 16px; }
.header-align legend { font-size: 12px; margin-bottom: 8px; }
.header-align label { display: grid; place-items: center; position: relative; width: 38px; height: 34px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.header-align input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.header-align label:has(:checked) { background: var(--accent); color: var(--accent-on); }
.header-align label:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.header-checkbox { display: flex; align-items: center; gap: 9px; margin: 11px 0; font-size: 12px; }
.header-checkbox input { accent-color: var(--accent); }
.header-layer-tabs { margin: 22px 0 18px; }
.header-layer-tabs button { padding: 7px 9px; font-size: 11px; }
.header-number { display: grid; grid-template-columns: minmax(0, 1fr) 70px; align-items: center; gap: 5px 10px; margin: 15px 0; }
.header-number label { grid-column: 1 / -1; font-size: 12px; }
.header-number input[type="range"] { width: 100%; min-width: 0; accent-color: var(--accent); }
.header-number input[type="number"] { width: 70px; min-height: 32px; border: 1px solid var(--line); border-radius: 3px; padding: 5px; }
.header-preview-panel { min-width: 0; }
.header-preview-panel > .field { max-width: 180px; margin: 0 0 12px; }
.header-preview-viewport { position: relative; overflow: hidden; width: 100%; background: #e5eae3; border: 1px solid var(--line); }
.header-preview-scale { transform-origin: top left; }
.is-admin .header-preview-scale .hero-banner { display: block; }
.header-preview-scale .play-button { pointer-events: none; }
.header-editor-footer { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.text-color-field { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 12px; font-size: 12px; line-height: 1.5; margin-bottom: 12px; }
.text-color-field input { width: 44px; height: 34px; padding: 3px; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; }
.text-color-dialog { width: min(680px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 20px; border: 1px solid var(--line); border-radius: 6px; background: #f8faf7; color: var(--text); }
.text-color-dialog::backdrop { background: #101c16c9; }
#textColorPreview .site-topbar, #textColorPreview .site-footer { min-height: 64px; padding: 18px; }
#textColorPreview .site-brand { font-size: 18px; }
#textColorPreview .nav-panel { padding: 14px 18px; }
#textColorPreview .nav-signature { display: block; white-space: normal; }
#textColorPreview .feed-heading { display: flex; flex-wrap: wrap; align-items: start; gap: 12px; }
#textColorPreview .feed-heading h2 { font-size: 24px; }
#textColorPreview .feed-heading-note { display: block; text-align: left; }
.text-preview-page { padding: 24px 18px; }
@media (max-width: 760px) {
  .header-editor { padding: 16px; }
  .header-editor-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .header-preview-panel { grid-row: 1; }
  .header-editor-footer { flex-wrap: wrap; }
}
