/* ==========================================================================
   GameVault ID - Clean Modern Storefront Design System
   Powered by Open Props CSS tokens + bespoke semantic polarity tokens.
   Dial: ENERGY 2 / RHYTHM 2 / MOTION 2
   WCAG AA contrast verified across both Light & Dark themes.
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg-canvas: #0b0e14;
  --bg-surface: #121722;
  --bg-surface-glass: rgba(18, 23, 34, 0.86);
  --bg-elevated: #1a2130;
  --bg-input: #0d1119;
  --bg-hover: #222b3d;

  --text-primary: #f1f5f9;
  --text-secondary: #a3b1c6;
  --text-tertiary: #8896ab;

  --border-subtle: #232c3d;
  --border-card: #283347;
  --border-strong: #64748b;

  --accent: #f0b429;
  --accent-hover: #f7c54d;
  --accent-text: #f5c146;
  --accent-on: #0b0e14;
  --accent-tint: rgba(240, 180, 41, 0.11);
  --accent-border: rgba(240, 180, 41, 0.38);
  --accent-wash: rgba(240, 180, 41, 0.06);

  --status-ok-bg: #0d2619;
  --status-ok-text: #86efac;
  --status-ok-border: #1e5635;

  --status-err-bg: #2c1217;
  --status-err-text: #fca5a5;
  --status-err-border: #6f242f;

  --status-info-bg: #0d2336;
  --status-info-text: #7dd3fc;
  --status-info-border: #1d5172;

  --status-warn-bg: #2b1e0a;
  --status-warn-text: #fcd34d;
  --status-warn-border: #705014;

  --gv-shadow-surface: 0 1px 2px rgba(0, 0, 0, 0.36);
  --gv-shadow-featured: 0 14px 34px -14px rgba(0, 0, 0, 0.65), 0 2px 6px rgba(0, 0, 0, 0.3);
  --gv-shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.72);
  --gv-shadow-btn: 0 1px 2px rgba(0, 0, 0, 0.35);

  --focus-ring: #f5c146;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg-canvas: #f4f6fa;
  --bg-surface: #ffffff;
  --bg-surface-glass: rgba(255, 255, 255, 0.88);
  --bg-elevated: #eef2f7;
  --bg-input: #ffffff;
  --bg-hover: #e6ecf5;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #5b677a;

  --border-subtle: #dce3ee;
  --border-card: #d5deeb;
  --border-strong: #707d92;

  --accent: #b45309;
  --accent-hover: #92400e;
  --accent-text: #9a4408;
  --accent-on: #ffffff;
  --accent-tint: #fdf4e7;
  --accent-border: #e5b880;
  --accent-wash: rgba(180, 83, 9, 0.055);

  --status-ok-bg: #ecfdf5;
  --status-ok-text: #14532d;
  --status-ok-border: #86efac;

  --status-err-bg: #fef2f2;
  --status-err-text: #991b1b;
  --status-err-border: #fca5a5;

  --status-info-bg: #f0f9ff;
  --status-info-text: #0c4a6e;
  --status-info-border: #7dd3fc;

  --status-warn-bg: #fffbeb;
  --status-warn-text: #78350f;
  --status-warn-border: #f5c76b;

  --shadow-color: 222 47% 11%;
  --shadow-strength: 3%;
  --gv-shadow-surface: var(--shadow-1);
  --gv-shadow-featured: var(--shadow-3);
  --gv-shadow-modal: var(--shadow-5);
  --gv-shadow-btn: 0 1px 2px rgba(15, 23, 42, 0.08);

  --focus-ring: #b45309;
  color-scheme: light;
}

/* Radius & Motion scale mapped onto Open Props */
:root {
  --gv-radius-sm: var(--radius-2, 0.375rem);
  --gv-radius-md: 0.625rem;
  --gv-radius-lg: var(--radius-3, 1rem);
  --gv-ease: var(--ease-out-3, cubic-bezier(0.22, 1, 0.36, 1));
  --gv-ease-spring: var(--ease-spring-2, cubic-bezier(0.25, 1.15, 0.5, 1));
}

/* Base reset & accessibility affordances */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-bottom: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg-canvas);
  background-image: radial-gradient(
    ellipse 85% 320px at 50% -110px,
    var(--accent-wash),
    transparent 72%
  );
  background-repeat: no-repeat;
  color: var(--text-primary);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  overflow-x: clip;
  transition: background-color 0.22s var(--gv-ease), color 0.22s var(--gv-ease);
}

h1,
h2,
h3,
h4,
.font-display {
  font-family: "Chakra Petch", "DM Sans", sans-serif;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

p {
  margin: 0;
}

.font-mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Interactive cursor affordance (R-39) */
a[href],
button:not(:disabled),
select:not(:disabled),
summary,
label[for],
input[type="checkbox"]:not(:disabled),
input[type="radio"]:not(:disabled),
[role="button"]:not([aria-disabled="true"]) {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Visible focus indicator (R-32) */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 200;
  padding: 0.75rem 1.1rem;
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 700;
  border-radius: var(--gv-radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  left: 0.75rem;
}

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

/* Layout shells */
.gv-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.gv-container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 2.8vw, 1.75rem);
}

.gv-container--narrow {
  max-width: 720px;
}

.gv-container--auth {
  max-width: 460px;
}

/* Top navigation bar (single frosted glass accent surface, R-10 dose cap) */
.gv-topbar {
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.gv-topbar-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
}

.gv-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  min-height: 44px;
  flex-shrink: 0;
}

.gv-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background-color: #050608;
  border: 1px solid var(--accent-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--gv-shadow-btn);
  position: relative;
}

.gv-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gv-brand-title {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  display: block;
}

.gv-brand-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 1px;
}

/* Desktop navigation cluster */
.gv-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.gv-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: var(--gv-radius-md);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.gv-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.25rem;
}

.gv-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.45rem 0.85rem;
  border-radius: calc(var(--gv-radius-md) - 3px);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 0.16s var(--gv-ease), color 0.16s var(--gv-ease), border-color 0.16s var(--gv-ease);
}

.gv-nav-link:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.gv-nav-link--active {
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border-color: var(--border-card);
  box-shadow: var(--gv-shadow-surface);
}

.gv-nav-link--active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
  flex-shrink: 0;
}

/* Theme toggle button with label on desktop */
.gv-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 0.8rem;
  border-radius: var(--gv-radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background-color 0.16s var(--gv-ease), color 0.16s var(--gv-ease), border-color 0.16s var(--gv-ease);
}

.gv-theme-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.gv-theme-btn [data-theme-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Main content */
.gv-main {
  flex: 1;
  padding: clamp(1.5rem, 3.2vw, 2.75rem) 0 clamp(2.5rem, 4vw, 4rem);
}

/* Announcement banner */
.gv-announcement {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.95rem 1.2rem;
  border-radius: var(--gv-radius-md);
  background-color: var(--status-warn-bg);
  border: 1px solid var(--status-warn-border);
  color: var(--status-warn-text);
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.gv-announcement[hidden] {
  display: none;
}

/* Page header */
.gv-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: clamp(1.35rem, 2.5vw, 2rem);
}

.gv-page-title {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-weight: 700;
  color: var(--text-primary);
}

.gv-page-desc {
  margin-top: 0.45rem;
  color: var(--text-secondary);
  font-size: clamp(0.9rem, 1.15vw, 0.98rem);
  max-width: 60ch;
}

/* Cards & surfaces (deliberate elevation hierarchy, R-12) */
.gv-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--gv-radius-lg);
  padding: clamp(1.2rem, 2.4vw, 1.75rem);
  box-shadow: var(--gv-shadow-surface);
  min-width: 0;
}

/* Primary focal workspace card: distinct elevation + top forged accent rail */
.gv-card--featured {
  border-color: var(--border-card);
  border-top: 3px solid var(--accent);
  box-shadow: var(--gv-shadow-featured);
  position: relative;
}

/* Supporting rail panels: lighter flat visual weight to defer to the focal card (R-14) */
.gv-rail-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--gv-radius-lg);
  padding: clamp(1.1rem, 2vw, 1.45rem);
  min-width: 0;
}

.gv-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}

.gv-card-title {
  font-size: 1.075rem;
  font-weight: 700;
  color: var(--text-primary);
}

.gv-card-meta {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Asymmetric Portal Grid (redeem main focus + supporting utility rail) */
.gv-portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(300px, 0.88fr);
  gap: 1.65rem;
  align-items: start;
}

.gv-rail-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.gv-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
}

.gv-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

/* Forms */
.gv-form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.gv-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.gv-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.gv-label-step {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-text);
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.gv-hint {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.gv-input,
.gv-select,
.gv-textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.72rem 1rem;
  border-radius: var(--gv-radius-md);
  border: 1.5px solid var(--border-strong);
  background-color: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.16s var(--gv-ease), box-shadow 0.16s var(--gv-ease), background-color 0.16s var(--gv-ease);
}

.gv-input:hover:not(:disabled),
.gv-select:hover:not(:disabled),
.gv-textarea:hover:not(:disabled) {
  border-color: var(--accent);
}

.gv-input:focus,
.gv-select:focus,
.gv-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

/* Primary 20-character voucher input well */
.gv-input--code {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  min-height: 58px;
  padding: 0.85rem 1rem;
  background-color: var(--bg-elevated);
}

.gv-input--code:focus {
  background-color: var(--bg-input);
}

.gv-textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.55;
}

.gv-input::placeholder,
.gv-textarea::placeholder {
  color: var(--text-tertiary);
}

/* Buttons */
.gv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 46px;
  padding: 0.7rem 1.25rem;
  border-radius: var(--gv-radius-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.925rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.16s var(--gv-ease),
    border-color 0.16s var(--gv-ease),
    color 0.16s var(--gv-ease),
    transform 0.14s var(--gv-ease),
    box-shadow 0.16s var(--gv-ease);
}

.gv-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.gv-btn:active:not(:disabled) {
  transform: translateY(0);
}

.gv-btn--primary {
  background-color: var(--accent);
  color: var(--accent-on);
  box-shadow: var(--gv-shadow-btn);
}

.gv-btn--primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
}

.gv-btn--secondary {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.gv-btn--secondary:hover:not(:disabled) {
  background-color: var(--bg-hover);
  border-color: var(--accent);
}

.gv-btn--ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.gv-btn--ghost:hover:not(:disabled) {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.gv-btn--danger {
  background-color: var(--status-err-bg);
  color: var(--status-err-text);
  border-color: var(--status-err-border);
}

.gv-btn--danger:hover:not(:disabled) {
  filter: brightness(0.96);
}

.gv-btn--success {
  background-color: var(--status-ok-bg);
  color: var(--status-ok-text);
  border-color: var(--status-ok-border);
}

.gv-btn--success:hover:not(:disabled) {
  filter: brightness(0.96);
}

.gv-btn--google {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: var(--gv-shadow-surface);
}

.gv-btn--google:hover:not(:disabled) {
  background-color: var(--bg-elevated);
  border-color: var(--accent);
}

.gv-btn--full {
  width: 100%;
}

.gv-btn--sm {
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  font-size: 0.825rem;
  border-radius: var(--gv-radius-sm);
}

.gv-btn--icon {
  min-width: 44px;
  min-height: 44px;
  padding: 0.55rem;
}

/* Status boxes & badges */
.gv-alert {
  padding: 1rem 1.15rem;
  border-radius: var(--gv-radius-md);
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  line-height: 1.55;
}

.gv-alert[hidden] {
  display: none;
}

.gv-alert--error {
  background-color: var(--status-err-bg);
  color: var(--status-err-text);
  border-color: var(--status-err-border);
}

.gv-alert--success {
  background-color: var(--status-ok-bg);
  color: var(--status-ok-text);
  border-color: var(--status-ok-border);
}

.gv-alert--info {
  background-color: var(--status-info-bg);
  color: var(--status-info-text);
  border-color: var(--status-info-border);
}

.gv-alert--warn {
  background-color: var(--status-warn-bg);
  color: var(--status-warn-text);
  border-color: var(--status-warn-border);
}

.gv-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--gv-radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.gv-badge--ok {
  background-color: var(--status-ok-bg);
  color: var(--status-ok-text);
  border-color: var(--status-ok-border);
}

.gv-badge--warn {
  background-color: var(--status-warn-bg);
  color: var(--status-warn-text);
  border-color: var(--status-warn-border);
}

.gv-badge--info {
  background-color: var(--status-info-bg);
  color: var(--status-info-text);
  border-color: var(--status-info-border);
}

.gv-badge--err {
  background-color: var(--status-err-bg);
  color: var(--status-err-text);
  border-color: var(--status-err-border);
}

.gv-badge--neutral {
  background-color: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

/* Info instruction box (post-redeem) */
.gv-install-box {
  margin-top: 0.85rem;
  padding: 1rem 1.15rem;
  border-radius: var(--gv-radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.7;
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.gv-redeem-help-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--status-ok-border);
}

/* Local recent redeems list (guest-safe device backup) */
.gv-recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.gv-recent-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--gv-radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-elevated);
}

.gv-recent-info {
  min-width: 0;
  flex: 1 1 200px;
}

.gv-recent-title {
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.gv-recent-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Interactive storefront game catalog grid */
.gv-catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
}

.gv-catalog-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1.05rem 1.15rem;
  border-radius: var(--gv-radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-elevated);
  min-width: 0;
  transition: border-color 0.16s var(--gv-ease), background-color 0.16s var(--gv-ease);
}

.gv-catalog-item:hover {
  border-color: var(--accent);
  background-color: var(--bg-surface);
}

.gv-catalog-top {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.gv-catalog-name {
  font-family: "Chakra Petch", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  word-break: break-word;
}

.gv-catalog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-subtle);
}

.gv-catalog-price {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.gv-catalog-more {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}

/* Resource action rows in supporting rail */
.gv-resource-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.gv-resource-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  min-height: 60px;
  border-radius: var(--gv-radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-elevated);
  text-decoration: none;
  color: var(--text-primary);
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition:
    border-color 0.16s var(--gv-ease),
    background-color 0.16s var(--gv-ease),
    transform 0.14s var(--gv-ease);
}

.gv-resource-item:hover {
  border-color: var(--accent);
  background-color: var(--bg-hover);
  transform: translateY(-1px);
}

.gv-resource-item:active {
  transform: translateY(0);
}

.gv-resource-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--gv-radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gv-resource-body {
  flex: 1;
  min-width: 0;
}

.gv-resource-title {
  display: block;
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-primary);
}

.gv-resource-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
  line-height: 1.4;
}

.gv-divider {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 1.35rem 0;
}

/* Tables */
.gv-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--gv-radius-md);
  background-color: var(--bg-surface);
}

.gv-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.gv-table th {
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background-color: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.gv-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.gv-table tbody tr:last-child td {
  border-bottom: 0;
}

.gv-table tbody tr:hover {
  background-color: var(--bg-hover);
}

/* Game picker tiles (Seller panel) */
.gv-game-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 1rem 1.1rem;
  border-radius: var(--gv-radius-md);
  border: 1px solid var(--border-card);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  text-align: left;
  font-family: inherit;
  min-height: 84px;
  transition:
    border-color 0.16s var(--gv-ease),
    background-color 0.16s var(--gv-ease),
    transform 0.14s var(--gv-ease);
}

.gv-game-tile:hover:not(:disabled) {
  border-color: var(--accent);
  background-color: var(--bg-elevated);
  transform: translateY(-1px);
}

.gv-game-tile:active:not(:disabled) {
  transform: translateY(0);
}

.gv-game-tile-name {
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--text-primary);
}

.gv-game-tile-price {
  font-size: 0.8125rem;
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent-text);
  font-weight: 600;
}

/* Code output banner (Seller panel) */
.gv-code-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.45rem;
  border-radius: var(--gv-radius-lg);
  border: 1.5px solid var(--accent-border);
  background-color: var(--accent-tint);
}

.gv-code-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  word-break: break-all;
}

/* Modal dialog */
.gv-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(11, 14, 20, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.gv-modal-backdrop[hidden] {
  display: none;
}

.gv-modal {
  width: 100%;
  max-width: 820px;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--gv-radius-lg);
  padding: clamp(1rem, 2vw, 1.4rem);
  box-shadow: var(--gv-shadow-modal);
}

.gv-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.gv-video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #0b0e14;
  border-radius: var(--gv-radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.gv-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Loading & Empty States */
.gv-state {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.gv-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: gv-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes gv-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Toast notifications */
.gv-toast-stack {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: min(360px, calc(100vw - 2rem));
}

.gv-toast {
  padding: 0.85rem 1.05rem;
  border-radius: var(--gv-radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--border-card);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--gv-shadow-modal);
  transition: opacity 0.2s var(--gv-ease), transform 0.2s var(--gv-ease);
}

.gv-toast--success {
  background-color: var(--status-ok-bg);
  color: var(--status-ok-text);
  border-color: var(--status-ok-border);
}

.gv-toast--error {
  background-color: var(--status-err-bg);
  color: var(--status-err-text);
  border-color: var(--status-err-border);
}

.gv-toast--leaving {
  opacity: 0;
  transform: translateY(6px);
}

/* Footer */
.gv-footer {
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  padding: 1.35rem 0;
}

.gv-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.gv-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.15rem;
}

.gv-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  padding: 0.35rem 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.gv-footer-links a:hover {
  color: var(--accent-text);
  text-decoration: underline;
}

/* Toolbar & Filters */
.gv-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
}

.gv-toolbar > :first-child {
  flex: 1 1 260px;
  min-width: 0;
}

.gv-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  flex: 0 1 auto;
}

.gv-toolbar-search {
  min-height: 44px;
  width: 220px;
  max-width: 100%;
}

.gv-toolbar-select {
  min-height: 44px;
  width: 190px;
  max-width: 100%;
}

/* Real-time Stat Strip */
.gv-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.65rem;
}

.gv-stat-pill {
  padding: 1rem 1.15rem;
  border-radius: var(--gv-radius-md);
  border: 1px solid var(--border-card);
  background-color: var(--bg-surface);
  box-shadow: var(--gv-shadow-surface);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.gv-stat-pill-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.gv-stat-pill-value {
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

/* Utility spacing */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Authentication & Account UI */
.gv-auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem) 1rem;
}

.gv-auth-card {
  width: 100%;
  max-width: 450px;
}

.gv-divider-text {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.25rem 0;
}

.gv-divider-text::before,
.gv-divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border-subtle);
}

.gv-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.25rem 0.2rem 0.75rem;
  border-radius: var(--gv-radius-md);
  border: 1px solid var(--border-card);
  background-color: var(--bg-surface);
  font-size: 0.825rem;
  color: var(--text-primary);
}

.gv-user-chip[hidden] {
  display: none;
}

.gv-user-name {
  font-weight: 600;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gv-user-name-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.35rem 0;
}

.gv-user-name-link:hover {
  color: var(--accent-text);
  text-decoration: underline;
}

.gv-inline-link {
  background: none;
  border: 0;
  padding: 0.2rem 0;
  color: var(--accent-text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gv-inline-link:hover {
  color: var(--text-primary);
}

/* Loyalty progress, reward cards & guest prompt */
.gv-progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.gv-progress-fill {
  height: 100%;
  background-color: var(--accent);
  border-radius: 999px;
  transition: width 0.35s var(--gv-ease);
}

.gv-reward-box {
  padding: 1.25rem;
  border-radius: var(--gv-radius-md);
  border: 1.5px solid var(--accent-border);
  background-color: var(--accent-tint);
}

.gv-loyalty-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  flex-wrap: wrap;
  padding: 0.95rem 1.1rem;
  margin-bottom: 1.25rem;
  border-radius: var(--gv-radius-md);
  border: 1px solid var(--accent-border);
  background-color: var(--accent-tint);
  color: var(--text-primary);
  font-size: 0.86rem;
  line-height: 1.45;
}

.gv-loyalty-prompt[hidden] {
  display: none;
}

.gv-loyalty-prompt-text {
  flex: 1 1 220px;
}

.gv-loyalty-prompt-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

/* Mobile Bottom Navigation Bar (visible only on mobile breakpoints, R-03) */
.gv-mobile-nav {
  display: none;
}

/* One-shot subtle entrance transitions (MOTION 2, R-19) */
@media (prefers-reduced-motion: no-preference) {
  .gv-page-head,
  .gv-card--featured {
    animation: gv-enter 0.28s var(--gv-ease) both;
  }

  .gv-modal {
    animation: gv-modal-in 0.2s var(--gv-ease) both;
  }
}

@keyframes gv-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gv-modal-in {
  from {
    opacity: 0;
    transform: scale(0.98) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ==========================================================================
   Responsive State 2: Tablet / Small Laptop (641px - 960px)
   Avoids squeezed 2-col desktop AND stretched 1-col phone stack.
   ========================================================================== */
@media (max-width: 960px) {
  .gv-portal-grid {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }

  /* Side-by-side supporting panels on tablet so vertical rhythm stays balanced */
  .gv-rail-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }

  .gv-two-col {
    grid-template-columns: 1fr;
  }

  .gv-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gv-theme-label {
    display: none;
  }

  .gv-theme-btn {
    padding: 0.55rem;
  }
}

/* ==========================================================================
   Responsive State 3: Mobile Phone (<= 640px)
   Distinct mobile layout with slim topbar + thumb-reachable bottom nav.
   ========================================================================== */
@media (max-width: 640px) {
  .gv-topbar-inner {
    min-height: 58px;
    padding: 0.45rem 0;
    gap: 0.5rem;
  }

  .gv-brand-sub {
    display: none;
  }

  .gv-brand-mark {
    width: 36px;
    height: 36px;
  }

  .gv-brand-title {
    font-size: 1.02rem;
  }

  /* Collapse desktop link bar out of topbar on mobile (moved to bottom nav) */
  .gv-nav-links {
    display: none;
  }

  .gv-nav-actions {
    margin-left: 0;
    gap: 0.4rem;
  }

  .gv-user-name,
  .gv-user-name-link {
    max-width: 96px;
  }

  .gv-rail-stack {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .gv-catalog-grid {
    grid-template-columns: 1fr;
  }

  .gv-stat-strip {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .gv-stat-pill {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
  }

  .gv-toolbar-group {
    width: 100%;
  }

  .gv-toolbar-search,
  .gv-toolbar-select {
    width: 100%;
  }

  /* Reserve space so bottom mobile nav NEVER covers content or footer */
  body.has-mobile-nav .gv-footer {
    padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  }

  body.has-mobile-nav .gv-toast-stack {
    bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    left: 1rem;
    right: 1rem;
    max-width: none;
  }

  .gv-mobile-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-card);
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    gap: 0.25rem;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  }

  [data-theme="dark"] .gv-mobile-nav {
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.45);
  }

  .gv-mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 50px;
    padding: 0.3rem 0.25rem;
    border-radius: var(--gv-radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: background-color 0.15s var(--gv-ease), color 0.15s var(--gv-ease);
  }

  .gv-mobile-nav-link:active {
    background-color: var(--bg-hover);
  }

  .gv-mobile-nav-link--active {
    color: var(--accent-text);
    background-color: var(--accent-tint);
    border-color: var(--accent-border);
    font-weight: 700;
  }
}

/* Reduced motion (R-39) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
