/* Polish (2026-11-19): one burgundy palette matching the SAVE/HERE logo, no glows,
   one-row phone header, readable phone lists. Shared verbatim by /library-assets and /member-assets. */

/* ---- Palette: burgundy and rose ---- */
:root {
  --accent: #c45266;
  --accent-strong: #d4687b;
  --accent-deep: #7a1c2e;
  --accent-soft: #2a1519;
  --accent-line: #5a2a33;
  --glow: #2a3550;
}
html[data-theme="light"] {
  --accent: #8c2a3a;
  --accent-strong: #a3364a;
  --accent-deep: #5a1424;
  --accent-soft: #f8eef0;
  --accent-line: #ead0d5;
  --glow: #c9d3e6;
}
html[data-theme="light"] .store-welcome.has-hero, html[data-theme="light"] .portal-hero {
  --accent: #c45266;
  --accent-strong: #d4687b;
  --accent-deep: #7a1c2e;
  --accent-soft: #2a1519;
  --accent-line: #5a2a33;
}

/* ---- Quiet surfaces: soft shadows instead of coloured glows ---- */
.brand-mark { box-shadow: 0 4px 12px -6px rgba(40, 8, 16, .8); }
.header-inner nav a[aria-current=page]:after { background: var(--accent); box-shadow: none; }
.button.primary, .button.primary:hover {
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.button.primary:hover { filter: brightness(1.06); }
.store-welcome .store-hero-tag { box-shadow: none; }
.store-game:hover .store-game-cover { box-shadow: 0 12px 26px -14px rgba(0, 0, 0, .7), 0 0 0 1px var(--line-strong); }
.avatar-xl { box-shadow: 0 0 0 1px #ffffff1f, 0 14px 30px -18px rgba(0, 0, 0, .8); }
.like-button.on { box-shadow: none; }
.game-choice:has(input:checked) { box-shadow: 0 0 0 1px var(--accent); }

/* Games without shares stay in the grid but step back. */
.store-game:has(.store-game-count.none) .store-game-cover { filter: saturate(.35) brightness(.72); transition: filter .2s; }
.store-game:has(.store-game-count.none):hover .store-game-cover { filter: none; }
.store-game:has(.store-game-count.none) .store-game-name { color: var(--muted); }

/* ---- Footer wordmark ---- */
.footer-word { height: 15px; display: inline-block; vertical-align: -2px; }
.site-footer a:has(.footer-word), .footer-brand { display: inline-flex; align-items: center; gap: 12px; }

/* ---- Coins not synced yet: a quiet dash, not a warning ---- */
.hub-coins strong.no-balance { color: var(--muted); font-weight: 500; }

/* ---- Disclosures: one chevron style everywhere ---- */
details > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after {
  content: ""; width: 7px; height: 7px; margin-left: auto; flex: none;
  border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg) translateY(-2px); transition: transform .15s;
}
details[open] > summary::after { transform: rotate(-135deg) translate(-1px, -1px); }
details > summary:hover::after { border-color: var(--ink); }
.hub-sync > summary .sync-badge { margin-left: auto; }
.hub-sync > summary::after { margin-left: 4px; }
.guide-help details > summary { min-height: 48px; }
@media (prefers-reduced-motion: reduce) { details > summary::after { transition: none; } }

/* ---- Save detail: meta items without stray separators ---- */
.store-detail-by { gap: 6px 14px; }
.store-detail-by .by-item { display: inline-flex; align-items: center; gap: 4px; }
.store-detail-by .by-item svg { width: 14px; height: 14px; }

/* ---- Pairing form: code and name boxes line up ---- */
.pair-box .compact-form { align-items: flex-end; }
.pair-box .compact-form input { height: 48px; min-height: 48px; }
.pair-box input[name="code"] { font-size: 18px; line-height: 1; }

/* ---- Guide page: the footer link would point at itself ---- */
body[data-route="guide"] .site-footer > a[href="#guide"] { display: none; }

/* ---- Management sidebar: a small refresh link instead of two big buttons ---- */
.admin-side-actions .side-refresh { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 4px; color: var(--muted); font-size: 13px; background: none; border: 0; cursor: pointer; }
.admin-side-actions .side-refresh:hover { color: var(--ink); }

/* ---- Phone: one header row with the mark, the menu and the theme switch ---- */
@media (max-width: 600px) {
  .site-header .header-inner, body:has(#member-view) .header-inner {
    display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; min-height: 54px; padding: 6px 16px;
  }
  .site-header .brand, body:has(#member-view) .header-inner .brand { display: flex; flex: none; padding: 0; }
  .site-header .brand .brand-text { display: none; }
  .site-header .brand-mark { width: 32px; height: 32px; border-radius: 8px; }
  .site-header nav, body:has(#member-view) .header-inner nav {
    order: 0; width: auto; flex: 1; min-width: 0; margin: 0; padding: 0; border: 0;
    gap: 14px; justify-content: flex-end; overflow-x: auto; scrollbar-width: none;
  }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { white-space: nowrap; flex: none; }
  .site-header .theme-toggle { margin-left: 0; flex: none; }

  /* Member tabs: one row that scrolls sideways instead of wrapping. */
  #member-workspace .workspace-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 2px; }
  #member-workspace .workspace-tabs::-webkit-scrollbar { display: none; }
  #member-workspace .workspace-tabs a { flex: none; padding-inline: 8px; font-size: 13.5px; }
  #member-workspace .workspace-tabs .tab-long { display: none; }

  /* Lists: title and details on top, status and actions on one line below. */
  .record-list.compact .record-row { grid-template-columns: 56px auto auto minmax(0, 1fr); gap: 6px 10px; align-items: center; }
  .record-list.compact .record-cover { grid-row: span 2; align-self: start; }
  .record-list.compact .record-main { grid-column: 2 / -1; }
  .record-list.compact .record-main h3 { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .record-list.compact .record-main p { white-space: normal; }
  .record-list.compact .record-amount { min-width: 0; text-align: left; }
  .record-list.compact .record-actions { grid-column: auto; justify-self: start; }
  .record-list.compact .record-actions:empty { display: none; }

  .site-footer a:has(.footer-word), .footer-brand { gap: 10px; }

  .pair-box .compact-form { flex-direction: column; align-items: stretch; }
}

/* Save detail on narrow screens: the Switch panel comes right after the title. */
@media (max-width: 840px) {
  .store-detail { display: flex; flex-direction: column; gap: 12px; }
  .store-detail-main { display: contents; }
  .store-detail-head { order: 0; }
  .store-download { order: 1; }
  .store-detail-main > :not(.store-detail-head) { order: 2; }
  .store-detail > *, .store-detail-main > * { width: 100%; min-width: 0; box-sizing: border-box; }
}

/* ---- Numbers in the logo's typeface (Anton, OFL; Latin subset, CJK falls back) ---- */
@font-face { font-family: "Anton SH"; src: url("/library-assets/anton-latin.woff2") format("woff2"); font-display: swap; unicode-range: U+0000-00FF; }
.portal-stat strong, .stat-tile strong, .hub-coins strong:not(.no-balance), .policy-card strong {
  font-family: "Anton SH", system-ui, sans-serif; font-weight: 400; letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
.portal-stat strong { font-size: 30px; line-height: 1.1; }

/* ---- Cover without art: burgundy ground, the game's name, a faint wordmark ---- */
.cover { background: radial-gradient(120% 90% at 20% 10%, #8c2a3a 0%, #4a1520 55%, #24090f 100%); }
.cover-fallback { color: #f5eae2; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.cover-fallback::after { content: "SAVE HERE"; position: absolute; right: 8px; bottom: 6px; font: 400 10px/1 "Anton SH", sans-serif; letter-spacing: .08em; color: rgba(245, 234, 226, .35); text-shadow: none; }
.cover:has(.cover-image) .cover-fallback::after { display: none; }

/* ---- Loading placeholders instead of "loading…" text ---- */
.sk { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--surface-muted, rgba(127,127,127,.12)) 0%, rgba(127,127,127,.2) 50%, var(--surface-muted, rgba(127,127,127,.12)) 100%); background-size: 200% 100%; animation: sk-shine 1.4s ease-in-out infinite; }
@keyframes sk-shine { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.skeleton-home, .skeleton-portal { display: grid; gap: 16px; padding: 8px 0 40px; }
.sk-hero { height: 200px; border-radius: 18px; }
.sk-title { height: 26px; width: 160px; }
.sk-line { height: 12px; width: 100%; border-radius: 6px; }
.sk-line.short { width: 55%; }
.sk-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sk-game { display: grid; gap: 8px; }
.sk-cover { aspect-ratio: 16 / 10; border-radius: 14px; }
.sk-avatar-xl { width: 96px; height: 96px; border-radius: 50%; }
.sk-comment { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.sk-avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.sk-lines { flex: 1; display: grid; gap: 8px; }
@media (max-width: 600px) { .sk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .sk-hero { height: 140px; } }

/* ---- Unread messages on the header's "我的" link ---- */
header nav a .nav-dot { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 5px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 1; vertical-align: 2px; box-sizing: border-box; }
.workspace-tabs .tab-count { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; box-sizing: border-box; }
.message-list { list-style: none; margin: 0; padding: 0; display: grid; }
.message-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-top: 1px solid var(--line); }
.message-item:first-child { border-top: 0; }
.message-item.is-unread { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); border-radius: 8px; }
.message-icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 700; }
.message-main { min-width: 0; flex: 1; }
.message-main a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.message-main a:hover { color: var(--accent); }
.message-main time { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

/* ---- Profile card: "我的" page and a member's public page share one design ---- */
.profile-hero { position: relative; isolation: isolate; overflow: hidden; margin-top: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 18px 40px -30px rgba(0,0,0,.8); }
.profile-band { position: relative; height: 136px; overflow: hidden; background: radial-gradient(130% 150% at 0% 0%, #8c2a3a 0%, #4a1520 46%, #170a0d 100%); }
.profile-band::after { content: "SAVE HERE"; position: absolute; right: -6px; bottom: -40px; z-index: 2; font: 400 140px/1 "Anton SH", sans-serif; letter-spacing: .02em; color: rgba(245, 234, 226, .07); white-space: nowrap; pointer-events: none; }
.profile-band img { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(20px) saturate(1.15); opacity: .6; }
.profile-band.has-art::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(122, 28, 46, .35), rgba(18, 8, 11, .6)); }
.profile-body { position: relative; z-index: 3; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 22px; margin-top: -48px; padding: 0 28px 20px; }
.profile-face { display: block; width: 108px; height: 108px; border-radius: 50%; padding: 4px; background: var(--surface); box-shadow: 0 0 0 1px var(--accent-line), 0 12px 28px -14px rgba(0,0,0,.8); }
.profile-face > *, .profile-hero .profile-avatar.hub-avatar > *, .profile-face .avatar { width: 100%; height: 100%; border-radius: 50%; }
.profile-hero .profile-avatar.hub-avatar { width: 108px; height: 108px; overflow: hidden; display: grid; place-items: center; }
.profile-hero .profile-avatar.hub-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-hero .profile-avatar.hub-avatar > span { display: grid; place-items: center; background: var(--accent-deep); color: #fff; font-size: 40px; font-weight: 700; }
.profile-face .avatar-xl { font-size: 42px; box-shadow: none; border: 0; }
.profile-id { min-width: 0; padding-bottom: 2px; }
.profile-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; color: var(--muted); }
.profile-kicker .member-no { margin: 0; }
.profile-role { padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); line-height: 20px; font-size: 12px; color: var(--ink); }
.profile-id h1 { margin: 6px 0 2px; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -.3px; color: var(--ink); overflow-wrap: anywhere; }
.profile-sub { margin: 0; font-size: 13.5px; color: var(--muted); }
.profile-sub a { color: var(--accent); font-weight: 600; }
.profile-actions { display: flex; align-items: center; gap: 8px; padding-bottom: 4px; }
.profile-actions .button { min-height: 40px; gap: 6px; }
.profile-actions .button svg { width: 17px; height: 17px; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s; }
.icon-button:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong, var(--muted)); }
.icon-button:disabled { opacity: .45; cursor: default; }
.icon-button svg { width: 18px; height: 18px; }
.profile-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-top: 1px solid var(--line); }
.profile-stat { display: grid; gap: 3px; align-content: center; padding: 14px 22px; border-left: 1px solid var(--line); min-width: 0; }
.profile-stat:first-child { border-left: 0; }
.profile-stat strong { font: 400 28px/1.05 "Anton SH", system-ui, sans-serif; letter-spacing: .02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.profile-stat.is-coins strong:not(.no-balance) { color: #e0b25a; }
.profile-stat strong.no-balance { color: var(--muted); }
.profile-stat span { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-stat span svg { width: 14px; height: 14px; flex: none; }
html[data-theme="light"] .profile-stat.is-coins strong:not(.no-balance) { color: #a8741c; }
/* The old cards these replace */
.hub-head, .portal-hero { display: none; }

@media (max-width: 600px) {
  .profile-hero { border-radius: 16px; margin-top: 10px; }
  .profile-band { height: 96px; }
  .profile-band::after { font-size: 92px; bottom: -26px; }
  .profile-body { grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin-top: -36px; padding: 0 16px 14px; }
  .profile-face, .profile-hero .profile-avatar.hub-avatar { width: 80px; height: 80px; }
  .profile-id { grid-column: 1 / -1; padding-top: 6px; }
  .profile-id h1 { font-size: 24px; }
  .profile-actions { grid-row: 1; grid-column: 2; justify-self: end; align-self: end; padding-bottom: 0; }
  .profile-actions .button { min-height: 36px; padding: 4px 12px; font-size: 13px; }
  .icon-button { width: 36px; height: 36px; border-radius: 10px; }
  .profile-stats { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .profile-stat { padding: 10px 6px; justify-items: center; text-align: center; }
  .profile-stat:nth-child(4n+1) { border-left: 0; }
  .profile-stat strong { font-size: 22px; }
  .profile-stat span { font-size: 11px; }
  .profile-stat.is-coins { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: flex-start; gap: 10px; padding: 12px 16px; border-left: 0; border-bottom: 1px solid var(--line); }
  .profile-stat.is-coins ~ .profile-stat:nth-child(4n+1) { border-left: 1px solid var(--line); }
  .profile-stat.is-coins ~ .profile-stat:nth-child(4n+2) { border-left: 0; }
  .profile-stat.is-coins strong { font-size: 26px; }
  .shot-hint { display: none; }
  .portal-card .portal-cover { aspect-ratio: 2 / 1; }
}
.profile-face .avatar-xl { padding: 0; background: var(--accent-deep); }
.profile-face .avatar-xl img, .profile-face .avatar-xl .avatar-initial { border: 0; }
.profile-id { padding-top: 58px; }
@media (max-width: 600px) { .profile-id { padding-top: 6px; } }
