/* =====================================================================
   12MILES / GARAGE DESIGN SYSTEM
   Dark theme with signature blaze orange accent, bordered cards,
   rounded corners, high contrast typography.
   ===================================================================== */

:root {
  /* 12Miles Core Palette */
  --ink: #111;
  --bg: #0f1115;
  --bg2: #07080a;
  --card: #181b22;
  --card2: #20242d;
  --line: #2b303b;
  --tx: #f2f4f8;
  --mut: #9aa3b5;
  --ac: #ff5a1f;
  --ac2: #ffb020;
  --ok: #2ecc71;
  --bad: #ff6674;
  --blue: #4d8dff;
  --focus: #ffb020;

  /* Accent Swatches */
  --pink: #ff7aa8;
  --yellow: #ffb020;
  --mint: #2ecc71;
  --sky: #38bdf8;
  --lilac: #a78bfa;
  --peach: #fb923c;
  --lime: #a3e635;
  --coral: #ff6b6b;
  --red: #c7283d;
  --teal: #14b8a6;
  --tabc: var(--ac);
  --r: 14px;
  --float: 0 8px 24px rgba(0, 0, 0, 0.45);

  /* Fonts */
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  --display: var(--font);

  /* Compatibility Aliases for components & existing views */
  --snap-black: var(--bg);
  --snap-dark: var(--bg);
  --snap-dark-card: var(--card);
  --snap-dark-card-hover: var(--card2);
  --snap-dark-elevated: var(--card2);
  --snap-yellow: var(--ac);
  --snap-yellow-hover: #e04a14;
  --snap-yellow-glow: rgba(255, 90, 31, 0.35);
  --snap-yellow-soft: rgba(255, 90, 31, 0.12);
  --snap-border: var(--line);
  --snap-border-strong: var(--line);
  --snap-border-yellow: var(--ac);
  --text-primary: var(--tx);
  --text-secondary: var(--mut);
  --text-muted: var(--mut);
  --text-white: var(--tx);
  --text-dark: var(--ink);

  /* Radii */
  --radius-pill: 9999px;
  --radius-xl: var(--r);
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;

  /* Rarity */
  --rarity-legendary: #ff7ad9;
  --rarity-epic: #ffe08a;
  --rarity-rare: #00D4FF;
  --rarity-common: #2ecc71;
  --snap-green: var(--ok);
  --snap-red: var(--bad);

  /* Transitions */
  --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-bounce: 250ms var(--spring);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg2);
  color: var(--tx);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Viewport Container: 12Miles centered 520px column */
#app-root {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: var(--bg2);
  padding: 0;
  width: 100%;
}

.device-frame {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-shadow: none;
  overflow-x: hidden;
  padding-bottom: 76px;
}

@media (max-width: 540px) {
  .device-frame {
    border-left: none;
    border-right: none;
  }
}

/* Dynamic Page Container */
#page-container {
  flex: 1;
  width: 100%;
  position: relative;
  animation: snapFadeIn 0.25s var(--ease-out);
}

@keyframes snapFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Common Typography & Headings */
h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.snap-badge-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--snap-yellow);
}

/* Snapchat Yellow Glow Pill Button — Refined & Proportional */
.btn-snap-yellow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--snap-yellow);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(229, 9, 20, 0.25);
  transition: all var(--transition-bounce);
  text-decoration: none;
  line-height: 1.2;
}

.btn-snap-yellow:hover {
  background: var(--snap-yellow-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(229, 9, 20, 0.35);
}

.btn-snap-yellow:active {
  transform: scale(0.97);
}

.btn-snap-yellow svg,
.btn-snap-secondary svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-snap-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--snap-dark-card);
  color: var(--text-white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--snap-border-strong);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.2;
}

.btn-snap-secondary:hover {
  background: var(--snap-dark-card-hover);
  border-color: var(--snap-yellow);
  color: var(--snap-yellow);
  transform: translateY(-1px);
}

.btn-snap-secondary:active {
  transform: scale(0.97);
}

/* Icon button — Compact */
.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--snap-dark-card);
  border: 1px solid var(--snap-border);
  color: var(--text-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  flex-shrink: 0;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn-icon:hover {
  background: var(--snap-dark-card-hover);
  border-color: var(--snap-yellow);
  color: var(--snap-yellow);
}

.btn-icon:active {
  transform: scale(0.92);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--card);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--ac);
}

/* =====================================================================
   12MILES CORE UTILITIES & COMPONENTS
   Bordered cards, stats, chips, buttons, badges, grids
   ===================================================================== */

/* Typography */
h2 { font-size: 20px; font-weight: 800; margin: 4px 0 12px; line-height: 1.15; }
h3 { font-size: 17px; font-weight: 700; }
.sub { color: var(--mut); font-size: 13px; }
.big { font-size: 28px; font-weight: 800; line-height: 1.1; }
.sec { font-size: 12px; letter-spacing: .08em; margin: 22px 0 10px; font-weight: 700; text-transform: uppercase; color: var(--mut); }
.hl { color: var(--ok); font-weight: 700; }

/* Layout & Flex */
.row { display: flex; align-items: center; gap: 10px; }
.sp { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stack > * + * { margin-top: 10px; }

/* Cards & Stats */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  margin-bottom: 12px;
  color: var(--tx);
  position: relative;
}
.card.click { cursor: pointer; }
.card.click:hover { background: var(--card2); }
.card.click:active { transform: scale(0.995); }

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px;
  color: var(--tx);
}
.stat .n { font-size: 22px; font-weight: 800; }
.stat .l { font-size: 12px; color: var(--mut); margin-top: 2px; }

/* Chips / Segments */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin-bottom: 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--tx);
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  min-height: 40px;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.chip:hover { background: var(--card2); }
.chip.on {
  background: var(--ac);
  border-color: var(--ac);
  color: var(--ink);
  font-weight: 700;
}

.seg {
  display: flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 14px;
  gap: 3px;
}
.seg button {
  flex: 1;
  background: none;
  border: 0;
  color: var(--tx);
  padding: 9px 4px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  min-height: 42px;
}
.seg button:hover { background: var(--card2); }
.seg button.on {
  background: var(--ac);
  color: var(--ink);
  font-weight: 700;
}

/* 12Miles Buttons */
.btn {
  background: var(--ac);
  color: var(--ink);
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  min-height: 44px;
  line-height: 1.2;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.btn:hover { filter: brightness(1.08); color: var(--ink); }
.btn:active { transform: scale(0.98); }
.btn.g {
  background: var(--card2);
  color: var(--tx);
  border: 1px solid var(--line);
}
.btn.g:hover { filter: none; background: var(--card); color: var(--tx); }
.btn.ok { background: var(--ok); color: var(--ink); }
.btn.bad { background: var(--red); color: #fff; }
.btn.s { padding: 6px 12px; font-size: 13px; min-height: 36px; }
.btn.w { width: 100%; display: flex; }
.btn.danger { background: var(--card2); color: var(--bad); border: 1px solid var(--line); }
.btn.dark { background: var(--tx); color: var(--bg); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }

.iconbtn {
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--tx);
  border-radius: 10px;
  width: 44px;
  height: 44px;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.iconbtn:hover { background: var(--card); }

/* Art & Thumbnails */
.thumb {
  width: 84px;
  height: 60px;
  border-radius: 10px;
  background: var(--card2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.hero {
  width: 100%;
  height: 190px;
  border-radius: var(--r);
  background: var(--card2);
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
}
.hero img { width: 100%; height: 100%; object-fit: cover; }

/* Tags & Prices */
.tag {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 99px;
  font-weight: 700;
  display: inline-block;
  background: var(--card2);
  color: var(--tx);
  line-height: 1.5;
}
.t-sell { background: #12331f; color: #5be08e; }
.t-trade { background: #1b2a4a; color: #8fb4ff; }
.t-auction { background: #3a2a10; color: #ffc56b; }
.t-new { background: #3a1b14; color: #ff9a72; }
.t-bad { background: #3a1420; color: #ff8c98; }
.t-mut { background: var(--card2); color: var(--mut); }
.price { font-weight: 800; color: var(--ac2); }

