/* ==========================================================================
   JNR Puff Lab
   ========================================================================== */

:root {
  --bg: #08060d;
  --bg-2: #0e0a17;
  --panel: rgba(19, 15, 30, 0.78);
  --panel-solid: #141020;
  --panel-2: rgba(255, 255, 255, 0.038);
  --line: rgba(255, 255, 255, 0.09);
  --line-bright: rgba(255, 255, 255, 0.17);
  --text: #f6f2ff;
  --muted: #9a92ae;
  --muted-2: #6e6684;
  --pink: #ff4f7b;
  --pink-2: #ff7d9c;
  --violet: #8c6bff;
  --cyan: #5fe7ff;
  --green: #57e6a8;
  --gold: #ffcf6a;
  --danger: #ff5d5d;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-display: "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.45);
  --puff-filter: saturate(1.08) brightness(1.01);
  --accent: #ff5646;
  --accent-2: #9df05b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1000px 700px at 50% -10%, rgba(105, 61, 176, 0.18), transparent 60%),
    radial-gradient(800px 600px at 100% 30%, rgba(255, 79, 123, 0.07), transparent 60%),
    linear-gradient(180deg, #0a0711 0%, #08060d 45%, #0a0712 100%);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-modal-open { overflow: hidden; }

button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
::selection { background: rgba(255, 79, 123, 0.35); color: #fff; }

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

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

.live-region {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ----------------------------------------------------------------------
   Ambient background
   ---------------------------------------------------------------------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: drift 26s ease-in-out infinite alternate;
}
.blob-a {
  width: 560px; height: 560px;
  left: -180px; top: 3%;
  background: rgba(106, 66, 207, 0.32);
}
.blob-b {
  width: 460px; height: 460px;
  right: -120px; top: 30%;
  background: rgba(255, 69, 111, 0.16);
  animation-delay: -9s;
}
.blob-c {
  width: 420px; height: 420px;
  left: 38%; bottom: -240px;
  background: rgba(45, 190, 171, 0.11);
  animation-delay: -17s;
}
.grain {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, -30px, 0) scale(1.12); }
}

/* ----------------------------------------------------------------------
   Top bar
   ---------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  max-width: 1500px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 28px 16px;
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  background: linear-gradient(180deg, rgba(8, 6, 13, 0.92), rgba(8, 6, 13, 0.62));
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  flex: 0 0 auto;
}
.brand-mark {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(255, 79, 123, 0.95), rgba(108, 72, 255, 0.92));
  box-shadow: 0 10px 28px rgba(255, 79, 123, 0.24), inset 0 1px 0 rgba(255,255,255,.3);
  overflow: hidden;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255,255,255,.16), transparent 42%);
}
.brand-wing {
  position: absolute;
  width: 28px; height: 14px;
  border-top: 2px solid rgba(255,255,255,.55);
  border-radius: 50%;
  transform: rotate(-22deg) translateY(-6px);
  left: 8px;
  opacity: .8;
}
.brand-core {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong {
  font-size: 16px;
  letter-spacing: .17em;
  font-weight: 850;
}
.brand-text small {
  font-size: 8px;
  letter-spacing: .15em;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
  transition: color .2s, background .2s, transform .2s;
}
.nav-btn:hover { color: var(--text); }
.nav-btn.is-active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.045));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.11), 0 5px 20px rgba(0,0,0,.2);
}
.nav-ico {
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
  width: 14px;
}
.nav-live {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(87,230,168,.12), 0 0 14px var(--green);
}
.nav-count {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  border-radius: 99px;
  color: #160b20;
  background: var(--pink-2);
  font-weight: 800;
}

.top-stats { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.stat-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.coin-icon { color: var(--gold); font-size: 12px; text-shadow: 0 0 12px rgba(255,207,106,.5); }
.level-pill { color: var(--muted); gap: 5px; }
.level-label { font-size: 8px; letter-spacing: .12em; }
.level-pill span:last-child { color: var(--text); }
.avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-bright);
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), transparent 50%),
    linear-gradient(145deg, #4b2b5f, #1c1228);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s, border-color .2s;
}
.avatar-btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.32); }

/* ----------------------------------------------------------------------
   Shared layout / panels
   ---------------------------------------------------------------------- */

.app-main {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 26px 28px 32px;
}
.app-main, .view, .solo-shell, .online-game, .online-grid, .belt-panel, .conveyor, .belt-items { min-width: 0; }
.online-grid, .belt-panel, .conveyor, .belt-items { max-width: 100%; }
.belt-items { width: 100%; }
.view { display: none; }
.view.is-active { display: block; animation: viewIn .45s cubic-bezier(.2,.8,.2,1); }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.panel-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .16em;
  color: var(--muted);
  text-transform: uppercase;
}
.dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.dot-green {
  background: var(--green);
  box-shadow: 0 0 9px rgba(87,230,168,.8);
}
.pulse-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(87,230,168,.5);
  animation: pulseDot 1.8s infinite;
}
.live-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(87,230,168,.45); }
  70% { box-shadow: 0 0 0 7px rgba(87,230,168,0); }
  100% { box-shadow: 0 0 0 0 rgba(87,230,168,0); }
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.035em; }
h1 { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.02; margin-bottom: 0; }
h1 span { color: var(--pink-2); }
h2 { font-size: 22px; margin-bottom: 6px; }
h3 { font-size: 16px; margin-bottom: 6px; }
p { color: var(--muted); }

.meter {
  height: 7px;
  border-radius: 99px;
  background: rgba(255,255,255,.075);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  transition: width .45s ease, background .3s;
}
.meter-thin { height: 5px; }
.meter-battery > span { background: linear-gradient(90deg, #1e9c78, var(--green)); }
.meter-liquid > span { background: linear-gradient(90deg, #2676c4, var(--cyan)); }
.meter-coil > span { background: linear-gradient(90deg, #b06a2d, var(--gold)); }
.meter-stock > span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.meter > span.is-low { background: linear-gradient(90deg, #bd2e43, var(--danger)) !important; }

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--pink-2);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.text-btn:hover { color: #fff; }
.text-btn span { transition: transform .2s; }
.text-btn:hover span { transform: translateX(3px); }

.primary-btn,
.secondary-btn,
.ghost-btn,
.ink-btn {
  border: 0;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s, border-color .18s;
}
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff557f, #a552ff);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .1em;
  box-shadow: 0 12px 30px rgba(193, 68, 143, 0.26), inset 0 1px 0 rgba(255,255,255,.28);
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 17px 38px rgba(193, 68, 143, 0.34), inset 0 1px 0 rgba(255,255,255,.3); }
.primary-btn:active { transform: translateY(1px) scale(.995); }
.primary-btn small {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(0,0,0,.22);
}
.secondary-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}
.secondary-btn:hover { background: rgba(255,255,255,.08); border-color: var(--line-bright); }
.secondary-btn small {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 10px;
}
.ghost-btn {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
}
.ghost-btn:hover { color: var(--text); border-color: var(--line-bright); background: rgba(255,255,255,.04); }
.ghost-small { min-height: 32px; padding: 0 12px; }
.ink-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .03em;
  white-space: nowrap;
}
.ink-btn:hover { color: var(--text); border-color: var(--line-bright); background: rgba(255,255,255,.07); }
.full-btn { width: 100%; margin-top: 10px; }

/* ----------------------------------------------------------------------
   SOLO LAYOUT
   ---------------------------------------------------------------------- */

.solo-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr) 292px;
  gap: 18px;
  align-items: start;
}
.rail { display: flex; flex-direction: column; gap: 14px; }
.rail-left, .rail-right { position: sticky; top: 90px; }
.profile-panel, .tip-panel, .mini-collection, .flavor-panel, .gauges-panel, .odds-panel { padding: 18px; }

.profile-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.profile-orbit { position: relative; flex: 0 0 auto; }
.profile-avatar {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 20%, rgba(255,255,255,.24), transparent 45%),
    linear-gradient(145deg, #432359, #1b1027);
  border: 1px solid rgba(255,255,255,.18);
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 6px 22px rgba(0,0,0,.3);
}
.profile-level {
  position: absolute;
  right: -3px; bottom: -3px;
  width: 18px; height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  border: 2px solid var(--panel-solid);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 800;
}
.profile-name { font-size: 15px; margin-bottom: 1px; letter-spacing: -.02em; }
.profile-sub { font-size: 9px; margin: 0; color: var(--muted); font-family: var(--font-mono); }
.xp-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: .03em;
}
.xp-row b { color: var(--text); }
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 16px 0 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.profile-stats div { display: flex; flex-direction: column; align-items: center; }
.profile-stats span { font-family: var(--font-mono); font-size: 15px; font-weight: 750; }
.profile-stats small { font-size: 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.save-note {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 8px;
  color: var(--muted-2);
  margin: 0;
  font-family: var(--font-mono);
}
.tip-panel { background: linear-gradient(145deg, rgba(255,79,123,.09), rgba(255,255,255,.018)); }
.tip-panel h3 { font-size: 17px; }
.tip-panel p { font-size: 11px; line-height: 1.55; margin-bottom: 0; color: var(--muted); }
.tip-panel p b { color: var(--text); }
.tip-mark {
  position: absolute;
  right: 12px; top: 12px;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .12em;
  color: var(--pink-2);
  border: 1px solid rgba(255,125,156,.28);
  border-radius: 5px;
  padding: 4px 5px;
}
.mini-collection .text-btn { margin-top: 12px; }
.mini-list { display: flex; flex-direction: column; gap: 7px; }
.mini-item {
  display: flex;
  color: var(--text);
  align-items: center;
  gap: 8px;
  padding: 7px;
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  cursor: pointer;
  border: 1px solid transparent;
  text-align: left;
  width: 100%;
}
.mini-item:hover { border-color: var(--line); background: rgba(255,255,255,.06); }
.mini-item.is-active { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.mini-swatch {
  width: 28px; height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-size: 10px;
  color: #0a0711;
  font-weight: 900;
}
.mini-copy { min-width: 0; flex: 1; }
.mini-copy strong { display: block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-copy small { display: block; font-size: 8px; color: var(--muted); font-family: var(--font-mono); }
.mini-rarity { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; background: var(--rarity, var(--muted)); box-shadow: 0 0 8px var(--rarity, transparent); }

.device-column { min-width: 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding: 2px 2px 18px;
}
.section-head h1 { margin-top: 5px; }
.mode-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .14em;
  white-space: nowrap;
}

/* Device card */

.device-card {
  position: relative;
  padding: 20px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(70% 50% at 50% 40%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    linear-gradient(160deg, rgba(31,24,47,.9), rgba(13,10,21,.96));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.08);
  overflow: hidden;
  isolation: isolate;
}
.device-noise {
  position: absolute;
  inset: 0;
  opacity: .045;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}
.device-card::after {
  content: "";
  position: absolute;
  left: 10%; right: 10%; bottom: -48%;
  height: 70%;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%);
  filter: blur(50px);
  z-index: 0;
  pointer-events: none;
}
.device-topline {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.device-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.device-brand {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .05em;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--text);
  color: #0a0711;
}
.device-id > span:last-child {
  font-size: 8px;
  font-family: var(--font-mono);
  letter-spacing: .13em;
  color: var(--muted);
}
.rarity-chip, .rarity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--rarity, var(--muted)) 45%, transparent);
  background: color-mix(in srgb, var(--rarity, var(--muted)) 12%, transparent);
  color: var(--rarity, var(--text));
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .11em;
  box-shadow: 0 0 18px color-mix(in srgb, var(--rarity, transparent) 15%, transparent);
  white-space: nowrap;
}
.rarity-badge {
  height: 26px;
  padding: 0 10px;
  font-size: 8px;
}

.stock-block { position: relative; z-index: 2; margin-top: 20px; }
.stock-number { display: flex; align-items: baseline; gap: 8px; }
.stock-number > span {
  font-family: var(--font-mono);
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 750;
  letter-spacing: -.06em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stock-number small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .06em;
}
.meter-stock { height: 9px; margin-top: 12px; }
.stock-caption {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .12em;
  color: var(--muted-2);
}

.device-stage {
  position: relative;
  z-index: 1;
  width: min(100%, 390px);
  aspect-ratio: 1 / 1;
  margin: 6px auto 0;
  touch-action: manipulation;
}
.stage-halo {
  position: absolute;
  inset: 9% 12% 12%;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--accent) 34%, transparent), transparent 48%),
    radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 72%);
  filter: blur(26px);
  animation: haloBreathe 5s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes haloBreathe {
  from { opacity: .72; transform: scale(.97); }
  to { opacity: 1; transform: scale(1.04); }
}
.stage-grid {
  position: absolute;
  left: 12%; right: 12%; bottom: 7%;
  height: 20%;
  border-radius: 50%;
  background:
    repeating-radial-gradient(ellipse at center, rgba(255,255,255,.17) 0 1px, transparent 1px 14px);
  opacity: .18;
  transform: perspective(400px) rotateX(66deg);
  pointer-events: none;
}
.puff-shadow {
  position: absolute;
  left: 33%; right: 33%; bottom: 5%;
  height: 5%;
  border-radius: 50%;
  background: rgba(0,0,0,.7);
  filter: blur(16px);
}
.puff-image {
  position: absolute;
  inset: 2% 14% 4%;
  width: 72%;
  height: 94%;
  object-fit: contain;
  filter: var(--puff-filter) drop-shadow(0 30px 30px rgba(0,0,0,.5));
  transition: filter .45s ease, transform .3s cubic-bezier(.2,.8,.2,1);
  user-select: none;
  -webkit-user-drag: none;
  z-index: 2;
  animation: floatPuff 6s ease-in-out infinite;
}
@keyframes floatPuff {
  0%, 100% { transform: translateY(0) rotate(-.4deg); }
  50% { transform: translateY(-9px) rotate(.3deg); }
}
.device-card.is-puffing .puff-image { transform: scale(.975) rotate(-1.2deg); animation-play-state: paused; }
.device-card.is-burnt .puff-image { filter: grayscale(.65) brightness(.7) contrast(1.15); }
.device-card.is-burnt .stage-halo { background: radial-gradient(closest-side, rgba(255,70,50,.25), transparent 60%); }
.mouth-hint {
  position: absolute;
  left: 50%;
  top: 3.4%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .2em;
  color: var(--muted-2);
  z-index: 3;
  white-space: nowrap;
  opacity: .7;
}
.flavor-plate {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 3%;
  transform: translateX(-50%);
  min-width: 180px;
  max-width: 82%;
  padding: 9px 15px 10px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(9, 7, 16, .8);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: center;
}
.flavor-plate-brand {
  display: block;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: .2em;
  margin-bottom: 2px;
}
.flavor-plate strong {
  display: block;
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flavor-plate > span:last-child {
  display: block;
  font-size: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.float-stat {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(10, 7, 18, .62);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  box-shadow: 0 8px 22px rgba(0,0,0,.16);
  pointer-events: none;
}
.fs-ico { font-size: 13px; color: var(--muted); }
.float-stat div { display: flex; flex-direction: column; line-height: 1.05; }
.float-stat small { font-size: 6px; color: var(--muted-2); letter-spacing: .12em; font-family: var(--font-mono); }
.float-stat b { font-family: var(--font-mono); font-size: 9px; margin-top: 2px; }
.fs-battery { left: 3%; top: 17%; }
.fs-liquid { right: 3%; top: 31%; }
.fs-coil { left: 4%; bottom: 25%; }
.fs-battery .fs-ico { color: var(--green); }
.fs-liquid .fs-ico { color: var(--cyan); }
.fs-coil .fs-ico { color: var(--gold); }

/* Rotary cap */

.rotary-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 8px;
  padding: 17px 16px 3px;
  border-top: 1px solid var(--line);
}
.rotary-wrap { flex: 0 0 auto; }
.rotary {
  position: relative;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,.09), transparent 55%),
    radial-gradient(circle, #191225 0 58%, #0e0a16 60% 100%);
  box-shadow:
    0 14px 38px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.12),
    inset 0 -6px 20px rgba(0,0,0,.5);
}
.rotary:active { cursor: grabbing; }
.rotary-ring {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  transition: transform .38s cubic-bezier(.2,.9,.25,1);
}
.rotary-ring span {
  position: absolute;
  left: calc(50% - 1px);
  top: calc(50% - 1px);
  width: 2px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255,255,255,.19);
  transform-origin: 1px calc(1px + 2px);
  transform: rotate(var(--a)) translateY(-50px);
}
.rotary-ring span.is-long { height: 8px; background: rgba(255,255,255,.36); }
.rotary-knob {
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 8px;
  background:
    radial-gradient(circle at 50% 28%, rgba(255,255,255,.13), transparent 52%),
    linear-gradient(160deg, #22192f, #0e0a15);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 2px 10px rgba(0,0,0,.4);
  pointer-events: none;
  text-align: center;
}
.knob-notch {
  width: 12px;
  height: 2px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  margin-bottom: 4px;
}
.rotary-knob strong {
  font-size: 8px;
  line-height: 1.15;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.rotary-knob small {
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--muted);
  margin-top: 3px;
}
.rotary-copy { min-width: 0; }
.rotary-copy h3 { font-size: 20px; line-height: 1.03; margin: 5px 0 6px; letter-spacing: -.045em; }
.rotary-copy p { font-size: 10px; line-height: 1.45; margin-bottom: 8px; color: var(--muted); max-width: 280px; }

.action-dock {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 10px;
  margin-top: 16px;
}
.puff-btn {
  position: relative;
  min-height: 78px;
  border: 0;
  border-radius: 19px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: #fff;
  background:
    radial-gradient(150% 170% at 15% 15%, rgba(255,255,255,.24), transparent 50%),
    linear-gradient(115deg, #ff4d7b, #b44cff 58%, #775bff);
  box-shadow:
    0 18px 42px rgba(200, 60, 144, .3),
    inset 0 1px 0 rgba(255,255,255,.36),
    inset 0 -2px 0 rgba(0,0,0,.15);
  transition: transform .15s, box-shadow .2s;
  touch-action: none;
}
.puff-btn:hover { transform: translateY(-1px); box-shadow: 0 22px 48px rgba(200,60,144,.38), inset 0 1px 0 rgba(255,255,255,.38); }
.puff-btn:active, .puff-btn.is-held { transform: scale(.985); }
.puff-btn-glow {
  position: absolute;
  width: 160px; height: 160px;
  border-radius: 50%;
  left: 10%; top: -60%;
  background: rgba(255,255,255,.23);
  filter: blur(30px);
  pointer-events: none;
}
.puff-btn.is-held .puff-btn-glow { animation: holdGlow .7s linear infinite; }
@keyframes holdGlow { 50% { transform: translateX(140px); opacity: .5; } }
.puff-btn-icon {
  font-size: 34px;
  line-height: 1;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(0,0,0,.14);
  flex: 0 0 auto;
  text-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.puff-btn-icon svg { width: 24px; height: 24px; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.2)); }
.puff-btn-text { display: flex; flex-direction: column; position: relative; z-index: 1; }
.puff-btn-text strong { font-size: 20px; letter-spacing: .08em; font-weight: 850; line-height: 1; }
.puff-btn-text small { font-family: var(--font-mono); font-size: 7px; letter-spacing: .14em; opacity: .74; margin-top: 6px; }
.auto-btn {
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(255,255,255,.04);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  min-height: 78px;
  transition: background .2s, border-color .2s;
  text-align: left;
}
.auto-btn:hover { background: rgba(255,255,255,.075); border-color: var(--line-bright); }
.auto-btn > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.auto-btn strong { font-size: 12px; letter-spacing: .12em; }
.auto-btn small { font-size: 6.5px; color: var(--muted); font-family: var(--font-mono); letter-spacing: .1em; margin-top: 4px; }
.auto-orb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.28), rgba(255,255,255,.04) 60%);
  flex: 0 0 auto;
  transition: background .2s, box-shadow .2s;
}
.auto-btn[aria-pressed="true"] {
  border-color: rgba(87,230,168,.35);
  background: linear-gradient(135deg, rgba(87,230,168,.15), rgba(87,230,168,.04));
}
.auto-btn[aria-pressed="true"] .auto-orb {
  background: var(--green);
  box-shadow: 0 0 10px rgba(87,230,168,.8), 0 0 24px rgba(87,230,168,.36);
  animation: orbPulse 1.7s ease-in-out infinite;
}
.auto-btn[aria-pressed="true"] strong { color: var(--green); }
@keyframes orbPulse { 50% { transform: scale(.8); opacity: .8; } }

.quick-actions {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.quick-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  cursor: pointer;
  text-align: left;
  min-height: 49px;
  transition: background .2s, border-color .2s;
}
.quick-btn:hover { background: rgba(255,255,255,.06); border-color: var(--line-bright); }
.quick-ico { font-size: 14px; color: var(--muted); width: 17px; text-align: center; }
.quick-btn > span:last-child { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.quick-btn strong { font-size: 8px; letter-spacing: .08em; }
.quick-btn small { font-family: var(--font-mono); font-size: 7px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Right rail */

.flavor-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.flavor-title-row h2 { font-size: 23px; line-height: 1.04; margin-bottom: 3px; }
.flavor-title-row p { font-size: 9px; font-family: var(--font-mono); color: var(--muted); margin: 0; }
.flavor-desc { font-size: 11px; line-height: 1.55; color: var(--muted); margin: 14px 0; }
.flavor-value {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  margin-bottom: 11px;
}
.flavor-value > span { font-family: var(--font-mono); font-size: 7px; letter-spacing: .12em; color: var(--muted-2); }
.flavor-value b { font-family: var(--font-mono); font-size: 13px; color: var(--gold); }
.gauge-row { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.055); }
.gauge-row:last-of-type { border-bottom: 0; }
.gauge-top { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--muted); margin-bottom: 7px; }
.gauge-top span { display: flex; align-items: center; gap: 6px; }
.gauge-top b { font-family: var(--font-mono); font-size: 9px; color: var(--text); }
.gauge-ico { font-style: normal; font-size: 11px; width: 12px; text-align: center; color: var(--muted); }
.gauge-row .ink-btn { margin-top: 7px; width: 100%; }
.burn-warning {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(255,93,93,.25);
  border-radius: 10px;
  background: rgba(255,93,93,.08);
}
.burn-warning > span { color: var(--danger); font-size: 14px; }
.burn-warning strong { display: block; font-size: 10px; color: #ffb3b3; }
.burn-warning p { font-size: 9px; margin: 2px 0 0; color: #c58f9a; line-height: 1.35; }
.odds-head { display: flex; justify-content: space-between; align-items: baseline; }
.odds-head h3 { font-size: 15px; }
.odds-head > span { font-family: var(--font-mono); font-size: 7px; color: var(--muted); }
.odds-list { display: flex; flex-direction: column; gap: 6px; }
.odds-row { display: flex; align-items: center; gap: 7px; font-size: 9px; }
.odds-row .rarity-dot { flex: 0 0 auto; }
.odds-row span:nth-child(2) { color: var(--muted); flex: 1; }
.odds-row b { font-family: var(--font-mono); color: var(--text); font-size: 8px; }
.rarity-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 2px; }
.r-common { background: #aab3c5; box-shadow: 0 0 8px rgba(170,179,197,.65); }
.r-rare { background: #54a7ff; box-shadow: 0 0 8px rgba(84,167,255,.75); }
.r-epic { background: #b474ff; box-shadow: 0 0 8px rgba(180,116,255,.8); }
.r-legendary { background: #ffbd4a; box-shadow: 0 0 9px rgba(255,189,74,.85); }
.r-mythic { background: #ff5d6f; box-shadow: 0 0 10px rgba(255,93,111,.9); }
.r-secret { background: linear-gradient(90deg,#7cf7ff,#ffe680,#ff7cf1); box-shadow: 0 0 12px rgba(124,247,255,.9); }

/* ----------------------------------------------------------------------
   ONLINE — auth
   ---------------------------------------------------------------------- */

.online-auth {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, .78fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  min-height: calc(100vh - 190px);
  padding: 24px 0 36px;
}
.auth-hero { max-width: 700px; }
.auth-hero h1 {
  font-size: clamp(46px, 6vw, 82px);
  line-height: .94;
  margin: 12px 0 20px;
  letter-spacing: -.06em;
}
.auth-hero h1 span {
  background: linear-gradient(100deg, var(--pink), #c673ff 55%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-hero > p { max-width: 520px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.auth-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 30px;
  max-width: 560px;
}
.auth-features > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border-left: 1px solid var(--line);
}
.feature-ico { color: var(--pink-2); font-size: 17px; margin-bottom: 6px; }
.auth-features strong { font-size: 10px; }
.auth-features small { font-size: 8px; color: var(--muted); font-family: var(--font-mono); }
.belt-preview {
  position: relative;
  height: 150px;
  margin-top: 45px;
  max-width: 640px;
  perspective: 600px;
  overflow: hidden;
}
.preview-belt {
  position: absolute;
  left: -10%; right: -10%; bottom: 17px;
  height: 46px;
  transform: rotateX(58deg);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.13) 0 2px, transparent 2px 34px),
    linear-gradient(180deg, #1f172c, #0e0a18);
  border-radius: 10px;
  box-shadow: 0 -2px 12px rgba(0,0,0,.5);
  animation: beltMove 2.2s linear infinite;
}
@keyframes beltMove { from { background-position: 0 0, 0 0; } to { background-position: 34px 0, 0 0; } }
.preview-card {
  position: absolute;
  bottom: 38px;
  width: 122px;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(150deg, rgba(46,35,66,.95), rgba(15,11,24,.97));
  border: 1px solid var(--line-bright);
  box-shadow: 0 14px 30px rgba(0,0,0,.4);
  animation: previewFloat 4.5s ease-in-out infinite;
  z-index: 2;
}
.preview-card span { display: block; font-family: var(--font-mono); font-size: 6px; color: var(--muted); }
.preview-card b { display: block; font-size: 10px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-card small { display: inline-block; margin-top: 7px; font-family: var(--font-mono); font-size: 6px; padding: 2px 5px; border-radius: 4px; background: rgba(255,255,255,.08); }
.pc-1 { left: 6%; border-color: rgba(84,167,255,.5); box-shadow: 0 14px 32px rgba(84,167,255,.16); }
.pc-2 { left: 38%; bottom: 58px; border-color: rgba(255,93,111,.52); box-shadow: 0 14px 34px rgba(255,93,111,.18); animation-delay: -1.4s; }
.pc-3 { left: 70%; border-color: rgba(170,179,197,.35); animation-delay: -2.8s; }
@keyframes previewFloat { 50% { transform: translateY(-7px); } }

.auth-card {
  position: relative;
  padding: 26px;
  border-radius: 26px;
  border: 1px solid var(--line-bright);
  background:
    radial-gradient(120% 80% at 90% 0%, rgba(140,107,255,.14), transparent 55%),
    linear-gradient(155deg, rgba(32,24,48,.95), rgba(12,9,19,.97));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.08);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.16);
  margin-bottom: 22px;
}
.auth-tab {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  cursor: pointer;
}
.auth-tab.is-active { background: rgba(255,255,255,.1); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field > span { font-family: var(--font-mono); font-size: 7px; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.22);
  color: var(--text);
  outline: none;
  font-size: 13px;
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: var(--muted-2); }
.field input:focus { border-color: rgba(140,107,255,.65); box-shadow: 0 0 0 3px rgba(140,107,255,.13); }
.form-error {
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid rgba(255,93,93,.26);
  background: rgba(255,93,93,.08);
  color: #ffb0b0;
  font-size: 10px;
  margin: 0 0 12px;
}
.auth-submit { width: 100%; margin-top: 4px; }
.auth-legal { font-size: 8px; color: var(--muted-2); line-height: 1.5; text-align: center; margin: 13px 5px 0; }

/* ----------------------------------------------------------------------
   ONLINE — lobby browser
   ---------------------------------------------------------------------- */

.lobby-browser { padding: 26px 0 20px; }
.browser-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}
.browser-head h1 { margin: 6px 0 10px; }
.browser-head p { max-width: 620px; font-size: 12px; margin: 0; }
.browser-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.browser-main { padding: 20px; }
.browser-actions { display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px; }
.browser-actions .secondary-btn { justify-content: center; min-height: 48px; border-radius: 14px; }
.join-code-row { padding: 16px 0 20px; border-bottom: 1px solid var(--line); }
.join-code-form { display: flex; align-items: flex-end; gap: 9px; max-width: 420px; }
.join-code-form .field { flex: 1; margin: 0; }
.join-code-form .ink-btn { height: 48px; padding: 0 18px; }
.lobby-list-head { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 10px; }
.lobby-list-head h3 { font-size: 12px; letter-spacing: .1em; margin: 0; }
.lobby-list-head span { font-family: var(--font-mono); font-size: 7px; color: var(--muted-2); }
.lobby-list { display: flex; flex-direction: column; gap: 8px; }
.lobby-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
  transition: border-color .2s, background .2s;
}
.lobby-row:hover { border-color: var(--line-bright); background: rgba(255,255,255,.05); }
.lobby-orb {
  width: 38px; height: 38px;
  border-radius: 11px;
  background:
    radial-gradient(circle at 32% 25%, rgba(255,255,255,.18), transparent 45%),
    linear-gradient(145deg, #3a2450, #171022);
  border: 1px solid rgba(255,255,255,.12);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  color: var(--pink-2);
  flex: 0 0 auto;
}
.lobby-row-main { flex: 1; min-width: 0; }
.lobby-row-main strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lobby-row-main small { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 8px; color: var(--muted); margin-top: 2px; }
.lobby-row .ink-btn { height: 34px; padding: 0 14px; }
.empty-inline { padding: 26px 10px; text-align: center; color: var(--muted); font-size: 11px; }
.online-how { padding: 20px; }
.how-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 17px; }
.how-list li { display: flex; gap: 11px; }
.how-list li > span { font-family: var(--font-mono); font-size: 8px; color: var(--pink-2); border: 1px solid rgba(255,125,156,.24); border-radius: 5px; padding: 3px 5px; height: fit-content; }
.how-list strong { font-size: 11px; display: block; }
.how-list p { font-size: 9px; line-height: 1.45; color: var(--muted); margin: 2px 0 0; }
.shield-note { margin-top: 20px; padding: 11px; border-radius: 10px; background: rgba(95,231,255,.06); border: 1px solid rgba(95,231,255,.14); font-size: 9px; line-height: 1.45; color: #a9dae4; display: flex; gap: 7px; }
.shield-note span { color: var(--cyan); }

/* ----------------------------------------------------------------------
   ONLINE — game
   ---------------------------------------------------------------------- */

.online-game { padding: 18px 0 20px; }
.lobby-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(13px);
  margin-bottom: 14px;
}
.lobby-identity { display: flex; align-items: center; gap: 13px; }
.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid rgba(87,230,168,.24);
  background: rgba(87,230,168,.07);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .12em;
  color: var(--green);
  flex: 0 0 auto;
}
.lobby-identity h2 { font-size: 17px; margin: 0; }
.lobby-identity p { font-size: 9px; color: var(--muted); margin: 1px 0 0; font-family: var(--font-mono); }
.code-copy {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  cursor: pointer;
}
.code-copy b { color: var(--text); letter-spacing: .12em; }
.code-copy:hover b { color: var(--pink-2); }
.lobby-bar-actions { display: flex; align-items: center; gap: 13px; }
.sync-status { font-family: var(--font-mono); font-size: 7px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sync-status.is-syncing .dot { background: var(--gold); }
.sync-status.is-error .dot { background: var(--danger); }
.sync-status.is-error { color: var(--danger); }

.online-grid { display: grid; grid-template-columns: minmax(0, 1fr) 326px; gap: 14px; align-items: start; }
.belt-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(90% 70% at 50% 110%, rgba(140,107,255,.09), transparent 65%),
    linear-gradient(160deg, rgba(26,20,39,.86), rgba(11,8,18,.94));
  overflow: hidden;
  min-height: 560px;
}
.belt-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 16px;
}
.belt-head h2 { margin: 4px 0 0; font-size: 25px; }
.belt-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 11px;
  max-width: 340px;
  justify-content: flex-end;
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--muted);
}
.conveyor { position: relative; padding: 24px 16px 28px; min-height: 405px; }
.belt-strip {
  position: absolute;
  left: -3%; right: -3%;
  top: 49%;
  height: 105px;
  transform: perspective(650px) rotateX(62deg);
  border-radius: 18px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.16) 0 2px, transparent 2px 46px),
    linear-gradient(180deg, #2a203a 0%, #14101e 55%, #090710 100%);
  border-top: 1px solid rgba(255,255,255,.17);
  border-bottom: 1px solid rgba(255,255,255,.04);
  box-shadow: 0 20px 50px rgba(0,0,0,.62);
  animation: beltSlide 2.4s linear infinite;
}
@keyframes beltSlide { to { background-position: 46px 0, 0 0; } }
.belt-items {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: safe center;
  gap: 11px;
  overflow-x: auto;
  padding: 8px 2px 30px;
  min-height: 345px;
  align-items: flex-end;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.16) transparent;
  scroll-snap-type: x proximity;
}
.belt-items::-webkit-scrollbar { height: 5px; }
.belt-items::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 9px; }
.belt-empty {
  position: absolute;
  inset: 110px 20px auto;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  padding: 40px 20px;
}
.belt-card {
  --rarity: #aab3c5;
  position: relative;
  flex: 0 0 178px;
  width: 178px;
  scroll-snap-align: start;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--rarity) 38%, rgba(255,255,255,.06));
  background:
    radial-gradient(80% 60% at 50% 0%, color-mix(in srgb, var(--rarity) 13%, transparent), transparent 70%),
    linear-gradient(165deg, rgba(40,31,55,.96), rgba(14,10,22,.98));
  box-shadow:
    0 16px 34px rgba(0,0,0,.42),
    0 0 24px color-mix(in srgb, var(--rarity) 10%, transparent),
    inset 0 1px 0 rgba(255,255,255,.1);
  padding: 11px;
  transition: transform .2s, box-shadow .2s;
  animation: cardIn .45s cubic-bezier(.2,.8,.2,1) both;
}
.belt-card:hover { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(0,0,0,.52), 0 0 34px color-mix(in srgb, var(--rarity) 18%, transparent); }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.belt-card.is-mine { border-color: color-mix(in srgb, var(--rarity) 55%, rgba(255,255,255,.18)); }
.belt-card.is-mine::after {
  content: "TOI";
  position: absolute;
  right: 9px; top: 9px;
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: .1em;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,.9);
  color: #0b0712;
  z-index: 4;
}
.belt-card.is-high { animation: cardIn .45s cubic-bezier(.2,.8,.2,1) both, rareGlow 2.8s ease-in-out infinite alternate; }
@keyframes rareGlow {
  to { box-shadow: 0 16px 34px rgba(0,0,0,.42), 0 0 38px color-mix(in srgb, var(--rarity) 34%, transparent), inset 0 1px 0 rgba(255,255,255,.12); }
}
.belt-card.is-secret { border: 1px solid transparent; background-clip: padding-box; }
.belt-card.is-secret::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: 17px;
  background: conic-gradient(from var(--angle, 0deg), #7cf7ff, #ffe680, #ff7cf1, #7cf7ff);
  animation: rotateSecret 4s linear infinite;
}
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes rotateSecret { to { --angle: 360deg; } }
.belt-puff-img {
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.belt-puff-img img {
  height: 104px;
  width: auto;
  object-fit: contain;
  filter: var(--puff-filter) drop-shadow(0 12px 14px rgba(0,0,0,.45));
  pointer-events: none;
}
.belt-rarity {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: .1em;
  color: var(--rarity);
  margin-bottom: 4px;
}
.belt-name {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.belt-owner { font-size: 8px; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.belt-owner b { color: var(--text); }
.belt-stats {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(255,255,255,.07);
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--muted);
}
.belt-stats b { color: var(--text); font-size: 8px; }
.steal-btn {
  width: 100%;
  height: 31px;
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,79,123,.92), rgba(170,79,255,.88));
  color: #fff;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.steal-btn:hover { filter: brightness(1.1); }
.steal-btn:disabled {
  background: rgba(255,255,255,.055);
  color: var(--muted-2);
  cursor: not-allowed;
  border: 1px solid var(--line);
}
.belt-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--muted-2);
}
.belt-foot i { display: inline-block; }
.online-side { display: flex; flex-direction: column; gap: 14px; }
.online-device { padding: 16px; }
.online-device-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.online-device-head h3 { font-size: 20px; margin: 0 0 5px; }
.online-level { font-family: var(--font-mono); font-size: 7px; color: var(--muted); border: 1px solid var(--line); padding: 4px 6px; border-radius: 5px; white-space: nowrap; }
.online-level b { color: var(--text); }
.online-device-visual { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; }
.online-device-visual img {
  width: 84px; height: 92px;
  object-fit: contain;
  filter: var(--puff-filter) drop-shadow(0 10px 15px rgba(0,0,0,.4));
}
.online-stock { display: flex; flex-direction: column; min-width: 0; }
.online-stock > span { font-family: var(--font-mono); font-size: 28px; letter-spacing: -.05em; font-weight: 700; line-height: 1; }
.online-stock small { font-family: var(--font-mono); font-size: 7px; color: var(--muted); margin-top: 4px; }
.online-mini-gauges { display: flex; flex-direction: column; gap: 7px; margin: 10px 0 13px; }
.online-mini-gauges > div { display: grid; grid-template-columns: 13px 1fr 24px; align-items: center; gap: 7px; }
.online-mini-gauges > div > span { font-size: 10px; color: var(--muted); text-align: center; }
.online-mini-gauges .meter { height: 5px; }
.online-mini-gauges small { font-family: var(--font-mono); font-size: 7px; color: var(--muted); text-align: right; }
.online-rotary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.022);
}
.mini-rotary {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,.09), transparent 55%),
    radial-gradient(circle, #191225 0 58%, #0e0a16 60% 100%);
  box-shadow: 0 6px 18px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.12);
}
.mini-rotary:active { cursor: grabbing; }
.mini-rotary.is-disabled { opacity: .38; cursor: default; }
.mini-rotary-ring {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  transition: transform .3s cubic-bezier(.2,.9,.25,1);
}
.mini-rotary-ring span {
  position: absolute;
  left: calc(50% - 1px);
  top: calc(50% - 1px);
  width: 1.5px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255,255,255,.22);
  transform-origin: 1px calc(1px + 2px);
  transform: rotate(var(--a)) translateY(-24px);
}
.mini-rotary-ring span.is-long { height: 5px; background: rgba(255,255,255,.42); }
.mini-rotary-knob {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 3px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.13);
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.12), transparent 55%), linear-gradient(160deg, #22192f, #0e0a15);
  box-shadow: inset 0 1px 7px rgba(0,0,0,.45);
  pointer-events: none;
}
.online-knob-notch { width: 8px; height: 1.5px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 8px var(--accent); margin-bottom: 2px; }
.mini-rotary-knob strong {
  font-size: 5.5px;
  line-height: 1.15;
  max-width: 28px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.mini-rotary-knob small { font-family: var(--font-mono); font-size: 5px; color: var(--muted); margin-top: 2px; }
.online-rotary-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.online-rotary-copy > span { font-family: var(--font-mono); font-size: 5.5px; letter-spacing: .1em; color: var(--muted); }
.online-rotary-copy strong { font-size: 10px; margin-top: 3px; }
.online-rotary-copy small { font-size: 7px; color: var(--muted-2); margin-top: 2px; }

.online-controls { display: grid; grid-template-columns: 1fr 104px; gap: 7px; }
.online-puff-btn {
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff4d7b, #a34cff);
  color: #fff;
  font-weight: 850;
  font-size: 10px;
  letter-spacing: .1em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(193,68,143,.25), inset 0 1px 0 rgba(255,255,255,.28);
  touch-action: none;
}
.online-puff-btn:active { transform: scale(.985); }
.online-puff-btn span { opacity: .6; margin-left: 4px; }
.auto-btn-small { min-height: 48px; border-radius: 12px; padding: 0 10px; }
.auto-btn-small .auto-orb { width: 14px; height: 14px; }
.auto-btn-small strong { font-size: 9px; }
.auto-btn-small small { font-size: 5px; }
.online-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 7px; }
.online-actions .ink-btn { min-height: 27px; padding: 0 4px; font-size: 7px; }
.online-device .full-btn { font-size: 8px; min-height: 34px; margin-top: 8px; }
.online-device.is-burnt { border-color: rgba(255,93,93,.35); }
.activity-panel { padding: 16px; }
.activity-list { display: flex; flex-direction: column; gap: 9px; max-height: 265px; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; }
.activity-item { display: flex; gap: 8px; font-size: 9px; line-height: 1.4; color: var(--muted); }
.activity-item i { flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); margin-top: 5px; }
.activity-item.is-steal i { background: var(--danger); box-shadow: 0 0 8px rgba(255,93,93,.7); }
.activity-item.is-draw i { background: var(--gold); box-shadow: 0 0 8px rgba(255,207,106,.7); }
.activity-item.is-join i { background: var(--green); }
.activity-item.is-burn i { background: #ff8a3d; }
.activity-item b { color: var(--text); font-weight: 600; }
.activity-empty { font-size: 9px; color: var(--muted-2); text-align: center; padding: 20px 0; }

/* ----------------------------------------------------------------------
   COLLECTION
   ---------------------------------------------------------------------- */

.collection-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  padding: 14px 0 24px;
  border-bottom: 1px solid var(--line);
}
.collection-head h1 { margin: 6px 0 10px; }
.collection-head p { font-size: 12px; margin: 0; }
.collection-metrics { display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap; }
.collection-metrics > div { display: flex; flex-direction: column; gap: 2px; }
.collection-metrics small { font-family: var(--font-mono); font-size: 7px; color: var(--muted); letter-spacing: .11em; }
.collection-metrics b { font-family: var(--font-mono); font-size: 19px; font-weight: 700; }
.collection-metrics b span { color: var(--gold); }
.collection-metrics .primary-btn { min-height: 42px; padding: 0 16px; font-size: 9px; }
.collection-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 17px 0;
}
.filter-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-btn {
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .06em;
  cursor: pointer;
}
.filter-btn:hover { color: var(--text); border-color: var(--line-bright); }
.filter-btn.is-active { color: #0c0714; background: var(--text); border-color: var(--text); }
.collection-hint { font-family: var(--font-mono); font-size: 7px; color: var(--muted-2); white-space: nowrap; }
.collection-hint.is-switch { cursor: pointer; color: var(--pink-2); padding: 5px 7px; border: 1px solid rgba(255,125,156,.18); border-radius: 6px; }
.collection-hint.is-switch:hover { color: #fff; border-color: rgba(255,125,156,.4); }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 11px; color: var(--muted); cursor: pointer; user-select: none; }
.check-row input { width: 16px; height: 16px; accent-color: var(--pink); }
.primary-btn:disabled, .ink-btn:disabled, .steal-btn:disabled { cursor: not-allowed; opacity: .55; }
.primary-btn:disabled { filter: saturate(.6); transform: none; box-shadow: none; }
.belt-card.is-static { animation: none !important; }
.belt-card.is-static.is-high { box-shadow: 0 16px 34px rgba(0,0,0,.42), 0 0 26px color-mix(in srgb, var(--rarity) 22%, transparent), inset 0 1px 0 rgba(255,255,255,.1); }
.online-puff-btn:disabled { opacity: .5; cursor: not-allowed; }
.auto-btn:disabled { opacity: .5; cursor: not-allowed; }

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 14px;
  padding-bottom: 18px;
}
.coll-card {
  --rarity: #aab3c5;
  position: relative;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--rarity) 30%, rgba(255,255,255,.06));
  background:
    radial-gradient(85% 60% at 50% 0%, color-mix(in srgb, var(--rarity) 13%, transparent), transparent 64%),
    linear-gradient(160deg, rgba(32,25,45,.88), rgba(12,9,19,.96));
  padding: 13px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .25s, border-color .25s;
  min-height: 292px;
  display: flex;
  flex-direction: column;
}
.coll-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--rarity) 62%, rgba(255,255,255,.1));
  box-shadow: 0 20px 45px rgba(0,0,0,.48), 0 0 34px color-mix(in srgb, var(--rarity) 15%, transparent);
}
.coll-card.is-active { border-color: color-mix(in srgb, var(--rarity) 60%, rgba(255,255,255,.2)); }
.coll-card.is-active .coll-active-tag { display: inline-flex; }
.coll-active-tag {
  display: none;
  position: absolute;
  right: 10px; top: 10px;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--text);
  color: #0b0712;
  font-family: var(--font-mono);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .06em;
  z-index: 4;
}
.coll-card.is-secret { border: 1px solid transparent; }
.coll-card.is-secret::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: 19px;
  background: conic-gradient(from var(--angle, 0deg), #7cf7ff, #ffe680, #ff7cf1, #7cf7ff);
  animation: rotateSecret 5s linear infinite;
}
.coll-visual { position: relative; height: 132px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.coll-visual::before {
  content: "";
  position: absolute;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rarity) 25%, transparent), transparent 70%);
  filter: blur(8px);
}
.coll-visual img {
  position: relative;
  z-index: 1;
  height: 126px;
  width: auto;
  object-fit: contain;
  filter: var(--puff-filter) drop-shadow(0 13px 15px rgba(0,0,0,.46));
  pointer-events: none;
}
.coll-rarity { font-family: var(--font-mono); font-size: 6.5px; letter-spacing: .12em; color: var(--rarity); margin-bottom: 3px; }
.coll-name { font-size: 13px; font-weight: 800; line-height: 1.1; margin-bottom: 3px; }
.coll-notes { font-size: 8px; font-family: var(--font-mono); color: var(--muted); }
.coll-footer {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
}
.coll-footer small { display: block; font-family: var(--font-mono); font-size: 6px; letter-spacing: .08em; color: var(--muted-2); }
.coll-footer b { font-family: var(--font-mono); font-size: 10px; font-weight: 700; }
.coll-footer .coll-stock { text-align: right; }
.coll-footer .coll-value b { color: var(--gold); }
.coll-action {
  margin-top: 8px;
  width: 100%;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .08em;
  cursor: pointer;
}
.coll-action:hover { color: var(--text); border-color: var(--line-bright); background: rgba(255,255,255,.08); }
.coll-action:disabled { opacity: .4; cursor: default; }
.collection-empty { text-align: center; padding: 60px 20px; border: 1px dashed var(--line); border-radius: 20px; }
.empty-orbit { font-size: 34px; color: var(--muted-2); margin-bottom: 10px; }
.collection-empty h3 { font-size: 18px; }
.collection-empty p { font-size: 11px; }

/* ----------------------------------------------------------------------
   Modals
   ---------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 3, 8, .78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn .2s ease;
}
.modal-backdrop[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  position: relative;
  width: min(100%, 560px);
  max-height: min(88vh, 800px);
  overflow-y: auto;
  border: 1px solid var(--line-bright);
  border-radius: 25px;
  background:
    radial-gradient(100% 60% at 50% 0%, rgba(140,107,255,.12), transparent 60%),
    linear-gradient(160deg, #1b1428, #0c0913 72%);
  box-shadow: 0 34px 100px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.1);
  padding: 26px;
  animation: modalIn .32s cubic-bezier(.2,.9,.2,1);
  scrollbar-width: thin;
}
@keyframes modalIn { from { transform: translateY(16px) scale(.97); opacity: 0; } }
.modal-close {
  position: absolute;
  right: 15px; top: 15px;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
}
.modal-close:hover { color: var(--text); border-color: var(--line-bright); background: rgba(255,255,255,.09); }
.modal-eyebrow { font-family: var(--font-mono); font-size: 8px; letter-spacing: .16em; color: var(--muted); margin-bottom: 8px; }
.modal h2 { font-size: 27px; line-height: 1.02; margin-bottom: 8px; letter-spacing: -.045em; }
.modal p { font-size: 11px; line-height: 1.55; }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal-actions > * { flex: 1; }

/* Draw modal */
.draw-stage {
  position: relative;
  height: 255px;
  margin: 6px 0 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(60% 60% at 50% 55%, rgba(140,107,255,.16), transparent 70%),
    rgba(0,0,0,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.draw-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.08) 0 1px, transparent 1px 20px);
  opacity: .25;
}
.capsule-machine { position: relative; width: 155px; height: 190px; z-index: 2; }
.capsule-glass {
  position: absolute;
  left: 14px; top: 0;
  width: 127px; height: 122px;
  border-radius: 50% 50% 42% 42%;
  border: 1px solid rgba(255,255,255,.2);
  background:
    radial-gradient(circle at 38% 28%, rgba(255,255,255,.2), transparent 30%),
    linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.015));
  box-shadow: inset 0 0 30px rgba(140,107,255,.12);
  overflow: hidden;
}
.capsule-ball {
  position: absolute;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff7095, #6c48ff);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.4), 0 4px 10px rgba(0,0,0,.4);
  animation: ballJiggle 2.4s ease-in-out infinite alternate;
}
.capsule-ball:nth-child(1) { left: 18px; bottom: 18px; }
.capsule-ball:nth-child(2) { left: 51px; bottom: 34px; background: linear-gradient(145deg,#64d8ff,#4265ff); animation-delay: -.8s; }
.capsule-ball:nth-child(3) { right: 17px; bottom: 16px; background: linear-gradient(145deg,#ffd36d,#ff7048); animation-delay: -1.6s; }
.capsule-ball:nth-child(4) { left: 42px; bottom: 7px; background: linear-gradient(145deg,#7ef4b5,#18a57d); animation-delay: -2.1s; }
@keyframes ballJiggle { to { transform: translateY(-4px) rotate(9deg); } }
.capsule-base {
  position: absolute;
  left: 6px; bottom: 0;
  width: 143px; height: 78px;
  border-radius: 12px 12px 18px 18px;
  background: linear-gradient(160deg, #302343, #15101f);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 30px rgba(0,0,0,.4);
  display: grid;
  place-items: center;
}
.capsule-slot {
  width: 53px; height: 23px;
  border-radius: 6px;
  background: #07050b;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 3px 9px rgba(0,0,0,.8);
}
.capsule-knob {
  position: absolute;
  right: 14px; top: 82px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff6b8e, #a34cff);
  border: 2px solid rgba(255,255,255,.22);
  box-shadow: 0 0 16px rgba(255,107,142,.3);
}
.draw-stage.is-spinning .capsule-glass { animation: shake .35s ease-in-out infinite; }
@keyframes shake { 25% { transform: translateX(-3px) rotate(-1deg); } 75% { transform: translateX(3px) rotate(1deg); } }
.draw-result {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 4;
  animation: resultIn .5s cubic-bezier(.2,.9,.2,1);
  background: radial-gradient(60% 60% at 50% 50%, rgba(8,6,13,.72), rgba(8,6,13,.94));
}
@keyframes resultIn { from { opacity: 0; transform: scale(.92); } }
.draw-result img { height: 155px; filter: var(--puff-filter) drop-shadow(0 18px 24px rgba(0,0,0,.5)); }
.draw-result .result-rarity { font-family: var(--font-mono); font-size: 8px; letter-spacing: .15em; color: var(--rarity); margin-top: 6px; }
.draw-result .result-name { font-size: 20px; font-weight: 850; margin-top: 2px; }
.draw-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.draw-summary div { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
.draw-summary small { display: block; font-family: var(--font-mono); font-size: 6px; color: var(--muted); letter-spacing: .1em; }
.draw-summary b { display: block; font-size: 12px; margin-top: 2px; }

/* Puff detail modal */
.detail-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 15px; }
.detail-visual {
  position: relative;
  flex: 0 0 150px;
  height: 190px;
  border-radius: 15px;
  border: 1px solid color-mix(in srgb, var(--rarity) 35%, var(--line));
  background: radial-gradient(60% 60% at 50% 45%, color-mix(in srgb, var(--rarity) 18%, transparent), transparent 70%), rgba(0,0,0,.18);
  display: grid;
  place-items: center;
}
.detail-visual img { height: 172px; filter: var(--puff-filter) drop-shadow(0 15px 18px rgba(0,0,0,.5)); }
.detail-copy { min-width: 0; }
.detail-copy h2 { font-size: 25px; margin: 4px 0; }
.detail-copy p { font-size: 10px; margin: 0; }
.detail-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 13px; }
.detail-stat { padding: 9px; border-radius: 9px; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.detail-stat small { display: block; font-family: var(--font-mono); font-size: 6px; color: var(--muted); letter-spacing: .07em; }
.detail-stat b { display: block; font-family: var(--font-mono); font-size: 11px; margin-top: 3px; }
.detail-meter-row { margin-top: 10px; }
.detail-meter-row > div { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); margin-bottom: 4px; }
.detail-meter-row b { font-family: var(--font-mono); font-size: 8px; color: var(--text); }

/* Steal modal */
.steal-target { display: flex; align-items: center; gap: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.03); margin: 14px 0; }
.steal-target img { height: 100px; filter: var(--puff-filter) drop-shadow(0 10px 12px rgba(0,0,0,.4)); }
.steal-target-copy { flex: 1; min-width: 0; }
.steal-target-copy small { display: block; font-family: var(--font-mono); font-size: 7px; color: var(--muted); }
.steal-target-copy strong { display: block; font-size: 18px; margin: 2px 0; }
.steal-target-copy .rarity-badge { height: 20px; font-size: 7px; }
.chance-box { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-radius: 11px; background: rgba(255,79,123,.06); border: 1px solid rgba(255,79,123,.17); margin-bottom: 11px; }
.chance-box div small { display: block; font-family: var(--font-mono); font-size: 7px; color: var(--muted); }
.chance-box b { font-family: var(--font-mono); font-size: 20px; color: var(--pink-2); }
.chance-box > span { font-size: 9px; color: var(--muted); max-width: 200px; text-align: right; }
.risk-note { display: flex; gap: 7px; padding: 10px; border-radius: 9px; background: rgba(255,255,255,.03); border: 1px solid var(--line); font-size: 9px; color: var(--muted); line-height: 1.45; }
.risk-note span { color: var(--gold); }

/* Account modal */
.account-card { display: flex; align-items: center; gap: 13px; margin: 13px 0 18px; }
.account-card .avatar-btn { width: 54px; height: 54px; font-size: 16px; cursor: default; }
.account-card h3 { font-size: 19px; margin: 0; }
.account-card p { margin: 1px 0 0; font-size: 9px; font-family: var(--font-mono); }
.account-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 18px; }
.account-stats div { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); }
.account-stats small { display: block; font-family: var(--font-mono); font-size: 6px; color: var(--muted); letter-spacing: .08em; }
.account-stats b { display: block; font-family: var(--font-mono); font-size: 13px; margin-top: 2px; }
.account-note { font-size: 9px; color: var(--muted); line-height: 1.5; }

/* Toasts */
.toast-stack {
  position: fixed;
  z-index: 300;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  max-width: 100%;
  padding: 9px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-bright);
  background: rgba(20, 15, 32, .95);
  box-shadow: 0 14px 35px rgba(0,0,0,.45);
  color: var(--text);
  font-size: 10px;
  line-height: 1.35;
  backdrop-filter: blur(16px);
  animation: toastIn .3s cubic-bezier(.2,.9,.2,1);
}
.toast.is-out { animation: toastOut .25s ease forwards; }
.toast .toast-ico { color: var(--pink-2); flex: 0 0 auto; }
.toast.is-success .toast-ico { color: var(--green); }
.toast.is-error { border-color: rgba(255,93,93,.35); }
.toast.is-error .toast-ico { color: var(--danger); }
.toast.is-gold { border-color: rgba(255,207,106,.35); }
.toast.is-gold .toast-ico { color: var(--gold); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(5px) scale(.98); } }

/* FX */
.fx-layer { position: fixed; inset: 0; z-index: 250; pointer-events: none; overflow: hidden; }
.fx-particle {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--c, #fff);
  box-shadow: 0 0 9px var(--c, #fff);
  animation: fxPop var(--dur, 1.2s) cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes fxPop {
  0% { transform: translate(0,0) rotate(0) scale(0); opacity: 1; }
  20% { transform: translate(var(--dx), var(--dy)) rotate(40deg) scale(1); opacity: 1; }
  100% { transform: translate(calc(var(--dx) * 2.4), calc(var(--dy) * 2.4 + 120px)) rotate(300deg) scale(.2); opacity: 0; }
}

/* Smoke canvas */
#smokeCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 45;
}

/* ----------------------------------------------------------------------
   Footer
   ---------------------------------------------------------------------- */

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px 28px 28px;
  border-top: 1px solid rgba(255,255,255,.045);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .04em;
  line-height: 1.5;
}

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


/* Laptop screens: keep the main controls above the fold. */
@media (max-height: 920px) and (min-width: 861px) {
  .app-main { padding-top: 14px; }
  .section-head { padding-bottom: 10px; }
  .section-head h1 { font-size: 34px; }
  .device-card { padding: 15px; }
  .stock-block { margin-top: 14px; }
  .stock-number > span { font-size: 40px; }
  .device-stage { width: min(100%, 300px); margin-top: 0; }
  .rotary-row { margin-top: 2px; padding: 10px 8px 0; }
  .rotary { width: 92px; height: 92px; }
  .rotary-knob { inset: 20px; }
  .rotary-ring span { transform: rotate(var(--a)) translateY(-37px); }
  .rotary-copy h3 { font-size: 17px; }
  .rotary-copy p { margin-bottom: 4px; }
  .action-dock { margin-top: 9px; }
  .puff-btn, .auto-btn { min-height: 66px; }
  .quick-actions { margin-top: 6px; }
  .quick-btn { min-height: 42px; }
}

@media (max-height: 800px) and (min-width: 861px) {
  .section-head h1 { font-size: 29px; }
  .section-head { padding-bottom: 6px; }
  .device-card { padding: 12px; }
  .stock-number > span { font-size: 34px; }
  .device-stage { width: min(100%, 260px); }
  .rotary { width: 84px; height: 84px; }
  .rotary-knob { inset: 18px; }
  .rotary-ring span { transform: rotate(var(--a)) translateY(-33px); }
  .rotary-copy h3 { font-size: 15px; }
}

@media (max-width: 1240px) {
  .solo-shell { grid-template-columns: 215px minmax(0,1fr) 270px; gap: 14px; }
  .app-main, .topbar { padding-left: 20px; padding-right: 20px; }
  .profile-panel, .tip-panel, .mini-collection, .flavor-panel, .gauges-panel, .odds-panel { padding: 15px; }
  .online-grid { grid-template-columns: minmax(0,1fr) 300px; }
  .rotary { width: 104px; height: 104px; }
  .rotary-knob { inset: 22px; }
  .rotary-ring span { transform: rotate(var(--a)) translateY(-43px); }
}

@media (max-width: 1060px) {
  .solo-shell { grid-template-columns: minmax(0,1fr) 280px; }
  .rail-left { display: none; }
  .auth-hero h1 { font-size: clamp(42px, 6vw, 64px); }
  .online-auth { gap: 35px; }
  .collection-head { align-items: flex-start; flex-direction: column; gap: 18px; }
}

@media (max-width: 860px) {
  .solo-shell { grid-template-columns: 1fr; }
  .rail-right { position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .odds-panel { grid-column: span 2; }
  .device-column { max-width: 620px; margin: 0 auto; width: 100%; }
  .online-auth { grid-template-columns: 1fr; min-height: 0; padding-top: 20px; }
  .auth-hero { max-width: none; }
  .auth-card { max-width: 480px; width: 100%; }
  .belt-preview { display: none; }
  .browser-grid { grid-template-columns: 1fr; }
  .online-how { display: none; }
  .online-grid { display: flex; flex-direction: column; gap: 12px; }
  .online-side { display: contents; }
  .online-device { position: static; order: 1; }
  .belt-panel { order: 2; }
  .activity-panel { order: 3; min-height: 0; }
  .activity-list { max-height: 295px; }
  .collection-metrics { gap: 15px; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(69px + env(safe-area-inset-bottom)); }
  .topbar {
    padding: calc(11px + env(safe-area-inset-top, 0px)) 16px 11px;
    gap: 10px;
    /* A backdrop-filter on an ancestor makes position:fixed children
       (the bottom nav) use the header as their containing block. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(8, 6, 13, .96);
  }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 13px; letter-spacing: .13em; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .main-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 120;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--line);
    background: rgba(10, 7, 17, .94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  .nav-btn {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 7px 4px;
    border-radius: 10px;
    font-size: 8px;
    letter-spacing: .06em;
  }
  .nav-btn.is-active { background: rgba(255,255,255,.065); box-shadow: none; }
  .nav-ico { font-size: 15px; }
  .nav-live { width: 6px; height: 6px; }
  .nav-count { position: absolute; margin-left: 17px; margin-top: -12px; }
  .top-stats .level-pill { display: none; }
  .stat-pill { height: 31px; padding: 0 9px; font-size: 10px; }
  .avatar-btn { width: 32px; height: 32px; }
  .app-main { padding: 16px 14px 22px; }
  .section-head { padding-bottom: 13px; align-items: flex-start; }
  .section-head h1 { font-size: 28px; }
  .section-head .mode-chip { display: none; }
  .device-card { padding: 14px; border-radius: 22px; }
  .device-id > span:last-child { display: none; }
  .stock-number > span { font-size: 38px; }
  .device-stage { margin-top: 0; }
  .float-stat { padding: 5px 7px; gap: 5px; }
  .float-stat small { font-size: 5px; }
  .float-stat b { font-size: 8px; }
  .fs-ico { font-size: 11px; }
  .fs-battery { left: 0; top: 15%; }
  .fs-liquid { right: 0; top: 30%; }
  .fs-coil { left: 1%; bottom: 27%; }
  .rotary-row { gap: 14px; padding: 15px 2px 0; }
  .rotary { width: 92px; height: 92px; }
  .rotary-knob { inset: 19px; }
  .rotary-ring span { transform: rotate(var(--a)) translateY(-38px); }
  .rotary-knob strong { font-size: 7px; max-width: 52px; }
  .rotary-copy h3 { font-size: 16px; }
  .rotary-copy p { font-size: 9px; margin-bottom: 4px; }
  .action-dock { grid-template-columns: minmax(0,1fr) 112px; }
  .puff-btn { min-height: 70px; padding: 0 14px; gap: 10px; }
  .puff-btn-icon { width: 40px; height: 40px; font-size: 28px; }
  .puff-btn-text strong { font-size: 17px; }
  .auto-btn { min-height: 70px; }
  .auto-btn { gap: 6px; }
  .auto-btn strong { font-size: 10px; }
  .quick-btn { padding: 9px 7px; gap: 6px; }
  .quick-ico { display: none; }
  .quick-btn strong { font-size: 7px; }
  .quick-btn small { font-size: 6px; }
  .rail-right { grid-template-columns: 1fr; }
  .odds-panel { grid-column: auto; }
  .flavor-panel, .gauges-panel, .odds-panel { padding: 16px; }
  .site-footer { flex-direction: column; padding: 17px 16px 20px; gap: 4px; }
  .auth-hero h1 { font-size: 44px; }
  .auth-hero > p { font-size: 12px; }
  .auth-features { gap: 0; margin-top: 22px; }
  .auth-features > div { padding: 8px; }
  .auth-features small { font-size: 7px; }
  .lobby-browser { padding-top: 12px; }
  .browser-head { flex-direction: column; gap: 12px; }
  .browser-head h1 { font-size: 34px; }
  .browser-actions { grid-template-columns: 1fr; }
  .browser-main { padding: 15px; }
  .lobby-bar { flex-direction: column; align-items: stretch; gap: 8px; padding: 11px 12px; }
  .lobby-bar-actions { justify-content: space-between; }
  .online-game { padding-top: 8px; }
  .belt-head { flex-direction: column; align-items: flex-start; padding: 16px 14px 10px; }
  .belt-head h2 { font-size: 21px; }
  .belt-legend { justify-content: flex-start; max-width: none; }
  .conveyor { padding: 20px 10px 24px; min-height: 380px; }
  .belt-card { flex-basis: 160px; width: 160px; }
  .belt-puff-img { height: 96px; }
  .belt-puff-img img { height: 93px; }
  .belt-items { min-height: 320px; }
  .online-side { grid-template-columns: 1fr; }
  .collection-head h1 { font-size: 36px; }
  .collection-metrics { justify-content: space-between; width: 100%; }
  .collection-metrics .primary-btn { width: 100%; }
  .collection-toolbar { flex-direction: column; align-items: flex-start; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .coll-card { min-height: 250px; padding: 9px; border-radius: 14px; }
  .coll-visual { height: 108px; }
  .coll-visual img { height: 103px; }
  .coll-name { font-size: 11px; }
  .coll-notes { font-size: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .coll-footer b { font-size: 9px; }
  .toast-stack { left: 50%; right: auto; transform: translateX(-50%); align-items: center; bottom: calc(78px + env(safe-area-inset-bottom)); }
  .modal { padding: 21px; border-radius: 21px; }
  .modal h2 { font-size: 23px; }
  .draw-stage { height: 225px; }
}

@media (max-width: 430px) {
  .brand-text strong { font-size: 12px; }
  .collection-grid { grid-template-columns: 1fr 1fr; }
  .coll-card { min-height: 235px; }
  .coll-visual { height: 96px; }
  .coll-visual img { height: 92px; }
  .rotary-copy p { display: none; }
  .action-dock { grid-template-columns: minmax(0, 1fr) 100px; }
  .auto-btn { min-height: 70px; }
  .device-stage { width: min(100%, 300px); }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .quick-actions .quick-btn:last-child { grid-column: span 2; }
}

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