/* ===================================================================
   ClankerSetups - design system
   Dark motorsport theme · electric blue + hot pink + acid yellow
   Palette pulled from the ClankerSetups badge logo. One stylesheet.
   =================================================================== */

:root {
  color-scheme: dark;
  --bg:        #05061c;
  --bg-2:      #0a0f2e;
  --panel:     rgba(14, 22, 58, 0.72);
  --panel-2:   rgba(22, 32, 76, 0.55);
  --stroke:    rgba(70, 120, 255, 0.20);
  --stroke-2:  rgba(255, 46, 115, 0.34);
  --ink:       #eef2ff;
  --ink-dim:   #aeb9e6;
  --ink-faint: #7683b6;
  --pink:      #ff2e73;
  --pink-2:    #ff5c93;
  --violet:    #2f6bff;   /* electric blue - primary secondary (from logo outline) */
  --blue:      #2f6bff;
  --cyan:      #3d8bff;   /* bright blue accent (tags, labels) */
  --yellow:    #d8f000;   /* acid yellow accent (from logo tagline) */
  --good:      #36e29b;
  --warn:      #ffd23c;
  --grad:      linear-gradient(135deg, #ff2e73 0%, #2f6bff 100%);
  --grad-cy:   linear-gradient(135deg, #3d8bff 0%, #2f6bff 100%);
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 18px 50px rgba(0,0,0,.55);
  --glow-pink: 0 0 0 1px rgba(255,46,115,.4), 0 10px 40px rgba(255,46,115,.30);
  --font:      "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display:   "Saira Condensed", "Oswald", "Arial Narrow", sans-serif;
  /* safe-area insets for notched phones (iPhone X+) */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
  /* Live chat viewport height (overridden by JS for iOS keyboard awareness) */
  --chat-vh: 100dvh;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  /* prevent text inflation on iOS rotate */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* iOS tap highlight removal */
  -webkit-tap-highlight-color: transparent;
}
button, .btn, a { -webkit-tap-highlight-color: transparent; }

/* atmospheric neon background applied to every page */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(1100px 600px at 82% -8%, rgba(255,46,115,.16), transparent 60%),
    radial-gradient(900px 700px at 8% 12%, rgba(47,107,255,.22), transparent 55%),
    radial-gradient(1200px 900px at 50% 120%, rgba(20,50,170,.28), transparent 60%),
    linear-gradient(180deg, #070b28 0%, #04051a 100%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; opacity: .35; pointer-events: none;
  background-image:
    linear-gradient(rgba(70,120,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70,120,255,.055) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 80%);
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 80%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: min(1240px, 92vw); margin-inline: auto; }

/* ---------- typography ---------- */
h1,h2,h3 { line-height: 1.05; letter-spacing: -.01em; }
.display {
  font-family: var(--display);
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .28em;
  text-transform: uppercase; color: var(--yellow);
}
.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.text-grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(6,9,30,.92), rgba(6,9,30,.55));
  border-bottom: 1px solid var(--stroke);
  /* respect iPhone notch */
  padding-top: var(--safe-top);
}
.nav-inner {
  width: min(1240px, 92vw); margin-inline: auto;
  height: 66px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { height: 42px; filter: drop-shadow(0 0 12px rgba(47,107,255,.55)); }
.nav-links { display: flex; gap: 26px; margin-left: 6px; }
.nav-links a {
  font-size: .9rem; font-weight: 600; color: var(--ink-dim);
  padding: 6px 0; position: relative; transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--grad); border-radius: 2px;
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nav-toggle {
  display: none; background: none; border: 0; color: var(--ink); cursor: pointer;
  font-size: 1.4rem; padding: 8px; min-width: 44px; min-height: 44px;
  display: none; align-items: center; justify-content: center;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: .92rem; letter-spacing: .01em;
  padding: 12px 22px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s;
  white-space: nowrap; font-family: var(--font);
  /* ensure comfortable touch target on mobile */
  min-height: 44px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--glow-pink); }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(255,46,115,.6), 0 14px 50px rgba(255,46,115,.5); }
.btn-ghost { background: rgba(255,255,255,.04); color: var(--ink); border-color: var(--stroke); }
.btn-ghost:hover { border-color: var(--stroke-2); background: rgba(255,255,255,.07); }
.btn-cyan { background: var(--grad-cy); color: #04121a; }
.btn-sm { padding: 8px 14px; font-size: .82rem; border-radius: 10px; min-height: 36px; }
.btn-block { width: 100%; }

/* Discord join button (Discord brand color #5865F2 / Blurple) */
.btn-discord {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font); font-weight: 700; font-size: .95rem;
  color: #fff; padding: 12px 22px; border-radius: 12px; border: 0;
  background: #5865F2; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .14s, box-shadow .2s, filter .2s, background .2s;
  box-shadow: 0 6px 18px rgba(88,101,242,.28);
  min-height: 44px;
}
.btn-discord:hover  { background: #4752C4; box-shadow: 0 8px 24px rgba(88,101,242,.5); }
.btn-discord:active { transform: translateY(1px); }
.btn-discord .ic-d { width: 22px; height: 22px; flex-shrink: 0; }
.btn-discord.btn-sm { padding: 9px 16px; font-size: .85rem; gap: 8px; border-radius: 10px; }
.btn-discord.btn-sm .ic-d { width: 18px; height: 18px; }
.btn-discord.btn-block { width: 100%; justify-content: center; }

/* ---------- generic cards / panels ---------- */
.card {
  background: var(--panel); border: 1px solid var(--stroke);
  border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.pad { padding: 22px; }
.pad-lg { padding: 30px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(47,107,255,.16); border: 1px solid var(--stroke);
  color: var(--ink-dim); text-transform: uppercase;
}
.pill.live { color: var(--good); border-color: rgba(54,226,155,.4); background: rgba(54,226,155,.1); }
.pill.soon { color: var(--warn); border-color: rgba(255,210,60,.35); background: rgba(255,210,60,.08); }
.pill.pink { color: var(--pink-2); border-color: var(--stroke-2); background: rgba(255,46,115,.12); }

.tag { font-size:.7rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color: var(--cyan); }
.rating { color: var(--warn); font-weight: 700; font-size: .85rem; }
.delta { font-family: var(--display); font-style: italic; }
.delta.pos { color: var(--good); }
.delta.neg { color: var(--pink-2); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .5; filter: hue-rotate(-42deg) saturate(1.12); }
.hero-media::after {
  content:""; position:absolute; inset:0;
  background: linear-gradient(90deg, rgba(5,6,28,.95) 8%, rgba(5,6,28,.42) 55%, rgba(5,6,28,.85) 100%),
              radial-gradient(120% 90% at 78% 0%, rgba(47,107,255,.18), transparent 60%),
              linear-gradient(180deg, transparent 40%, var(--bg) 100%);
}
.hero-inner { padding: 92px 0 80px; }
.hero-logo {
  width: auto; height: clamp(120px, 20vw, 216px);
  margin: 0 0 22px -6px;
  filter: drop-shadow(0 14px 40px rgba(47,107,255,.45));
}
.hero h1 { font-size: clamp(2.8rem, 7vw, 5.4rem); }
.hero p.lead { font-size: 1.15rem; color: var(--ink-dim); max-width: 42ch; margin-top: 14px; }

/* ---------- layout helpers ---------- */
.grid { display: grid; gap: 18px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.section { padding: 64px 0; }
/* CTA card: heading, copy and buttons all centered together (was: heading
   defaulted left while the copy/buttons centered, making it look off-center) */
.cta-card { text-align: center; }
.cta-card .btn-row { justify-content: center; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- product (setup/wrap) cards ---------- */
.product {
  overflow: hidden; cursor: pointer; transition: transform .18s, border-color .2s;
  display: flex; flex-direction: column;
}
.product:hover { transform: translateY(-4px); border-color: var(--stroke-2); }
.product .thumb {
  aspect-ratio: 16/10; position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 30% 0%, rgba(47,107,255,.35), rgba(6,9,30,.9));
}
.product .thumb img { width:100%; height:100%; object-fit: cover; }
.product .thumb::after {
  content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, transparent 45%, rgba(6,4,18,.85));
}
.product .thumb .badge { position:absolute; top:10px; left:10px; z-index:2; }
.product .thumb .dl {
  position:absolute; bottom:10px; right:10px; z-index:2;
  width:34px; height:34px; border-radius:9px; display:grid; place-items:center;
  background: var(--grad); color:#fff; box-shadow: var(--glow-pink); font-size:1rem;
}
.product .body { padding: 14px 16px 16px; display:flex; flex-direction:column; gap:6px; }
.product .body h3 { font-size: 1rem; }
.product .meta { display:flex; justify-content:space-between; align-items:center; margin-top:4px; }

/* track-tile background (CSS-art for setup thumbnails without photos) */
.track-tile { position:absolute; inset:0; }
.track-tile svg { width:100%; height:100%; }

/* ---------- marketplace layout (sidebar + grid) ---------- */
.shop { display:grid; grid-template-columns: 232px 1fr; gap: 26px; align-items:start; }
.filters { position: sticky; top: 86px; }
.filters h4 { font-size:.72rem; letter-spacing:.2em; text-transform:uppercase; color:var(--ink-faint); margin: 18px 0 10px; }
.filters h4:first-child { margin-top: 0; }
.check { display:flex; align-items:center; gap:9px; padding:5px 0; font-size:.88rem; color:var(--ink-dim); cursor:pointer; }
.check input { accent-color: var(--pink); width:15px; height:15px; }
.search {
  display:flex; align-items:center; gap:10px; padding:11px 16px;
  background: var(--panel-2); border:1px solid var(--stroke); border-radius:12px;
}
.search input { flex:1; background:none; border:0; color:var(--ink); font-size:.95rem; outline:none; font-family:var(--font); }
.search input::placeholder { color: var(--ink-faint); }
.swatches { display:flex; gap:8px; flex-wrap:wrap; }
.swatch { width:22px; height:22px; border-radius:6px; border:1px solid rgba(255,255,255,.15); cursor:pointer; }

/* ---------- dashboard / app shell ---------- */
.app { display:grid; grid-template-columns: 220px 1fr; gap: 26px; align-items:start; }
.side { position: sticky; top: 86px; padding: 12px; }
.side a {
  display:flex; align-items:center; gap:11px; padding:11px 14px; border-radius:10px;
  font-size:.9rem; font-weight:600; color:var(--ink-dim); transition: all .15s;
}
.side a:hover { background: rgba(255,255,255,.04); color: var(--ink); }
.side a.active { background: var(--grad); color:#fff; box-shadow: var(--glow-pink); }
.side a .ic { width:18px; text-align:center; opacity:.9; }

.stat { font-family: var(--display); font-style: italic; font-size: 2.4rem; line-height:1; }
.kv { display:flex; justify-content:space-between; padding:9px 0; border-bottom:1px solid var(--stroke); font-size:.9rem; }
.kv:last-child { border-bottom:0; }
.kv .k { color: var(--ink-faint); }
.list-row { display:flex; align-items:center; gap:13px; padding:12px 0; border-bottom:1px solid var(--stroke); }
.list-row:last-child { border-bottom:0; }
.list-row .ico { width:40px; height:40px; border-radius:10px; background: var(--panel-2); display:grid; place-items:center; flex-shrink:0; border:1px solid var(--stroke); }
.list-row .grow { flex:1; min-width:0; }
.list-row small { color: var(--ink-faint); }

/* WyConnect sign-in button - compact brand pill (navy to pink) */
.wy-signin {
  font-family: var(--font); font-weight: 700; font-size: .82rem; color: #fff;
  padding: 9px 16px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(100deg, #0d1642 0%, #23306e 45%, #b81f52 100%);
  box-shadow: 0 6px 18px rgba(120,30,80,.35);
  transition: transform .14s, box-shadow .2s, filter .2s;
  min-height: 36px;
}
.wy-signin:hover { filter: brightness(1.12); box-shadow: 0 8px 24px rgba(160,40,110,.5); }
.wy-signin:active { transform: translateY(1px); }

/* avatar / account chip */
.acct { display:flex; align-items:center; gap:10px; cursor:pointer; text-decoration:none; color:inherit; }
.acct:hover .avatar { box-shadow: 0 0 0 2px rgba(255,90,220,.4); }
.avatar {
  width:34px; height:34px; border-radius:50%;
  background:var(--grad); display:grid; place-items:center;
  font-weight:800; color:#fff; font-size:.9rem; flex-shrink:0;
  overflow:hidden; transition: box-shadow .2s;
}
.avatar img { width:100%; height:100%; object-fit:cover; display:block; }
.menu { position:relative; }
.menu-pop {
  position:absolute; right:0; top:48px; min-width:190px; padding:8px; display:none;
  background: var(--bg-2); border:1px solid var(--stroke); border-radius:12px; box-shadow:var(--shadow); z-index:60;
}
.menu-pop.open { display:block; }
.menu-pop a, .menu-pop button { display:block; width:100%; text-align:left; padding:9px 12px; border-radius:8px; font-size:.88rem; color:var(--ink-dim); background:none; border:0; cursor:pointer; font-family:var(--font); min-height:36px; }
.menu-pop a:hover, .menu-pop button:hover { background: rgba(255,255,255,.05); color:var(--ink); }

/* ---------- AI tuner chat ---------- */
.chat { display:flex; flex-direction:column; gap:14px; min-height: 360px; }
.msg { max-width: 78%; padding: 13px 16px; border-radius: 14px; font-size:.94rem; line-height:1.5; }
.msg.ai { align-self:flex-start; background: var(--panel); border:1px solid var(--stroke); border-bottom-left-radius:4px; }
.msg.me { align-self:flex-end; background: var(--grad); color:#fff; border-bottom-right-radius:4px; }
.msg .who { font-size:.7rem; letter-spacing:.1em; text-transform:uppercase; color:var(--cyan); margin-bottom:4px; }
.composer { display:flex; gap:10px; margin-top:16px; }
.composer input {
  flex:1; padding:13px 16px; border-radius:12px; background:var(--panel-2);
  border:1px solid var(--stroke); color:var(--ink); outline:none;
  font-size:.95rem; font-family:var(--font);
  /* prevent iOS zoom on focus */
  -webkit-appearance: none; appearance: none;
}

/* ---------- countdown ---------- */
.countdown { display:flex; gap:14px; flex-wrap:wrap; }
.count-box { min-width:84px; text-align:center; padding:16px; }
.count-box .num { font-family:var(--display); font-style:italic; font-size:2.6rem; line-height:1; background:var(--grad); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.count-box .lbl { font-size:.66rem; letter-spacing:.2em; text-transform:uppercase; color:var(--ink-faint); margin-top:6px; }

/* ---------- pricing ---------- */
.plans { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; align-items:stretch; }
.plan { display:flex; flex-direction:column; gap:16px; position:relative; padding:26px 24px; }
.plan.featured { border-color: var(--stroke-2); box-shadow: var(--glow-pink); }
.plan .price { font-family:var(--display); font-style:italic; font-size:3rem; line-height:1; }
.plan .price span { font-size:1rem; font-style:normal; color:var(--ink-faint); font-family:var(--font); }
.plan ul { list-style:none; display:flex; flex-direction:column; gap:10px; flex:1; }
.plan li { display:flex; gap:9px; font-size:.9rem; color:var(--ink-dim); }
.plan li::before { content:"✦"; color:var(--pink-2); }
.toggle { display:inline-flex; padding:4px; background:var(--panel-2); border:1px solid var(--stroke); border-radius:999px; }
.toggle button { border:0; background:none; color:var(--ink-dim); padding:8px 18px; border-radius:999px; font-weight:600; cursor:pointer; font-size:.85rem; font-family:var(--font); }
.toggle button.on { background:var(--grad); color:#fff; }

/* ---------- footer ---------- */
.footer { border-top:1px solid var(--stroke); margin-top:70px; padding:50px 0 34px; font-size:.88rem; padding-bottom: calc(34px + var(--safe-bottom)); }
.foot-top { display:grid; grid-template-columns:1.5fr 2fr; gap:44px; }
.foot-brand img { height:46px; filter:drop-shadow(0 0 12px rgba(47,107,255,.55)); }
.foot-brand p { color:var(--ink-faint); margin-top:14px; max-width:44ch; line-height:1.65; }
.foot-links { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; }
.foot-links h5 { color:var(--ink); font-size:.74rem; letter-spacing:.16em; text-transform:uppercase; margin-bottom:12px; }
.foot-links a { display:block; padding:5px 0; color:var(--ink-dim); }
.foot-links a:hover { color:var(--pink-2); }
.foot-base { margin-top:36px; padding-top:20px; border-top:1px solid var(--stroke); display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; color:var(--ink-faint); }
.foot-partner { color:var(--pink-2); font-weight:600; }
.foot-partner:hover { text-decoration:underline; }
.foot-discord { display:inline-flex; align-items:center; gap:11px; color:var(--ink); font-weight:600; }
.foot-discord::before { content:""; display:inline-block; width:15px; height:15px; flex-shrink:0; margin-right:1px;
  background:#5865F2; -webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -28.5 256 256'><path d='M216.856 16.597A208.502 208.502 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046-19.692-2.961-39.203-2.961-58.533 0-1.832-4.4-4.55-9.933-6.846-14.046a207.809 207.809 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161.094 161.094 0 0 0 79.735 175.3a136.413 136.413 0 0 1-21.846-10.632 108.636 108.636 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a131.66 131.66 0 0 0 5.355 4.237 136.07 136.07 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848 21.142-6.58 42.646-16.637 64.815-33.213 5.316-56.288-9.08-105.09-38.056-148.36ZM85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2c12.867 0 23.236 11.804 23.015 26.2.02 14.375-10.148 26.18-23.015 26.18Zm85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2 0 14.375-10.148 26.18-23.015 26.18Z'/></svg>") no-repeat center/contain;
  mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -28.5 256 256'><path d='M216.856 16.597A208.502 208.502 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046-19.692-2.961-39.203-2.961-58.533 0-1.832-4.4-4.55-9.933-6.846-14.046a207.809 207.809 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161.094 161.094 0 0 0 79.735 175.3a136.413 136.413 0 0 1-21.846-10.632 108.636 108.636 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a131.66 131.66 0 0 0 5.355 4.237 136.07 136.07 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848 21.142-6.58 42.646-16.637 64.815-33.213 5.316-56.288-9.08-105.09-38.056-148.36ZM85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2c12.867 0 23.236 11.804 23.015 26.2.02 14.375-10.148 26.18-23.015 26.18Zm85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2 0 14.375-10.148 26.18-23.015 26.18Z'/></svg>") no-repeat center/contain;
}
.foot-discord:hover { color:var(--cyan); }

/* ---------- AI status + coming soon ---------- */
.ai-status { display:inline-flex; align-items:center; gap:8px; font-size:.8rem; color:var(--ink-dim); }
.ai-dot { width:9px; height:9px; border-radius:50%; background:var(--ink-faint); transition:.3s; }
.ai-dot.online { background:var(--good); box-shadow:0 0 10px var(--good); }
.ai-dot.offline { background:#ff5470; box-shadow:0 0 10px #ff5470; }
.soon-wrap { text-align:center; max-width:640px; margin:60px auto; padding: 0 4vw; }
.soon-badge { font-family:var(--display); font-style:italic; font-size:.9rem; letter-spacing:.2em; color:var(--pink-2); text-transform:uppercase; }
.soon-wrap h1 { font-size:clamp(2.4rem,6vw,4rem); margin:12px 0; }
.soon-list { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-top:24px; color:var(--ink-faint); font-size:.85rem; }

/* ---------- gate notice ---------- */
.gate { text-align:center; padding:70px 20px; max-width:520px; margin-inline:auto; }
.gate .avatar { margin:0 auto 18px; width:54px; height:54px; }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .nav-links { position:fixed; inset:calc(66px + var(--safe-top)) 0 auto 0; flex-direction:column; gap:0;
    background:var(--bg-2); border-bottom:1px solid var(--stroke); padding:8px 6vw 16px; display:none; z-index:49; }
  .nav-links.open { display:flex; }
  .nav-links a { padding:14px 0; border-bottom:1px solid var(--stroke); min-height: 44px; display:flex; align-items:center; }
  .nav-links a:last-child { border-bottom:0; }
  .nav-toggle { display:flex; }
  .shop, .app { grid-template-columns: 1fr; }
  .filters, .side { position:static; }
  .cards-3, .cards-2, .plans { grid-template-columns: 1fr 1fr; }
  /* hero is a touch smaller on tablet */
  .hero-inner { padding: 72px 0 60px; }
  /* section padding tighter */
  .section { padding: 48px 0; }
  /* footer tighter */
  .foot-top { grid-template-columns:1fr; gap:28px; }
  .foot-links { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
@media (max-width: 720px) {
  .nav-inner { gap: 14px; height: 60px; }
  .nav-links { inset: calc(60px + var(--safe-top)) 0 auto 0; }
  .brand img { height: 34px; }
  .nav-links a { font-size: 1rem; }
}
@media (max-width: 620px) {
  .cards-3, .cards-2, .plans, .foot-links { grid-template-columns: 1fr; }
  .hero-inner { padding: 56px 0 44px; }
  .hero h1 { font-size: clamp(2.2rem, 9vw, 3.2rem); }
  .hero p.lead { font-size: 1rem; }
  .msg { max-width: 90%; }
  /* Stack the row of buttons on mobile into full-width */
  .row.btn-row > .btn,
  .row.btn-row > a.btn { flex: 1 1 100%; }
  /* Section tighter */
  .section { padding: 40px 0; }
  .card.pad-lg { padding: 22px; }
  .card.pad { padding: 18px; }
}
@media (max-width: 420px) {
  .wrap { width: 94vw; }
  .nav-inner { width: 94vw; }
  /* The plan price text breaks weirdly small; tighten */
  .plan .price { font-size: 2.4rem; }
}

/* ============================================================
   TUNER PAGE - mobile-first chat experience
   On phones the chat card becomes the entire viewport below the
   site header. Composer is sticky at the bottom. Hero / footer /
   aside are hidden. Suggestion chips collapse into a horizontal
   rail above the composer. A "?" button opens the aside as a
   bottom sheet.
   ============================================================ */

/* Info button (only visible on mobile) */
.info-btn {
  display: none;
  background: transparent; border: 1px solid var(--stroke);
  color: var(--ink-dim); padding: 0; cursor: pointer;
  width: 36px; height: 36px; border-radius: 10px;
  align-items: center; justify-content: center;
  font-family: var(--font); font-size: 1rem; font-weight: 700;
  line-height: 1; flex-shrink: 0;
  transition: color .15s, border-color .15s, background .15s;
}
.info-btn:hover { color: var(--ink); border-color: var(--stroke-2); background: rgba(255,255,255,.04); }
.info-btn:active { transform: translateY(1px); }

/* Tuner main: full-height container that holds the chat grid */
.tuner-main {
  display: block;
  padding-bottom: 0;
}

/* SFX toggle (top-right of chat card on desktop + mobile) */
.sfx-btn { background: transparent; border: 0; color: var(--ink-dim); padding: 4px; cursor: pointer; display:inline-flex; align-items:center; line-height:0; min-width: 44px; min-height: 44px; justify-content:center; }
.sfx-btn:hover { color: var(--ink); }
.sfx-btn .ic-sfx { width: 20px; height: 20px; }
.sfx-btn.muted .sfx-on { display: none; }
.sfx-btn:not(.muted) .sfx-off { display: none; }

/* Pass banner */
.pass-banner { display:none; align-items:center; gap:10px; margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; font-size: .84rem; background: radial-gradient(120% 160% at 0% 0%, rgba(61,139,255,.18), var(--panel)); border: 1px solid rgba(61,139,255,.35); color: var(--ink); }
.pass-banner.show { display: flex; }

/* Free messages meter */
.free-meter {
  display: none; align-items: center; gap: 10px;
  margin: 10px 0 0; font-size: .78rem; color: var(--ink-faint);
}
.free-meter.show { display: flex; }
.free-meter .dots { display:inline-flex; gap:5px; }
.free-meter .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,46,115,.4); border: 1px solid rgba(255,46,115,.55);
  transition: background .2s;
}
.free-meter .dot.used { background: transparent; opacity: .35; }

/* Chip row: wraps freely on desktop */
.chip-row { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.chip-row .btn { font-size:.78rem; padding:7px 12px; }

/* Typing cursor + streaming bubble */
.typing-cursor { display:inline-block; width:7px; height:14px; background: var(--pink-2); margin-left:2px; vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity:0; } }
.msg.ai.streaming { border-color: var(--stroke-2); box-shadow: 0 0 0 1px rgba(255,90,220,.2); }
.chat .msg { animation: msgIn .25s ease-out; }
@keyframes msgIn { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform:none; } }

/* Chat box: FIXED size on desktop. Mobile overrides below. */
.chat-wrap { display:flex; flex-direction:column; height: 540px; min-height: 540px; max-height: 540px; }
.chat {
  display:flex; flex-direction:column; gap:14px; flex:1 1 0; min-height: 0; max-height: 100%;
  overflow-y: auto; overflow-x: hidden; padding-right: 6px;
  scroll-behavior: smooth;
}
.chat::-webkit-scrollbar { width: 8px; }
.chat::-webkit-scrollbar-track { background: transparent; }
.chat::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(47,107,255,.5), rgba(255,46,115,.5)); border-radius: 999px; }
.chat { scrollbar-width: thin; scrollbar-color: rgba(47,107,255,.55) transparent; }

/* "Jump to latest" floating button (appears when scrolled up) */
.jump-latest {
  position: absolute; right: 18px; bottom: 14px;
  display: none; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--grad); color: #fff; border: 0;
  font-family: var(--font); font-weight: 700; font-size: .82rem;
  box-shadow: var(--glow-pink); cursor: pointer;
  z-index: 5; transition: transform .15s;
}
.jump-latest:hover { transform: translateY(-1px); }
.jump-latest.show { display: inline-flex; }
.jump-latest .badge {
  display:inline-flex; align-items:center; justify-content:center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: rgba(0,0,0,.25); font-size: .7rem; font-weight: 800;
}

/* Bottom-sheet defaults - hidden on desktop, only shown in the mobile media block.
   !important is needed because the mobile @media block redeclares display: block and
   we need to make sure desktop always wins, regardless of cascade or @media source order quirks. */
.info-backdrop { display: none !important; }
.info-sheet { display: none !important; }
.info-sheet .grab {
  width: 40px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.18); margin: 0 auto 16px;
}
.info-sheet h4 { font-size:.74rem; letter-spacing:.18em; text-transform:uppercase; color:var(--ink-faint); margin: 16px 0 10px; }
.info-sheet h4:first-child { margin-top: 4px; }
.info-sheet ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.info-sheet li { color: var(--ink-dim); font-size: .92rem; line-height: 1.5; padding-left: 18px; position: relative; }
.info-sheet li::before { content: "✦"; color: var(--pink-2); position: absolute; left: 0; top: 0; }
.info-sheet .close-btn {
  display: block; width: 100%; margin-top: 18px;
  padding: 12px; border: 0; border-radius: 12px;
  background: var(--grad); color: #fff; font-weight: 700;
  font-family: var(--font); font-size: .95rem; cursor: pointer;
  min-height: 44px;
}
.info-sheet.open { transform: translateY(0); }

/* ============================================================
   HAMBURGER - auth items (Garage, Team, Sign in/out)
   Injected into .nav-links by app.js when WyConnect session changes.
   On desktop these are just extra items in the row; on mobile they
   sit below the main links separated by a divider.
   ============================================================ */
.nav-sep,
.nav-signin, .nav-signout,
.nav-links a.lwc-auth-link {
  display: none;
}
@media (max-width: 768px) {
  .nav-sep {
    display: block; width: 100%; height: 1px;
    background: var(--stroke); margin: 8px 0;
    flex-shrink: 0;
  }
  .nav-signin, .nav-signout {
    font-family: var(--font); font-weight: 700; font-size: 1rem;
    color: var(--ink-dim); background: transparent; border: 0;
    padding: 14px 0; cursor: pointer; text-align: left;
    min-height: 44px; white-space: nowrap;
  }
  .nav-signin:hover, .nav-signout:hover { color: var(--pink-2); }
  .nav-signout { color: var(--ink-faint); }
  .nav-links a.lwc-auth-link {
    display: block;
    padding: 14px 0; min-height: 44px;
    font-weight: 600; font-size: 1rem; color: var(--ink-dim);
  }
  .nav-links a.lwc-auth-link:hover { color: var(--pink-2); }
}

/* ============================================================
   GARAGE - profile + owned items
   ============================================================ */
.garage-hero {
  display: grid; grid-template-columns: auto 1fr; gap: 22px;
  align-items: center;
  padding: 36px 32px;
  background: radial-gradient(120% 160% at 100% 0%, rgba(255,46,115,.16), var(--panel));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.garage-hero .avatar-lg {
  position: relative;
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 2.4rem; flex-shrink: 0;
  overflow: hidden; box-shadow: 0 8px 30px rgba(255,46,115,.35);
  cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.garage-hero .avatar-lg:hover { transform: scale(1.04); box-shadow: 0 10px 40px rgba(255,46,115,.55); }
.garage-hero .avatar-lg img { width:100%; height:100%; object-fit:cover; display:block; }
.garage-hero .avatar-lg .edit-dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-2); border: 2px solid var(--stroke-2);
  display: grid; place-items: center;
  color: var(--pink-2); font-size: .9rem;
}
.garage-hero h1 { font-family: var(--display); font-style: italic; font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 6px; }
.garage-hero .role-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ink-dim); font-size: .92rem; }
.iracing-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(56,140,255,.12); color: #6fa6ff;
  border: 1px solid rgba(56,140,255,.35);
}
.iracing-badge::before {
  content: ""; display: inline-block; width: 10px; height: 10px;
  background: #6fa6ff;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M3 21h2v-7H3v7zm4 0h2V10H7v11zm4 0h2V3h-2v18zm4 0h2v-9h-2v9zm4 0h2V7h-2v14z'/></svg>") no-repeat center/contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M3 21h2v-7H3v7zm4 0h2V10H7v11zm4 0h2V3h-2v18zm4 0h2v-9h-2v9zm4 0h2V7h-2v14z'/></svg>") no-repeat center/contain;
}

.profile-form { display: grid; gap: 16px; margin-top: 18px; }
.profile-form .field { display: flex; flex-direction: column; gap: 6px; }
.profile-form label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.profile-form input, .profile-form textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--stroke);
  color: var(--ink); font-family: var(--font); font-size: .95rem;
  outline: none; transition: border-color .15s;
}
.profile-form input:focus, .profile-form textarea:focus { border-color: var(--stroke-2); }
.profile-form input[readonly] { color: var(--ink-faint); cursor: default; }
.profile-form textarea { min-height: 80px; resize: vertical; font-family: var(--font); }
.profile-form .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.profile-form .row .grow { flex: 1 1 200px; }
.profile-form .help { font-size: .78rem; color: var(--ink-faint); }
.profile-form .saved { color: var(--good); font-size: .85rem; opacity: 0; transition: opacity .3s; }
.profile-form .saved.show { opacity: 1; }
.avatar-picker { display: none; }
.avatar-picker-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 700; color: var(--ink-dim);
  cursor: pointer; padding: 8px 14px; border-radius: 10px;
  border: 1px dashed var(--stroke);
  transition: border-color .15s, color .15s;
}
.avatar-picker-label:hover { border-color: var(--stroke-2); color: var(--ink); }

.garage-section {
  margin-top: 26px;
  padding: 24px 28px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.garage-section h2 { font-family: var(--display); font-style: italic; font-size: 1.4rem; margin: 0 0 6px; }
.garage-section .lead { color: var(--ink-dim); font-size: .92rem; margin: 0 0 16px; }
.garage-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.garage-item {
  background: var(--panel-2); border: 1px solid var(--stroke);
  border-radius: 12px; padding: 14px 16px;
}
.garage-item h3 { font-size: .98rem; margin: 0 0 4px; }
.garage-item p { font-size: .82rem; color: var(--ink-dim); margin: 0; }
.garage-item .meta { display: flex; gap: 10px; align-items: center; margin-top: 8px; font-size: .74rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .12em; }
.garage-empty { color: var(--ink-faint); font-size: .88rem; text-align: center; padding: 18px 0; }
.garage-pass { border-color: rgba(54,226,155,.4); background: radial-gradient(120% 160% at 0% 0%, rgba(54,226,155,.18), var(--panel-2)); }
.garage-pass .meta { color: var(--good); }
.garage-pass h3::before {
  content: "★ "; color: var(--good);
}

.danger-zone {
  margin-top: 26px;
  padding: 18px 22px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: rgba(0,0,0,.25);
}
.danger-zone h3 { color: var(--ink-dim); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 10px; }
.danger-zone .btn { background: transparent; color: var(--ink-faint); border: 1px solid var(--stroke); }
.danger-zone .btn:hover { color: #ff5470; border-color: #ff5470; background: rgba(255,84,112,.08); }

@media (max-width: 720px) {
  .garage-hero { grid-template-columns: 1fr; text-align: center; padding: 26px 20px; }
  .garage-hero .avatar-lg { margin: 0 auto; }
  .garage-hero .role-line { justify-content: center; }
  .garage-section { padding: 20px 18px; }
}

/* ============================================================
   MOBILE TUNER (<= 768px) - chat is the entire experience
   ============================================================ */
@media (max-width: 768px) {
  .tuner-main {
    height: calc(var(--chat-vh) - 60px - var(--safe-top) - var(--safe-bottom));
    /* Fallback if --chat-vh is unset: */
    min-height: calc(100dvh - 60px);
    padding: 0;
    display: flex;
    flex-direction: column;
    min-width: 0; /* allow grid to shrink instead of growing to fit content */
  }
  .tuner-grid {
    grid-template-columns: 1fr !important;
    height: 100%;
    gap: 0;
    min-width: 0;
  }
  /* The chat card becomes the only thing on screen */
  .chat-card {
    height: 100%;
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--stroke);
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    min-width: 0;
    overflow: hidden;
  }
  /* Sticky-ish chat header inside the card */
  .chat-card-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--stroke);
    background: rgba(6,9,30,.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-shrink: 0;
    gap: 10px;
    min-width: 0;
  }
  .chat-card-head .head-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 0; overflow: hidden; }
  .chat-card-head .head-title .tag { font-size: .66rem; }
  .chat-card-head .head-title .ai-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-card-head .head-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
  .info-btn { display: inline-flex; }
  /* Pass banner goes below the head */
  .pass-banner { margin: 0; border-radius: 0; border-left: 0; border-right: 0; flex-shrink: 0; }
  /* Chat area: flex 1, scrolls internally, edge-to-edge */
  .chat-wrap {
    height: auto !important; min-height: 0 !important; max-height: none !important;
    flex: 1 1 0;
    display: flex; flex-direction: column;
    position: relative;
    min-width: 0;
    overflow: hidden;
  }
  .chat {
    padding: 14px 14px 6px;
    flex: 1 1 0; min-height: 0;
    min-width: 0;
  }
  /* Composer area sticks to bottom of card, with safe-area padding */
  .composer-area {
    flex-shrink: 0;
    border-top: 1px solid var(--stroke);
    background: rgba(6,9,30,.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 12px calc(10px + var(--safe-bottom));
  }
  .composer { margin-top: 0; }
  .composer input { font-size: 16px; } /* iOS zoom blocker */
  /* Chip rail: horizontal scroll above the composer */
  .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 8px 0 0;
    padding: 0 0 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
  }
  .chip-row::-webkit-scrollbar { display: none; }
  .chip-row .btn {
    flex-shrink: 0;
    font-size: .76rem;
    padding: 8px 12px;
    min-height: 36px;
  }
  /* Hide hero, footer, aside on mobile chat page */
  .tuner-main + .footer,
  body.tuner .hero,
  body.tuner .footer { display: none; }
  body.tuner .tuner-aside { display: none; }
  /* The hero IS hidden on mobile for the tuner page only */
  body.tuner { background: var(--bg); }
  /* Make the messages slightly bigger for thumb reading */
  .msg { font-size: .95rem; padding: 12px 14px; min-width: 0; overflow-wrap: anywhere; word-wrap: break-word; }
  .msg.ai { max-width: 88%; }
  .msg.me { max-width: 88%; }
  /* Jump-to-latest goes above composer */
  .jump-latest { right: 14px; bottom: 14px; }
  /* Bottom sheet: now actually displayable on mobile (use !important to beat the base hide) */
  .info-backdrop {
    display: block !important;
    position: fixed; inset: 0; background: rgba(0,0,0,.55);
    opacity: 0; pointer-events: none; transition: opacity .25s;
    z-index: 199;
  }
  .info-backdrop.open { opacity: 1; pointer-events: auto; }
  .info-sheet {
    display: block !important;
    position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--bg-2);
    border-top: 1px solid var(--stroke);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -20px 60px rgba(0,0,0,.6);
    padding: 16px 18px calc(28px + var(--safe-bottom));
    transform: translateY(100%);
    transition: transform .3s ease;
    z-index: 200;
    max-height: 75vh; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .info-sheet.open { transform: translateY(0); }
}
