/* ============================================================
   MOROZWAY v2 — Ultra Premium Liquid Glass
   Stronger contrast · richer motion · commercial product feel
   ============================================================ */

:root {
  --bg: #05050a;
  --bg-deep: #020206;
  --surface: rgba(14, 14, 22, 0.78);
  --surface-elevated: rgba(22, 22, 34, 0.88);
  --glass-base: linear-gradient(165deg,
    rgba(255,255,255,0.09) 0%,
    rgba(40, 42, 60, 0.45) 35%,
    rgba(12, 12, 20, 0.82) 100%);
  --glass-elevated: linear-gradient(155deg,
    rgba(255,255,255,0.12) 0%,
    rgba(48, 50, 70, 0.5) 40%,
    rgba(16, 16, 26, 0.9) 100%);
  --glass-shine: linear-gradient(125deg,
    rgba(255,255,255,0.28) 0%,
    rgba(255,255,255,0.06) 28%,
    transparent 55%);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.28);
  --glass-top: rgba(255, 255, 255, 0.32);
  --glass-bottom: rgba(255, 255, 255, 0.03);
  --text: #f4f6fc;
  --text-secondary: #b4bcd0;
  --text-muted: #6a7288;
  --accent: #ff3b5c;
  --accent-rgb: 255, 59, 92;
  --accent-soft: rgba(255, 59, 92, 0.22);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 34px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --shadow-glass:
    0 16px 48px rgba(0,0,0,0.45),
    0 0 0 1px rgba(255,255,255,0.04),
    inset 0 1px 0 var(--glass-top),
    inset 0 -1px 0 var(--glass-bottom);
  --shadow-elevated:
    0 24px 60px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.18);
  --font: "Manrope", system-ui, -apple-system, sans-serif;
}

:root[data-theme="red"]     { --accent:#ff3b5c; --accent-rgb:255,59,92; }
:root[data-theme="blue"]    { --accent:#3b9eff; --accent-rgb:59,158,255; }
:root[data-theme="purple"]  { --accent:#b56bff; --accent-rgb:181,107,255; }
:root[data-theme="emerald"] { --accent:#1ed8a0; --accent-rgb:30,216,160; }
:root[data-theme="gold"]    { --accent:#f0c14b; --accent-rgb:240,193,75; }
:root[data-theme="pink"]    { --accent:#ff5aad; --accent-rgb:255,90,173; }
:root[data-theme="cyan"]    { --accent:#22d3ee; --accent-rgb:34,211,238; }
:root[data-theme="mono"]    { --accent:#e8ecf4; --accent-rgb:232,236,244; }
:root[data-theme="orange"]  { --accent:#ff8a3d; --accent-rgb:255,138,61; }
:root[data-theme="violet"]  { --accent:#9b6dff; --accent-rgb:155,109,255; }
:root[data-theme="ice"]     { --accent:#7dd3fc; --accent-rgb:125,211,252; }
:root[data-theme="mint"]    { --accent:#34d399; --accent-rgb:52,211,153; }
:root[data-theme="rose"]    { --accent:#fb4b7a; --accent-rgb:251,75,122; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
}

body {
  min-height: 100%;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 130% 55% at 50% -12%, rgba(var(--accent-rgb), 0.32), transparent 62%),
    radial-gradient(ellipse 90% 45% at 50% 115%, rgba(var(--accent-rgb), 0.12), transparent 68%),
    radial-gradient(ellipse 70% 40% at 85% 25%, rgba(100, 60, 180, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 30% at 10% 60%, rgba(var(--accent-rgb), 0.08), transparent 50%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 35%, #080810 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.4;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Ambient blobs — stronger */
.ambient {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.65;
  will-change: transform, opacity;
}
.ambient-one {
  width: 380px; height: 380px;
  top: -140px; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.45) 0%, transparent 70%);
  animation: none;
}
.ambient-two {
  width: 280px; height: 280px;
  bottom: 5%; right: -90px;
  background: radial-gradient(circle, rgba(140, 80, 220, 0.22) 0%, transparent 70%);
  animation: none;
}
.ambient-three {
  width: 220px; height: 220px;
  top: 42%; left: -70px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.16) 0%, transparent 70%);
  animation: none;
}

@keyframes ambientBreath {
  0%   { opacity: 0.45; transform: translateX(-50%) scale(1); }
  100% { opacity: 0.85; transform: translateX(-50%) scale(1.18); }
}
@keyframes ambientFloat {
  0%   { opacity: 0.35; transform: translate(0,0) scale(1); }
  100% { opacity: 0.65; transform: translate(-25px, -35px) scale(1.2); }
}
@keyframes ambientFloat2 {
  0%   { opacity: 0.28; transform: translate(0,0) scale(1); }
  100% { opacity: 0.55; transform: translate(30px, 25px) scale(1.15); }
}

#snowfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.app {
  position: relative;
  z-index: 2;
  width: min(430px, 100%);
  margin: 0 auto;
  padding: 12px 16px 52px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

/* ========== GLASS CARDS ========== */
.card {
  position: relative;
  background: var(--glass-base);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.25s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glass-shine);
  opacity: 0.65;
  pointer-events: none;
  border-radius: inherit;
}
.card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 60%;
  height: 200%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.07), transparent);
  transform: rotate(18deg);
  animation: none;
  pointer-events: none;
}
@keyframes glassSheen {
  0%, 100% { left: -60%; opacity: 0; }
  40% { opacity: 1; }
  70% { left: 120%; opacity: 0; }
}

@supports (backdrop-filter: blur(24px)) {
  .card,
  .stats,
  .tile,
  .topbar-button,
  .topbar-balance,
  .theme-sheet-panel,
  .case-screen .card,
  .case-screen .screen-card,
  .profile-stats-list,
  .ref-reward-hero,
  .ref-mini-stats,
  .ref-top,
  .task-item,
  .withdraw-amount {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ========== TOP BAR ========== */
.home-topbar {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  position: relative;
  z-index: 10;
}
.topbar-button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass-base);
  color: #e0e6f8;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 10px 24px rgba(0,0,0,0.3);
  transition: transform 0.2s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.topbar-button:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 0 20px rgba(var(--accent-rgb), 0.15);
}
.topbar-button:active { transform: scale(0.92); }
.topbar-button svg {
  width: 21px; height: 21px;
  fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.topbar-balance {
  justify-self: center;
  min-width: 78px;
  padding: 10px 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.65);
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.18), rgba(8, 12, 24, 0.85));
  color: #f0f4ff;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow:
    0 0 28px rgba(var(--accent-rgb), 0.28),
    inset 0 1px 0 rgba(255,255,255,0.15);
  letter-spacing: 0.02em;
  animation: none;
}
@keyframes balancePulse {
  0%, 100% { box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.2), inset 0 1px 0 rgba(255,255,255,0.12); }
  50% { box-shadow: 0 0 36px rgba(var(--accent-rgb), 0.38), inset 0 1px 0 rgba(255,255,255,0.18); }
}
.topbar-amount { font-size: 15px; line-height: 1; }
.topbar-balance > span:last-child { font-size: 13px; opacity: 0.95; color: #fbbf24; }

/* ========== HERO ========== */
.hero {
  position: relative;
  min-height: 310px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 0;
  overflow: visible;
}
.hero-glow {
  position: absolute;
  width: 300px; height: 220px;
  bottom: 10px; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.38) 0%, transparent 70%);
  filter: blur(36px);
  animation: none;
  pointer-events: none;
}
@keyframes heroGlowPulse {
  0%   { opacity: 0.55; transform: translateX(-50%) scale(1); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.22); }
}
.hero-mascots {
  position: relative;
  width: min(100%, 390px);
  max-height: 350px;
  object-fit: contain;
  object-position: center bottom;
  -webkit-mask-image: linear-gradient(to bottom, #000 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 84%, transparent 100%);
  filter: drop-shadow(0 16px 36px rgba(0,0,0,0.5)) drop-shadow(0 0 40px rgba(var(--accent-rgb), 0.12));
  animation: none;
  user-select: none;
  pointer-events: none;
}
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.015); }
}

/* ========== BALANCE CARD ========== */
.balance {
  position: relative;
  width: 210px;
  min-height: 92px;
  margin: -52px auto 20px;
  padding: 15px 20px 14px;
  text-align: center;
  border-radius: 26px;
  z-index: 4;
  background: linear-gradient(150deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.04) 100%);
  border: 1px solid rgba(255,255,255,0.26);
  box-shadow:
    0 20px 48px rgba(0,0,0,0.4),
    0 0 40px rgba(var(--accent-rgb), 0.1),
    inset 0 1px 0 rgba(255,255,255,0.25);
}
.balance-head {
  display: flex;
  justify-content: center;
  margin-bottom: 3px;
}
.balance-head span {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
}
.balance .amount {
  font-size: 38px;
  line-height: 1.05;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  text-shadow: 0 0 30px rgba(var(--accent-rgb), 0.25);
}
.balance .amount span {
  font-size: 26px;
  color: #fbbf24;
  margin-left: 3px;
  filter: drop-shadow(0 0 8px rgba(251,191,36,0.5));
}
.balance.is-updated .amount,
.amount.is-updated {
  animation: none;
}
@keyframes valueBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ========== STATS ========== */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0 0 18px;
  min-height: 108px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--glass-base);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 14px 36px rgba(0,0,0,0.28);
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 92px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 10px 4px;
  transition: transform 0.25s var(--ease);
}
.stat:active { transform: scale(0.96); }
.stat .stat-icon {
  color: #c0ccf0;
  margin-bottom: 2px;
  opacity: 0.95;
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.2));
}
.stat b {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(var(--accent-rgb), 0.15);
}
.stat small {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

/* ========== TILES ========== */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.tile {
  min-height: 136px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  border-radius: 28px;
  background: var(--glass-base);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 14px 32px rgba(0,0,0,0.22);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 0.22s var(--ease), border-color 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 50%);
  pointer-events: none;
}
.tile:active { transform: scale(0.96); }
.tile-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e0e8ff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.tile-icon svg { width: 22px; height: 22px; }
.tile-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tile-copy b {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}
.tile-copy small {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.case-tile {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: linear-gradient(155deg, rgba(var(--accent-rgb), 0.2) 0%, rgba(255,255,255,0.03) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 14px 32px rgba(0,0,0,0.22),
    0 0 40px -6px rgba(var(--accent-rgb), 0.3);
}
.case-tile .tile-icon {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: rgba(var(--accent-rgb), 0.35);
  color: var(--accent);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.25);
}

/* ========== LINKS ========== */
.links {
  margin-top: 4px;
  padding: 0 6px;
  border-radius: 26px;
  background: var(--glass-base);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-glass);
}
.links button {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}
.links button + button {
  border-top: 1px solid rgba(255,255,255,0.08);
}
.links button:active { background: rgba(255,255,255,0.05); }
.link-icon {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  display: grid;
  place-items: center;
  color: #d0daf8;
  flex-shrink: 0;
}
.link-icon svg { width: 20px; height: 20px; }
.link-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.link-text b {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}
.link-text small {
  font-size: 12px;
  color: var(--text-muted);
}
.link-arrow {
  font-size: 22px;
  color: var(--text-muted);
  font-weight: 300;
}

#notice {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: 20px 0 8px;
  min-height: 18px;
  opacity: 0.85;
}
.footer {
  text-align: center;
  margin-top: 8px;
}
.footer small {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  font-weight: 700;
  opacity: 0.55;
}

/* ========== THEME SHEET ========== */
.theme-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.theme-sheet[hidden] { display: none !important; }
.theme-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.62);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: fadeIn 0.28s var(--ease);
}
.theme-sheet-panel {
  position: relative;
  width: min(430px, 100%);
  background: linear-gradient(180deg, rgba(32,32,44,0.97) 0%, rgba(12,12,18,0.99) 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-bottom: 0;
  border-radius: 30px 30px 0 0;
  padding: 14px 20px 36px;
  box-shadow: 0 -24px 70px rgba(0,0,0,0.55);
  animation: sheetUp 0.38s var(--ease);
}
@keyframes sheetUp {
  from { transform: translateY(100%); opacity: 0.5; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.theme-sheet-handle {
  width: 42px; height: 5px;
  border-radius: 99px;
  background: rgba(255,255,255,0.22);
  margin: 0 auto 16px;
}
.theme-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.theme-sheet-title {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
}
.theme-sheet-close {
  width: 36px; height: 36px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.theme-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.theme-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 14px 6px 12px;
  border-radius: 20px;
  border: 1.5px solid transparent;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.theme-dot:active { transform: scale(0.95); }
.theme-dot.is-active {
  border-color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 10px 24px rgba(0,0,0,0.3);
}
.theme-swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 16px color-mix(in srgb, var(--swatch) 55%, transparent), inset 0 1px 0 rgba(255,255,255,0.35);
}
.mono-swatch {
  background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%) !important;
}
.theme-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ========== PAGE SCREENS ========== */
.case-screen,
.page-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  width: min(430px, 100%);
  margin: 0 auto;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 50% at 50% -8%, rgba(var(--accent-rgb), 0.24), transparent 58%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 45%, #080810 100%);
  padding: 14px 16px 44px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: none;
  animation: pageIn 0.34s var(--ease);
}
.case-screen.page-active,
.page-screen.page-active {
  display: block;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateX(22px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.app.page-mode .home-topbar,
.app.page-mode .hero,
.app.page-mode .balance,
.app.page-mode .stats,
.app.page-mode .tiles,
.app.page-mode .links,
.app.page-mode #notice,
.app.page-mode .footer {
  visibility: hidden;
  pointer-events: none;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.case-back,
.page-back {
  width: 44px; height: 44px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--glass-base);
  color: #e8eefc;
  font-size: 24px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
  transition: transform 0.2s;
}
.case-back:active,
.page-back:active { transform: scale(0.92); }

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.screen-title {
  font-size: 23px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.screen-balance-pill {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.15), rgba(8,12,24,0.8));
  font-weight: 800;
  font-size: 13px;
  color: #f0f4ff;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.18);
}

.screen-card {
  background: var(--glass-base);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-glass);
  position: relative;
  overflow: hidden;
}
.screen-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glass-shine);
  opacity: 0.5;
  pointer-events: none;
  border-radius: inherit;
}

/* PROFILE */
.profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 24px;
  margin-bottom: 14px;
}
.profile-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
  display: grid;
  place-items: center;
  font-size: 40px;
  color: rgba(255,255,255,0.3);
  margin-bottom: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.12);
}
.profile-name {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 5px;
}
.profile-id {
  font-size: 13px;
  color: var(--text-muted);
}
.profile-stats-list {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--glass-base);
  box-shadow: var(--shadow-glass);
}
.profile-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.profile-stat-row:last-child { border-bottom: 0; }
.profile-stat-row span {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 600;
}
.profile-stat-row b {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
}
.profile-stat-row b .star { color: #fbbf24; }

/* REFERRAL */
.ref-reward-hero {
  text-align: center;
  padding: 32px 16px 24px;
  margin-bottom: 14px;
  border-radius: var(--radius-lg);
  background: var(--glass-base);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-glass);
  position: relative;
  overflow: hidden;
}
.ref-reward-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 70% at 50% 15%, rgba(var(--accent-rgb), 0.22), transparent 70%);
  pointer-events: none;
}
.ref-reward-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
}
.ref-reward-value {
  font-size: 56px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-shadow: 0 0 40px rgba(var(--accent-rgb), 0.3);
}
.ref-reward-value .star {
  font-size: 42px;
  color: #fbbf24;
  filter: drop-shadow(0 0 12px rgba(251,191,36,0.5));
}
.ref-link-box {
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: 16px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-all;
  text-align: center;
}
.ref-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--glass-base);
  overflow: hidden;
  box-shadow: var(--shadow-glass);
}
.ref-mini-stat {
  padding: 18px 8px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.ref-mini-stat:last-child { border-right: 0; }
.ref-mini-stat b {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 3px;
}
.ref-mini-stat small {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.ref-top {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--glass-base);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-glass);
}
.ref-top-title {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ref-top-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}
.ref-top-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ref-top-list li:last-child { border-bottom: 0; }
.ref-top-list .rank { color: var(--text-muted); margin-right: 6px; }
.ref-top-list .score { font-weight: 800; color: #fff; }
.ref-top-note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.45;
}
.ref-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-primary {
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
  border: 0;
  background: linear-gradient(180deg, #f4f6fc 0%, #c4cadc 100%);
  color: #0c0c12;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.75);
  transition: transform 0.2s, filter 0.2s;
}
.btn-primary:active { transform: scale(0.975); filter: brightness(0.94); }
.btn-ghost {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* TASKS */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.task-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: var(--glass-base);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-glass);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  text-align: left;
  width: 100%;
  color: inherit;
}
.task-item:active { transform: scale(0.975); }
.task-item-icon {
  width: 50px; height: 50px;
  border-radius: 17px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  display: grid;
  place-items: center;
  font-size: 24px;
  flex-shrink: 0;
}
.task-item-body {
  flex: 1;
  min-width: 0;
}
.task-item-body b {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 3px;
}
.task-item-body small {
  font-size: 12px;
  color: var(--text-muted);
}
.task-item-arrow {
  font-size: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

#morozwayTaskList { margin-top: 10px; }
#morozwayTaskList .card { margin-bottom: 10px; padding: 16px !important; }
#morozwayTaskList h3 { font-size: 15px; margin-bottom: 6px; }
#morozwayTaskList p { font-size: 13px; color: var(--text-secondary); margin: 4px 0; }
#morozwayTaskList .case-spin,
#morozwayTaskList button { margin-top: 10px; }

/* WITHDRAW */
.withdraw-balance-block {
  text-align: center;
  padding: 28px 16px 22px;
  margin-bottom: 20px;
}
.withdraw-balance-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  font-weight: 700;
}
.withdraw-balance-value {
  font-size: 52px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-shadow: 0 0 40px rgba(var(--accent-rgb), 0.25);
}
.withdraw-balance-value .star {
  color: #fbbf24;
  font-size: 38px;
  filter: drop-shadow(0 0 10px rgba(251,191,36,0.45));
}
.withdraw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  margin-bottom: 18px;
}
.withdraw-amount {
  min-height: 58px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--glass-base);
  color: #fff;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.withdraw-amount:active { transform: scale(0.95); }
.withdraw-amount.is-selected {
  border-color: rgba(var(--accent-rgb), 0.75);
  background: rgba(var(--accent-rgb), 0.15);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.2), inset 0 1px 0 rgba(255,255,255,0.12);
}
.withdraw-custom-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.withdraw-custom-input {
  flex: 1;
  min-height: 54px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  padding: 0 16px;
  outline: none;
}
.withdraw-custom-input::placeholder { color: var(--text-muted); }
.withdraw-custom-input:focus {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}
.withdraw-note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  margin: 14px 0 16px;
}
.withdraw-history-link {
  display: block;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
  background: none;
  border: 0;
  width: 100%;
  font-family: var(--font);
}

/* CASE */
.case-brand {
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.22em;
  font-weight: 800;
  color: var(--text-muted);
  margin: 4px 0 16px;
}
.case-brand span { color: var(--accent); }
.case-balance {
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.case-cost {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.case-roulette {
  position: relative;
  height: 104px;
  margin: 0 -8px 22px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.3);
}
.case-pointer {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--accent);
  z-index: 2;
  transform: translateX(-50%);
  box-shadow: 0 0 16px var(--accent);
}
.case-track {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 10px;
  padding: 0 50%;
  will-change: transform;
}
.case-prize {
  flex-shrink: 0;
  width: 74px;
  height: 74px;
  border-radius: 18px;
  background: var(--glass-elevated);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  gap: 2px;
}
.case-prize small {
  font-size: 10px;
  color: var(--text-muted);
}
.case-prize.is-winner {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.45);
}
.case-odds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.case-odds > div {
  padding: 12px 8px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  text-align: center;
  font-size: 13px;
}
.case-odds b { display: block; margin-top: 4px; font-size: 12px; }
.case-spin {
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
  border: 0;
  background: linear-gradient(180deg, #f4f6fc 0%, #c4cadc 100%);
  color: #0c0c12;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.3);
}
.case-spin:disabled { opacity: 0.5; cursor: not-allowed; }
.case-history { margin-top: 12px; }
.history-item {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 14px;
}
.history-item small { color: var(--text-muted); }

#commentTaskScreen .card { padding: 18px !important; }
#commentPreview img { border-radius: 12px; width: 100%; }
#commentScreenshots {
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font-family: var(--font);
}

/* REVEAL */
.reveal {
  animation: cardAppear 0.55s var(--ease) both;
}
.reveal:nth-child(1) { animation-delay: 0.05s; }
.reveal:nth-child(2) { animation-delay: 0.1s; }
.reveal:nth-child(3) { animation-delay: 0.15s; }
.reveal:nth-child(4) { animation-delay: 0.2s; }
.reveal:nth-child(5) { animation-delay: 0.25s; }
@keyframes cardAppear {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tap-pop { animation: tapPop 0.3s var(--ease); }
@keyframes tapPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}

@media (max-width: 380px) {
  .hero { min-height: 275px; }
  .hero-mascots { max-height: 305px; }
  .balance { margin-top: -44px; width: 190px; }
  .balance .amount { font-size: 34px; }
  .tile { min-height: 124px; padding: 16px; }
  .home-topbar { grid-template-columns: 44px 1fr 44px; }
  .topbar-button { width: 44px; height: 44px; border-radius: 16px; }
  .theme-options { gap: 8px; }
  .withdraw-grid { gap: 8px; }
  .withdraw-amount { min-height: 52px; font-size: 14px; }
}

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