/* GameHawk web — the approved design.
   Tokens mirror gamehawk-ui-assets/tokens/colors.json; never sample the boards. */
:root {
  --background: #070809;
  --surface: #101214;
  --surface-raised: #16181b;
  --surface-border: #303238;
  --gold: #f2be3e;
  --gold-bright: #ffd568;
  --gold-muted: #9d7627;
  --silver: #c8cbd0;
  --silver-muted: #888c93;
  --text-primary: #f4f4f5;
  --text-secondary: #a9abb0;
  --deal: #ff4f45;
  --success: #6cab62;
  --scrim: rgba(0, 0, 0, .72);

  --header-height: 147px;
  --gutter: 28px;
  --frame: 1280px;
  /* Web-only: every screen transition and appearing detail fades over this. */
  --transition: 500ms;
  /* Outline buttons: silver border, gold text. */
  --silver-border: rgba(200, 203, 208, .5);

  /* Pre-token names kept so the login/loader views keep reading naturally. */
  --black: var(--background);
  --row: var(--surface);
  --muted: var(--silver-muted);
  --error: var(--deal);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--silver);
  font: 15px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Focus is never carried by color alone: a gold ring with a dark gap. */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 8px;
}

button { font: inherit; cursor: pointer; }

/* ---------- Sign-in and loader (unchanged surfaces) ---------- */

.screen { max-width: 720px; margin: 0 auto; padding: 20px 16px 48px; }
.center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.logo-mark { width: 190px; height: 190px; object-fit: contain; }
.logo { font-size: 42px; font-weight: 800; letter-spacing: .3px; }
.tagline { color: var(--text-secondary); font-size: 17px; margin: 0 0 28px; }
/* Phone-approval step: everything inside one gold frame, hints tight under the tagline. */
.approval-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  width: min(100%, 560px); padding: 36px 32px 28px;
  border: 1px solid var(--gold); border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(242, 190, 62, .12), 0 24px 60px rgba(0, 0, 0, .5);
}
.approval-card .tagline { margin: 0 0 14px; }
.approval-card .hint { margin: 0; font-size: 15px; line-height: 1.5; }
.approval-card .hint + .hint { margin-top: 4px; }
.approval-card button { margin-top: 22px; }
.hawk-loader { width: 200px; height: 200px; }
.hawk-loader img { width: 100%; height: 100%; object-fit: contain; }
.spinner {
  width: 26px; height: 26px; margin-top: 14px;
  border: 2px solid var(--surface); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Site footer ----------
   In flow at the end of every page (never fixed): margin-top auto pushes it to
   the bottom-right of a flex-column page that is at least one viewport tall. */
.page { min-height: 100vh; display: flex; flex-direction: column; position: relative; }
.contact-button {
  position: absolute; top: 18px; right: max(22px, env(safe-area-inset-right));
  padding: 8px 16px; border: 1px solid var(--silver-border); border-radius: 999px;
  color: var(--gold); font-size: 13px; font-weight: 600; text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}
.contact-button:hover { border-color: var(--gold); background: rgba(242, 190, 62, .06); }
.page > .center { min-height: 0; flex: 1; }
.site-footer {
  margin-top: auto;
  display: flex; justify-content: flex-end; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 24px max(24px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) 24px;
  color: var(--silver-muted); font-size: 13px; letter-spacing: .02em;
}
@media (max-width: 640px) {
  .site-footer:not(.in-shell) { justify-content: center; }
}
/* Signed in: the fixed tab bar owns the bottom centre. On wide viewports the
   footer shares the bottom edge to its right; narrower, it lifts above the bar. */
.site-footer.in-shell { padding-top: 40px; }
@media (max-width: 1200px) {
  .site-footer.in-shell { padding-bottom: calc(68px + 36px + env(safe-area-inset-bottom)); }
}
.shinro-ring { width: 28px; height: 28px; animation: spin 180s linear infinite; }  /* 2°/s */
.site-link { color: var(--gold); text-decoration: none; }
.site-link:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .shinro-ring { animation: none; } }
.signin-stack { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.signin { min-height: 40px; }
#appleid-signin { width: 320px; height: 40px; }
.signin-note { margin: 12px 0 0; font-size: 13px; }

/* ---------- Sign-in page: wing artwork, centred hero, icon steps ---------- */
.login-page {
  background:
    linear-gradient(to bottom, rgba(7, 8, 9, .2), rgba(7, 8, 9, .45) 55%, rgba(7, 8, 9, .92) 100%),
    var(--background) url(login-bg.jpg) center / cover no-repeat;
}
/* Bottom band: store badges between the gold rules, Contact left, footer right. */
.login-rule .store-badge { padding: 5px 14px; min-width: 0; background: rgba(7, 8, 9, .55); }
.login-page .contact-button { top: auto; right: auto; bottom: 20px; left: max(22px, env(safe-area-inset-left)); }
.login-hero {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px;
  padding: 40px 24px 24px;
}
.login-hero .logo-mark { width: 170px; height: 170px; }
.login-hero .logo { margin-top: -6px; font-size: 44px; }
.login-tagline {
  margin: 0 0 24px;
  color: var(--gold); font-size: 13px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
}
.login-hero .signin-note { margin-top: 14px; }
.login-card {
  gap: 10px;
  padding: 30px 32px 28px;
  background: rgba(7, 8, 9, .62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.login-card .login-tagline { margin-bottom: 22px; }
/* Re-proof wait over a live page: near-opaque black with the page blurred behind. */
.reproof-card {
  gap: 10px;
  background: rgba(7, 8, 9, .94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.login-card .error { margin: 0; white-space: pre-line; }
.login-steps {
  list-style: none; margin: 0 auto; padding: 8px 24px 20px;
  width: min(1200px, 100%);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
}
.login-step {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 16px; text-align: center;
}
.login-step + .login-step { border-left: 1px solid rgba(200, 203, 208, .14); }
.step-icon {
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(242, 190, 62, .7);
  background: rgba(7, 8, 9, .45);
  box-shadow: 0 0 24px rgba(242, 190, 62, .12);
}
.step-icon .icon { width: 30px; height: 30px; }
.step-hawk { width: 46px; transform: rotate(-45deg); }
.step-title { margin-top: 6px; font-size: 18px; font-weight: 600; color: var(--gold); }
.login-rule {
  width: min(1100px, 100%); margin: 0 auto; padding: 6px 24px 0;
  display: flex; align-items: center; gap: 18px;
}
.login-rule::before, .login-rule::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, rgba(242, 190, 62, .6), transparent);
}
@media (max-width: 900px) {
  .login-steps { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .login-step + .login-step { border-left: 0; }
  .step-icon { width: 64px; height: 64px; }
  .step-icon .icon { width: 24px; height: 24px; }
  .step-hawk { width: 36px; }
}
@media (max-width: 900px) {
  /* Contact flows above the footer instead of sharing its corner. */
  .login-page .contact-button { position: static; align-self: center; margin-top: 16px; }
}

/* Store badges: the theme's outline pill, never the vendors' artwork. */
.store-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.store-badge {
  display: inline-flex; flex-direction: column; gap: 1px;
  padding: 7px 18px; min-width: 150px;
  border: 1px solid var(--silver-border); border-radius: 999px;
  color: var(--gold); text-decoration: none; line-height: 1.15;
  transition: border-color var(--transition), background var(--transition);
}
.store-badge:hover { border-color: var(--gold); background: rgba(242, 190, 62, .06); }
.store-badge small { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
.store-badge strong { font-size: 15px; }
.store-badge.disabled { opacity: .55; cursor: default; }
.store-badge.disabled:hover { border-color: var(--silver-border); background: none; }

/* ---------- Shell ---------- */

.shell { min-height: 100vh; display: flex; flex-direction: column; }
/* Flex children with auto side margins shrink-wrap; the rows must fill the frame. */
.shell > .scope-row, .shell > .content { width: 100%; }

/* ---------- Page wallpaper: one per header type, fixed behind the whole shell ---------- */
/* Keyed off the header class with :has(); browsers without it keep the plain background. */
.shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--background) center / cover no-repeat;
}
.shell:has(> .page-header.type-1)::before {
  background-image: linear-gradient(rgba(7, 8, 9, .58), rgba(7, 8, 9, .78)), url("backgrounds/wallpaper-type-1.jpg");
}
.shell:has(> .page-header.type-2)::before {
  background-image: linear-gradient(rgba(7, 8, 9, .58), rgba(7, 8, 9, .78)), url("backgrounds/wallpaper-type-2.jpg");
}
.shell:has(> .page-header.type-3)::before {
  background-image: linear-gradient(rgba(7, 8, 9, .58), rgba(7, 8, 9, .78)), url("backgrounds/wallpaper-type-3.jpg");
}

/* ---------- Decorative page header ---------- */

.page-header {
  position: relative;
  height: var(--header-height);
  overflow: hidden;
  border-bottom: 1px solid transparent;
}

.header-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* The hawk watermark follows the account's tier; the banner is gone so the wallpaper shows through. */
.page-header .header-decoration {
  background: url("header-hawk-bronze.png") right center / auto 100% no-repeat;
}
.page-header.tier-silver .header-decoration { background-image: url("header-hawk-silver.png"); }
.page-header.tier-gold .header-decoration { background-image: url("header-hawk-gold.png"); }

.header-content {
  position: relative;
  max-width: var(--frame);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.top-bar {
  /* Out of the flow: the title band uses the header's full height, as on the
     phones, and the actions sit over its top-right corner. */
  position: absolute;
  top: 0; right: var(--gutter);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  height: 44px;
}

.top-actions { display: flex; gap: 4px; }

.icon-button {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%;
  color: var(--silver);
}
.icon-button:hover { background: rgba(255, 255, 255, .06); color: var(--text-primary); }
.icon-button .plus { font-size: 24px; line-height: 1; color: var(--silver); }

/* The title is centered in the band between the top bar and the metrics. */
.title-zone {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
}

.page-title {
  position: relative;
  /* Its own stacking context, so the glow below can sit behind the text
     without falling behind the header decoration. */
  isolation: isolate;
  margin: 0;
  text-align: center;
  font-size: 60px;
  font-weight: 700;
  color: var(--text-primary);
  pointer-events: none;
}
/* The soft warm glow hugging the word, as on the phones. Insets are relative
   to the title box, so it tracks the word's width instead of a fixed size. */
.page-title::before {
  content: "";
  position: absolute;
  inset: -10px -30px;
  background: var(--gold);
  opacity: .5;
  filter: blur(28px);
  border-radius: 50%;
  z-index: -1;
}

.metrics {
  display: flex;
  align-items: flex-start;
  gap: 34px;
  margin-top: auto;
  padding-bottom: 12px;
}

.metric { display: flex; align-items: flex-start; gap: 10px; }
.metric-icon { width: 40px; height: 40px; color: var(--gold); flex: none; }
.metric-value { font-size: 19px; font-weight: 700; color: var(--gold); }
.metric-label { font-size: 15px; color: var(--silver); }

.gold-divider {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(to right, rgba(242, 190, 62, .7), rgba(242, 190, 62, 0));
}

.icon { display: inline-flex; width: 18px; height: 18px; flex: none; }
.icon svg { width: 100%; height: 100%; display: block; }
.icon.silver { color: var(--silver); }
.icon.gold { color: var(--gold); }
.icon.muted { color: var(--silver-muted); }
.icon.success { color: var(--success); }
.icon.spin { animation: spin 1s linear infinite; }
.icon-button .icon, .metric-icon { width: 22px; height: 22px; }
.metric-icon { width: 40px; height: 40px; }

/* ---------- Platform tabs ---------- */

.scope-row {
  max-width: var(--frame);
  margin: 0 auto;
  padding: 18px var(--gutter) 0;
}

.platform-tabs { display: flex; flex-wrap: wrap; gap: 8px; }

.platform-tab {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--silver-border);
  background: var(--surface);
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.platform-tab:hover { border-color: var(--gold); background: rgba(242, 190, 62, .06); }
.platform-tab.selected {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--background);
}

/* ---------- Content ---------- */

.content {
  max-width: var(--frame);
  margin: 0 auto;
  padding: 18px var(--gutter) 0;
}

.content.with-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--surface-border);
}
.panel-head h2 { margin: 0; font-size: 16px; color: var(--text-primary); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--surface-border);
}
.count { color: var(--text-secondary); font-size: 13px; margin-left: auto; }

.search, .selector, .price-input {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: var(--surface-raised);
  color: var(--silver);
  font: inherit;
  font-size: 13px;
}
.search { flex: 1; max-width: 280px; }
.selector { color: var(--silver); font-weight: 600; }

button.link {
  background: none; border: 0; padding: 4px;
  color: var(--gold); font-size: 12px; font-weight: 600;
}
button.primary {
  min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--gold); color: var(--background); font-weight: 600;
}
button.ghost {
  background: var(--surface-raised); color: var(--gold);
  border: 1px solid var(--silver-border); border-radius: 999px;
  padding: 9px 16px;
}
button.ghost:hover { border-color: var(--gold); background: rgba(242, 190, 62, .06); }
button.ghost.danger { color: var(--deal); }
button.ghost.small { padding: 6px 12px; font-size: 13px; }

/* ---------- Tables ---------- */

/* Rows are the phones' cells: each one a rounded, bordered card with a gap
   to its neighbours (border-spacing keeps the gap between rows only). */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0 10px; margin-top: -10px; }
.data-table th {
  text-align: left;
  padding: 10px 16px 4px;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--silver-muted);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 16px;
  vertical-align: middle;
  background: var(--surface-raised);
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
}
.data-table td:first-child { border-left: 1px solid var(--surface-border); border-radius: 16px 0 0 16px; }
.data-table td:last-child { border-right: 1px solid var(--surface-border); border-radius: 0 16px 16px 0; }
.data-table td.num { white-space: nowrap; }

tr.selectable { cursor: pointer; }
tr.selectable:hover td { border-color: var(--silver-muted); }
/* Selection is a pulsing gold outline, never a gold fill. Each cell draws its
   segment on a pseudo-element over its own border; the segments meet into one
   rounded rectangle. */
tr.selectable td { position: relative; }
tr.selectable.selected td::after {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
  animation: pulse-outline 1.6s ease-in-out infinite;
}
tr.selectable.selected td:first-child::after { border-left: 2px solid var(--gold); border-radius: 16px 0 0 16px; }
tr.selectable.selected td:last-child::after { border-right: 2px solid var(--gold); border-radius: 0 16px 16px 0; }
@keyframes pulse-outline {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

.game-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.game-title { color: var(--text-primary); font-weight: 600; }

.cover { border-radius: 6px; object-fit: cover; background: var(--background); display: block; }
.cover.thumb { width: 40px; height: 56px; flex: none; }
/* Deals / Wishlist / Alerts rows: twice the height, with a landscape thumb. */
.rows-tall td { padding: 12px 16px; }
.rows-tall .cover.thumb { width: 160px; height: 75px; border-radius: 8px; }
.rows-tall .saving { flex-wrap: wrap; row-gap: 4px; }
.rows-tall .game-cell { gap: 16px; }
.rows-tall .game-title { font-size: 16px; }
.cover.portrait { width: 100%; max-width: 150px; aspect-ratio: 3 / 4; border-radius: 10px; }
.cover.landscape { width: 100%; aspect-ratio: 460 / 215; border-radius: 10px; }
.cover.placeholder { border: 1px solid var(--surface-border); }

.source-badge {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.price { color: var(--text-primary); font-weight: 600; }
.price-stack { display: inline-flex; align-items: baseline; gap: 10px; }
.price-was { color: var(--silver-muted); text-decoration: line-through; font-size: 13px; }
.price-deal { color: var(--deal); font-weight: 700; }
.price-target { color: var(--gold); font-weight: 700; }

.saving { display: inline-flex; align-items: center; gap: 8px; }
.discount-pill {
  padding: 3px 7px; border-radius: 999px;
  background: rgba(242, 190, 62, .15); color: var(--gold);
  font-size: 11px; font-weight: 700;
}
.atl-tag {
  padding: 2px 7px; border: 1px solid rgba(242, 190, 62, .6); border-radius: 6px;
  color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .04em;
  white-space: nowrap;
}

/* Status pairs its color with text and a dot — never color alone. */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.matched { color: var(--success); }
.status.above { color: var(--deal); }
.status.waiting { color: var(--silver-muted); }

.alert-on { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-size: 13px; }
.alert-on .icon { width: 16px; height: 16px; }
.muted { color: var(--silver-muted); }

/* ---------- Home ---------- */

.summary-row {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  color: inherit;
}
.summary-card:hover { border-color: var(--gold-muted); }
.summary-card .chevron { width: 16px; height: 16px; margin-left: auto; color: var(--silver-muted); }
.summary-card .metric-text { display: flex; flex-direction: column; }

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

/* Server health and last sync sit in the header's top-left corner, the mirror
   of the actions on the right: out of the flow, over the header band. */
.server-status {
  position: absolute;
  top: 0; left: var(--gutter);
  height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}
.server-status .icon { width: 18px; height: 18px; flex: none; }
@media (max-width: 720px) {
  .server-status { height: auto; padding-top: 12px; max-width: 55%; white-space: normal; line-height: 1.3; }
}

/* ---------- Vault ---------- */

.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.cover-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
}
.cover-card .source-badge { align-self: flex-start; }
/* The tile's art fills its width at the phones' 3:4; the play status is
   pinned bottom-left so every tile in a row ends the same way. */
.cover-card .cover.portrait { max-width: none; border-radius: 8px; }
.cover-card .playtime { margin-top: auto; display: flex; align-items: center; gap: 4px; min-height: 16px; }
.cover-card .playtime .icon { width: 12px; height: 12px; }
.cover-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  /* Long titles wrap rather than shrink. */
  overflow-wrap: anywhere;
}
.content.vault .toolbar {
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  background: var(--surface);
  margin-bottom: 18px;
}

/* ---------- Detail / alert panel ---------- */

.side-panel { position: sticky; top: 18px; animation: fade-in var(--transition) ease-out; }
/* Everything in a detail panel is centered on its axis. */
.detail-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.detail-title { margin: 0; font-size: 17px; color: var(--text-primary); }
.detail-rows { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.status-text { margin: 0; font-size: 13px; color: var(--text-secondary); }
.detail-body .detail-rows, .detail-body .threshold, .detail-body .action-row { width: 100%; }
.detail-body .action-row { justify-content: center; margin-top: 12px; }
.detail-body .store-buttons { justify-content: center; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.detail-divider { width: 100%; height: 1px; background: var(--surface-border); margin: 4px 0; }

/* The phones' GameDetailView: description paragraph, then gold-labelled metadata lines, left-aligned. */
.game-detail { width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: left; animation: fade-in var(--transition) ease-out; }
.detail-description { margin: 0; font-size: 15px; line-height: 1.45; color: var(--text-primary); white-space: pre-line; }
/* Vault sheet: description and metadata scroll together in one bounded box, sized so the
 * sheet (head, cover, title, store button, price rows) fits the viewport without its own scroll. */
.game-detail.scroll-box {
  max-height: 34vh; overflow-y: auto; padding-right: 8px;
  scrollbar-width: thin; scrollbar-color: var(--surface-border) transparent;
}
/* Clamped to --clamp-lines (5 in the side panels, 3 in the Vault sheet); the gold chevron expands or contracts the rest. */
.detail-description-block { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.detail-description-block .detail-description { width: 100%; }
.detail-description.clamp {
  display: -webkit-box; -webkit-line-clamp: var(--clamp-lines, 5); -webkit-box-orient: vertical; overflow: hidden;
}
.detail-expand {
  background: none; border: 0; padding: 2px 10px; cursor: pointer;
  color: var(--gold); display: inline-flex; align-items: center; line-height: 0; border-radius: 8px;
}
.detail-expand:hover { color: var(--gold-bright); }
.detail-expand:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.detail-expand svg { transition: transform var(--transition) ease-out; }
.detail-expand[aria-expanded="true"] svg { transform: rotate(180deg); }
/* Loaded detail grows from the placeholder's height, and the paragraph opens or
 * closes over the same fade, instead of popping. */
.game-detail.resizing, .detail-description.resizing { transition: height var(--transition) ease-out; overflow: hidden; }
.meta-rows { display: flex; flex-direction: column; gap: 6px; }
.meta-row { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; }
.meta-label { flex: 0 0 96px; font-weight: 600; color: var(--gold); }
.meta-value { color: var(--text-primary); }
.detail-loading { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--silver-muted); }
.detail-spinner {
  width: 12px; height: 12px; flex: 0 0 12px;
  border: 2px solid var(--surface-border); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 1s linear infinite;
}
.detail-empty { margin: 0; font-size: 12px; color: var(--silver-muted); }
.save-row { width: 100%; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.field-label { font-size: 12px; color: var(--silver-muted); }
.price-input { width: 100%; }

/* The phones' deal-alert slider: minimum discount, cutoff previewed beside it. */
.threshold {
  width: 100%; padding: 12px 14px 8px;
  background: var(--surface-raised); border: 1px solid var(--surface-border); border-radius: 12px;
}
.threshold-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.threshold-percent { color: var(--gold); font-weight: 700; font-size: 14px; }
.threshold-cutoff { color: var(--text-secondary); font-size: 13px; }
.threshold-slider { width: 100%; margin: 0; accent-color: var(--gold); cursor: pointer; }
.threshold-slider[disabled] { opacity: .4; cursor: default; }

/* ---------- States ---------- */

.state { padding: 32px 16px; text-align: center; color: var(--text-secondary); }
.state h2 { margin: 0 0 4px; font-size: 15px; color: var(--text-primary); }
.state p { margin: 0; font-size: 13px; }
.empty-card { background: var(--surface); border-radius: 14px; }

/* Saved confirmation: a gold check that pops in and is gone in 1 s. */
.saved-check {
  position: fixed; left: 50%; top: 50%; z-index: 30; pointer-events: none;
  width: 64px; height: 64px; margin: -32px 0 0 -32px;
  display: grid; place-items: center;
  background: #000; border: 2px solid var(--gold); border-radius: 50%;
  box-shadow: 0 0 24px rgba(242, 190, 62, .35);
  animation: saved-pop 1s ease-out forwards;
}
.saved-check .icon { width: 32px; height: 32px; }
.saved-check .icon svg { stroke-width: 2.5; }
@keyframes saved-pop {
  0% { opacity: 0; transform: scale(.6); }
  15% { opacity: 1; transform: scale(1); }
  55% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); }
}
@media (prefers-reduced-motion: reduce) { .saved-check { animation: none; } }

.toast {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%);
  background: var(--surface-raised); border: 1px solid var(--surface-border);
  color: var(--text-primary); padding: 10px 16px; border-radius: 10px; font-size: 13px;
}

/* ---------- Tab bar ---------- */

.tabbar-region {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  /* Above the tab-switch ghost: the bar persists while pages crossfade. */
  z-index: 10;
  display: flex;
  justify-content: center;
  /* Extra top padding carries the scrim above the raised home disc. */
  padding: 44px 16px 20px;
  pointer-events: none;
  /* Bottom scrim: content dims out before it reaches the bar instead of colliding with it. */
  background: linear-gradient(to top, rgba(7, 8, 9, .92), rgba(7, 8, 9, .55) 45%, rgba(7, 8, 9, 0));
}

.tabbar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  width: min(500px, 100%);
  height: 68px;
  padding: 0 10px;
  border-radius: 34px;
  border: 1.5px solid #35373b;
  background: linear-gradient(to bottom, #151719, #0b0c0e);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
}

.tab {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: 0;
  color: var(--silver);
}
.tab-icon { width: 23px; height: 23px; color: var(--silver); }
.tab-label { font-size: 10px; font-weight: 600; color: var(--silver-muted); }
.tab-baseline { width: 16px; height: 2px; border-radius: 1px; background: transparent; }

.tab:hover .tab-label { color: var(--silver); }
.tab.selected .tab-icon { color: var(--gold); }
/* The Wishlist heart stays silver even when selected. */
.tab.selected .tab-icon.heart { color: var(--silver); }
.tab.selected .tab-label { color: var(--gold); }
.tab.selected .tab-baseline { background: var(--gold); }

.tab.home { position: relative; }
.home-disc {
  position: absolute;
  top: -12px;
  width: 62px; height: 62px;
  border-radius: 50%;
  border: 1.5px solid #2f3135;
  background: radial-gradient(circle at 50% 40%, #24262a, #090a0b);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
  display: grid;
  place-items: center;
}
/* Only the hawk rotates; disc, ring, and hit target stay upright. */
.home-hawk { width: 38px; transform: rotate(-45deg); }
.tab.home.selected .home-disc {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(242, 190, 62, .55);
}

/* ---------- Overlays ---------- */

.overlay {
  position: fixed; inset: 0;
  background: var(--scrim);
  display: grid; place-items: center;
  padding: 20px;
  z-index: 20;
}
.sheet {
  width: min(520px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 0; font-size: 18px; color: var(--text-primary); }

/* Each section sits in its own rounded silver box. */
.settings-section {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px 16px;
  border: 1px solid rgba(200, 203, 208, .32);
  border-radius: 14px;
  background: var(--surface-raised);
}
.settings-section > button.ghost { margin-top: 6px; }
.settings-section h3 {
  margin: 0; font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold);
}
.settings-rows { display: flex; flex-direction: column; gap: 6px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.segmented {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: var(--background);
  border-radius: 10px;
}
.segment {
  padding: 7px 14px;
  border: 0; border-radius: 8px;
  background: none; color: var(--silver-muted);
  font-size: 13px; font-weight: 600;
}
.segment.selected { background: var(--gold); color: var(--background); }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .content.with-panel { grid-template-columns: minmax(0, 1fr); }
  .side-panel { position: static; }
  .summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wishlist-card { grid-column: 1 / -1; }
  .panel-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; --header-height: 156px; }
  /* Narrow: the actions go back in flow so they never sit on the title. */
  .top-bar { position: static; height: 40px; flex: none; }
  .page-title { font-size: 48px; }
  .metrics { gap: 20px; }
  .metric-icon { width: 32px; height: 32px; }
  .summary-row { grid-template-columns: minmax(0, 1fr); }
  /* Phone wraps platform tabs at three per row, like the apps. */
  .platform-tab { flex: 0 0 auto; }
  .data-table th:nth-child(n + 4), .data-table td:nth-child(n + 4) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner, .icon.spin, .detail-spinner { animation: none; }
  .game-detail.resizing, .detail-description.resizing, .detail-expand svg { transition: none; }
  tr.selectable.selected td::after, button.cover-card.selected::after { animation: none; }
}

/* ---------- Motion: one app-wide fade, --transition ---------- */

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
.content, .overlay, .toast { animation: fade-in var(--transition) ease-out; }
.content.no-fade, .content.no-fade .side-panel { animation: none; }
/* Tab switch crossfade: the outgoing shell sits opaque over the new page and
   fades out beneath the persistent tab bar. */
#root { position: relative; }
.shell-ghost {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 5; pointer-events: none;
  background: var(--background);
  animation: fade-out var(--transition) ease-out forwards;
}
/* Fade-through for non-tab screen changes (re-proof card, sign-out): above every overlay. */
.fade-scrim {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  background: var(--background);
  animation: fade-in var(--transition) ease-out forwards;
}
.fade-scrim.lift { animation: fade-out var(--transition) ease-out forwards; }
@media (prefers-reduced-motion: reduce) {
  .content, .overlay, .toast, .side-panel { animation: none; }
  .shell-ghost, .fade-scrim { display: none; }
}

.badge-row { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- Vault tile + game-detail sheet ---------- */

/* The tile is a real button so it is clickable, focusable, and keyboard-operable. */
button.cover-card {
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
button.cover-card:hover { border-color: var(--gold-muted); }
/* Selection outlines (Vault tile while its sheet is open, compact cards): the
   same pulsing gold as a selected table row, drawn just outside the border. */
button.cover-card { position: relative; }
button.cover-card.selected::after {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  border: 3px solid var(--gold); border-radius: inherit;
  box-shadow: 0 0 14px rgba(242, 190, 62, .4);
  animation: pulse-outline 1.6s ease-in-out infinite;
}

.detail-sheet { position: relative; overflow: auto; }
/* Companion artwork spans the top of the sheet and fades into the base. */
.detail-decoration {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 220px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.detail-sheet.type-1 .detail-decoration { background: url("detail-type-1.jpg") center top / cover no-repeat; }
.detail-sheet.type-2 .detail-decoration { background: url("detail-type-2.jpg") center top / cover no-repeat; }
.detail-sheet.type-3 .detail-decoration { background: url("detail-type-3.jpg") center top / cover no-repeat; }
.detail-sheet .sheet-head, .detail-sheet .detail-body { position: relative; }

.contact-link {
  color: var(--gold);
  text-decoration: none;
  font-size: 15px;
}
.contact-link:hover { text-decoration: underline; }

/* ---------- Home: the phones' fanned Wishlist card ---------- */

.wishlist-card {
  position: relative;
  overflow: hidden;
  min-height: 140px;
  padding-left: 18px;
  /* Gold-to-silver hairline over a black card, as on the phones. */
  border-color: transparent;
  background:
    linear-gradient(#000, #000) padding-box,
    linear-gradient(135deg, var(--gold), var(--silver)) border-box;
}
.wishlist-card:hover { border-color: transparent; filter: brightness(1.1); }
.wishlist-card .metric-value.big { font-size: 36px; line-height: 1.1; color: var(--text-primary); }
.wishlist-card .metric-label { display: inline-flex; align-items: center; gap: 5px; color: var(--text-secondary); }
.wishlist-card .metric-label .icon { width: 12px; height: 12px; }
.fan {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  display: flex; align-items: center;
}
.fan-cover {
  width: 90px; height: 124px;
  border-radius: 10px; border: 1px solid var(--surface-border);
  margin-left: -22px;
  /* Corners-only fade: opaque centre, transparent at the far corners. */
  -webkit-mask-image: radial-gradient(circle at center, #000 55%, transparent 100%);
  mask-image: radial-gradient(circle at center, #000 55%, transparent 100%);
}
.fan-cover.fan-0 { margin-left: 0; transform: rotate(-8deg); }
.fan-cover.fan-1 { z-index: 1; }
.fan-cover.fan-2 { transform: rotate(6deg); }

/* ---------- All-time-low record, alert prices, bells ---------- */

/* Filled while the deal matches the record; the outline .atl-tag carries "ATL $x" otherwise. */
.atl-capsule {
  padding: 3px 8px; border-radius: 999px;
  background: var(--gold); color: var(--background);
  font-size: 10px; font-weight: 800; letter-spacing: .04em; white-space: nowrap;
}
.price-above { color: var(--deal); font-weight: 700; }
.price-matched { color: var(--success); font-weight: 700; }

/* The bell keeps its own 44px target, independent of row selection. */
.icon-button.bell {
  width: auto; min-width: 44px; padding: 0 10px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 22px;
}
.bell-amount { color: var(--gold); font-size: 13px; font-weight: 600; }

/* ---------- Vault playtime, store links, sync line ---------- */

.playtime { font-size: 12px; color: var(--text-secondary); }
/* The phones' outlined gold store buttons, one per platform, left-aligned. */
.store-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
a.store-button {
  display: inline-flex; align-items: center;
  min-height: 34px; padding: 0 18px;
  border: 1px solid var(--silver-border); border-radius: 999px;
  color: var(--gold); text-decoration: none;
  font-size: 13px; font-weight: 600;
}
a.store-button:hover { border-color: var(--gold); background: rgba(242, 190, 62, .06); }
/* Until the bundle is rebuilt it still emits the health icon and sentence; only the sync line shows. */
.server-status > :not(.sync-line) { display: none; }

/* ---------- Admin sheet ---------- */

.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px;
  background: var(--surface-raised); border: 1px solid var(--surface-border); border-radius: 10px;
}
.admin-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.key-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
button.primary.small { min-height: 32px; padding: 0 12px; font-size: 13px; flex: none; }
button.primary[disabled] { opacity: .35; cursor: default; filter: grayscale(.6); }

.icon-button.bell.locked { opacity: 0.4; }
.threshold.locked { opacity: 0.45; }
.tier-note { color: var(--gold); font-size: 13px; line-height: 1.45; margin: 0; }
.tier-status { margin: 0; font-size: 14px; }
.tier-status.tier-gold { color: var(--gold); }
.tier-status.tier-bronze { color: #c98a5a; }
.settings-row.paused { opacity: 0.6; }
