/* Game Deal Tracker: one stylesheet for the whole site.
   Phase 2 design: Geist + Geist Mono, navy near-black in dark mode, soft gray in light mode,
   one green accent used sparingly (main button, discounts, the lowest price line). */

:root {
  color-scheme: light;
  --page: #edf0f4;
  --page-glow: rgba(120, 140, 175, 0.16);
  --header: rgba(249, 250, 251, 0.55);
  --surface: #f9fafb;
  --surface-sunken: #f1f3f6;
  --text-primary: #1a2130;
  --text-secondary: #4a5366;
  --text-muted: #687186;
  --border: rgba(26, 33, 48, 0.11);
  --border-strong: rgba(26, 33, 48, 0.22);
  --accent: #16803f;
  --accent-hover: #126b34;
  --on-accent: #ffffff;
  --accent-soft: rgba(22, 128, 63, 0.14);
  --focus: #16803f;
  --error: #b42323;
  --error-soft: rgba(180, 35, 35, 0.09);
  --danger: #b42323;
  --danger-hover: #951c1c;
  --grid: rgba(26, 33, 48, 0.08);
  --axis: rgba(26, 33, 48, 0.22);
  --series-lowest: #16803f;
  --series-normal: #8a93a6;
  --radius: 12px;
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0f1621;
    --page-glow: rgba(70, 110, 170, 0.20);
    --header: rgba(18, 26, 38, 0.65);
    --surface: #172030;
    --surface-sunken: #121a27;
    --text-primary: #e6eaf2;
    --text-secondary: #aab3c4;
    --text-muted: #8792a6;
    --border: rgba(165, 185, 215, 0.13);
    --border-strong: rgba(165, 185, 215, 0.26);
    --accent: #22c55e;
    --accent-hover: #4ade80;
    --on-accent: #06110a;
    --accent-soft: rgba(34, 197, 94, 0.16);
    --focus: #4ade80;
    --error: #f5a3a3;
    --error-soft: rgba(229, 72, 77, 0.14);
    --danger: #ef6b6f;
    --danger-hover: #f2555a;
    --grid: rgba(165, 185, 215, 0.09);
    --axis: rgba(165, 185, 215, 0.24);
    --series-lowest: #4ade80;
    --series-normal: #7c879b;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f1621;
  --page-glow: rgba(70, 110, 170, 0.20);
  --header: rgba(18, 26, 38, 0.65);
  --surface: #172030;
  --surface-sunken: #121a27;
  --text-primary: #e6eaf2;
  --text-secondary: #aab3c4;
  --text-muted: #8792a6;
  --border: rgba(165, 185, 215, 0.13);
  --border-strong: rgba(165, 185, 215, 0.26);
  --accent: #22c55e;
  --accent-hover: #4ade80;
  --on-accent: #06110a;
  --accent-soft: rgba(34, 197, 94, 0.16);
  --focus: #4ade80;
  --error: #f5a3a3;
  --error-soft: rgba(229, 72, 77, 0.14);
  --danger: #ef6b6f;
  --danger-hover: #f2555a;
  --grid: rgba(165, 185, 215, 0.09);
  --axis: rgba(165, 185, 215, 0.24);
  --series-lowest: #4ade80;
  --series-normal: #7c879b;
}

/* Smooth fade between light and dark, only while the theme button is used. */
.theme-fade,
.theme-fade *,
.theme-fade *::before,
.theme-fade *::after {
  transition: background-color 350ms ease, border-color 350ms ease, color 350ms ease,
              fill 350ms ease, stroke 350ms ease !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 520px at 50% -160px, var(--page-glow), transparent 70%) no-repeat,
    var(--page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-primary);
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--header);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.brand-bg { fill: var(--accent); }
.brand-tag { fill: var(--on-accent); }
.brand-arrow {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Theme switch: a sliding toggle, sun on the left, moon on the right. */
.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 60px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-muted);
  cursor: pointer;
  flex: none;
}

.theme-switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  transition: transform 250ms ease;
}

.theme-switch[aria-checked="true"]::before {
  transform: translateX(28px);
}

.theme-switch .icon {
  position: relative;
  z-index: 1;
}

.theme-switch[aria-checked="false"] .icon-sun,
.theme-switch[aria-checked="true"] .icon-moon {
  color: var(--text-primary);
}

/* Header links */

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.nav-link:hover {
  background: var(--surface-sunken);
}

.button-small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.9375rem;
}

/* Page layout */

.auth-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(32px, 8vh, 96px) 16px 48px;
}

.auth-column {
  width: 100%;
  max-width: 400px;
  display: grid;
  gap: 20px;
}

.auth-head h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.auth-head p {
  margin: 8px 0 0;
  color: var(--text-secondary);
}

.eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-title {
  margin: 0 0 4px;
  font-size: 1.0625rem;
  font-weight: 600;
}

.card-text {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* Forms */

.form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 0.875rem;
  font-weight: 500;
}

.field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-sunken);
  color: var(--text-primary);
  font: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input:hover {
  border-color: var(--text-muted);
}

.field input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input[aria-invalid="true"] {
  border-color: var(--error);
}

.field input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px var(--error-soft);
}

.hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.button:hover {
  background: var(--accent-hover);
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.button-block {
  width: 100%;
}

.button-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.button-secondary:hover {
  background: var(--surface-sunken);
  border-color: var(--text-muted);
}

.button-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.button-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--error-soft);
  color: var(--error);
  font-size: 0.9375rem;
}

.form-error:empty {
  display: none;
}

.switch-link {
  margin: 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* Recruiter shortcut on the log in page */

.recruiter {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.recruiter p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.recruiter strong {
  color: var(--text-primary);
  font-weight: 600;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

/* Account page */

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

.who-name {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 500;
  word-break: break-all;
}

.who-label {
  margin: 0 0 2px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card-danger {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}

.loading {
  color: var(--text-muted);
}

[hidden] {
  display: none !important;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer a {
  color: var(--text-secondary);
}

.switch-link a {
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ===========================================================================
   Landing page
   =========================================================================== */

.landing {
  flex: 1;
  display: grid;
  gap: 72px;
  padding-top: clamp(40px, 7vh, 80px);
  padding-bottom: 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  max-width: 14ch;
}

.hero .lead {
  margin: 20px 0 0;
  max-width: 46ch;
  color: var(--text-secondary);
  font-size: 1.125rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}

/* "Recruiter?" text that opens a small balloon */

.recruiter-wrap {
  position: relative;
  margin-top: 20px;
}

.text-button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-button:hover {
  color: var(--text-primary);
  text-decoration-color: currentColor;
}

.balloon {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 10;
  width: min(340px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(8, 12, 20, 0.18);
}

.balloon::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 24px;
  width: 12px;
  height: 12px;
  border-top: 1px solid var(--border-strong);
  border-left: 1px solid var(--border-strong);
  background: var(--surface);
  transform: rotate(45deg);
}

.balloon p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* Deal card: big cover, huge discount in mono over a dark fade */

.deal-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}

.deal-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.deal-card[aria-pressed="true"] {
  border-color: var(--accent);
}

.deal-cover {
  position: relative;
  aspect-ratio: 460 / 215;
  background: var(--surface-sunken);
}

.deal-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deal-cover img.broken {
  visibility: hidden;
}

.deal-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 10, 18, 0.92) 0%, rgba(6, 10, 18, 0.7) 28%, rgba(6, 10, 18, 0.15) 60%, transparent 75%);
  pointer-events: none;
}

.deal-off {
  position: absolute;
  left: 14px;
  bottom: 8px;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #4ade80;
}

.deal-off.none {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e6eaf2;
}

.deal-body {
  display: grid;
  gap: 6px;
  padding: 14px 16px 16px;
}

.deal-title {
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deal-prices {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.price-now {
  font-size: 1.0625rem;
  font-weight: 500;
}

.price-was {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: line-through;
}

.price-none {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* The big card in the hero */

.hero-deal .deal-off {
  left: 20px;
  bottom: 14px;
  font-size: clamp(3rem, 2rem + 3vw, 4.5rem);
}

.hero-deal .deal-body {
  padding: 18px 20px 20px;
}

.hero-deal .deal-title {
  font-size: 1.125rem;
}

.hero-deal .price-now {
  font-size: 1.25rem;
}

.hero-caption {
  margin: 10px 2px 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Sections */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 6px 0 0;
  max-width: 60ch;
  color: var(--text-secondary);
}

.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.status {
  margin: 12px 0 0;
  color: var(--text-secondary);
}

.status:empty {
  display: none;
}

.status.error {
  color: var(--error);
}

/* Price history panel */

.history {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-margin-top: 24px;
}

.history:focus {
  outline: none;
}

.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.history-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.history-summary {
  margin: 6px 0 0;
  color: var(--text-secondary);
}

.history-summary strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 500;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 20px 0 8px;
  padding: 0;
  list-style: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.key {
  width: 18px;
  height: 0;
  border-top: 2px solid var(--series-lowest);
}

.key-normal {
  border-top: 2px dashed var(--series-normal);
}

.chart-box {
  position: relative;
  height: 280px;
}

.note {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.table-view {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.table-view summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.table-scroll {
  margin-top: 12px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td.num,
th.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

tr.cheapest td {
  color: var(--text-primary);
  font-weight: 500;
}

.tag {
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* About */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.about p {
  margin: 0;
  max-width: 62ch;
  color: var(--text-secondary);
}

/* Skeleton while the cards load */

.skeleton {
  pointer-events: none;
}

.skeleton .deal-cover,
.skeleton .bar {
  background: var(--surface-sunken);
}

.skeleton .bar {
  display: block;
  height: 12px;
  border-radius: 6px;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .about {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .landing {
    gap: 56px;
  }
}

@media (max-width: 520px) {
  .deal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .deal-grid .deal-off {
    left: 10px;
    bottom: 6px;
    font-size: 1.375rem;
  }

  .deal-grid .deal-body {
    padding: 10px 12px 12px;
  }

  .deal-grid .deal-title {
    font-size: 0.875rem;
  }

  .deal-grid .price-now {
    font-size: 0.9375rem;
  }

  .deal-grid .price-was {
    font-size: 0.75rem;
  }

  .hide-mobile {
    display: none !important;
  }

  .history {
    padding: 18px 16px;
  }

  .chart-box {
    height: 240px;
  }
}

/* ---------------------------------------------------------------------------
   Watchlist page
   --------------------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.nav-link[aria-current="page"] {
  background: var(--surface-sunken);
}

.app-main {
  flex: 1;
  padding-top: clamp(28px, 5vh, 56px);
  padding-bottom: 64px;
}

.app-stack {
  display: grid;
  gap: 28px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-sub {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.demo-note {
  margin: 0;
  max-width: 44ch;
  padding: 10px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* A text input outside a .field (search, target prices) */

.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-sunken);
  color: var(--text-primary);
  font: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input:hover {
  border-color: var(--text-muted);
}

.input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input[aria-invalid="true"] {
  border-color: var(--error);
}

.input-small {
  min-height: 36px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
}

/* Search */

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-results {
  display: grid;
  gap: 0;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.search-results:empty {
  display: none;
}

.result {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.result-thumb {
  display: block;
  width: 120px;
  height: 45px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-sunken);
}

.result-thumb.broken {
  visibility: hidden;
}

.result-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.result-title {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-price {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.result-form {
  display: flex;
  gap: 8px;
}

.result-form .input {
  width: 9.5rem;
}

.result-done {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.result .mini-status {
  grid-column: 2 / -1;
}

.mini-status {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.mini-status:empty {
  display: none;
}

.mini-status.error {
  color: var(--error);
}

/* List of followed games */

.empty {
  margin: 0;
  padding: 32px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-secondary);
}

.watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.watch-grid:empty {
  display: none;
}

.watch-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.watch-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.watch-open .deal-cover {
  transition: opacity 150ms ease;
}

.watch-open:hover .deal-cover {
  opacity: 0.88;
}

.watch-open[aria-pressed="true"] {
  box-shadow: inset 0 -3px 0 var(--accent);
}

.target-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.75rem;
  font-weight: 600;
}

.watch-body {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
}

.watch-body .deal-title {
  margin: 0;
  font-size: 1rem;
}

.watch-store {
  margin: -4px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.target-form {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.target-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.target-row {
  display: flex;
  gap: 8px;
}

.text-danger {
  justify-self: start;
  font-size: 0.875rem;
  color: var(--danger);
  text-decoration-color: currentColor;
}

.text-danger:hover {
  color: var(--danger-hover);
}

@media (max-width: 520px) {
  .result {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .result-thumb {
    width: 84px;
    height: 32px;
  }

  .result-form,
  .result-done {
    grid-column: 1 / -1;
  }

  .result-form .input {
    width: 100%;
  }

  .result .mini-status {
    grid-column: 1 / -1;
  }

  .page-head h1 {
    font-size: 1.5rem;
  }
}

/* Header on small phones: keep every link on one line */
.nav-link {
  white-space: nowrap;
}

@media (max-width: 520px) {
  .header-actions {
    gap: 2px;
  }

  .nav-link {
    padding: 0 8px;
  }
}

@media (max-width: 420px) {
  .brand span {
    display: none;
  }
}

/* Buy link on the watchlist cards (goes through CheapShark's redirect) */
.buy-link {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.buy-link::after {
  content: " ↗";
}

.buy-link:hover {
  text-decoration: underline;
}

/* Home top deals: the card is a link to the store (through CheapShark) */
a.deal-card {
  text-decoration: none;
}

a.deal-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.deal-card.static {
  cursor: default;
}

.deal-card.static:hover {
  transform: none;
}

.deal-store {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

a.deal-card:hover .buy-link {
  text-decoration: underline;
}

.deals-date {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* Home grid: every card in a row has the same height, and the title always
   takes 2 lines, so prices and store lines line up even when a title wraps. */
.deal-grid > li {
  display: flex;
}

.deal-grid .deal-card {
  height: 100%;
}

.deal-grid .deal-body {
  flex: 1;
  align-content: start;
}

.deal-grid .deal-title {
  min-height: calc(1.3em * 2);
}
