/* ==========================================================================
   Schlecki Gacha – styles
   ========================================================================== */

:root {
  --bg: #0b0a1a;
  --bg-2: #13112a;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-solid: #17153a;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f1efff;
  --text-2: #b4afd6;
  --text-3: #7d78a6;
  --accent: #ff5fa2;
  --accent-2: #7c5cff;
  --accent-grad: linear-gradient(135deg, #ff5fa2 0%, #b55cff 55%, #7c5cff 100%);
  --gold: #ffd166;
  --good: #3ddc97;
  --bad: #ff5d73;

  --r3: #4d9bff;
  --r4: #b36bff;
  --r5: #ff4d5e;
  --r6: #ffd700;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --topbar-h: 68px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Animated background ------------------------------------------------------ */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-orbs span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35;
  animation: float 22s ease-in-out infinite alternate;
}
.bg-orbs span:nth-child(1) { width: 520px; height: 520px; background: #7c5cff; top: -160px; left: -120px; }
.bg-orbs span:nth-child(2) { width: 460px; height: 460px; background: #ff5fa2; bottom: -180px; right: -120px; animation-delay: -8s; }
.bg-orbs span:nth-child(3) { width: 340px; height: 340px; background: #2a7bff; top: 40%; left: 55%; opacity: 0.18; animation-delay: -14s; }
@keyframes float { to { transform: translate(60px, 40px) scale(1.1); } }

/* Top bar ------------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
  background: rgba(11, 10, 26, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; flex-shrink: 0; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: var(--accent-grad); font-size: 1.2rem; box-shadow: 0 6px 20px rgba(255, 95, 162, 0.35);
}
.brand-name span { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-left: 2px; }

.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--text-2); font-weight: 500; white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--text); background: var(--surface-2); }

.account { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.balance-pill {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.18), rgba(255, 209, 102, 0.05));
  border: 1px solid rgba(255, 209, 102, 0.3); font-weight: 700; font-variant-numeric: tabular-nums;
  transition: transform 0.2s;
}
.balance-pill:hover { transform: translateY(-1px); }
.balance-pill.bump { animation: bump 0.5s ease; }
@keyframes bump { 40% { transform: scale(1.12); } }
.coin {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff3c4, #ffd166 45%, #d9952b);
  color: #6b4300; font-size: 0.72rem; font-weight: 800; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--accent-grad); display: grid; place-items: center; font-weight: 700; font-size: 0.95rem;
  border: 2px solid var(--border-strong);
}
.avatar.sm { width: 28px; height: 28px; font-size: 0.75rem; border-width: 1px; }
.avatar.lg { width: 84px; height: 84px; font-size: 2rem; border-width: 3px; }
.user-menu { position: relative; }
.user-menu > button { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; }
.menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px; padding: 6px;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
  animation: pop 0.15s ease;
}
.menu a, .menu button {
  display: flex; width: 100%; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px;
  background: none; border: 0; text-align: left; cursor: pointer; color: var(--text-2);
}
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--text); }
.menu .menu-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu .menu-head small { display: block; color: var(--text-3); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }

/* Bottom tab bar (mobile) -------------------------------------------------- */
.tabbar { display: none; }
@media (max-width: 860px) {
  .nav { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(11, 10, 26, 0.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0;
    font-size: 0.7rem; color: var(--text-3); border-radius: 12px;
  }
  .tabbar a span { font-size: 1.25rem; line-height: 1; }
  .tabbar a.active { color: var(--text); background: var(--surface); }
  .view { padding-bottom: 96px !important; }
  .brand-name { display: none; }
}

/* Layout ------------------------------------------------------------------- */
.view { max-width: 1180px; margin: 0 auto; padding: 32px 20px 64px; outline: none; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
.page-head p { color: var(--text-2); margin-top: 6px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; font-weight: 700; color: var(--accent); margin-bottom: 8px; }

.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; position: relative; overflow: hidden;
}
.panel h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.panel h3 { font-size: 1.05rem; font-weight: 600; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel.glow::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: var(--accent-grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.5; pointer-events: none;
}

/* Buttons & inputs --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 14px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s, opacity 0.2s; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.13); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent-grad); border-color: transparent; box-shadow: 0 8px 26px rgba(181, 92, 255, 0.35); }
.btn.primary:hover:not(:disabled) { background: var(--accent-grad); box-shadow: 0 12px 34px rgba(255, 95, 162, 0.45); }
.btn.gold { background: linear-gradient(135deg, #ffe08a, #ffb84d); color: #3d2600; border-color: transparent; box-shadow: 0 8px 26px rgba(255, 184, 77, 0.35); }
.btn.discord { background: #5865f2; border-color: transparent; box-shadow: 0 8px 26px rgba(88, 101, 242, 0.4); }
.btn.discord:hover:not(:disabled) { background: #6b77f5; }
.btn.danger { background: rgba(255, 93, 115, 0.15); border-color: rgba(255, 93, 115, 0.4); color: #ffb3bf; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { color: var(--text); background: var(--surface); }
.btn.lg { padding: 16px 28px; font-size: 1.1rem; border-radius: 16px; }
.btn.sm { padding: 7px 12px; font-size: 0.85rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn .price { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.22); font-size: 0.85em; }

.input, .select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.25); outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus, .select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.select option { background: var(--surface-solid); }
.field, label.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.875rem; color: var(--text-2); font-weight: 500; }

.segmented { display: inline-flex; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border); gap: 4px; flex-wrap: wrap; }
.segmented button {
  border: 0; background: none; padding: 8px 14px; border-radius: 10px; cursor: pointer; color: var(--text-2); font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
.segmented button:hover:not(:disabled) { color: var(--text); }
.segmented button.active { background: var(--surface-2); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }
.segmented button:disabled { opacity: 0.4; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 0.85rem; font-weight: 600; cursor: default;
}
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--border-strong); }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.tag.ok { background: rgba(61, 220, 151, 0.15); color: var(--good); }
.tag.wait { background: rgba(255, 209, 102, 0.12); color: var(--gold); }
.tag.off { background: rgba(255, 255, 255, 0.08); color: var(--text-3); }

/* Rarity helpers ----------------------------------------------------------- */
.r3 { --rc: var(--r3); }
.r4 { --rc: var(--r4); }
.r5 { --rc: var(--r5); }
.r6 { --rc: var(--r6); }
.rarity-text { color: var(--rc); font-weight: 700; }
.rarity-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 800;
  background: color-mix(in srgb, var(--rc) 22%, transparent); color: var(--rc); border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
}

/* Cards (collectibles) ----------------------------------------------------- */
.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 170px), 1fr)); }
.cards.lg { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.card {
  position: relative; aspect-ratio: 5 / 7; border-radius: 16px; overflow: hidden; cursor: pointer;
  background: linear-gradient(160deg, color-mix(in srgb, var(--rc) 35%, #15132e), #0f0d24 70%);
  border: 2px solid color-mix(in srgb, var(--rc) 60%, transparent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 0 var(--rc);
  transition: transform 0.25s cubic-bezier(.2, .8, .2, 1), box-shadow 0.25s;
  isolation: isolate;
}
.card:hover { transform: translateY(-4px) rotate(-0.5deg); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 26px color-mix(in srgb, var(--rc) 45%, transparent); }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.card .card-fallback {
  position: absolute; inset: 0; z-index: -1; display: grid; place-items: center;
  font-size: 4.5rem; font-weight: 800; color: color-mix(in srgb, var(--rc) 70%, #fff);
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--rc) 45%, transparent), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 10px, transparent 10px 20px);
  text-shadow: 0 6px 30px color-mix(in srgb, var(--rc) 80%, transparent);
}
.card .card-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.card .card-count {
  padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); font-weight: 800; font-size: 0.8rem;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.card .card-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 12px 12px;
  background: linear-gradient(to top, rgba(6, 5, 18, 0.95) 30%, transparent);
}
.card .card-name { font-weight: 700; font-size: 1.02rem; line-height: 1.2; }
.card .card-series { font-size: 0.78rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .card-id { font-size: 0.7rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.card.missing { filter: grayscale(1) brightness(0.45); border-style: dashed; cursor: default; }
.card.missing:hover { transform: none; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.card.missing .card-fallback { font-size: 3rem; }
.card.in-showcase::after {
  content: '★ Showcase'; position: absolute; top: 40px; left: 10px; padding: 2px 8px; border-radius: 6px; font-size: 0.68rem; font-weight: 800;
  background: var(--accent-grad);
}

/* Holo shine for 5★ and GEM */
.card.r5 .shine, .card.r6 .shine {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0.55;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 45%, transparent 60%);
  background-size: 250% 250%; background-repeat: no-repeat; animation: shine 4.5s ease-in-out infinite;
}
.card.r6 .shine {
  background:
    linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, 0.7) 45%, transparent 60%),
    linear-gradient(125deg, #ff008455, #ffd70055, #00ffd055, #7c5cff55, #ff008455);
  background-size: 250% 250%, 400% 400%; background-repeat: no-repeat; opacity: 0.6;
}
.card.r6 { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 28px rgba(255, 215, 0, 0.35); }
@keyframes shine { 0% { background-position: 100% 100%, 0% 50%; } 100% { background-position: 0% 0%, 100% 50%; } }

.gacha-layout { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
@media (max-width: 860px) { .gacha-layout { grid-template-columns: 1fr; } }
.casino-layout { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); align-items: start; }

/* Gacha machine ------------------------------------------------------------ */
.machine {
  position: relative; display: grid; place-items: center; min-height: 380px; border-radius: 28px; padding: 30px 20px;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(255, 95, 162, 0.35), transparent 60%),
    radial-gradient(ellipse at 50% -20%, rgba(124, 92, 255, 0.35), transparent 60%),
    rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  overflow: hidden;
}
.capsule-wrap { position: relative; width: 190px; height: 190px; }
.capsule {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  box-shadow: inset 0 -12px 30px rgba(0, 0, 0, 0.35), 0 20px 60px rgba(124, 92, 255, 0.45);
  transition: box-shadow 0.4s;
}
.capsule::before, .capsule::after { content: ''; position: absolute; left: 0; right: 0; height: 50%; }
.capsule::before { top: 0; background: linear-gradient(160deg, #fff, #d9d4ff); }
.capsule::after { bottom: 0; background: var(--capsule-color, var(--accent-grad)); }
.capsule .band { position: absolute; top: calc(50% - 7px); left: 0; right: 0; height: 14px; background: #2b2250; z-index: 2; }
.capsule .knob { position: absolute; top: calc(50% - 20px); left: calc(50% - 20px); width: 40px; height: 40px; border-radius: 50%; background: #2b2250; border: 6px solid #fff; z-index: 3; }
.capsule .gloss { position: absolute; top: 14%; left: 18%; width: 30%; height: 18%; border-radius: 50%; background: rgba(255, 255, 255, 0.75); filter: blur(4px); z-index: 4; transform: rotate(-25deg); }
.machine.spinning .capsule-wrap { animation: shake 0.5s ease-in-out infinite; }
.machine.opening .capsule-wrap { animation: crack 0.7s ease-in forwards; }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg) translateY(-4px); } 75% { transform: rotate(9deg) translateY(-4px); } }
@keyframes crack { 60% { transform: scale(1.15); filter: brightness(1.5); } 100% { transform: scale(2.2); opacity: 0; filter: brightness(3); } }
.machine .status { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: var(--text-2); font-weight: 600; }
.machine .rays {
  position: absolute; width: 700px; height: 700px; opacity: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--ray, #ffffff) 25%, transparent) 0deg 8deg, transparent 8deg 22deg);
  border-radius: 50%; mask: radial-gradient(circle, #000 20%, transparent 65%); -webkit-mask: radial-gradient(circle, #000 20%, transparent 65%);
  animation: rotate 18s linear infinite;
}
.machine.opening .rays, .machine.revealed .rays { opacity: 1; transition: opacity 0.6s; }
@keyframes rotate { to { transform: rotate(360deg); } }

.results { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(46%, 170px), 220px)); justify-content: center; width: 100%; perspective: 1200px; }
.flip { aspect-ratio: 5 / 7; position: relative; transform-style: preserve-3d; transition: transform 0.7s cubic-bezier(.3, 1.4, .5, 1); cursor: pointer; }
.flip.revealed { transform: rotateY(180deg); }
.flip > * { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .card { transform: rotateY(180deg); }
.flip .back {
  border-radius: 16px; display: grid; place-items: center; font-size: 2.6rem;
  background: linear-gradient(135deg, #2b2250, #18153a); border: 2px solid var(--border-strong);
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 12px, transparent 12px 24px), linear-gradient(135deg, #2b2250, #18153a);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.flip .back.hint { animation: hint 1.4s ease-in-out infinite; }
.flip .back.hint.r5, .flip .back.hint.r6 { box-shadow: 0 0 30px var(--rc), 0 0 60px color-mix(in srgb, var(--rc) 50%, transparent); border-color: var(--rc); }
@keyframes hint { 50% { transform: translateY(-5px); } }
.result-enter { perspective: 1200px; animation: dealIn 0.5s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes dealIn { from { opacity: 0; transform: translateY(60px) scale(0.6) rotate(-8deg); } }

.odds { display: grid; gap: 10px; }
.odds-row { display: grid; grid-template-columns: 130px 1fr 60px; align-items: center; gap: 12px; font-size: 0.9rem; }
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--rc, var(--accent-grad)); min-width: 3px; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.progress { height: 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--accent-grad); transition: width 1s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 0 20px rgba(255, 95, 162, 0.5); }

/* Coinflip ----------------------------------------------------------------- */
.coin-stage { display: grid; place-items: center; height: 220px; perspective: 900px; }
.big-coin { width: 150px; height: 150px; position: relative; transform-style: preserve-3d; transition: transform 2s cubic-bezier(.2, .7, .2, 1); }
.big-coin .face {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; font-size: 3.4rem;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: radial-gradient(circle at 30% 30%, #fff3c4, #ffd166 45%, #d9952b);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.25), inset 0 -8px 0 rgba(0, 0, 0, 0.15), 0 20px 40px rgba(0, 0, 0, 0.4);
}
.big-coin .face small { position: absolute; bottom: 22px; font-size: 0.75rem; font-weight: 800; color: #6b4300; letter-spacing: 0.1em; text-transform: uppercase; }
.big-coin .face.titten { transform: rotateY(180deg); }
.big-coin .face.edge { transform: rotateX(90deg); font-size: 2.4rem; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice {
  padding: 18px 12px; border-radius: 16px; border: 2px solid var(--border); background: rgba(0, 0, 0, 0.2); cursor: pointer; text-align: center;
  font-weight: 700; transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.choice span { display: block; font-size: 2rem; }
.choice:hover { border-color: var(--border-strong); }
.choice.active { border-color: var(--accent); background: rgba(255, 95, 162, 0.12); transform: translateY(-2px); }
.amount-row { display: flex; gap: 8px; }
.amount-row .input { text-align: center; font-weight: 700; font-size: 1.1rem; }
.result-text { text-align: center; font-size: 1.2rem; font-weight: 700; min-height: 1.8em; }
.result-text.win { color: var(--good); }
.result-text.lose { color: var(--bad); }

/* Wheel -------------------------------------------------------------------- */
.wheel-wrap { position: relative; width: min(100%, 340px); aspect-ratio: 1; margin: 0 auto; }
.wheel-wrap svg { width: 100%; height: 100%; transition: transform 4.5s cubic-bezier(.15, .85, .15, 1); filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.45)); }
.wheel-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 2; width: 0; height: 0;
  border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid #fff;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}
.wheel-hub {
  position: absolute; top: 50%; left: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--accent-grad); border: 5px solid #fff; display: grid; place-items: center; font-size: 1.5rem; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.prize-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.prize-list div { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); font-size: 0.875rem; }

/* Drop banner -------------------------------------------------------------- */
.drop-banner {
  position: sticky; top: var(--topbar-h); z-index: 40; display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px; background: linear-gradient(90deg, #ffb84d, #ff5fa2, #b55cff, #ffb84d); background-size: 300% 100%;
  animation: bannerFlow 6s linear infinite; color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 8px 30px rgba(255, 95, 162, 0.4);
}
.drop-banner .btn { background: #fff; color: #3a1c5c; text-shadow: none; border: 0; }
@keyframes bannerFlow { to { background-position: 300% 0; } }

/* Feed, lists, tables ------------------------------------------------------ */
.feed { display: flex; flex-direction: column; gap: 8px; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.2); animation: fadeIn 0.4s ease; }
.feed-item .thumb { width: 38px; height: 52px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: color-mix(in srgb, var(--rc) 30%, #15132e); border: 1px solid var(--rc); display: grid; place-items: center; font-weight: 800; }
.feed-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.feed-item .grow { flex: 1; min-width: 0; }
.feed-item .grow div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row .rank { width: 32px; text-align: center; font-weight: 800; color: var(--text-3); font-variant-numeric: tabular-nums; }
.list-row .rank.top { font-size: 1.3rem; }
.list-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row.me { background: rgba(255, 95, 162, 0.08); border-radius: 10px; }
a.list-row:hover { background: var(--surface); border-radius: 10px; }
.delta-plus { color: var(--good); font-weight: 700; }
.delta-minus { color: var(--bad); font-weight: 700; }

.stat-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat { padding: 16px; border-radius: 14px; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--border); }
.stat .label { font-size: 0.78rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.stat .value { font-size: 1.6rem; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* Hero --------------------------------------------------------------------- */
.hero { display: grid; gap: 40px; grid-template-columns: 1.1fr 0.9fr; align-items: center; padding: 30px 0 50px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.03em; }
.hero h1 em { font-style: normal; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 1.15rem; color: var(--text-2); margin: 20px 0 30px; max-width: 520px; }
.hero-cards { position: relative; height: 380px; }
.hero-cards .card { position: absolute; width: 190px; top: 50%; left: 50%; cursor: default; pointer-events: none; }
.hero-cards .card:nth-child(1) { transform: translate(-115%, -50%) rotate(-12deg); }
.hero-cards .card:nth-child(2) { transform: translate(-50%, -56%); z-index: 2; }
.hero-cards .card:nth-child(3) { transform: translate(15%, -50%) rotate(12deg); }
.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.feature { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.feature .ico { font-size: 1.8rem; margin-bottom: 10px; }
.feature h3 { font-size: 1.05rem; margin-bottom: 6px; }
.feature p { color: var(--text-2); font-size: 0.92rem; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 10px; }
  .hero-cards { height: 300px; order: -1; }
  .hero-cards .card { width: 150px; }
}

.empty { text-align: center; padding: 50px 20px; color: var(--text-2); }
.empty .ico { font-size: 3rem; margin-bottom: 12px; }

.showcase-slots { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
.slot-empty { aspect-ratio: 5 / 7; border-radius: 16px; border: 2px dashed var(--border-strong); display: grid; place-items: center; color: var(--text-3); text-align: center; padding: 10px; font-size: 0.9rem; }
@media (max-width: 560px) { .showcase-slots { gap: 8px; } .showcase-slots .card-series, .showcase-slots .card-id { display: none; } .showcase-slots .card-name { font-size: 0.8rem; } }

.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

.skeleton { border-radius: 12px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04)); background-size: 200% 100%; animation: skel 1.3s linear infinite; min-height: 120px; }
@keyframes skel { to { background-position: -200% 0; } }

/* Toasts ------------------------------------------------------------------- */
.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
@media (max-width: 860px) { .toasts { bottom: 90px; right: 12px; left: 12px; max-width: none; } }
.toast {
  padding: 14px 18px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  animation: toastIn 0.3s cubic-bezier(.2, .9, .3, 1.2); font-weight: 500;
}
.toast.error { border-color: rgba(255, 93, 115, 0.5); }
.toast.success { border-color: rgba(61, 220, 151, 0.5); }
.toast.out { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(0.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* Modal -------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(5, 4, 15, 0.75); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 20px; animation: fadeIn 0.2s ease;
}
.modal {
  width: min(100%, 760px); max-height: calc(100dvh - 40px); overflow: auto; background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-radius: 24px; box-shadow: var(--shadow); padding: 28px; animation: pop 0.25s cubic-bezier(.2, .9, .3, 1.2); position: relative;
}
.modal .close { position: absolute; top: 14px; right: 14px; }
.item-detail { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.item-detail .card { cursor: default; }
@media (max-width: 640px) { .item-detail { grid-template-columns: 1fr; } .item-detail .card { max-width: 240px; margin: 0 auto; width: 100%; } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

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