html,
body {
  max-width: 100%;
  overflow-x: clip;
}

:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --surface: #ffffff;
  --surface-soft: #ece7dd;
  --ink: #1f2522;
  --muted: #66706a;
  --line: #d9d2c6;
  --accent: #276b5d;
  --accent-strong: #17463d;
  --gold: #b6812d;
  --red: #a64838;
  --shadow: 0 18px 45px rgb(31 37 34 / 10%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  --page-density-card-padding: 20px;
  --page-density-section-gap: 16px;
  --page-density-heading-gap: 14px;
  --page-density-banner-copy-padding: 1.5rem;
  --page-density-rich-line-height: 1.65;
  --page-density-status-padding: 12px;
  --page-density-tag-padding-y: 6px;
  --page-density-tag-padding-x: 10px;
  --page-density-achievement-size: 54px;
}

body.page-density-compact {
  --page-density-card-padding: 16px;
  --page-density-section-gap: 12px;
  --page-density-heading-gap: 10px;
  --page-density-banner-copy-padding: 1.1rem;
  --page-density-rich-line-height: 1.55;
  --page-density-status-padding: 10px;
  --page-density-tag-padding-y: 5px;
  --page-density-tag-padding-x: 8px;
  --page-density-achievement-size: 46px;
}

body.page-density-spacious {
  --page-density-card-padding: 26px;
  --page-density-section-gap: 20px;
  --page-density-heading-gap: 18px;
  --page-density-banner-copy-padding: 1.9rem;
  --page-density-rich-line-height: 1.75;
  --page-density-status-padding: 14px;
  --page-density-tag-padding-y: 7px;
  --page-density-tag-padding-x: 12px;
  --page-density-achievement-size: 60px;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3 {
  margin-top: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgb(247 244 238 / 92%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.immersive-page .site-header {
  position: static;
  background: rgb(247 244 238 / 82%);
}

.immersive-page main {
  display: flow-root;
  min-height: 100vh;
}

.banner-hero-shell {
  position: relative;
  display: grid;
  overflow: hidden;
}

.banner-hero-shell .banner-hero-media {
  display: grid;
}

.banner-hero-shell .banner-hero-media img {
  display: block;
  width: 100%;
}

.banner-hero-shell.hero-mode-overlay-left .banner-hero-copy {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(46vw, 720px);
  padding: var(--page-density-banner-copy-padding);
}

.banner-hero-shell.hero-mode-overlay-bottom .banner-hero-copy {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  padding: var(--page-density-banner-copy-padding);
}

.banner-hero-shell.hero-mode-caption-strip .banner-hero-copy {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  max-width: none;
  padding: var(--page-density-banner-copy-padding);
}

.banner-hero-shell.hero-mode-poster-stack {
  display: grid;
}

.banner-hero-shell.hero-mode-poster-stack .banner-hero-copy {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: none;
}

.banner-hero-shell.banner-preset-focus .banner-hero-media img,
.banner-hero-shell.banner-preset-cinematic .banner-hero-media img {
  transform: scale(1.08) !important;
}

.banner-hero-shell.banner-preset-poster .banner-hero-copy,
.banner-hero-shell.banner-preset-framed .banner-hero-copy,
.banner-hero-shell.banner-preset-broadside .banner-hero-copy {
  box-shadow: 0 18px 40px rgb(0 0 0 / 18%);
}

.banner-hero-shell.hero-mode-overlay-left.banner-preset-poster .banner-hero-copy {
  inset: auto auto 24px 24px;
  width: min(32rem, calc(100% - 48px));
  padding: 1.35rem 1.5rem;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 18px;
}

.banner-hero-shell.hero-mode-overlay-bottom.banner-preset-cinematic .banner-hero-copy {
  padding-top: 3rem;
  background: linear-gradient(180deg, transparent, rgb(0 0 0 / 78%));
}

.banner-hero-shell.hero-mode-overlay-bottom.banner-preset-caption .banner-hero-copy {
  width: min(40rem, 100%);
  margin-left: auto;
  padding: 1.2rem 1.4rem 1.6rem;
}

.banner-hero-shell.hero-mode-caption-strip.banner-preset-filmstrip .banner-hero-copy {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 1rem 1.4rem;
}

.banner-hero-shell.hero-mode-caption-strip.banner-preset-filmstrip .eyebrow {
  margin: 0;
}

.banner-hero-shell.hero-mode-caption-strip.banner-preset-broadside .banner-hero-copy {
  padding-block: 1.5rem;
}

.banner-hero-shell.hero-mode-poster-stack.banner-preset-framed .banner-hero-media {
  padding: 18px;
  background: rgb(255 255 255 / 04%);
}

.banner-hero-shell.hero-mode-poster-stack.banner-preset-compact .banner-hero-copy {
  padding: 1rem 1.2rem 1.2rem;
}

.brand,
.top-nav,
.hero-actions,
.section-heading.row,
.filters,
.profile-title {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-size: 0.8rem;
}

.top-nav {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 18px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.top-nav-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  min-width: 0;
}

.top-nav-context:empty {
  display: none;
}

.top-nav-context > a {
  padding: 8px 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 88%, white);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.top-nav-context > a:hover {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.top-nav-account {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.top-nav-account > a,
.top-nav-account .nav-form button {
  color: var(--muted);
}

.nav-form {
  margin: 0;
}

.nav-form button {
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.top-nav a:hover,
.nav-form button:hover,
.subtle-link,
.entry-meta a,
.review a {
  color: var(--accent-strong);
}

main {
  min-height: calc(100vh - 69px);
}

.hero,
.profile-head,
.dashboard-head,
.game-hero,
.login-shell {
  padding: clamp(40px, 8vw, 88px) clamp(18px, 4vw, 56px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  min-height: 520px;
  background:
    linear-gradient(120deg, rgb(39 107 93 / 92%), rgb(31 37 34 / 78%)),
    url("https://images.unsplash.com/photo-1550745165-9bc0b252726f?auto=format&fit=crop&w=1800&q=80") center/cover;
  color: #fff;
}

.hero h1,
.profile-head h1,
.dashboard-head h1,
.game-hero h1 {
  margin-bottom: 14px;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.95;
}

.lede {
  max-width: 720px;
  color: inherit;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow,
.hero .lede {
  color: rgb(255 255 255 / 88%);
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button,
.chip,
select,
input[type="search"] {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.button,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  font-size: 0.9rem;
  white-space: nowrap;
}

.button.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.button.ghost {
  color: var(--ink);
  background: var(--surface);
}

.button.ghost.danger {
  color: var(--red);
  border-color: rgb(166 72 56 / 28%);
  background: rgb(166 72 56 / 8%);
}

.steam-button {
  gap: 10px;
  width: 100%;
  color: #fff;
  background: #171a21;
  border-color: #171a21;
  font-weight: 800;
}

.steam-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #171a21;
  background: #fff;
  border-radius: 50%;
  font-size: 0.8rem;
}

.hero .button.ghost {
  color: #fff;
  background: rgb(255 255 255 / 14%);
  border-color: rgb(255 255 255 / 28%);
}

.hero-panel {
  padding: 24px;
  background: rgb(255 255 255 / 14%);
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stat-grid div {
  padding: 18px;
  background: rgb(255 255 255 / 16%);
  border-radius: 8px;
}

.stat-grid strong {
  display: block;
  font-size: 2rem;
}

.stat-grid span {
  color: rgb(255 255 255 / 78%);
}

.content-band {
  padding: clamp(28px, 5vw, 56px) clamp(18px, 4vw, 56px);
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 69px);
  background:
    linear-gradient(120deg, rgb(31 37 34 / 78%), rgb(39 107 93 / 88%)),
    url("https://images.unsplash.com/photo-1542751371-adc38448a05e?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.login-panel {
  width: min(100%, 480px);
  padding: clamp(24px, 5vw, 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1;
}

.login-panel .lede {
  color: var(--muted);
  font-size: 1.05rem;
}

.fine-print {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.content-band.muted,
.profile-head,
.dashboard-head {
  background: var(--surface-soft);
}

.section-heading {
  max-width: 1180px;
  margin: 0 auto 22px;
}

.section-heading.row {
  justify-content: space-between;
  gap: 18px;
}

.section-heading h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.compact-heading {
  margin-top: 28px;
  margin-bottom: 14px;
}

.compact-heading h3 {
  margin: 0;
  font-size: 1.15rem;
}

.filters {
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 36px;
  background: var(--surface);
  color: var(--muted);
}

.chip.active,
.chip:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.card-grid,
.timeline-list,
.review-list,
.dashboard-grid,
.two-column {
  max-width: 1180px;
  margin: 0 auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.slim-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.game-card,
.timeline-entry,
.review {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.game-card {
  min-width: 0;
}

.game-art {
  display: flex;
  align-items: flex-end;
  min-height: 160px;
  padding: 16px;
  background:
    linear-gradient(180deg, transparent, rgb(0 0 0 / 72%)),
    var(--art, linear-gradient(135deg, #276b5d, #b6812d));
  background-position: center;
  background-size: cover;
  color: #fff;
  font-weight: 800;
}

.game-card-body {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
}

.game-card-body > div {
  min-width: 0;
}

.game-card h3,
.timeline-entry h3,
.review h3 {
  margin-bottom: 6px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.game-card-owner {
  margin: -1px 0 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

.game-card p,
.timeline-entry p,
.review p,
.entry-meta,
.empty {
  color: var(--muted);
}

.game-card-note {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.status-pill,
select {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  background: #f7f4ee;
  white-space: nowrap;
}

.status-pill {
  color: var(--muted);
  border: 1px solid rgb(31 37 34 / 8%);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
}

.status-pill::before {
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  content: "";
}

.status-playing {
  color: #17634f;
  background: rgb(39 107 93 / 12%);
}

.status-completed {
  color: #7b5317;
  background: rgb(182 129 45 / 14%);
}

.status-backlog {
  color: #49606c;
  background: rgb(73 96 108 / 12%);
}

.status-paused {
  color: #7b5a14;
  background: rgb(182 129 45 / 10%);
}

.status-dropped {
  color: #8b382b;
  background: rgb(166 72 56 / 12%);
}

select {
  max-width: 140px;
}

.card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.profile-games {
  overflow: hidden;
}

.profile-games .section-heading {
  max-width: 1480px;
}

.profile-games #collection-grid {
  max-width: 1480px;
  margin: 0 auto;
}

.profile-games .card-grid {
  display: flex;
  max-width: none;
  gap: 22px;
  margin: 0 calc(clamp(18px, 4vw, 56px) * -1);
  padding: 0 clamp(18px, 4vw, 56px) 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: clamp(18px, 4vw, 56px);
  scroll-snap-type: x proximity;
}

.profile-games .game-card {
  flex: 0 0 clamp(380px, 34vw, 520px);
  scroll-snap-align: start;
}

.profile-games .game-art {
  min-height: 240px;
}

.profile-games .game-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  min-height: 260px;
  gap: 18px;
}

.profile-games .game-card-note {
  -webkit-line-clamp: 6;
}

.profile-games .status-pill {
  align-self: start;
}

.profile-games .card-grid::-webkit-scrollbar {
  height: 10px;
}

.profile-games .card-grid::-webkit-scrollbar-track {
  background: rgb(31 37 34 / 8%);
  border-radius: 999px;
}

.profile-games .card-grid::-webkit-scrollbar-thumb {
  background: rgb(39 107 93 / 45%);
  border-radius: 999px;
}

.library-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto 18px;
}

.library-summary h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.library-search {
  max-width: 1180px;
  margin: 28px auto 14px;
}

.library-search label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 800;
}

input[type="search"] {
  width: min(100%, 520px);
  min-height: 44px;
  padding: 0 14px;
  background: var(--surface);
}

.notice {
  max-width: 1180px;
  margin: 0 auto 18px;
  padding: 12px 14px;
  color: var(--accent-strong);
  background: rgb(39 107 93 / 10%);
  border: 1px solid rgb(39 107 93 / 22%);
  border-radius: 8px;
}

.notice.error {
  color: var(--red);
  background: rgb(166 72 56 / 10%);
  border-color: rgb(166 72 56 / 22%);
}

.notice.warning {
  color: #8b5d14;
  background: rgb(182 129 45 / 10%);
  border-color: rgb(182 129 45 / 24%);
}

.timeline-list {
  display: grid;
  gap: 12px;
}

.journal-list {
  display: grid;
  gap: 12px;
}

.journal-entry {
  padding: 16px;
  background: rgb(247 244 238 / 55%);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.journal-entry.has-spoilers {
  border-color: rgb(166 72 56 / 28%);
}

.journal-entry h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.journal-entry-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.journal-entry-heading h3 {
  margin-bottom: 0;
}

.journal-entry-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.journal-entry-edit {
  background: var(--surface);
}

.danger-button {
  color: var(--red);
}

.journal-entry > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.journal-preview-stack {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.journal-visibility-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.journal-visibility-bar .eyebrow,
.journal-visibility-bar h2 {
  margin: 0;
}

.journal-visibility-form {
  margin: 0;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-switch-track {
  position: relative;
  width: 56px;
  height: 32px;
  background: rgb(31 37 34 / 14%);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 180ms ease, border-color 180ms ease;
}

.toggle-switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgb(31 37 34 / 18%);
  content: "";
  transition: transform 180ms ease;
}

.toggle-switch input:checked + .toggle-switch-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-switch-track::after {
  transform: translateX(24px);
}

.toggle-switch-label {
  min-width: 2.2rem;
  color: var(--ink);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.toggle-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toggle-setting-copy {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
  cursor: pointer;
}

.template-lock-grid,
.section-order-grid {
  display: grid;
  gap: 10px;
}

.template-lock-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.template-lock-toggle {
  justify-content: space-between;
  padding: 10px 12px;
  background: rgb(39 107 93 / 4%);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.template-lock-toggle .toggle-setting-copy {
  font-size: 0.92rem;
}

.section-order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 12px;
  align-items: center;
}

.journal-live-preview {
  min-height: 180px;
}

.field-hint {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.markdown-body {
  color: var(--muted);
  line-height: 1.6;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre {
  margin: 0 0 12px;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 22px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin-bottom: 8px;
  color: var(--ink);
  line-height: 1.2;
}

.markdown-body h1 {
  font-size: 1.35rem;
}

.markdown-body h2 {
  font-size: 1.2rem;
}

.markdown-body h3 {
  font-size: 1.05rem;
}

.markdown-body blockquote {
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

.markdown-body code {
  padding: 2px 5px;
  background: var(--surface-soft);
  border-radius: 6px;
}

.markdown-body pre {
  padding: 12px;
  overflow-x: auto;
  background: var(--surface-soft);
  border-radius: 8px;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
}

.markdown-body img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 420px;
  margin: 0;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.markdown-body .journal-image {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.markdown-body .journal-image figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
}

.journal-screenshot-picker {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.journal-screenshot-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.journal-screenshot-tools label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.journal-screenshot-tools input {
  accent-color: var(--accent);
}

.journal-screenshot-track {
  display: grid;
  grid-auto-columns: minmax(190px, 240px);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-snap-type: x proximity;
}

.journal-screenshot-card {
  overflow: hidden;
  background: rgb(247 244 238 / 55%);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: grab;
  scroll-snap-align: start;
}

.journal-screenshot-card:active {
  cursor: grabbing;
}

.journal-screenshot-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-soft);
}

.journal-screenshot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 160ms ease;
}

.journal-screenshot-card:hover .journal-screenshot-thumb img {
  transform: scale(1.035);
}

.journal-screenshot-copy {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.journal-screenshot-copy p {
  min-height: 2.8em;
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
}

.spoiler-block {
  color: var(--muted);
}

.spoiler-block summary {
  margin-bottom: 8px;
  color: var(--red);
  cursor: pointer;
  font-weight: 800;
}

.screenshot-carousel {
  position: relative;
}

.screenshot-editor {
  display: grid;
  gap: 18px;
}

.screenshot-track {
  display: flex;
  gap: 12px;
  margin: 0 -8px;
  padding: 0 8px 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.screenshot-tile {
  position: relative;
  flex: 0 0 clamp(220px, 32vw, 340px);
  padding: 0;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  scroll-snap-align: start;
}

.screenshot-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 180ms ease;
}

.screenshot-tile:hover img,
.screenshot-tile:focus img {
  transform: scale(1.035);
}

.screenshot-tile span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgb(0 0 0 / 78%));
  font-weight: 800;
  text-align: left;
}

.screenshot-featured-mark,
.screenshot-private-mark,
.screenshot-badge {
  position: absolute;
  z-index: 2;
  padding: 5px 8px;
  color: #fff;
  background: rgb(39 107 93 / 88%);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.screenshot-featured-mark {
  top: 8px;
  left: 8px;
}

.screenshot-private-mark {
  top: 8px;
  right: 8px;
  background: rgb(166 72 56 / 90%);
}

.screenshot-lightbox[hidden] {
  display: none;
}

.screenshot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 56px);
  overflow: hidden;
  backdrop-filter: blur(14px) saturate(1.12);
}

.screenshot-lightbox-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(1200px, 100%);
  max-height: 90vh;
  padding: clamp(14px, 2vw, 22px);
  background: rgb(255 255 255 / 18%);
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 8px;
  box-shadow: 0 24px 90px rgb(0 0 0 / 34%);
  backdrop-filter: blur(24px) saturate(1.18);
}

.screenshot-lightbox figure {
  display: grid;
  gap: 12px;
  margin: 0;
  width: 100%;
}

.screenshot-lightbox figure img {
  display: block;
  width: 100%;
  max-height: calc(90vh - 120px);
  object-fit: contain;
  border-radius: 8px;
  background: rgb(0 0 0 / 38%);
}

.screenshot-lightbox figcaption {
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.screenshot-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 64px;
  color: #fff;
  background: rgb(0 0 0 / 42%);
  border: 1px solid rgb(255 255 255 / 26%);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 2.2rem;
  transform: translateY(-50%);
}

.screenshot-nav.previous {
  left: 18px;
}

.screenshot-nav.next {
  right: 18px;
}

.screenshot-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.screenshot-manage-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  max-height: 520px;
  padding-right: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgb(39 107 93 / 55%) rgb(31 37 34 / 8%);
}

.screenshot-manage-list::-webkit-scrollbar {
  width: 10px;
}

.screenshot-manage-list::-webkit-scrollbar-track {
  background: rgb(31 37 34 / 8%);
  border-radius: 999px;
}

.screenshot-manage-list::-webkit-scrollbar-thumb {
  background: rgb(39 107 93 / 55%);
  border-radius: 999px;
}

.screenshot-manage-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
  background: rgb(247 244 238 / 55%);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.screenshot-manage-thumb {
  position: relative;
}

.screenshot-manage-thumb img {
  width: 120px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-soft);
}

.screenshot-badge {
  left: 6px;
  bottom: 6px;
}

.screenshot-badge.private {
  left: auto;
  right: 6px;
  background: rgb(166 72 56 / 90%);
}

.screenshot-manage-form {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.screenshot-manage-form .form-actions {
  align-items: center;
}

.timeline-list.compact {
  gap: 10px;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
}

.timeline-marker {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--red);
  border-radius: 8px;
  font-weight: 800;
}

.marker-session {
  background: #276b5d;
}

.marker-started {
  background: #3f7f4f;
}

.marker-status {
  background: #b6812d;
}

.marker-milestone {
  background: #7a5cad;
}

.marker-note {
  background: #3f6f91;
}

.marker-finished,
.marker-reviewed {
  background: #a64838;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.profile-head,
.dashboard-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.profile-title {
  align-items: flex-start;
  gap: 18px;
}

.avatar {
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 3px solid var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dashboard-grid,
.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 0;
}

.dashboard-grid {
  max-width: min(100%, 1560px);
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.34fr);
}

.dashboard-grid .game-card-body {
  display: grid;
  align-content: start;
  gap: 14px;
}

.dashboard-grid .card-actions {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

.dashboard-grid .small-button {
  width: 100%;
}

.dashboard-grid > *,
.two-column > * {
  max-width: none;
  margin: 0;
}

.game-hero {
  min-height: 440px;
  display: flex;
  align-items: end;
  color: #fff;
  background:
    linear-gradient(180deg, rgb(0 0 0 / 12%), rgb(0 0 0 / 76%)),
    var(--banner, linear-gradient(135deg, #17463d, #a64838));
  background-position: center;
  background-size: cover;
}

.game-editor-hero {
  min-height: 360px;
  display: flex;
  align-items: end;
  padding: clamp(40px, 8vw, 88px) clamp(18px, 4vw, 56px);
  color: #fff;
  background:
    linear-gradient(180deg, rgb(0 0 0 / 10%), rgb(0 0 0 / 76%)),
    var(--banner, linear-gradient(135deg, #17463d, #a64838));
  background-color: #111;
  background-position: var(--banner-position, center);
  background-repeat: no-repeat;
  background-size: var(--banner-size, contain);
}

.game-page-card {
  min-width: 0;
  padding: var(--page-density-card-padding);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.local-heading {
  margin: 0 0 var(--page-density-heading-gap);
}

.local-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}

.steam-rich-text {
  color: var(--ink);
  line-height: var(--page-density-rich-line-height);
}

.steam-rich-text p,
.steam-rich-text ul,
.steam-rich-text ol {
  margin-bottom: 12px;
}

.steam-rich-text ul,
.steam-rich-text ol {
  padding-left: 22px;
}

.requirements-list,
.news-list,
.game-timeline {
  display: grid;
  gap: var(--page-density-section-gap);
}

.requirements-list h3,
.news-item h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.news-item {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.news-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-list span {
  padding: var(--page-density-tag-padding-y) var(--page-density-tag-padding-x);
  color: var(--accent-strong);
  background: rgb(39 107 93 / 10%);
  border-radius: 8px;
  font-size: 0.9rem;
}

.status-reason {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.player-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.player-stat-grid div {
  padding: var(--page-density-status-padding);
  background: rgb(39 107 93 / 8%);
  border: 1px solid rgb(39 107 93 / 12%);
  border-radius: 8px;
}

.player-stat-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.player-stat-grid strong {
  font-size: 1.15rem;
}

.achievement-list {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--page-density-section-gap) - 6px);
  margin-bottom: 14px;
}

.achievement-item {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--page-density-achievement-size);
  height: var(--page-density-achievement-size);
  border-radius: 8px;
  cursor: help;
}

.achievement-item img {
  width: var(--page-density-achievement-size);
  height: var(--page-density-achievement-size);
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-soft);
}

.achievement-item.is-locked img {
  filter: grayscale(1);
  opacity: 0.78;
}

.achievement-placeholder {
  display: grid;
  place-items: center;
  width: var(--page-density-achievement-size);
  height: var(--page-density-achievement-size);
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 8px;
  font-weight: 800;
}

.achievement-hover-card {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 5;
  display: none;
  width: min(280px, 72vw);
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.achievement-hover-card::after {
  position: absolute;
  right: 18px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  content: "";
  transform: rotate(45deg);
}

.achievement-item:hover .achievement-hover-card,
.achievement-item:focus .achievement-hover-card,
.achievement-item:focus-within .achievement-hover-card {
  display: block;
}

.achievement-hover-card strong {
  display: block;
  margin-bottom: 4px;
}

.achievement-hover-card p {
  margin: 0 0 4px;
  color: var(--muted);
  line-height: 1.4;
}

.achievement-hover-card small {
  color: var(--gold);
  font-weight: 800;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 56px);
  overflow: hidden;
  backdrop-filter: blur(14px) saturate(1.12);
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 18%, rgb(255 255 255 / 18%), transparent 32%),
    linear-gradient(135deg, rgb(31 37 34 / 72%), rgb(39 107 93 / 46%));
  border: 0;
  cursor: pointer;
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  width: min(920px, 100%);
  max-height: min(780px, 88vh);
  padding: clamp(18px, 3vw, 28px);
  overflow: hidden;
  background: rgb(255 255 255 / 76%);
  border: 1px solid rgb(255 255 255 / 48%);
  border-radius: 8px;
  box-shadow: 0 24px 90px rgb(0 0 0 / 34%);
  backdrop-filter: blur(24px) saturate(1.18);
}

.lightbox-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.lightbox-head h2 {
  margin-bottom: 6px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.lightbox-head p {
  margin: 0;
  color: var(--muted);
}

.lightbox-close {
  min-height: 38px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.achievement-modal-list {
  display: grid;
  gap: 12px;
  min-height: 0;
  max-height: calc(min(780px, 88vh) - 146px);
  padding-right: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgb(39 107 93 / 55%) rgb(255 255 255 / 28%);
}

.achievement-modal-list::-webkit-scrollbar {
  width: 10px;
}

.achievement-modal-list::-webkit-scrollbar-track {
  background: rgb(255 255 255 / 28%);
  border-radius: 999px;
}

.achievement-modal-list::-webkit-scrollbar-thumb {
  background: rgb(39 107 93 / 55%);
  border-radius: 999px;
}

.achievement-modal-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
  background: rgb(255 255 255 / 68%);
  border: 1px solid rgb(255 255 255 / 62%);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.achievement-modal-item img,
.achievement-modal-item .achievement-placeholder {
  width: 64px;
  height: 64px;
}

.achievement-modal-item.is-locked img {
  filter: grayscale(1);
  opacity: 0.75;
}

.achievement-modal-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.achievement-modal-title h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.achievement-modal-title span {
  padding: 5px 8px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.achievement-modal-item.is-unlocked .achievement-modal-title span {
  color: var(--accent-strong);
  background: rgb(39 107 93 / 10%);
  border-color: rgb(39 107 93 / 18%);
}

.achievement-modal-item p {
  margin: 0 0 6px;
  color: var(--muted);
  line-height: 1.45;
}

.achievement-modal-item small {
  color: var(--gold);
  font-weight: 800;
}

.game-timeline-event {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.game-timeline-partial {
  view-transition-name: game-timeline;
}

.timeline-animation-cascade .game-timeline-event {
  animation: timeline-cascade-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--timeline-index, 0) * 45ms);
}

.timeline-animation-slide .game-timeline-event {
  animation: timeline-slide-in 280ms ease-out both;
  animation-delay: calc(var(--timeline-index, 0) * 30ms);
}

.timeline-animation-pop .game-timeline-event {
  animation: timeline-pop-in 260ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(var(--timeline-index, 0) * 28ms);
}

.timeline-animation-none .game-timeline-event {
  animation: none;
}

.game-timeline-event:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.game-timeline-event h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.timeline-event-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.timeline-event-heading h3 {
  margin-bottom: 6px;
}

.game-timeline-event p {
  margin: 0;
  color: var(--muted);
}

.session-line {
  margin-bottom: 22px;
  padding: 8px 4px 0;
}

.session-track {
  position: relative;
  height: 96px;
}

.session-track::before {
  position: absolute;
  top: 17px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
  content: "";
}

.session-marker {
  position: absolute;
  top: calc(10px + (var(--marker-stack, 0) * 18px));
  width: 16px;
  height: 16px;
  background: var(--accent);
  border: 3px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--accent);
  transform: translateX(-50%);
}

.event-line .session-marker {
  cursor: help;
}

.marker-card {
  position: absolute;
  left: 50%;
  bottom: calc(24px + (var(--marker-stack, 0) * 18px));
  z-index: 4;
  display: none;
  width: min(260px, 70vw);
  padding: 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  line-height: 1.35;
  transform: translateX(-50%);
}

.marker-card::after {
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.session-marker:hover .marker-card,
.session-marker:focus .marker-card,
.session-marker:focus-within .marker-card {
  display: grid;
  gap: 5px;
}

.marker-card-type {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.marker-card strong {
  font-size: 0.95rem;
}

.marker-card span,
.marker-card small {
  color: var(--muted);
}

.session-line-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-more-button {
  margin-top: 16px;
  width: 100%;
}

.timeline-more-button.htmx-request {
  opacity: 0.7;
  transform: translateY(1px);
}

::view-transition-old(game-timeline) {
  animation: timeline-out 160ms ease-in both;
}

::view-transition-new(game-timeline) {
  animation: timeline-cascade-in 280ms ease-out both;
}

@keyframes timeline-cascade-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes timeline-slide-in {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes timeline-pop-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes timeline-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-timeline-event,
  ::view-transition-old(game-timeline),
  ::view-transition-new(game-timeline) {
    animation: none;
  }
}

.game-editor-hero h1 {
  margin-bottom: 14px;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.98;
}

.game-editor-hero .eyebrow,
.game-editor-hero .lede {
  color: rgb(255 255 255 / 88%);
}

.editor-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 28px;
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) clamp(18px, 4vw, 56px);
}

.editor-main,
.editor-side {
  min-width: 0;
}

.editor-workspace {
  display: grid;
  gap: 16px;
}

.editor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.editor-tab {
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.editor-tab.active,
.editor-tab:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.editor-tab-panel {
  min-width: 0;
}

.editor-tab-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.55fr) minmax(0, 1.45fr);
  gap: 16px;
}

.editor-tab-grid.preview-wide {
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
}

.template-preview-layout {
  display: grid;
  gap: 18px;
}

.template-selector-form {
  display: grid;
  gap: 12px;
}

.template-editor-section {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.template-accordion {
  padding-top: 12px;
}

.template-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.template-accordion-summary::-webkit-details-marker {
  display: none;
}

.template-accordion-summary .eyebrow,
.template-accordion-summary h2 {
  margin: 0;
}

.template-accordion-icon {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 180ms ease, border-color 180ms ease;
  flex: 0 0 auto;
}

.template-accordion[open] .template-accordion-icon {
  border-color: var(--accent);
  transform: rotate(225deg);
}

.template-accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 220ms ease;
}

.template-accordion[open] .template-accordion-body {
  grid-template-rows: 1fr;
}

.template-accordion-body-inner {
  min-height: 0;
  overflow: hidden;
  display: grid;
  gap: 10px;
  padding-top: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 180ms ease, transform 220ms ease, padding-top 220ms ease;
}

.template-accordion[open] .template-accordion-body-inner {
  padding-top: 8px;
  opacity: 1;
  transform: translateY(0);
}

.template-editor-subsection {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.template-editor-subsection:first-child {
  padding-top: 0;
  border-top: none;
}

.template-selector-form select {
  max-width: 520px;
}

.template-preset-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.template-preset-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.template-preset-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.template-preset-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgb(15 23 42 / 8%);
}

.template-preset-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 14px 30px rgb(15 23 42 / 10%);
}

.template-preset-card-ai {
  border-color: rgb(39 107 93 / 22%);
  background: linear-gradient(180deg, rgb(39 107 93 / 4%), var(--surface));
}

.template-preset-card-ai.active {
  box-shadow: 0 0 0 1px var(--accent), 0 16px 34px rgb(39 107 93 / 14%);
}

.template-preset-card-preview {
  display: block;
}

.template-preset-card-page,
.template-preset-card-surface,
.template-preset-card-hero,
.template-preset-card-title,
.template-preset-card-ink,
.template-preset-card-muted,
.template-preset-card-accent {
  display: block;
  border-radius: 7px;
}

.template-preset-card-page {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.template-preset-card-surface {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-rows: 44px 18px;
  gap: 8px;
  padding: 8px;
  min-height: 86px;
}

.template-preset-card-hero {
  display: flex;
  align-items: flex-end;
  grid-row: 1 / span 2;
  min-height: 62px;
  padding: 8px;
}

.template-preset-card-title {
  width: 72%;
  height: 8px;
  border-radius: 999px;
  opacity: 0.96;
}

.template-preset-card-text {
  display: grid;
  gap: 6px;
  align-content: center;
}

.template-preset-card-ink,
.template-preset-card-muted {
  height: 6px;
  border-radius: 999px;
}

.template-preset-card-ink {
  width: 88%;
}

.template-preset-card-muted {
  width: 68%;
  opacity: 0.82;
}

.template-preset-card-accent {
  min-height: 18px;
}

.template-preset-card-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 86px;
  border-radius: 10px;
  overflow: hidden;
}

.template-preset-card-split-left,
.template-preset-card-split-right {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.template-preset-card-split-left {
  align-content: end;
}

.template-preset-card-split-right {
  align-content: center;
}

.template-preset-card-hud {
  display: grid;
  gap: 8px;
}

.template-preset-card-hud-hero {
  display: flex;
  align-items: flex-end;
  min-height: 36px;
  padding: 8px;
  border-radius: 8px;
}

.template-preset-card-hud-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.template-preset-card-hud-stat {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgb(255 255 255 / 10%);
}

.template-preset-card-hud-stat.accent {
  border-color: transparent;
}

.template-preset-card-inventory {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 8px;
}

.template-preset-card-inventory-art,
.template-preset-card-inventory-meta {
  min-height: 86px;
  padding: 8px;
  border-radius: 8px;
}

.template-preset-card-inventory-art {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.template-preset-card-accent-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.template-preset-card-inventory-meta {
  display: grid;
  gap: 6px;
  align-content: start;
}

.template-preset-card-terminal {
  display: grid;
  gap: 8px;
  min-height: 86px;
  padding: 8px;
  border-radius: 8px;
}

.template-preset-card-terminal-top {
  display: flex;
  gap: 6px;
}

.template-preset-card-terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.template-preset-card-terminal-hero {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 52px;
  padding: 8px;
  border-radius: 8px;
}

.template-preset-card-editorial {
  display: grid;
  gap: 8px;
  min-height: 86px;
  align-content: start;
}

.template-preset-card-editorial-rule {
  height: 3px;
  border-radius: 999px;
}

.template-preset-card-title.wide {
  width: 84%;
}

.template-preset-card-surface.editorial {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 8px;
  padding: 8px;
  min-height: 42px;
}

.template-preset-card-meta {
  display: grid;
  gap: 4px;
}

.template-preset-card-meta strong {
  color: var(--ink);
  font-size: 0.96rem;
}

.template-preset-card-meta small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.template-capability-list {
  display: grid;
  gap: 6px;
  padding-top: 6px;
}

.template-quality-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.template-quality-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--surface) 92%, white);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.template-quality-item strong {
  font-size: 0.95rem;
}

.template-quality-item span {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.template-quality-item.passed span {
  color: var(--accent);
}

.template-quality-item.failed span {
  color: var(--red);
}

.template-quality-item .field-help {
  grid-column: 1 / -1;
  margin: 0;
}

.template-manage-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.template-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.template-color-field {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.template-color-field span {
  color: var(--muted);
  font-size: 0.9rem;
}

.template-color-field small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.section-copy-grid {
  display: grid;
  gap: 14px;
}

.section-copy-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: color-mix(in srgb, var(--surface) 94%, white);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.section-copy-card h3 {
  margin: 0 0 2px;
  font-size: 1rem;
}

.template-color-field input[type="color"] {
  width: 100%;
  min-height: 44px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.template-generate-button .template-generate-loading {
  display: none;
}

.template-generate-button.htmx-request {
  opacity: 0.8;
  pointer-events: none;
}

.template-generate-button.htmx-request .template-generate-idle {
  display: none;
}

.template-generate-button.htmx-request .template-generate-loading {
  display: inline;
}

.template-preview-layout .page-preview-frame {
  min-height: min(980px, 78vh);
}

.preview-apply-fx #template-preview-panel .page-preview-stage {
  animation: template-preview-fade-in 220ms ease;
}

@keyframes template-preview-fade-in {
  from {
    opacity: 0.45;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.theme-export-json {
  width: 100%;
  min-height: 220px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 0.86rem/1.5 "Cascadia Code", "Consolas", monospace;
  resize: vertical;
}

.preview-mode-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 10px;
}

.preview-mode-button {
  min-width: 140px;
  padding: 9px 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.preview-mode-button.active {
  color: #fff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.preview-viewport-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 14px;
}

.preview-viewport-button {
  min-width: 110px;
  padding: 9px 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.preview-viewport-button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.page-preview-stage {
  width: 100%;
  overflow: hidden;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.page-preview-canvas {
  position: relative;
  margin: 0 auto;
}

.preview-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.preview-pane {
  display: grid;
  gap: 8px;
}

.preview-pane-heading {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.template-warning-list {
  display: grid;
  gap: 10px;
}

.editor-form {
  display: grid;
  gap: 18px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.partial-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.banner-option-panel {
  display: grid;
  gap: 12px;
}

@media (max-width: 900px) {
  .template-preset-save-row,
  .preview-compare-grid,
  .template-manage-preset-grid {
    grid-template-columns: 1fr;
  }
}

.banner-editor {
  display: grid;
  gap: 18px;
}

.banner-controls-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.banner-preview-card {
  padding: 24px;
  overflow: hidden;
}

.banner-preview-card #banner-preview,
.banner-preview-card #steam-banner {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.banner-preview-card #banner-preview > * {
  max-width: 100%;
}

.banner-preview-card .game-template-hero,
.banner-preview-card [class$="-hero"] {
  position: relative;
  display: grid;
  width: 100%;
  max-width: 100%;
  color: #fff;
  background: #050505;
  overflow: hidden;
  border-radius: 8px;
}

.banner-preview-card .banner-hero-media {
  display: grid;
  place-items: center;
}

.banner-preview-card .banner-hero-media img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.banner-preview-card .banner-hero-copy {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(46vw, 720px);
  max-width: min(100%, 720px);
  padding: clamp(24px, 5vw, 48px) clamp(18px, 4vw, 32px);
  background: linear-gradient(
    90deg,
    rgb(5 5 5 / 88%),
    rgb(5 5 5 / 56%),
    transparent
  );
}

.banner-preview-card [class$="-hero"] h1,
.banner-preview-card .game-template-hero h1 {
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.95;
}

.banner-preview-card .banner-hero-copy .eyebrow,
.banner-preview-card .banner-hero-copy .lede {
  color: rgb(255 255 255 / 88%);
}

.field-help {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.banner-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.banner-option-grid form {
  margin: 0;
}

.banner-option {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 8px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.banner-option:hover,
.banner-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgb(39 107 93 / 14%);
}

.banner-option img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-soft);
}

.banner-option span {
  color: var(--muted);
  font-size: 0.85rem;
}

.custom-banner-panel {
  display: grid;
  gap: 14px;
}

.custom-banner-form {
  display: grid;
  gap: 16px;
}

.upload-dropzone {
  display: grid;
  place-items: center;
  min-height: 118px;
  padding: 18px;
  color: var(--muted);
  background: rgb(39 107 93 / 6%);
  border: 2px dashed rgb(39 107 93 / 35%);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}

.upload-dropzone:hover {
  background: rgb(39 107 93 / 10%);
}

.upload-dropzone.is-dragging {
  color: var(--accent-strong);
  background: rgb(39 107 93 / 14%);
  border-color: var(--accent);
}

.upload-dropzone input {
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
}

.banner-crop-preview {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 220px;
  padding: 14px;
  color: #fff;
  background:
    linear-gradient(180deg, transparent, rgb(0 0 0 / 72%)),
    var(--banner, linear-gradient(135deg, #17463d, #a64838));
  background-color: #111;
  background-position: var(--banner-position, center);
  background-repeat: no-repeat;
  background-size: var(--banner-size, contain);
  border-radius: 8px;
  font-weight: 800;
}

.banner-safe-zone {
  position: absolute;
  inset: 14px;
  border: 2px dashed rgb(255 255 255 / 72%);
  border-radius: 8px;
  pointer-events: none;
}

.banner-safe-zone-left {
  width: min(46%, 380px);
  right: auto;
  background: linear-gradient(90deg, rgb(255 255 255 / 12%), transparent);
}

.banner-safe-zone-lower-left {
  top: auto;
  bottom: 18px;
  width: min(48%, 420px);
  height: 34%;
  right: auto;
  background: linear-gradient(90deg, rgb(255 255 255 / 12%), transparent);
}

.banner-safe-zone-editorial {
  top: auto;
  bottom: 18px;
  left: 18px;
  right: 18px;
  height: 28%;
  background: linear-gradient(180deg, transparent, rgb(255 255 255 / 12%));
}

.banner-safe-zone-full-width {
  top: auto;
  bottom: 18px;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgb(255 255 255 / 12%));
}

.banner-safe-zone-label {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 7px;
  color: #fff;
  background: rgb(0 0 0 / 42%);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.banner-preview-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .banner-preview-card .banner-hero-copy {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 100%;
    background: #050505;
  }
}

.crop-control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field-group input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.steam-preview-frame {
  min-height: 180px;
  overflow: hidden;
}

.steam-preview-frame .game-template-hero {
  min-height: 260px;
  margin: -20px;
  padding: 28px;
}

.steam-preview-frame .game-template-hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.page-preview-frame {
  width: 1440px;
  max-width: none;
  min-height: 820px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
}

.preview-ribbon {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 16px;
  color: #fff;
  background: var(--red);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label,
.check-row {
  font-weight: 800;
}

.dashboard-public-themes-shell {
  padding: 0 clamp(18px, 4vw, 56px) clamp(28px, 5vw, 64px);
}

.dashboard-public-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.dashboard-public-theme-card {
  display: grid;
  gap: 16px;
}

.dashboard-public-theme-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-public-theme-heading h3 {
  margin: 0;
}

.dashboard-public-theme-preview {
  display: grid;
  gap: 8px;
  padding: 18px;
  color: var(--preview-hero-title);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0%), rgb(255 255 255 / 0%)),
    linear-gradient(135deg, var(--preview-hero), var(--preview-bg));
  border: 1px solid var(--preview-panel);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%);
}

.dashboard-public-theme-preview strong {
  font-size: 1.45rem;
  line-height: 1.05;
}

.dashboard-public-theme-preview small {
  color: var(--preview-muted);
}

.dashboard-public-theme-eyebrow {
  color: var(--preview-accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-public-theme-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
}

.dashboard-public-theme-swatch {
  display: grid;
  gap: 8px;
  padding: 10px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.dashboard-public-theme-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgb(39 107 93 / 12%);
}

.dashboard-public-theme-swatch-bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.dashboard-public-theme-swatch-bars span {
  display: block;
  min-height: 42px;
  border-radius: 10px;
}

.dashboard-public-theme-colors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.dashboard-public-theme-colors label {
  display: grid;
  gap: 6px;
}

.dashboard-public-theme-colors span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.dashboard-public-theme-colors input[type="color"] {
  width: 100%;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.field-group input[type="text"],
.field-group textarea,
.field-group select {
  width: min(100%, 520px);
  max-width: none;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.field-group input[type="text"],
.field-group select {
  min-height: 44px;
}

.field-group textarea {
  min-height: 110px;
  padding-top: 10px;
  resize: vertical;
}

.timeline-entry-form {
  display: grid;
  gap: 16px;
}

.inline-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 16px;
}

.timeline-public {
  min-height: 44px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.editor-side {
  display: grid;
  align-content: start;
  gap: 14px;
}

.meta-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.meta-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
}

.meta-list span {
  color: var(--muted);
}

.full-button {
  width: 100%;
}

.game-hero .eyebrow,
.game-hero .lede {
  color: rgb(255 255 255 / 88%);
}

.review-list {
  display: grid;
  gap: 14px;
}

.review {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
}

.review-score {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-weight: 800;
}

.empty {
  padding: 18px;
  background: rgb(255 255 255 / 55%);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

body[class*="template-page"] .journal-entry,
body[class*="template-page"] .screenshot-tile,
body[class*="template-page"] .screenshot-lightbox-panel,
body[class*="template-page"] .empty {
  background: var(--template-partial-surface, var(--surface));
  border-color: var(--template-partial-border, var(--line));
  backdrop-filter: var(--template-partial-backdrop-filter, none);
  -webkit-backdrop-filter: var(--template-partial-backdrop-filter, none);
}

body[class*="template-page"] .markdown-body,
body[class*="template-page"] .journal-entry > p,
body[class*="template-page"] .game-timeline-event p,
body[class*="template-page"] .steam-rich-text,
body[class*="template-page"] .news-item p,
body[class*="template-page"] .screenshot-lightbox figcaption,
body[class*="template-page"] .empty {
  color: var(--template-partial-muted, var(--muted));
}

@media (max-width: 820px) {
  .site-header,
  .profile-head,
  .dashboard-head,
  .section-heading.row {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .dashboard-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .top-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 10px 16px;
  }

  .top-nav-account {
    padding-left: 0;
    border-left: none;
  }

  .game-card-body,
  .review,
  .editor-shell,
  .editor-tab-grid,
  .banner-controls-grid {
    grid-template-columns: 1fr;
  }

  .card-actions {
    align-items: flex-start;
  }
}
