:root {
  --ink: #172033;
  --muted: #657087;
  --paper: #fffdf8;
  --soft: #f4f1e9;
  --line: #ded9cc;
  --accent: #bd3c2c;
  --accent-dark: #8d291e;
  --blue: #1e5f78;
  --green: #2e7657;
  --shadow: 0 16px 45px rgba(35, 31, 25, .10);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1180px, calc(100% - 36px)); margin-inline: auto; }
.grow { flex: 1; }
.inline-form { display: inline; margin: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 248, .94);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(222, 217, 204, .8);
}
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 850; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px;
  background: var(--accent); color: white; border-radius: 10px 14px 9px 12px;
  font-size: .83rem; letter-spacing: .04em; transform: rotate(-2deg);
  box-shadow: 3px 3px 0 #e7ae4b;
}
.main-nav { display: flex; align-items: center; gap: 7px; }
.main-nav > a, .link-button {
  border: 0; background: transparent; color: var(--ink); padding: 9px 11px;
  border-radius: 10px; font-weight: 680; font-size: .94rem;
}
.main-nav > a:hover, .main-nav > a.active, .link-button:hover { background: var(--soft); text-decoration: none; }
.main-nav .profile-button { color: white; background: var(--ink); padding-inline: 15px; }
.main-nav .profile-button:hover { background: var(--accent); }
.nav-toggle { display: none; border: 0; background: var(--soft); padding: 8px 12px; border-radius: 9px; }
.dev-warning { background: #fff0c7; border-bottom: 1px solid #e7c264; padding: 8px 18px; font-size: .85rem; text-align: center; color: #65480a; }

.hero { overflow: hidden; background: linear-gradient(135deg, #f7e8d3, #fffdf8 55%, #dfeef0); border-bottom: 1px solid var(--line); }
.hero-grid { min-height: 530px; display: grid; grid-template-columns: 1.25fr .75fr; gap: 40px; align-items: center; padding-block: 72px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-weight: 850; text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; margin-top: 0; }
h1 { font-size: clamp(2.6rem, 7vw, 5.1rem); margin-bottom: 18px; }
h2 { font-size: clamp(1.7rem, 3vw, 2.45rem); margin-bottom: 12px; }
h3 { font-size: 1.15rem; }
.hero-copy { font-size: clamp(1.05rem, 2vw, 1.25rem); color: #48536a; max-width: 700px; }
.hero-search { display: flex; gap: 10px; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 8px; margin: 28px 0 17px; box-shadow: var(--shadow); }
.hero-search input { border: 0; outline: 0; background: transparent; padding: 11px 13px; min-width: 0; flex: 1; }
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-art { position: relative; min-height: 350px; }
.paper-stack {
  position: absolute; width: 230px; height: 300px; display: grid; place-items: center;
  border: 2px solid var(--ink); background: white; box-shadow: 13px 15px 0 rgba(23,32,51,.12);
  font-weight: 950; font-size: 2.2rem; letter-spacing: .08em;
}
.paper-one { right: 80px; top: 45px; transform: rotate(-12deg); background: #fff4d7; }
.paper-two { right: 8px; top: 15px; transform: rotate(8deg); background: #d9edef; color: var(--blue); }
.paper-three { right: 53px; top: 55px; transform: rotate(-1deg); color: var(--accent); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); background: white; color: var(--ink);
  min-height: 43px; padding: 9px 15px; border-radius: 11px; font-weight: 780;
  box-shadow: 0 2px 0 rgba(23,32,51,.05);
}
.button:hover { text-decoration: none; border-color: #b8ae9d; transform: translateY(-1px); }
.button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.ghost { background: transparent; }
.button.danger { color: #a42323; border-color: #e6b4b4; background: #fff8f8; }
.button.large { min-height: 50px; padding-inline: 22px; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: .85rem; }

.page-section { padding-block: 58px; }
.inner-section { border-top: 1px solid var(--line); margin-top: 58px; padding-top: 48px; }
.soft-section { background: var(--soft); border-block: 1px solid var(--line); }
.section-heading, .page-heading, .panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading h2, .page-heading h1 { margin-bottom: 0; }
.page-heading h1 { font-size: clamp(2.2rem, 5vw, 3.9rem); }
.page-heading p:not(.eyebrow) { color: var(--muted); max-width: 720px; }
.narrow-page { max-width: 900px; }
.two-column-section { display: grid; grid-template-columns: 1.3fr .7fr; gap: 55px; align-items: start; }

.game-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.game-card { border: 1px solid var(--line); background: white; border-radius: var(--radius); overflow: hidden; box-shadow: 0 5px 18px rgba(36,31,24,.055); transition: transform .17s, box-shadow .17s; min-width: 0; }
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.game-cover { position: relative; display: block; aspect-ratio: 4 / 5; background: #ebe6d9; overflow: hidden; }
.game-cover img { width: 100%; height: 100%; object-fit: cover; }
.game-cover:hover { text-decoration: none; }
.cover-placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: repeating-linear-gradient(-45deg, #efe8d9 0 14px, #f8f3e9 14px 28px); color: var(--accent); font-size: 2rem; font-weight: 950; }
.cover-placeholder.large { min-height: 500px; }
.cover-placeholder span { border: 3px solid currentColor; padding: 10px 14px; transform: rotate(-4deg); }
.status-badge { position: absolute; top: 12px; right: 12px; color: white; background: var(--ink); padding: 5px 9px; border-radius: 999px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.game-card-body { padding: 17px; }
.game-card h3 { margin-bottom: 6px; font-size: 1.2rem; }
.game-card h3 a { color: var(--ink); }
.byline { margin: 0 0 13px; color: var(--muted); font-size: .91rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; min-height: 25px; background: var(--soft); color: #4e5667; border: 1px solid #e6dfd0; padding: 3px 8px; border-radius: 999px; font-size: .76rem; }
.card-footer { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid #eee9de; margin-top: 16px; padding-top: 12px; font-size: .79rem; color: var(--muted); }

.compact-list { display: grid; gap: 9px; }
.compact-game, .creator-row { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: white; }
.compact-game:hover, .creator-row:hover { text-decoration: none; border-color: #bcb2a1; transform: translateX(3px); }
.compact-game small, .creator-row small { display: block; color: var(--muted); margin-top: 2px; }
.mini-cover { width: 48px; height: 55px; border-radius: 7px; display: grid; place-items: center; overflow: hidden; background: var(--soft); color: var(--accent); font-weight: 900; font-size: .72rem; }
.mini-cover img { width: 100%; height: 100%; object-fit: cover; }
.creator-panel { background: #172033; color: white; border-radius: 22px; padding: 24px; }
.creator-panel .eyebrow { color: #e7ae4b; }
.creator-panel .creator-row { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.13); color: white; }
.creator-panel .creator-row small { color: #c6ccda; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: #e7ae4b; color: var(--ink); display: grid; place-items: center; overflow: hidden; font-weight: 900; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.large { width: 88px; height: 88px; font-size: 2rem; }

.filter-bar { display: flex; gap: 12px; align-items: end; padding: 16px; border: 1px solid var(--line); background: var(--soft); border-radius: 16px; margin-bottom: 15px; }
.filter-bar label { min-width: 160px; }
.result-count { color: var(--muted); margin: 0 0 20px; }
label > span, legend { display: block; margin-bottom: 7px; font-weight: 760; font-size: .9rem; }
input, textarea, select {
  width: 100%; border: 1px solid #cbc4b5; background: white; color: var(--ink);
  border-radius: 10px; padding: 11px 12px; outline: 0;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30,95,120,.13); }
textarea { resize: vertical; }

.game-detail-grid { display: grid; grid-template-columns: minmax(260px, 390px) 1fr; gap: 54px; align-items: start; }
.detail-cover { border: 1px solid var(--line); border-radius: 19px; overflow: hidden; background: var(--soft); box-shadow: var(--shadow); }
.detail-cover img { width: 100%; }
.detail-topline { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.detail-topline h1 { font-size: clamp(2.4rem, 5vw, 4.5rem); margin: 12px 0 10px; }
.creator-byline { font-size: 1.08rem; color: var(--muted); }
.fact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 28px 0; }
.fact-grid > div, .stats-grid > div { border: 1px solid var(--line); background: var(--soft); border-radius: 12px; padding: 13px; }
.fact-grid small, .stats-grid small { display: block; color: var(--muted); margin-bottom: 4px; }
.fact-grid strong { font-size: .97rem; }
.status-pill { display: inline-flex; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .07em; font-size: .69rem; font-weight: 850; background: #ece8df; color: #5f6675; }
.status-pill.published { background: #dff3e8; color: #245f44; }
.status-pill.wip { background: #fff0c7; color: #795600; }
.status-pill.draft { background: #e7e8ee; color: #505769; }
.content-section { margin-top: 33px; }
.content-section h2 { font-size: 1.42rem; }
.prose { white-space: pre-wrap; color: #3f495d; line-height: 1.75; }
.download-box { margin-top: 18px; border: 1px solid var(--line); background: white; border-radius: 15px; padding: 17px; }
.download-box h2 { font-size: 1.3rem; }
.download-box > p { margin-bottom: 0; color: var(--muted); font-size: .84rem; }
.download-button { display: flex; flex-direction: column; gap: 2px; background: var(--accent); color: white; border-radius: 11px; padding: 12px 13px; margin-bottom: 8px; }
.download-button:hover { text-decoration: none; background: var(--accent-dark); }
.download-button small { opacity: .75; }
.muted-box { background: var(--soft); }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 30px; }
.tag-list a { background: #e7f0f2; padding: 6px 10px; border-radius: 999px; font-size: .85rem; }
.source-link { color: var(--muted); font-size: .85rem; margin-top: 30px; }
.link-list { display: flex; flex-direction: column; gap: 8px; }
.screenshot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.screenshot-grid a { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--soft); }
.screenshot-grid img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.timeline { border-left: 2px solid var(--line); margin-left: 9px; display: grid; gap: 24px; }
.timeline > div { position: relative; padding-left: 24px; }
.timeline .version-dot { position: absolute; width: 12px; height: 12px; background: var(--accent); border-radius: 50%; left: -7px; top: 5px; box-shadow: 0 0 0 4px var(--paper); }
.timeline small { margin-left: 10px; color: var(--muted); }
.timeline p { margin-bottom: 0; color: #48536a; }

.profile-hero { position: relative; overflow: hidden; background: #172033; color: white; min-height: 320px; }
.profile-banner-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .27; }
.profile-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(23,32,51,.96), rgba(23,32,51,.53)); }
.profile-hero-inner { position: relative; z-index: 1; min-height: 320px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 25px; padding-block: 50px; }
.profile-avatar { width: 130px; height: 130px; font-size: 3rem; border: 5px solid rgba(255,255,255,.8); }
.profile-hero h1 { font-size: clamp(2.6rem, 6vw, 4.7rem); margin-bottom: 11px; }
.profile-hero p { max-width: 700px; color: #d9deea; }
.profile-links { display: flex; flex-wrap: wrap; gap: 16px; font-size: .9rem; }
.profile-links a { color: #ffd67f; }
.creator-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.creator-card { position: relative; border: 1px solid var(--line); background: white; border-radius: var(--radius); overflow: hidden; padding: 0 20px 20px; color: var(--ink); }
.creator-card:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-3px); }
.creator-banner { height: 110px; background: linear-gradient(135deg, #dbeaec, #f4dfbf); margin-inline: -20px; }
.creator-banner img { width: 100%; height: 100%; object-fit: cover; }
.creator-card .avatar { margin-top: -44px; border: 4px solid white; }
.creator-card h2 { margin: 13px 0 8px; }
.creator-card p { color: var(--muted); min-height: 72px; }
.creator-stats { display: flex; gap: 20px; border-top: 1px solid var(--line); padding-top: 15px; }
.creator-stats strong { display: block; font-size: 1.2rem; }
.private-section { background: #f5f3f8; margin-inline: -18px; padding-inline: 18px; border-radius: 18px; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; padding: 25px; box-shadow: 0 5px 22px rgba(36,31,24,.055); }
.form-stack { display: grid; gap: 20px; }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.checkbox-label { display: flex; align-items: center; gap: 9px; padding-top: 29px; }
.checkbox-label input { width: auto; }
.checkbox-label span { margin: 0; }
.file-field { display: block; border: 1px dashed #aaa18f; background: var(--soft); border-radius: 12px; padding: 14px; }
.file-field input { border: 0; padding: 6px 0; background: transparent; }
.file-field small, .help-text { display: block; color: var(--muted); margin-top: 5px; }
.upload-section { border-top: 1px solid var(--line); padding-top: 20px; }
.upload-section h2 { font-size: 1.35rem; }
.form-actions { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding-top: 20px; }
.existing-media { border-top: 1px solid var(--line); padding-top: 18px; }
.edit-cover-preview { width: 180px; max-height: 250px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.manage-list { display: grid; gap: 8px; }
.manage-list > div { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 12px; background: var(--soft); border-radius: 10px; }
.manage-list small { display: block; color: var(--muted); }
.edit-screenshot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.edit-screenshot-grid > div { border: 1px solid var(--line); padding: 8px; border-radius: 10px; }
.edit-screenshot-grid img { aspect-ratio: 16/10; object-fit: cover; margin-bottom: 7px; }
.profile-select-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.help-box { border-left: 4px solid #e7ae4b; background: #fff6df; padding: 14px 16px; color: #5b4a24; }
.help-box p:last-child { margin-bottom: 0; }
.help-box code { background: rgba(255,255,255,.7); padding: 2px 4px; border-radius: 4px; }
.import-preview { display: grid; grid-template-columns: 220px 1fr; gap: 23px; margin-bottom: 20px; }
.import-preview img { width: 220px; max-height: 290px; object-fit: cover; border-radius: 11px; }
.import-report { margin-top: 20px; }
.error-list { display: grid; gap: 10px; }
.error-list > div { border: 1px solid #e7b1b1; background: #fff4f4; padding: 12px; border-radius: 10px; }
.error-list p { margin-bottom: 0; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 24px; }
.stats-grid > div { padding: 17px; }
.stats-grid strong { display: block; font-size: 1.9rem; }
.stats-grid.compact { grid-template-columns: repeat(2, minmax(120px, 220px)); }
.dashboard-grid { display: grid; grid-template-columns: 1fr 330px; gap: 22px; align-items: start; }
.dashboard-side { display: grid; gap: 18px; }
.dashboard-game-list { display: grid; gap: 8px; }
.dashboard-game { display: flex; gap: 13px; align-items: center; border-top: 1px solid var(--line); padding: 12px 0; }
.dashboard-game:first-child { border-top: 0; }
.dashboard-game small { display: block; color: var(--muted); margin-top: 4px; }
.tool-panel a { display: block; padding: 13px 0; border-top: 1px solid var(--line); color: var(--ink); }
.tool-panel a:hover { text-decoration: none; color: var(--accent); }
.tool-panel a span { display: block; color: var(--muted); font-size: .87rem; margin-top: 3px; }

.collection-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 19px; }
.collection-card { min-height: 210px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, white, #f3eee4); padding: 23px; color: var(--ink); }
.collection-card:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-3px); }
.collection-card p:not(.eyebrow) { color: var(--muted); flex: 1; }
.collection-hero { display: flex; justify-content: space-between; gap: 25px; align-items: start; padding: 38px; border-radius: 23px; margin-bottom: 32px; background: linear-gradient(135deg, #172033, #285c69); color: white; }
.collection-hero h1 { font-size: clamp(2.5rem, 6vw, 4.7rem); }
.collection-hero .prose { color: #dce3eb; max-width: 760px; }
.collection-hero a { color: #ffd67f; }
.checklist { border: 1px solid var(--line); border-radius: 13px; padding: 13px; }
.checklist label { display: flex; align-items: center; gap: 12px; padding: 10px; border-top: 1px solid #ebe6dc; }
.checklist label:first-of-type { border-top: 0; }
.checklist input { width: auto; }
.checklist span { margin: 0; }
.checklist small { display: block; color: var(--muted); text-transform: capitalize; }

.flash { margin-top: 18px; padding: 12px 15px; border-radius: 10px; }
.flash.success { background: #dff3e8; color: #23593f; border: 1px solid #a9d3bb; }
.flash.error { background: #fff0f0; color: #842626; border: 1px solid #e3b1b1; }
.empty-state { text-align: center; border: 1px dashed #bbb19e; background: var(--soft); border-radius: var(--radius); padding: 45px 20px; color: var(--muted); }
.empty-state.big { padding-block: 90px; }
.empty-state h1, .empty-state h2, .empty-state h3 { color: var(--ink); }
.error-state { border-color: #dca8a8; background: #fff5f5; }

.site-footer { border-top: 1px solid var(--line); background: #172033; color: white; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; padding-block: 42px; }
.footer-inner p { margin: 5px 0 0; color: #bfc7d8; }
.footer-links { display: flex; gap: 18px; align-items: center; }
.footer-links a { color: #f4d390; }

@media (max-width: 980px) {
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .two-column-section, .dashboard-grid { grid-template-columns: 1fr; }
  .creator-grid, .collection-grid { grid-template-columns: repeat(2, 1fr); }
  .game-detail-grid { grid-template-columns: 300px 1fr; gap: 30px; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1180px); }
  .header-inner { min-height: 64px; }
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; left: 12px; right: 12px; top: 68px; flex-direction: column; align-items: stretch; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: var(--shadow); }
  .main-nav.open { display: flex; }
  .main-nav > a, .link-button { width: 100%; text-align: left; }
  .hero-grid { min-height: auto; padding-block: 52px; }
  h1 { font-size: 2.7rem; }
  .hero-search { flex-direction: column; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .page-section { padding-block: 40px; }
  .game-detail-grid { grid-template-columns: 1fr; }
  .detail-cover { max-width: 430px; margin-inline: auto; }
  .fact-grid { grid-template-columns: repeat(2, 1fr); }
  .screenshot-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-hero-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .profile-links { justify-content: center; }
  .form-grid.two, .form-grid.three, .profile-select-grid { grid-template-columns: 1fr; }
  .checkbox-label { padding-top: 0; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar label { min-width: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .creator-grid, .collection-grid { grid-template-columns: 1fr; }
  .import-preview { grid-template-columns: 1fr; }
  .import-preview img { width: 100%; max-height: 400px; object-fit: contain; }
  .page-heading, .section-heading, .detail-topline, .collection-hero { align-items: start; flex-direction: column; }
  .footer-inner { flex-direction: column; }
  .edit-screenshot-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 470px) {
  .game-grid { grid-template-columns: 1fr; }
  .fact-grid, .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-game { align-items: flex-start; flex-wrap: wrap; }
  .dashboard-game .button { margin-left: 61px; }
  .card-footer { font-size: .75rem; }
}

/* =========================================================
   PCG legacy-inspired theme — v0.3
   Recaptures the charcoal / electric-blue / acid-lime mood
   of the original shop while retaining the new site's layout.
   ========================================================= */
:root {
  --ink: #f0f3f8;
  --muted: #a9b3c9;
  --paper: #393b4b;
  --soft: #303240;
  --line: #54586c;
  --accent: #cfe900;
  --accent-dark: #b6cf00;
  --blue: #1988ff;
  --green: #19bd5a;
  --shadow: 0 16px 45px rgba(5, 8, 20, .28);
}

body {
  background: var(--paper);
  color: var(--ink);
}

a { color: var(--blue); }

.site-header {
  position: sticky;
  background: rgba(54, 56, 71, .97);
  border-bottom: 2px solid var(--blue);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .13);
}
.header-inner {
  min-height: 92px;
  flex-wrap: wrap;
  justify-content: center;
  padding-block: 13px 16px;
}
.brand {
  width: 100%;
  justify-content: center;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .17em;
  font-size: 1rem;
  font-weight: 700;
}
.brand-mark {
  width: 39px;
  height: 39px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  color: var(--accent);
  background: transparent;
  box-shadow: 3px 3px 0 var(--blue);
  font-size: .68rem;
}
.main-nav {
  justify-content: center;
  flex-wrap: wrap;
}
.main-nav > a,
.link-button {
  color: var(--accent);
  border-radius: 3px;
  font-weight: 650;
}
.main-nav > a:hover,
.main-nav > a.active,
.link-button:hover {
  color: #fff;
  background: rgba(25, 136, 255, .16);
}
.main-nav .profile-button {
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
}
.main-nav .profile-button:hover {
  color: var(--paper);
  background: var(--accent);
}
.nav-toggle {
  color: var(--accent);
  background: #2d2f3c;
  border: 1px solid var(--line);
}

.hero {
  background:
    radial-gradient(circle at 82% 20%, rgba(25,136,255,.15), transparent 28%),
    linear-gradient(145deg, #343645, #3c3e50 62%, #303240);
  border-bottom: 1px solid var(--line);
}
.hero-copy { color: var(--muted); }
.eyebrow { color: var(--blue); font-style: italic; text-transform: none; letter-spacing: .04em; }
.hero-search,
.panel,
.game-card,
.download-box,
.creator-card {
  background: #3e4051;
  border-color: var(--line);
}
.hero-search input { color: white; }
.hero-search input::placeholder { color: #aeb6c9; }

.paper-stack {
  border-color: var(--accent);
  background: #3e4051;
  box-shadow: 13px 15px 0 rgba(0,0,0,.22);
}
.paper-one { background: #383a49; color: var(--accent); }
.paper-two { background: #343645; color: var(--blue); }
.paper-three { background: #414354; color: #fff; }

.button {
  color: var(--ink);
  border-color: var(--line);
  background: #45485a;
  border-radius: 3px;
}
.button:hover { border-color: var(--blue); background: #4a4d60; }
.button.primary,
.download-button {
  color: #172000;
  background: var(--accent);
  border-color: var(--accent);
}
.button.primary:hover,
.download-button:hover { background: var(--accent-dark); }
.button.ghost { color: var(--accent); border-color: var(--accent); }

.soft-section {
  background: #323441;
  border-color: var(--line);
}
.inner-section,
.site-footer,
.card-footer,
.upload-section,
.form-actions,
.existing-media,
.creator-stats,
.dashboard-game,
.tool-panel a { border-color: var(--line); }

.section-heading h2,
.page-heading h1,
.game-card h3 a,
.content-section h2,
.download-box h2,
.empty-state h1,
.empty-state h2,
.empty-state h3 { color: var(--accent); }

.game-card {
  border-radius: 2px;
  box-shadow: none;
}
.game-card:hover {
  border-color: var(--blue);
  box-shadow: 0 12px 28px rgba(0,0,0,.22);
}
.game-cover { background: #2c2e39; }
.game-card-body { padding: 16px 15px 15px; }
.game-card h3 { font-weight: 500; }
.game-series {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: .78rem;
  font-style: italic;
}
.byline,
.card-footer,
.result-count,
.creator-byline,
.source-link { color: var(--muted); }
.chip {
  color: #dce3f2;
  background: #303240;
  border-color: #55596e;
  border-radius: 3px;
}
.status-badge { border-radius: 2px; background: var(--blue); }
.cover-placeholder { background: #303240; color: var(--accent); }

.detail-cover {
  border-radius: 2px;
  border-color: var(--line);
  background: #303240;
}
.detail-topline h1 {
  color: var(--accent);
  font-weight: 500;
  letter-spacing: -.025em;
}
.series-link {
  display: inline-block;
  margin-bottom: 2px;
  color: var(--blue);
  font-size: 1rem;
  font-style: italic;
  font-weight: 600;
}
.series-link:hover { color: #62b0ff; }
.fact-grid > div,
.stats-grid > div {
  color: var(--ink);
  border-color: var(--line);
  background: #303240;
  border-radius: 3px;
}
.fact-grid small,
.stats-grid small { color: var(--muted); }
.prose,
.timeline p { color: #bdc6d8; }
.tag-list a { color: var(--blue); background: #30394d; border: 1px solid #405a7d; border-radius: 3px; }
.screenshot-grid a { border-radius: 2px; border-color: var(--line); background: #303240; }
.timeline .version-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--paper); }

input,
textarea,
select {
  color: #f2f4f8;
  background: #2f3140;
  border-color: #62667b;
  border-radius: 3px;
}
input::placeholder,
textarea::placeholder { color: #929db4; }
input:focus,
textarea:focus,
select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(25,136,255,.18); }
.file-field,
.empty-state,
.muted-box,
.manage-list > div { background: #303240; border-color: var(--line); }

.creator-row,
.compact-game {
  color: var(--ink);
  border-color: var(--line);
  background: #3e4051;
  border-radius: 3px;
}
.creator-row:hover,
.compact-game:hover { border-color: var(--blue); background: #424557; }
.creator-card p,
.creator-card small,
.compact-game small { color: var(--muted); }
.profile-hero { background: #303240; }
.profile-hero::after { background: linear-gradient(90deg, rgba(42,44,57,.98), rgba(42,44,57,.62)); }
.profile-links a,
.footer-links a { color: var(--accent); }
.collection-card {
  color: var(--ink);
  background: linear-gradient(145deg, #414354, #303240);
  border-color: var(--line);
  border-radius: 3px;
}
.collection-card p:not(.eyebrow) { color: var(--muted); }
.collection-hero { background: linear-gradient(135deg, #292b38, #263d59); border: 1px solid var(--blue); border-radius: 3px; }

.site-footer { background: #292b37; }
.footer-inner p { color: var(--muted); }

@media (max-width: 760px) {
  .header-inner { min-height: 64px; justify-content: space-between; flex-wrap: nowrap; }
  .brand { width: auto; justify-content: flex-start; font-size: .75rem; letter-spacing: .1em; }
  .brand-mark { display: none; }
  .main-nav {
    top: 66px;
    background: #343645;
    border-color: var(--blue);
  }
}
/* PCG v0.31 — rounded corners + softer upload controls */

:root {
  --pcg-round-small: 9px;
  --pcg-round-medium: 14px;
  --pcg-round-large: 18px;
  --pcg-upload-bg: #596174;
  --pcg-upload-bg-hover: #697287;
  --pcg-upload-border: #7b8498;
  --pcg-upload-text: #f1f4fb;
}

/* Restore the friendlier rounded shape language from v0.2. */
.button,
.main-nav > a,
.link-button,
.main-nav .profile-button,
.nav-toggle,
input,
textarea,
select,
.chip,
.status-badge,
.status-pill,
.tag-list a {
  border-radius: var(--pcg-round-small);
}

.game-card,
.creator-card,
.collection-card,
.panel,
.download-box,
.hero-search,
.filter-bar,
.file-field,
.empty-state,
.muted-box,
.creator-row,
.compact-game,
.fact-grid > div,
.stats-grid > div,
.manage-list > div,
.edit-screenshot-grid > div,
.error-list > div {
  border-radius: var(--pcg-round-medium);
}

.detail-cover,
.screenshot-grid a,
.collection-hero,
.creator-panel,
.private-section {
  border-radius: var(--pcg-round-large);
}

.game-cover {
  border-radius: var(--pcg-round-medium) var(--pcg-round-medium) 0 0;
}

/* Give buttons a softer, less rigid silhouette. */
.button {
  border-radius: 11px;
}

/* Native file chooser buttons: muted blue-gray rather than harsh white/neon. */
input[type="file"] {
  padding: 7px;
  color: #cbd2e1;
  background: #303240;
  border: 1px solid #5c6074;
  border-radius: 11px;
}

input[type="file"]::file-selector-button {
  margin-right: 11px;
  padding: 9px 13px;
  border: 1px solid var(--pcg-upload-border);
  border-radius: 9px;
  color: var(--pcg-upload-text);
  background: var(--pcg-upload-bg);
  font-weight: 700;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

input[type="file"]::file-selector-button:hover {
  background: var(--pcg-upload-bg-hover);
  border-color: #929caf;
  transform: translateY(-1px);
}

/* Firefox's older file-button selector. */
input[type="file"]::-webkit-file-upload-button {
  margin-right: 11px;
  padding: 9px 13px;
  border: 1px solid var(--pcg-upload-border);
  border-radius: 9px;
  color: var(--pcg-upload-text);
  background: var(--pcg-upload-bg);
  font-weight: 700;
  cursor: pointer;
}

.file-field {
  background: #353746;
  border-color: #63687d;
}

.file-field:hover {
  background: #393c4c;
  border-color: #7c8499;
}

/* Upload/save actions remain visible, but use a gentler lime. */
.form-actions .button.primary,
.upload-section .button.primary {
  color: #293000;
  background: #c5d96a;
  border-color: #c5d96a;
}

.form-actions .button.primary:hover,
.upload-section .button.primary:hover {
  background: #d2e47b;
  border-color: #d2e47b;
}

/* v0.15: existing-file attachment and dedicated duplicate merging tool */
.existing-file-attach {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--border, #5d6170);
  border-radius: var(--pcg-round-medium, 14px);
  background: rgba(255,255,255,.025);
}
.existing-file-attach select[multiple] {
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
}
.compact-form { gap: 14px; }
.compact-form .button { align-self: flex-start; }
.duplicate-groups { display: grid; gap: 22px; }
.duplicate-group { padding: 22px; }
.duplicate-group-heading,
.duplicate-merge-options {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.duplicate-page-list { display: grid; gap: 10px; margin: 18px 0; }
.duplicate-page-row {
  display: grid;
  grid-template-columns: minmax(130px, auto) minmax(170px, auto) 1fr;
  gap: 16px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}
.duplicate-keep,
.duplicate-merge-check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}
.duplicate-page-info { display: grid; gap: 4px; }
.duplicate-page-info small { color: var(--muted, #b7bcc7); }
.duplicate-page-info p { margin: 6px 0 0; }
.duplicate-merge-options label { min-width: min(100%, 360px); }
@media (max-width: 780px) {
  .duplicate-page-row { grid-template-columns: 1fr; }
  .duplicate-group-heading,
  .duplicate-merge-options { flex-direction: column; }
}

/* v0.16: configurable header character fan + compact searchable file picker */
.site-header {
  min-height: 94px;
  overflow: hidden;
  border-bottom: 4px solid var(--blue);
}
.header-inner { position: relative; z-index: 3; min-height: 90px; }
.header-character-stage {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: -23px;
  width: min(720px, 70vw);
  height: 120px;
  transform: translateX(-50%);
  pointer-events: none;
}
.header-character {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: clamp(74px, 8vw, 118px);
  height: 132px;
  object-fit: contain;
  object-position: center bottom;
  transform-origin: 50% 92%;
  filter: drop-shadow(0 4px 2px rgba(0,0,0,.22));
}
.header-character-1 { transform: translateX(-365%) rotate(-30deg); }
.header-character-2 { transform: translateX(-285%) rotate(-23deg); }
.header-character-3 { transform: translateX(-205%) rotate(-15deg); }
.header-character-4 { transform: translateX(-125%) rotate(-7deg); }
.header-character-5 { transform: translateX(-50%) rotate(0deg); z-index: 2; }
.header-character-6 { transform: translateX(25%) rotate(7deg); }
.header-character-7 { transform: translateX(105%) rotate(15deg); }
.header-character-8 { transform: translateX(185%) rotate(23deg); }
.header-character-9 { transform: translateX(265%) rotate(30deg); }

.existing-file-picker { margin-top: 14px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; }
.existing-file-picker summary { list-style: none; width: 100%; }
.existing-file-picker summary::-webkit-details-marker { display: none; }
.existing-file-picker summary::after { content: "▾"; margin-left: auto; }
.existing-file-picker[open] summary::after { content: "▴"; }
.existing-file-picker-panel { margin-top: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #292b38; }
.existing-file-picker-panel select[multiple] { min-height: 230px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; }
.existing-file-picker-panel option[hidden] { display: none; }

.header-lineup-preview {
  position: relative;
  height: 190px;
  overflow: hidden;
  margin-bottom: 28px;
  border-bottom: 4px solid var(--blue);
  border-radius: 16px 16px 0 0;
  background: #292b38;
}
.header-preview-slot { position: absolute; left: 50%; bottom: -24px; width: 112px; height: 155px; transform-origin: 50% 92%; display: grid; place-items: center; }
.header-preview-slot img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.header-preview-slot span { display: grid; place-items: center; width: 56px; height: 56px; border: 1px dashed #798095; border-radius: 50%; color: var(--muted); }
.header-preview-slot-1 { transform: translateX(-365%) rotate(-30deg); }
.header-preview-slot-2 { transform: translateX(-285%) rotate(-23deg); }
.header-preview-slot-3 { transform: translateX(-205%) rotate(-15deg); }
.header-preview-slot-4 { transform: translateX(-125%) rotate(-7deg); }
.header-preview-slot-5 { transform: translateX(-50%); z-index: 2; }
.header-preview-slot-6 { transform: translateX(25%) rotate(7deg); }
.header-preview-slot-7 { transform: translateX(105%) rotate(15deg); }
.header-preview-slot-8 { transform: translateX(185%) rotate(23deg); }
.header-preview-slot-9 { transform: translateX(265%) rotate(30deg); }
.header-slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.header-slot-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #303240; }
.header-slot-card h2 { margin: 12px 0 2px; font-size: 1.15rem; }
.header-slot-card > small { display: block; margin-bottom: 12px; color: var(--muted); }
.header-slot-thumb { height: 145px; display: grid; place-items: center; overflow: hidden; border-radius: 11px; background: #252733; }
.header-slot-thumb img { width: 100%; height: 100%; object-fit: contain; }
.header-slot-thumb span { color: var(--muted); }
@media (max-width: 900px) {
  .header-character-stage { width: 58vw; opacity: .68; }
  .header-slot-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 650px) {
  .site-header { min-height: 68px; }
  .header-inner { min-height: 64px; }
  .header-character-stage { display: none; }
  .header-slot-grid { grid-template-columns: 1fr; }
}

/* v0.17: bulk duplicate merging and favicon editor */
.merge-all-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.merge-all-panel h2,
.favicon-editor h2 { margin-top: 0; }
.favicon-editor { display: grid; gap: 24px; max-width: 760px; }
.favicon-preview-wrap { display: flex; align-items: center; gap: 20px; }
.favicon-preview {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 18px;
  padding: 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
}
@media (max-width: 700px) {
  .merge-all-panel,
  .favicon-preview-wrap { align-items: stretch; flex-direction: column; }
  .merge-all-panel .button { width: 100%; }
}


/* Header clarity, per-character scale controls, and catalog/homepage admin tools */
.brand,
.main-nav > a,
.link-button {
  -webkit-text-stroke: 1px rgba(0, 0, 0, .92);
  paint-order: stroke fill;
  text-shadow:
    0 2px 2px rgba(0, 0, 0, .9),
    0 0 5px rgba(0, 0, 0, .75);
}
.header-character-1 { transform: translateX(-365%) rotate(-30deg) scale(var(--character-scale, 1)); }
.header-character-2 { transform: translateX(-285%) rotate(-23deg) scale(var(--character-scale, 1)); }
.header-character-3 { transform: translateX(-205%) rotate(-15deg) scale(var(--character-scale, 1)); }
.header-character-4 { transform: translateX(-125%) rotate(-7deg) scale(var(--character-scale, 1)); }
.header-character-5 { transform: translateX(-50%) rotate(0deg) scale(var(--character-scale, 1)); }
.header-character-6 { transform: translateX(25%) rotate(7deg) scale(var(--character-scale, 1)); }
.header-character-7 { transform: translateX(105%) rotate(15deg) scale(var(--character-scale, 1)); }
.header-character-8 { transform: translateX(185%) rotate(23deg) scale(var(--character-scale, 1)); }
.header-character-9 { transform: translateX(265%) rotate(30deg) scale(var(--character-scale, 1)); }
.header-preview-slot-1 { transform: translateX(-365%) rotate(-30deg) scale(var(--character-scale, 1)); }
.header-preview-slot-2 { transform: translateX(-285%) rotate(-23deg) scale(var(--character-scale, 1)); }
.header-preview-slot-3 { transform: translateX(-205%) rotate(-15deg) scale(var(--character-scale, 1)); }
.header-preview-slot-4 { transform: translateX(-125%) rotate(-7deg) scale(var(--character-scale, 1)); }
.header-preview-slot-5 { transform: translateX(-50%) scale(var(--character-scale, 1)); }
.header-preview-slot-6 { transform: translateX(25%) rotate(7deg) scale(var(--character-scale, 1)); }
.header-preview-slot-7 { transform: translateX(105%) rotate(15deg) scale(var(--character-scale, 1)); }
.header-preview-slot-8 { transform: translateX(185%) rotate(23deg) scale(var(--character-scale, 1)); }
.header-preview-slot-9 { transform: translateX(265%) rotate(30deg) scale(var(--character-scale, 1)); }
.header-scale-control { margin-top: 13px; }
.header-scale-control input[type="range"] { width: 100%; }
.header-scale-control output { color: var(--accent); font-weight: 800; }
.form-divider { margin: 0; color: var(--muted); font-weight: 800; text-align: center; text-transform: uppercase; }
.audit-source { margin: 22px 0 12px; }
.audit-section { margin-top: 18px; }
.audit-section li { margin: 8px 0; }

/* Unified green action buttons while preserving ghost and danger actions. */
:root { --pcg-button-green: #2e7657; --pcg-button-green-hover: #245e46; }
.button:not(.danger):not(.ghost), .button.primary, .download-button { color: #fff; background: var(--pcg-button-green); border-color: var(--pcg-button-green); }
.button:not(.danger):not(.ghost):hover, .button.primary:hover, .download-button:hover { color: #fff; background: var(--pcg-button-green-hover); border-color: var(--pcg-button-green-hover); }
.card-stat-separator { display: inline-block; margin-inline: .28em; }

/* Creator authentication patch */
.account-password-panel { margin-top: 22px; }
.credential-warning { margin-bottom: 18px; background: #fff7d6; border-color: #ddc873; color: #241f12; }
.table-wrap { overflow-x: auto; }
.credentials-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.credentials-table th, .credentials-table td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; }
.credentials-table input { width: 100%; min-width: 160px; }
.credentials-table td:last-child { width: 1%; white-space: nowrap; }

/* Public creator signup and searchable creator login */
.account-access-grid { align-items: start; }
.account-access-grid .panel { height: 100%; }
.account-access-grid label > small,
.account-access-grid form > small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}
.account-access-grid datalist { color: #111; }
#creator-name-input {
  padding-right: 2.75rem;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}


/* Drag-and-drop fields on the game editor. */
.drop-file-field {
  position: relative;
  min-height: 154px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  text-align: center;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.drop-file-field > span { font-size: 1rem; }
.drop-file-field input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.drop-file-prompt {
  display: block;
  font-size: .93rem;
  line-height: 1.35;
}
.drop-file-field small {
  margin-top: 0;
  overflow-wrap: anywhere;
}
.drop-file-field.is-dragging {
  border-color: #b9d85c;
  background: #454a3c;
  transform: translateY(-2px);
}
.drop-file-field.has-files {
  border-style: solid;
  border-color: #9ebc53;
}

/* Daily DACAD */
.homepage-feature-zone { display: grid; grid-template-columns: minmax(260px, .82fr) minmax(0, 1.7fr); gap: 24px; align-items: stretch; }
.homepage-feature-card, .homepage-dacad-card, .dacad-archive-section { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); }
.homepage-feature-card { display: flex; flex-direction: column; }
.homepage-feature-card .game-grid, .featured-home-grid { display: grid; grid-template-columns: 1fr; }
.homepage-feature-card .game-card { width: 100%; }
.homepage-card-link { margin-top: auto; padding-top: 16px; font-weight: 700; }
.homepage-dacad-card .section-heading { margin-bottom: 14px; }
.homepage-dacad-prompt, .dacad-prompt-heading { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: center; }
.homepage-dacad-prompt img, .dacad-prompt-heading img { width: 112px; height: 112px; object-fit: cover; border-radius: 16px; border: 1px solid var(--border); background: #fff; }
.homepage-dacad-prompt h3 { margin: 0 0 7px; font-size: 1.35rem; }
.homepage-dacad-prompt p, .dacad-prompt-heading p { margin: 0; color: var(--muted); line-height: 1.5; }
.homepage-dacad-upload { display: flex; align-items: center; gap: 12px; margin: 18px 0; flex-wrap: wrap; }
.homepage-dacad-upload input[type="file"] { flex: 1 1 230px; }
.homepage-dacad-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dacad-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 16px; margin-top: 20px; }
.dacad-entry-card { margin: 0; min-width: 0; }
.dacad-image-button { display: block; width: 100%; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: #ddd; cursor: zoom-in; aspect-ratio: 1 / 1; }
.dacad-image-button img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .18s ease; }
.dacad-image-button:hover img { transform: scale(1.045); }
.dacad-entry-card figcaption { padding-top: 7px; font-size: .9rem; font-weight: 700; }
.dacad-entry-card figcaption small { display: block; color: var(--muted); font-weight: 400; margin-top: 3px; }
.homepage-dacad-gallery .dacad-entry-card figcaption { font-size: .78rem; }
.dacad-archive-section { margin-bottom: 28px; }
.dacad-archive-section.is-today { border-width: 2px; }
.dacad-prompt-heading { grid-template-columns: 150px minmax(0, 1fr); }
.dacad-prompt-heading img { width: 150px; height: 150px; }
.dacad-upload-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 14px; align-items: end; margin: 22px 0; padding: 16px; border-radius: 16px; background: var(--soft); }
.dacad-upload-form label span { display: block; margin-bottom: 6px; font-weight: 700; }
.dacad-login-note { display: flex; gap: 12px; align-items: center; margin: 20px 0; }
.dacad-lightbox { width: min(92vw, 1100px); max-height: 92vh; padding: 46px 18px 18px; border: 0; border-radius: 18px; background: #171717; color: #fff; }
.dacad-lightbox::backdrop { background: rgba(0,0,0,.78); }
.dacad-lightbox img { display: block; max-width: 100%; max-height: 78vh; margin: auto; object-fit: contain; }
.dacad-lightbox p { text-align: center; margin: 12px 0 0; }
.dacad-lightbox-close { position: absolute; right: 12px; top: 8px; border: 0; background: transparent; color: #fff; font-size: 2rem; cursor: pointer; }
button.button:disabled { background: #aaa !important; border-color: #aaa !important; color: #eee !important; cursor: not-allowed; opacity: .8; }
@media (max-width: 850px) {
  .homepage-feature-zone { grid-template-columns: 1fr; }
  .dacad-upload-form { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .homepage-dacad-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .homepage-dacad-prompt, .dacad-prompt-heading { grid-template-columns: 82px minmax(0, 1fr); align-items: start; }
  .homepage-dacad-prompt img, .dacad-prompt-heading img { width: 82px; height: 82px; }
}

/* Feature requests */
.homepage-feature-zone {
  grid-template-columns: minmax(230px, .82fr) minmax(340px, 1.18fr) minmax(300px, 1fr);
  align-items: stretch;
}
.homepage-feature-requests-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  min-width: 0;
}
.homepage-feature-request-form textarea,
.feature-request-form-panel textarea {
  width: 100%;
  resize: vertical;
  min-height: 82px;
  border: 1px solid var(--line, #ccd5e2);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: var(--soft);
  color: inherit;
}
.homepage-feature-request-form textarea::placeholder,
.feature-request-form-panel textarea::placeholder { color: var(--muted); }
.homepage-feature-request-submit,
.feature-request-form-panel .form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin-top: 9px;
}
.feature-request-list {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}
.feature-request-card {
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px;
  background: var(--soft);
  transition: background .18s ease, border-color .18s ease;
}
.feature-request-card.is-done {
  background: #244f34;
  border-color: #65bd7d;
}
.feature-request-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  font-size: .86rem;
}
.feature-request-topline time { color: var(--muted); }
.feature-request-author { color: var(--accent); font-weight: 800; }
.feature-request-author:hover { text-decoration: underline; }

.feature-request-done-label {
  margin-left: auto;
  color: #9df0ad;
  font-weight: 800;
}
.feature-request-card p {
  margin: 8px 0 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.feature-request-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.feature-request-actions form { margin: 0; }
.reaction-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: inherit;
  padding: 5px 9px;
  cursor: pointer;
  font: inherit;
}
.reaction-button:hover { background: var(--soft); }
.feature-request-admin-action { margin-left: auto !important; }
.feature-request-admin-action .button.small { padding: 5px 9px; font-size: .78rem; }
.homepage-list {
  max-height: 440px;
  overflow: auto;
  padding-right: 3px;
}
.feature-request-form-panel {
  max-width: 820px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.feature-request-form-panel label { display: block; margin-bottom: 8px; }
.feature-request-list.full-list { max-width: 900px; margin-top: 24px; }
.feature-request-list.full-list .feature-request-card { padding: 17px; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
@media (max-width: 1120px) {
  .homepage-feature-zone { grid-template-columns: 1fr 1fr; }
  .homepage-feature-requests-card { grid-column: 1 / -1; }
  .homepage-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
}
@media (max-width: 720px) {
  .homepage-feature-zone { grid-template-columns: 1fr; }
  .homepage-feature-requests-card { grid-column: auto; }
  .homepage-list { grid-template-columns: 1fr; }
}

/* Feature request panel parity + no-reload interaction feedback */
.homepage-feature-requests-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.feature-request-inline-message {
  margin: 9px 0 0;
  color: #ffb5b5;
  font-size: .88rem;
  font-weight: 700;
}
.feature-request-actions button:disabled,
.homepage-feature-request-form button:disabled,
.feature-request-form-panel button:disabled {
  opacity: .62;
  cursor: wait;
}


/* Fixed-height homepage feature row + feature request deletion */
@media (min-width: 1121px) {
  .homepage-feature-zone {
    height: 834px;
  }
  .homepage-feature-zone > .homepage-feature-card,
  .homepage-feature-zone > .homepage-dacad-card,
  .homepage-feature-zone > .homepage-feature-requests-card {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  .homepage-feature-requests-card {
    display: flex;
    flex-direction: column;
  }
  .homepage-feature-requests-card .homepage-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}
.feature-request-delete-action { margin: 0 !important; }
.feature-request-delete-action .button.danger {
  padding: 5px 9px;
  font-size: .78rem;
  background: #8f3030;
  border-color: #b95a5a;
  color: #fff;
}
.feature-request-delete-action .button.danger:hover {
  background: #aa3b3b;
}

/* Daily DACAD reactions, admin controls, and expanded previews */
.dacad-entry-card { position: relative; z-index: 1; transition: transform .2s ease, filter .2s ease; transform-origin: center; }
@media (hover: hover) and (pointer: fine) {
  .dacad-entry-card:hover { z-index: 50; transform: scale(5); filter: drop-shadow(0 12px 24px rgba(0,0,0,.5)); }
  .dacad-entry-card:hover .dacad-image-button { border-radius: 5px; }
  .dacad-entry-card:hover figcaption,
  .dacad-entry-card:hover .dacad-entry-actions { background: var(--surface); padding-left: 5px; padding-right: 5px; }
  .dacad-entry-card:hover figcaption { font-size: .24rem; }
  .dacad-entry-card:hover .dacad-entry-actions { font-size: .2rem; }
  .dacad-entry-card:hover .dacad-reaction-count,
  .dacad-entry-card:hover .dacad-add-reaction,
  .dacad-entry-card:hover .dacad-delete-entry { min-height: 8px; padding: 1px 3px; border-radius: 4px; font-size: .2rem; }
}
.dacad-entry-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding-top: 7px; }
.dacad-reaction-summary { display: flex; gap: 5px; flex-wrap: wrap; }
.dacad-reaction-count, .dacad-add-reaction, .dacad-delete-entry { border: 1px solid var(--border); background: var(--soft); color: var(--text); border-radius: 999px; min-height: 30px; padding: 4px 9px; cursor: pointer; font: inherit; }
.dacad-reaction-count { display: inline-flex; align-items: center; gap: 4px; }
.dacad-reaction-count:hover, .dacad-add-reaction:hover { border-color: var(--accent); transform: translateY(-1px); }
.dacad-delete-entry { margin-left: auto; color: #ffb8b8; border-color: rgba(255,100,100,.45); background: rgba(120,20,20,.28); }
.dacad-delete-entry:hover { background: rgba(170,30,30,.48); }
.dacad-lightbox { overflow: auto; }
.dacad-lightbox-image-wrap { display: flex; align-items: center; justify-content: center; min-height: 40vh; }
.dacad-lightbox-reactions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.dacad-lightbox .dacad-reaction-count, .dacad-lightbox .dacad-add-reaction { background: #2a2a2a; color: #fff; border-color: #555; }
.dacad-emoji-picker { width: min(92vw, 650px); max-height: 82vh; padding: 26px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); }
.dacad-emoji-picker::backdrop { background: rgba(0,0,0,.72); }
.dacad-emoji-picker h2 { margin-top: 0; }
.dacad-emoji-picker input { width: 100%; }
.dacad-emoji-custom-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 12px 0; }
.dacad-emoji-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; max-height: 50vh; overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--soft); }
.dacad-emoji-catalog button { min-width: 42px; min-height: 42px; border: 0; border-radius: 9px; background: transparent; font-size: 1.55rem; cursor: pointer; }
.dacad-emoji-catalog button:hover { background: rgba(80,150,255,.22); transform: scale(1.14); }
@media (max-width: 850px), (hover: none) {
  .dacad-entry-card:hover { transform: none; filter: none; }
}

/* Daily DACAD floating emoji button + smoother unclipped hover preview */
.dacad-image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
}
.dacad-image-wrap .dacad-image-button {
  height: 100%;
}
.dacad-add-reaction-overlay {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 4;
  min-height: 30px;
  padding: 4px 8px;
  background: rgba(28, 31, 37, .88);
  border-color: rgba(255, 255, 255, .55);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .55);
  backdrop-filter: blur(3px);
}
.dacad-add-reaction-overlay:hover {
  background: rgba(45, 54, 66, .96);
}

.dacad-entry-card {
  transition:
    transform .68s cubic-bezier(.22, .72, .18, 1),
    filter .68s ease;
  will-change: transform;
}
.homepage-dacad-card,
.dacad-archive-section,
.dacad-gallery,
.homepage-dacad-gallery {
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  .homepage-dacad-card:has(.dacad-entry-card:hover),
  .dacad-archive-section:has(.dacad-entry-card:hover),
  .dacad-gallery:has(.dacad-entry-card:hover),
  .homepage-dacad-gallery:has(.dacad-entry-card:hover) {
    z-index: 100;
    overflow: visible !important;
  }
  .homepage-feature-zone:has(.homepage-dacad-card .dacad-entry-card:hover) {
    position: relative;
    z-index: 100;
    overflow: visible;
  }
  .dacad-entry-card:hover {
    transition-duration: .78s;
  }
  .dacad-entry-card:hover .dacad-add-reaction-overlay {
    right: 2px;
    bottom: 2px;
    min-height: 8px;
    padding: 1px 2px;
    border-radius: 3px;
    font-size: .2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.5);
  }
}

@media (min-width: 1121px) {
  .homepage-feature-zone > .homepage-dacad-card:has(.dacad-entry-card:hover) {
    overflow: visible !important;
  }
}


/* Daily DACAD larger resting cards + compact metadata controls */
.homepage-dacad-gallery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.dacad-gallery {
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}
.dacad-credit-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.dacad-credit-line > span {
  min-width: 0;
}
.dacad-add-reaction-inline {
  flex: 0 0 auto;
  min-height: 25px;
  padding: 2px 7px;
  font-size: .84rem;
}
.dacad-delete-entry-icon {
  position: absolute;
  left: 7px;
  top: 7px;
  z-index: 5;
  min-height: 24px;
  min-width: 24px;
  margin: 0;
  padding: 2px 4px;
  border: 0;
  border-radius: 7px;
  background: rgba(18, 18, 18, .48);
  color: #fff;
  opacity: .42;
  box-shadow: 0 1px 5px rgba(0,0,0,.28);
  font-size: .78rem;
  line-height: 1;
}
.dacad-delete-entry-icon:hover,
.dacad-delete-entry-icon:focus-visible {
  opacity: 1;
  background: rgba(125, 25, 25, .9);
}
.dacad-entry-actions:empty { display: none; }

@media (hover: hover) and (pointer: fine) {
  .dacad-entry-card:hover .dacad-delete-entry-icon {
    left: 2px;
    top: 2px;
    min-height: 8px;
    min-width: 8px;
    padding: 1px;
    border-radius: 2px;
    font-size: .18rem;
  }
  .dacad-entry-card:hover .dacad-add-reaction-inline {
    min-height: 8px;
    padding: 1px 2px;
    border-radius: 3px;
    font-size: .2rem;
  }
}

@media (max-width: 560px) {
  .homepage-dacad-gallery { grid-template-columns: 1fr; }
  .dacad-gallery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

/* Floating homepage table of contents */
.homepage-toc {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  align-items: flex-start;
  flex-direction: row-reverse;
  gap: 8px;
}
.homepage-toc-toggle {
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 800;
}
.homepage-toc-toggle:hover,
.homepage-toc-toggle:focus-visible {
  transform: scale(1.06);
  border-color: var(--accent);
}
.homepage-toc-panel {
  width: min(290px, calc(100vw - 84px));
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateX(12px) scale(.97);
  transform-origin: right center;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  pointer-events: none;
}
.homepage-toc-panel strong {
  display: block;
  padding: 4px 8px 8px;
}
.homepage-toc-panel a {
  display: block;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}
.homepage-toc-panel a:hover,
.homepage-toc-panel a:focus-visible {
  background: var(--soft);
}
.homepage-toc.is-open .homepage-toc-panel,
.homepage-toc:hover .homepage-toc-panel,
.homepage-toc:focus-within .homepage-toc-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}
#community-stuff,
#paper-computer-games,
#paper-games,
#pc-games,
#comics-books,
#recently-added,
#recently-updated,
#creators {
  scroll-margin-top: 26px;
}
@media (max-width: 700px) {
  .homepage-toc { right: 10px; top: auto; bottom: 18px; transform: none; }
  .homepage-toc-toggle { width: 42px; height: 42px; }
  .homepage-toc-panel { max-height: 60vh; }
}

/* Classic homepage art + classic navigation buttons in the modern hero */
.classic-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 20%, rgba(25,136,255,.15), transparent 28%),
    linear-gradient(145deg, #343645, #3c3e50 62%, #303240);
}
.classic-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--classic-hero-image);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: cover;
  filter: brightness(var(--classic-hero-brightness));
}
.classic-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(48,50,64,.03) 0%,
    rgba(48,50,64,.10) var(--classic-hero-fade-start),
    rgba(48,50,64,.94) var(--classic-hero-fade-end),
    #303240 88%,
    #303240 100%);
}
.classic-hero .hero-grid { position: relative; z-index: 1; }
.classic-hero .hero-grid > div:first-child {
  text-shadow: 0 2px 14px rgba(0,0,0,.72);
}
.classic-hero .hero-search,
.classic-hero .hero-actions { text-shadow: none; }
.classic-home-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 18px;
  max-width: 720px;
  text-shadow: none;
}
.classic-home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(190px, 42vw);
  text-decoration: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.48));
  transition: transform .16s ease, filter .16s ease;
}
.classic-home-button:hover { transform: translateY(-2px) scale(1.025); filter: drop-shadow(0 4px 7px rgba(0,0,0,.62)); }
.classic-home-button img { display: block; max-width: 100%; max-height: 58px; width: auto; height: auto; }
.classic-home-button span {
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 4px;
  background: rgba(42,44,57,.82);
  color: #fff;
  font-weight: 800;
}

/* The cards are now larger at rest, so use a restrained hover preview. */
@media (hover: hover) and (pointer: fine) {
  .dacad-entry-card:hover {
    transform: scale(2) !important;
    transition-duration: .52s !important;
    transition-timing-function: cubic-bezier(.22,.72,.18,1) !important;
    z-index: 120;
  }
}

@media (max-width: 850px) {
  .classic-hero::before { background-position: 35% center; }
  .classic-hero::after {
    background: linear-gradient(90deg, rgba(48,50,64,.32), rgba(48,50,64,.88) 78%, #303240 100%);
  }
  .classic-home-buttons { gap: 6px; }
  .classic-home-button { max-width: 145px; }
  .classic-home-button img { max-height: 46px; }
}

/* 2026-08-07 classic hero correction: hard fade and readable DACAD hover metadata */
.classic-hero::before {
  /* Actually fade the IMAGE out, instead of merely laying a translucent gray
     gradient over it. This guarantees the normal hero background is restored
     before the blue paper-stack glow on the right. */
  -webkit-mask-image: linear-gradient(90deg,
    #000 0%,
    #000 var(--classic-hero-fade-start),
    transparent var(--classic-hero-fade-end),
    transparent 100%);
  mask-image: linear-gradient(90deg,
    #000 0%,
    #000 var(--classic-hero-fade-start),
    transparent var(--classic-hero-fade-end),
    transparent 100%);
}
.classic-hero::after {
  background: linear-gradient(90deg,
    rgba(48,50,64,.06) 0%,
    rgba(48,50,64,.18) var(--classic-hero-fade-start),
    rgba(48,50,64,.78) calc(var(--classic-hero-fade-end) - 7%),
    #303240 var(--classic-hero-fade-end),
    #303240 100%);
}

/* Older 5x-hover compensation intentionally made captions microscopic.
   With today's restrained 2x hover, keep the metadata at normal readable size. */
@media (hover: hover) and (pointer: fine) {
  .dacad-entry-card:hover figcaption,
  .dacad-entry-card:hover .dacad-entry-actions,
  .dacad-entry-card:hover .dacad-credit-line {
    font-size: inherit !important;
  }
  .dacad-entry-card:hover figcaption {
    font-size: .78rem !important;
    padding: 7px 5px 0 !important;
  }
  .dacad-entry-card:hover .dacad-entry-actions {
    font-size: .9rem !important;
    padding: 7px 5px 0 !important;
  }
  .dacad-entry-card:hover .dacad-add-reaction-inline,
  .dacad-entry-card:hover .dacad-reaction-count {
    min-height: 25px !important;
    padding: 2px 7px !important;
    border-radius: 999px !important;
    font-size: .84rem !important;
  }
  .dacad-entry-card:hover .dacad-delete-entry-icon {
    left: 7px !important;
    top: 7px !important;
    min-height: 24px !important;
    min-width: 24px !important;
    padding: 2px 4px !important;
    border-radius: 7px !important;
    font-size: .78rem !important;
  }
}

.homepage-hero-admin-preview { display: grid; gap: 8px; }
.homepage-hero-admin-preview-frame {
  width: min(100%, 760px);
  min-height: 180px;
  max-height: 340px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--soft);
}
.homepage-hero-admin-preview-frame img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
}


/* 2026-08-07: SVG classic hero support + contain DACAD hover below hero */
/* The classic homepage really does use SVG artwork. classic-home-hero.js now
   treats SVG as a valid image, so it appears in Homepage Hero & Text and can
   be used directly as a CSS background/preview. */

/* Keep the top hero in a stacking layer above Community Stuff. The DACAD hover
   may escape the DACAD card, but it must never paint back over the hero. */
.classic-hero {
  z-index: 20;
}
.homepage-feature-zone {
  position: relative;
  isolation: isolate;
  z-index: 1;
}
@media (hover: hover) and (pointer: fine) {
  .homepage-feature-zone:has(.homepage-dacad-card .dacad-entry-card:hover) {
    z-index: 1 !important;
  }
}


/* 2026-08-15: reliable homepage hero framing + visible paper-stack glow */
.classic-hero::before {
  background-size: auto var(--classic-hero-scale, 100%);
  background-position: var(--classic-hero-position-x, 0%) var(--classic-hero-position-y, 50%);
}
/* The image itself already fades with the mask. Do not put an opaque gray wall
   over the right side, because that hides the blue glow behind the paper art. */
.classic-hero::after {
  background: linear-gradient(90deg,
    rgba(48,50,64,.08) 0%,
    rgba(48,50,64,.15) var(--classic-hero-fade-start),
    rgba(48,50,64,.08) calc(var(--classic-hero-fade-end) - 5%),
    rgba(48,50,64,0) var(--classic-hero-fade-end),
    rgba(48,50,64,0) 100%);
}
/* Put the glow with the art it belongs to, above the hero background/fade but
   behind the three paper cards. This makes it independent of hero-image opacity. */
.classic-hero .hero-art { position: relative; isolation: isolate; }
.classic-hero .hero-art::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1% -14% -5% -18%;
  pointer-events: none;
  background: radial-gradient(ellipse at 58% 42%, rgba(25,136,255,.42) 0%, rgba(25,136,255,.20) 34%, rgba(25,136,255,0) 72%);
  filter: blur(8px);
}
.classic-hero .paper-stack { position: absolute; z-index: 1; }

.homepage-editor-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--soft);
}
.homepage-editor-hero-panel { overflow: hidden; }
.homepage-hero-admin-preview {
  position: static !important;
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 820px;
  overflow: hidden;
}
.homepage-hero-admin-preview-frame {
  position: relative !important;
  inset: auto !important;
  width: 100%;
  height: 280px;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background-color: #303240;
  background-repeat: no-repeat;
  background-size: auto 100%;
  background-position: 0% 50%;
}
.homepage-hero-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}
@media (max-width: 800px) {
  .homepage-hero-control-grid { grid-template-columns: 1fr; }
  .homepage-hero-admin-preview-frame { height: 220px; }
}

/* 2026-08-15 v2.4 — self-contained classic hero sky, organic stars + classic font */

@font-face {
  font-family: "Press Start Regular";
  src:
    url("/classic/pressstart2p-regular-webfont.woff2") format("woff2"),
    url("/classic/pressstart2p-regular-webfont.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.classic-home-button span {
  font-family: "Press Start Regular", Monaco, monospace !important;
  font-weight: normal !important;
  letter-spacing: 0 !important;
}

/* Purple behind the SVG on the left -> current blue-purple through the center
   -> black at the far right. */
.classic-hero {
  background:
    linear-gradient(
      90deg,
      #49275f 0%,
      #3c2d62 24%,
      #34305f 48%,
      #272a58 66%,
      #15172f 84%,
      #000000 100%
    ) !important;
}

.classic-hero-starfield {
  position: absolute;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  pointer-events: none;
}

.classic-hero-starfield::before,
.classic-hero-starfield::after {
  content: "";
  position: absolute;
  inset: -8%;
  pointer-events: none;
  background-repeat: repeat;
  will-change: opacity;
}

.classic-hero-starfield::before {
  opacity: .62;
  background-image:
    radial-gradient(circle, rgba(255,238,84,.98) 0 1.6px, rgba(255,221,47,.48) 1.8px, transparent 3.2px),
    radial-gradient(circle, rgba(255,247,135,.96) 0 .8px, transparent 1.7px),
    radial-gradient(circle, rgba(255,214,36,.92) 0 1.15px, rgba(255,232,88,.26) 1.5px, transparent 2.7px),
    radial-gradient(circle, rgba(255,250,171,.90) 0 .55px, transparent 1.35px),
    radial-gradient(circle, rgba(255,225,52,.95) 0 1.35px, transparent 2.25px),
    radial-gradient(circle, rgba(255,244,116,.88) 0 .72px, transparent 1.55px),
    radial-gradient(circle, rgba(255,207,27,.86) 0 1.05px, transparent 2.0px);
  background-size:
    347px 263px,
    173px 229px,
    421px 317px,
    109px 157px,
    509px 389px,
    257px 193px,
    613px 443px;
  background-position:
    23px 41px,
    117px 13px,
    281px 167px,
    61px 103px,
    397px 29px,
    181px 139px,
    73px 271px;
  animation: pcgStarsTwinkleA 10.7s ease-in-out infinite alternate;
}

.classic-hero-starfield::after {
  opacity: .43;
  background-image:
    radial-gradient(circle, rgba(255,231,65,.98) 0 1.9px, rgba(255,216,34,.32) 2.2px, transparent 3.8px),
    radial-gradient(circle, rgba(255,248,145,.94) 0 .65px, transparent 1.5px),
    radial-gradient(circle, rgba(255,219,43,.92) 0 1.25px, transparent 2.4px),
    radial-gradient(circle, rgba(255,252,181,.86) 0 .48px, transparent 1.2px),
    radial-gradient(circle, rgba(255,226,54,.91) 0 .92px, transparent 1.9px);
  background-size:
    683px 491px,
    211px 283px,
    467px 359px,
    137px 199px,
    773px 557px;
  background-position:
    311px 83px,
    43px 173px,
    197px 37px,
    89px 61px,
    521px 233px;
  animation: pcgStarsTwinkleB 15.3s ease-in-out infinite alternate;
}

@keyframes pcgStarsTwinkleA {
  0% { opacity: .34; }
  31% { opacity: .68; }
  63% { opacity: .46; }
  100% { opacity: .78; }
}

@keyframes pcgStarsTwinkleB {
  0% { opacity: .52; }
  39% { opacity: .28; }
  74% { opacity: .61; }
  100% { opacity: .36; }
}

@media (prefers-reduced-motion: reduce) {
  .classic-hero-starfield::before,
  .classic-hero-starfield::after {
    animation: none;
  }
}


/* 2026-08-15 — Mercado Coins, challenges, records, and paid PCGs */
.mercado-balance, .mercado-mini-balance, .profile-coins { font-weight: 800; color: #8a5a00; }
.mercado-balance { padding: 10px 14px; border: 1px solid #e4c76e; border-radius: 999px; background: #fff7d7; white-space: nowrap; }
.mercado-stat a { display:block; margin-top:4px; font-size:.8rem; }
.mercado-shop-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.mercado-shop-card { display:flex; flex-direction:column; min-height:240px; }
.mercado-shop-card h2 { margin:.3rem 0; }
.mercado-shop-card p { flex:1; }
.mercado-shop-icon { font-size:2rem; }
.mercado-shop-bottom { display:flex; gap:12px; align-items:center; justify-content:space-between; }
.points-lock-status { display:grid; gap:2px; margin:8px 0 12px; padding:10px 12px; border-radius:12px; background:#fff3bd; border:1px solid #e2c45e; }
.points-lock-status small { color:#65511b; }
.points-unlock-form { display:grid; gap:7px; margin:12px 0; }
.beat-game-control { margin:12px 0 22px; }
.beat-game-checkbox { display:inline-flex; align-items:center; gap:9px; border:0; background:transparent; color:inherit; text-decoration:none; padding:5px 2px; cursor:pointer; font:inherit; text-align:left; opacity:.82; }
.beat-game-checkbox:hover { opacity:1; }
.beat-game-checkbox:disabled { cursor:default; }
.fake-checkbox, .challenge-check { display:grid; place-items:center; flex:0 0 auto; width:22px; height:22px; border:2px solid #5b6c80; border-radius:6px; background:#fff; font-weight:900; }
.beat-game-checkbox.checked .fake-checkbox { background:#d9f5dd; border-color:#3b934a; color:#1b712d; }
.beat-game-checkbox small { display:block; color:var(--muted); margin-top:1px; }
.profile-tab-bar { display:flex; gap:8px; margin-bottom:22px; }
.records-list { display:grid; gap:8px; }
.record-game-row { display:grid; gap:2px; padding:12px 14px; border:1px solid var(--border); border-radius:12px; text-decoration:none; color:inherit; background:var(--surface); }
.record-game-row small { color:var(--muted); }
.trophy-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:12px; }
.trophy-card { display:grid; place-items:center; text-align:center; gap:8px; min-height:130px; padding:15px; border:1px solid #d8bd58; border-radius:16px; background:linear-gradient(#fff9d9,#fff); }
.trophy-card span { font-size:2.2rem; }
.reward-booster-row { display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; }

/* Community Stuff: four equal columns on desktop, responsive below. */
.homepage-feature-zone { grid-template-columns:repeat(4,minmax(0,1fr)) !important; align-items:stretch !important; }
.homepage-feature-zone > .homepage-feature-card,
.homepage-feature-zone > .homepage-dacad-card,
.homepage-feature-zone > .homepage-feature-requests-card,
.homepage-feature-zone > .homepage-challenges-card { min-width:0; height:560px; max-height:560px; overflow:hidden; }
.homepage-feature-requests-card, .homepage-challenges-card { background:var(--surface); border:1px solid var(--border); border-radius:22px; padding:22px; box-shadow:var(--shadow); }
.homepage-challenges-card { display:flex; flex-direction:column; }
.challenge-heading-actions { display:flex; gap:9px; align-items:center; }
.challenge-plus { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:#315f9e; color:#fff; text-decoration:none; font-size:1.35rem; line-height:1; }
.homepage-challenge-list { display:grid; gap:9px; min-height:0; overflow:hidden; margin-top:12px; }
.home-challenge-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; grid-template-areas:"check copy points" "avatars avatars avatars"; gap:5px 9px; align-items:start; padding:10px; border:1px solid var(--border); border-radius:12px; background:var(--soft); transition:background .45s, opacity .65s, transform .65s, max-height .65s, margin .65s, padding .65s; }
.home-challenge-row .challenge-check { grid-area:check; }
.home-challenge-row .challenge-copy { grid-area:copy; min-width:0; }
.home-challenge-row .challenge-copy strong, .home-challenge-row .challenge-copy small { display:block; }
.home-challenge-row .challenge-copy small { color:var(--muted); margin-top:2px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.challenge-points { grid-area:points; white-space:nowrap; color:#8a5a00; }
.challenge-completers { grid-area:avatars; display:flex; align-items:center; min-height:25px; padding-left:31px; }
.challenge-avatar { display:grid; place-items:center; width:25px; height:25px; margin-left:-5px; overflow:hidden; border:2px solid #fff; border-radius:50%; background:#dbe5f2; color:#20344e; font-size:.7rem; font-weight:900; text-decoration:none; }
.challenge-avatar:first-child { margin-left:0; }
.challenge-avatar img { width:100%; height:100%; object-fit:cover; }
.challenge-completers small { margin-left:7px; color:var(--muted); }
.challenge-just-completed { background:#d9f5dd; border-color:#5aa767; animation:challengeCheckPop .7s ease both; }
.challenge-just-completed .challenge-check { background:#55a565; border-color:#3c8c4b; color:#fff; }
.challenge-fade-out { opacity:0; transform:translateY(-8px); max-height:0; margin:0; padding-top:0; padding-bottom:0; overflow:hidden; }
@keyframes challengeCheckPop { 0%{transform:scale(.98)} 45%{transform:scale(1.025)} 100%{transform:scale(1)} }
.challenge-full-list { display:grid; gap:12px; }
.challenge-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:12px; align-items:center; }
.challenge-row.is-complete { background:#edf9ef; }
.challenge-row .challenge-completers { padding-left:0; grid-column:2 / -1; }
.challenge-row .challenge-points { grid-area:auto; }

@media (max-width:1100px) {
  .homepage-feature-zone { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
}
@media (max-width:900px) {
  .mercado-shop-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width:700px) {
  .homepage-feature-zone { grid-template-columns:1fr !important; }
  .homepage-feature-zone > .homepage-feature-card,
  .homepage-feature-zone > .homepage-dacad-card,
  .homepage-feature-zone > .homepage-feature-requests-card,
  .homepage-feature-zone > .homepage-challenges-card { height:auto; max-height:none; }
}
@media (max-width:620px) { .mercado-shop-grid { grid-template-columns:1fr; } .challenge-row { grid-template-columns:auto 1fr; } }
@media (prefers-reduced-motion:reduce) { .challenge-just-completed { animation:none; } }


/* Header creator quick menu + Mercado Coin balance */
.header-account-menu { position:relative; z-index:7; flex:0 0 auto; }
.header-account-menu > summary {
  display:flex; align-items:center; gap:8px; list-style:none; cursor:pointer; user-select:none;
  min-height:52px; padding:5px 9px 5px 5px; border:1px solid rgba(255,255,255,.42);
  border-radius:999px; background:rgba(255,255,255,.88); box-shadow:0 3px 12px rgba(20,35,62,.18);
  color:var(--ink);
}
.header-account-menu > summary::-webkit-details-marker { display:none; }
.header-account-menu > summary:hover { background:#fff; }
.header-account-avatar {
  display:grid; place-items:center; width:42px; height:42px; overflow:hidden; border:2px solid var(--blue);
  border-radius:50%; background:#dbe5f2; color:#20344e; font-weight:900;
}
.header-account-avatar img { width:100%; height:100%; object-fit:cover; }
.header-account-coins { white-space:nowrap; font-size:.9rem; }
.header-account-caret { font-size:.72rem; transition:transform .18s ease; }
.header-account-menu[open] .header-account-caret { transform:rotate(180deg); }
.header-account-dropdown {
  position:absolute; top:calc(100% + 8px); right:0; width:220px; padding:8px; border:1px solid var(--line);
  border-radius:14px; background:#fff; box-shadow:0 15px 35px rgba(16,28,50,.22);
}
.header-account-name { padding:8px 10px 10px; border-bottom:1px solid var(--line); color:var(--muted); font-size:.78rem; }
.header-account-name strong { display:block; margin-top:2px; color:var(--ink); font-size:.9rem; }
.header-account-dropdown a, .header-account-dropdown button {
  display:block; width:100%; border:0; border-radius:9px; padding:9px 10px; background:transparent; color:var(--ink);
  text-align:left; text-decoration:none; font-weight:700; font-size:.9rem;
}
.header-account-dropdown a:hover, .header-account-dropdown button:hover { background:var(--soft); text-decoration:none; }
.header-account-dropdown form { margin:0; border-top:1px solid var(--line); padding-top:4px; }
@media (max-width:900px) {
  .header-inner { gap:10px; }
  .header-account-coins { font-size:.82rem; }
}
@media (max-width:650px) {
  .header-account-menu > summary { min-height:44px; padding:3px 7px 3px 3px; }
  .header-account-avatar { width:36px; height:36px; }
  .header-account-coins { display:none; }
  .header-account-dropdown { position:fixed; top:66px; right:12px; width:min(260px,calc(100vw - 24px)); }
}

/* 2026-08-15 follow-up: header account positioning + expanded five-card Community Stuff */
.site-header { overflow: visible; }
.header-inner { position: relative; }
.header-account-menu {
  position: absolute;
  right: 0;
  bottom: 7px;
  z-index: 80;
}
.header-account-menu > summary {
  color: #fff;
  background: rgba(28, 30, 42, .42);
  border-color: rgba(255,255,255,.28);
  box-shadow: 0 3px 12px rgba(0,0,0,.2);
  backdrop-filter: blur(8px);
}
.header-account-menu > summary:hover { background: rgba(28, 30, 42, .72); }
.header-account-coins { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.75); }
.header-account-caret { color: #fff; }
.header-account-dropdown {
  z-index: 100;
  top: calc(100% + 8px);
  right: 0;
}

/* First four Community Stuff cards are ~1.3x their former desktop width and 1.4x height.
   The Creators panel keeps its normal relative width and its original visual styling. */
.homepage-feature-zone {
  width: min(155%, calc(100vw - 30px));
  max-width: none;
  margin-left: 50%;
  margin-right: 0;
  transform: translateX(-50%);
  grid-template-columns: repeat(4, minmax(0, 1.3fr)) minmax(250px, 1fr) !important;
  align-items: start !important;
}
.homepage-feature-zone > .homepage-feature-card,
.homepage-feature-zone > .homepage-dacad-card,
.homepage-feature-zone > .homepage-feature-requests-card,
.homepage-feature-zone > .homepage-challenges-card {
  height: 784px;
  max-height: 784px;
}
.homepage-feature-zone > .homepage-creators-card {
  width: auto;
  min-width: 0;
  align-self: start;
  height: auto;
  max-height: 784px;
  overflow: auto;
}

@media (max-width: 1350px) {
  .homepage-feature-zone {
    width: min(100%, calc(100vw - 30px));
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    transform: none;
    margin-left: auto;
    margin-right: auto;
  }
  .homepage-feature-zone > .homepage-creators-card { grid-column: auto; max-height: none; }
}
@media (max-width: 900px) {
  .header-account-menu { right: 4px; bottom: 6px; }
}
@media (max-width: 650px) {
  .header-account-menu { position: relative; right: auto; bottom: auto; }
  .header-account-dropdown { position: fixed; top: 66px; right: 12px; width: min(260px, calc(100vw - 24px)); }
}
@media (max-width: 700px) {
  .homepage-feature-zone { grid-template-columns: 1fr !important; }
  .homepage-feature-zone > .homepage-feature-card,
  .homepage-feature-zone > .homepage-dacad-card,
  .homepage-feature-zone > .homepage-feature-requests-card,
  .homepage-feature-zone > .homepage-challenges-card { height: auto; max-height: none; }
}

/* 2026-08-15 fine-tune: community sizing, TOC hover, header clipping, account position */

/* Only reveal the floating contents panel when the actual hamburger is hovered/focused,
   when it has been explicitly opened, or while the pointer/focus is inside the panel. */
.homepage-toc:hover .homepage-toc-panel,
.homepage-toc:focus-within .homepage-toc-panel {
  opacity: 0;
  visibility: hidden;
  transform: translateX(12px) scale(.97);
  pointer-events: none;
}
.homepage-toc.is-open .homepage-toc-panel,
.homepage-toc-toggle:hover + .homepage-toc-panel,
.homepage-toc-toggle:focus-visible + .homepage-toc-panel,
.homepage-toc-panel:hover,
.homepage-toc-panel:focus-within {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

/* The account dropdown needs to escape the header, but the decorative characters should not. */
.header-character-stage {
  clip-path: inset(0 0 23px 0);
}

/* Fine-tuned desktop Community Stuff sizing:
   first four cards ~= 1.2x their original width and 1.35x original height;
   Creators keeps the original-width proportion. */
.homepage-feature-zone {
  width: min(145%, calc(100vw - 30px));
  grid-template-columns: repeat(4, minmax(0, 1.2fr)) minmax(250px, 1fr) !important;
}
.homepage-feature-zone > .homepage-feature-card,
.homepage-feature-zone > .homepage-dacad-card,
.homepage-feature-zone > .homepage-feature-requests-card,
.homepage-feature-zone > .homepage-challenges-card {
  height: 756px;
  max-height: 756px;
}
.homepage-feature-zone > .homepage-creators-card {
  max-height: 756px;
}

/* About one additional CSS inch to the right on roomy desktop screens. */
@media (min-width: 1451px) {
  .header-account-menu { right: -96px; }
}

/* Keep the existing responsive fallbacks from pushing content off smaller screens. */
@media (max-width: 1450px) {
  .header-account-menu { right: 4px; }
}
\n\n/* 2026-08-15 follow-up: hidden homepage TOC must not block clicks underneath.\n   The fixed wrapper itself is non-interactive; only the hamburger, and the\n   panel once visibly opened, can receive pointer input. */\n.homepage-toc {\n  pointer-events: none;\n}\n.homepage-toc-toggle {\n  pointer-events: auto;\n}\n.homepage-toc-panel {\n  pointer-events: none !important;\n}\n.homepage-toc.is-open .homepage-toc-panel,\n.homepage-toc-toggle:hover + .homepage-toc-panel,\n.homepage-toc-toggle:focus-visible + .homepage-toc-panel,\n.homepage-toc-panel:hover,\n.homepage-toc-panel:focus-within {\n  pointer-events: auto !important;\n}\n

/* Series seasons + per-season numbering */
.game-series-trail { margin-bottom: 6px; color: var(--ink); font-size: .78rem; font-style: italic; }
.game-series-trail .game-series, .series-link-blue { color: var(--blue); }
.detail-series-trail { font-size: .92rem; margin-bottom: 8px; }
.series-game-row { grid-template-columns: auto minmax(0,1fr) minmax(150px,220px) 76px; }
.game-number-field { display:flex; align-items:center; gap:6px; margin:0; }
.game-number-field span { color:var(--muted); font-weight:700; }
.game-number-field input { width:64px; min-width:0; }
@media (max-width: 900px) { .series-game-row { grid-template-columns:auto minmax(0,1fr); } .game-section-select, .game-number-field { grid-column:2; } }
