* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  scroll-behavior: smooth;
}

:root {
  --ice-blue: #4fc3f7;
  --ice-blue-dark: #0288d1;
  --accent: #7fe8ff;
  --silver: #d7e4ee;
  --bronze: #4fc3f7;
  --frost-white: #eaf6ff;
  --panel-bg: rgba(0, 18, 32, 0.55);
  --panel-border: rgba(79, 195, 247, 0.28);
  --live-green: #4dff9e;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--frost-white);
  background: #000000;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

/* Background layers */
#winter-canvas {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(180deg, rgba(0,8,18,0.72) 0%, rgba(0,0,0,0.85) 55%, #000000 100%),
    url("../assets/bg.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.cursor-glow {
  position: fixed; top: 0; left: 0; width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79,195,247,0.14), transparent 70%);
  transform: translate(-50%, -50%); pointer-events: none; z-index: 1; transition: opacity 0.3s;
}

.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; mix-blend-mode: screen; opacity: 0.4; }
.aurora-band { position: absolute; top: -20%; left: -20%; width: 140%; height: 70%; filter: blur(50px); }
.aurora-band.a1 { background: linear-gradient(120deg, transparent, #2196f3 40%, #4fc3f7 60%, transparent); animation: auroraWave1 14s ease-in-out infinite alternate; }
.aurora-band.a2 { background: linear-gradient(100deg, transparent, #0d47a1 45%, #4fc3f7 65%, transparent); top: -10%; animation: auroraWave2 18s ease-in-out infinite alternate; }
.aurora-band.a3 { background: linear-gradient(140deg, transparent, #4fc3f7 35%, #7fe8ff 55%, transparent); top: -25%; animation: auroraWave3 22s ease-in-out infinite alternate; }
@keyframes auroraWave1 { 0% { transform: translateX(-5%) skewY(-4deg) scaleY(1); opacity:0.35;} 100% { transform: translateX(8%) skewY(4deg) scaleY(1.2); opacity:0.6;} }
@keyframes auroraWave2 { 0% { transform: translateX(6%) skewY(6deg) scaleY(1.1); opacity:0.25;} 100% { transform: translateX(-8%) skewY(-3deg) scaleY(0.9); opacity:0.5;} }
@keyframes auroraWave3 { 0% { transform: translateX(-8%) skewY(3deg); opacity:0.3;} 100% { transform: translateX(10%) skewY(-5deg); opacity:0.55;} }

.stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.stars span { position: absolute; width: 2px; height: 2px; background: #cfeeff; border-radius: 50%; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity:0.15; transform:scale(1);} 50% { opacity:1; transform:scale(1.6);} }

/* Layout base */
.site-header, .container, .site-footer { position: relative; z-index: 2; }

.site-header { background: rgba(0,10,20,0.75); backdrop-filter: blur(8px); border-bottom: 1px solid var(--panel-border); transition: background 0.2s ease; }
.header-inner { max-width: 1100px; margin: 0 auto; padding: 18px 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.logo { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; color: var(--ice-blue); text-shadow: 0 0 12px rgba(79,195,247,0.6); }

/* Image logo mark (van_logo.png) */
.logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(79,195,247,0.85));
}

/* Snowflake emoji beside the logo/name */
.logo-flake { animation: spin 6s linear infinite; filter: drop-shadow(0 0 6px rgba(79,195,247,0.8)); }
@keyframes spin { to { transform: rotate(360deg); } }
.logo-sub { font-size: 12px; font-weight: 400; opacity: 0.6; margin-left: 8px; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a { color: var(--frost-white); text-decoration: none; margin-left: 16px; font-size: 14px; opacity: 0.85; transition: opacity 0.2s ease, color 0.2s ease; }
.nav-links a:hover { color: var(--ice-blue); opacity: 1; }
.btn-nav { margin-left: 16px; padding: 9px 16px; font-size: 13px; }

.container { max-width: 1100px; margin: 0 auto; padding: 32px 24px 80px; }

/* Status banner */
.status-banner { display: none; padding: 12px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 14px; transition: opacity 0.25s ease; }
.status-banner.loading, .status-banner.error { display: block; }
.status-banner.loading { background: rgba(79,195,247,0.12); border: 1px solid var(--ice-blue); color: var(--ice-blue); }
.status-banner.error { background: rgba(255,90,90,0.12); border: 1px solid #ff5a5a; color: #ffb3b3; }

/* Live bar */
.live-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 14px;
}
.btn-small { padding: 8px 14px; font-size: 12px; }

.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: #d7e6f5;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.live-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8a97a6;
  box-shadow: 0 0 0 0 rgba(138, 151, 166, 0.5);
  transition: background 0.25s ease;
}

/* Offline state (default) */
.live-status-pill.is-offline {
  background: rgba(120, 130, 145, 0.10);
  border-color: rgba(120, 130, 145, 0.25);
  color: #9aa7b5;
}
.live-status-pill.is-offline .live-status-dot {
  background: #7c8a99;
}

/* Live state — toggled via JS when the stream is live */
.live-status-pill.is-live {
  background: rgba(255, 59, 92, 0.12);
  border-color: rgba(255, 59, 92, 0.4);
  color: #ffd7de;
  box-shadow: 0 0 18px rgba(255, 59, 92, 0.25);
}
.live-status-pill.is-live .live-status-dot {
  background: #ff3b5c;
  animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 59, 92, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(255, 59, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 92, 0); }
}

/* Live pill positioned inside the nav bar (next to Connect Account) */
.live-status-pill--nav {
  margin-left: 16px;
  padding: 7px 14px;
  font-size: 12.5px;
}

/* Promo section (Play on Clutch — home page) */
.promo-section {
  margin-bottom: 20px;
  border-radius: 20px;
  padding: 2px;
  background: linear-gradient(135deg, var(--ice-blue), var(--ice-blue-dark), #001a2e);
  box-shadow: 0 0 40px rgba(79,195,247,0.22);
  position: relative;
}

.promo-inner {
  background: linear-gradient(180deg, rgba(0,14,26,0.96), rgba(0,0,0,0.98));
  border-radius: 18px;
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.promo-inner::after {
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 40px rgba(79,195,247,0.07);
  animation: frostPulse 6s ease-in-out infinite;
  pointer-events: none;
}

.promo-text {
  flex: 1;
  min-width: 240px;
  position: relative;
  z-index: 1;
}

.promo-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--frost-white);
  margin-bottom: 4px;
  line-height: 1.3;
}

.promo-title .accent-word {
  color: var(--accent);
  text-shadow: 0 0 16px rgba(127,232,255,0.4);
}

.promo-subtext {
  font-size: 11.5px;
  color: var(--silver);
  opacity: 0.7;
  margin-bottom: 0;
  line-height: 1.35;
}

.promo-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.promo-code-box {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
}

.promo-code-box .code-label {
  padding: 11px 8px 11px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ice-blue);
  opacity: 0.8;
  white-space: nowrap;
}

.promo-code-box .code-value {
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--frost-white);
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex: 1;
  text-align: center;
}

.promo-code-box .copy-btn {
  border: none;
  border-left: 1px solid var(--panel-border);
  background: rgba(79, 195, 247, 0.1);
  color: var(--ice-blue);
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.promo-code-box .copy-btn:hover {
  background: rgba(79, 195, 247, 0.22);
}
.promo-code-box .copy-btn.copied {
  background: rgba(72, 199, 142, 0.22);
  color: #b7f5d6;
}

.promo-play-btn {
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 700px) {
  .promo-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 24px 20px;
  }
  .promo-title { font-size: 14.5px; }
  .promo-subtext { font-size: 11px; }
  .promo-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .promo-code-box {
    width: 100%;
    justify-content: space-between;
  }
  .promo-code-box .code-value {
    flex: 1;
  }
  .promo-play-btn {
    width: 100%;
  }
}

/* Prize pot / points hero */
.pot-hero, .points-hero {
  margin-bottom: 20px; border-radius: 20px; padding: 2px;
  background: linear-gradient(135deg, var(--ice-blue), var(--ice-blue-dark), #001a2e);
  box-shadow: 0 0 40px rgba(79,195,247,0.22); position: relative;
}
.pot-hero-inner, .points-hero-inner {
  background: linear-gradient(180deg, rgba(0,14,26,0.96), rgba(0,0,0,0.98));
  border-radius: 18px; padding: 36px 24px; text-align: center; position: relative; overflow: hidden;
}
.pot-hero-inner::after, .points-hero-inner::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 40px rgba(79,195,247,0.07);
  animation: frostPulse 6s ease-in-out infinite; pointer-events: none;
}
@keyframes frostPulse { 0%,100% { box-shadow: inset 0 0 30px rgba(79,195,247,0.05); } 50% { box-shadow: inset 0 0 50px rgba(79,195,247,0.15); } }
.pot-icicles {
  position: absolute; top:0; left:0; right:0; height:14px;
  background: repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(79,195,247,0.45) 18px, rgba(79,195,247,0.45) 20px);
  clip-path: polygon(0 0,100% 0,95% 100%,90% 20%,85% 100%,80% 20%,75% 100%,70% 20%,65% 100%,60% 20%,55% 100%,50% 20%,45% 100%,40% 20%,35% 100%,30% 20%,25% 100%,20% 20%,15% 100%,10% 20%,5% 100%,0 20%);
}
.pot-label { font-size: 14px; letter-spacing: 2px; text-transform: uppercase; color: var(--ice-blue); opacity: 0.9; margin-bottom: 8px; }
.pot-amount { font-size: 56px; font-weight: 800; color: var(--accent); margin-bottom: 10px; animation: blueGlow 3s ease-in-out infinite; }
@keyframes blueGlow { 0%,100% { text-shadow: 0 0 20px rgba(127,232,255,0.45); } 50% { text-shadow: 0 0 40px rgba(127,232,255,0.9), 0 0 60px rgba(79,195,247,0.4); } }
.pot-note { font-size: 13px; opacity: 0.7; }

.earn-note { text-align: center; font-size: 13px; opacity: 0.6; margin: -8px 0 24px; }

/* Countdown */
.countdown-card {
  background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 18px;
  padding: 24px; margin-bottom: 32px; text-align: center; backdrop-filter: blur(6px); position: relative;
}
.countdown-label { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--ice-blue); margin-bottom: 14px; opacity: 0.9; }
.countdown-timer { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.countdown-unit { background: rgba(255,255,255,0.05); border: 1px solid var(--panel-border); border-radius: 12px; padding: 14px 18px; min-width: 70px; }
.countdown-unit span { display: block; font-size: 28px; font-weight: 800; color: var(--accent); text-shadow: 0 0 16px rgba(127,232,255,0.4); }
.countdown-unit small { font-size: 11px; opacity: 0.6; text-transform: uppercase; letter-spacing: 1px; }

/* Leaderboard table */
.lb-section { margin-bottom: 32px; }
.lb-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.lb-header h2 { margin: 0; font-size: 20px; color: var(--ice-blue); }
.lb-sub { font-size: 12px; opacity: 0.6; }

.table-wrap {
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(6px);
  position: relative;
}
.table-wrap::after {
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 40px rgba(79,195,247,0.06);
  animation: frostPulse 6s ease-in-out infinite;
  pointer-events: none;
}

.ice-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ice-table thead tr {
  background: linear-gradient(90deg, rgba(79,195,247,0.14), rgba(79,195,247,0.02));
}
.ice-table th {
  text-align: left;
  padding: 16px 20px;
  color: var(--ice-blue);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-bottom: 1px solid var(--panel-border);
}
.ice-table th:last-child, .ice-table td:last-child { text-align: right; }
.ice-table th:first-child, .ice-table td:first-child { text-align: center; width: 70px; }

.ice-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  position: relative;
}
.ice-table tbody tr {
  transition: background 0.2s ease, transform 0.15s ease;
}
.ice-table tbody tr:hover {
  background: rgba(79,195,247,0.07);
  transform: translateX(2px);
}
.ice-table tbody tr:last-child td { border-bottom: none; }

.ice-table tbody tr.rank-1-row { background: linear-gradient(90deg, rgba(79,195,247,0.14), transparent); }
.ice-table tbody tr.rank-2-row { background: linear-gradient(90deg, rgba(215,228,238,0.06), transparent); }
.ice-table tbody tr.rank-3-row { background: linear-gradient(90deg, rgba(79,195,247,0.08), transparent); }

.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.07); font-weight: 800; font-size: 13px;
}
.rank-badge.rank-1 { background: linear-gradient(135deg, #4fc3f7, #0288d1); color: #001420; box-shadow: 0 0 14px rgba(79,195,247,0.65); animation: crownPulse 2s ease-in-out infinite; }
@keyframes crownPulse { 0%,100% { box-shadow: 0 0 10px rgba(79,195,247,0.5); } 50% { box-shadow: 0 0 22px rgba(79,195,247,0.95); } }
.rank-badge.rank-2 { background: linear-gradient(135deg, #dfe9f2, #b0c4d4); color: #1a2a35; box-shadow: 0 0 10px rgba(215,228,238,0.4); }
.rank-badge.rank-3 { background: linear-gradient(135deg, #6fb8d9, #3a7ca5); color: #001420; box-shadow: 0 0 10px rgba(111,184,217,0.4); }

.lb-player { font-weight: 600; }
.lb-wagered-val { font-weight: 600; opacity: 0.9; }
.prize-tag { color: var(--accent); font-weight: 800; font-size: 14px; }
.prize-tag.none { color: rgba(255,255,255,0.3); font-weight: 400; }

/* Generic panels (connect section fallback, store, admin) */
.panel {
  background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 18px;
  padding: 24px; margin-bottom: 32px; backdrop-filter: blur(6px); position: relative;
}
.panel::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 40px rgba(79,195,247,0.06);
  animation: frostPulse 6s ease-in-out infinite; pointer-events: none;
}
.panel-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.panel-header h2 { margin: 0 0 6px; font-size: 20px; color: var(--ice-blue); }
.panel-sub { margin: 0 0 18px; font-size: 13px; opacity: 0.65; }

/* Connect form */
.connect-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  position: relative;
  z-index: 1;
}

.ice-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ice-field label {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ice-blue);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
}

.ice-field input[type="text"],
.ice-field input[type="email"],
.ice-field input[type="password"],
.ice-field textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--frost-white);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

.ice-field input[type="text"]::placeholder,
.ice-field input[type="email"]::placeholder,
.ice-field input[type="password"]::placeholder,
.ice-field textarea::placeholder {
  color: rgba(234, 246, 255, 0.35);
}

.ice-field input[type="text"]:hover,
.ice-field input[type="email"]:hover,
.ice-field input[type="password"]:hover,
.ice-field textarea:hover {
  border-color: rgba(79, 195, 247, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.ice-field input[type="text"]:focus,
.ice-field input[type="email"]:focus,
.ice-field input[type="password"]:focus,
.ice-field textarea:focus {
  border-color: var(--ice-blue);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.18), inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

.ice-field textarea {
  resize: vertical;
  min-height: 40px;
  line-height: 1.4;
}

.ice-field input[type="file"] {
  background: rgba(79, 195, 247, 0.04);
  border: 1.5px dashed rgba(79, 195, 247, 0.35);
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 11px;
  color: var(--silver);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.ice-field input[type="file"]:hover {
  border-color: var(--ice-blue);
  background: rgba(79, 195, 247, 0.08);
}
.ice-field input[type="file"]::file-selector-button {
  background: linear-gradient(160deg, #eaf9ff, #4fc3f7);
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 12px;
  color: #001420;
  margin-right: 12px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.ice-field input[type="file"]::file-selector-button:hover {
  transform: translateY(-1px);
}

.ice-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  color: var(--silver);
  opacity: 0.95;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 2px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.ice-checkbox:hover {
  background: rgba(79, 195, 247, 0.06);
  border-color: rgba(79, 195, 247, 0.25);
}
.ice-checkbox input {
  width: 15px;
  height: 15px;
  accent-color: var(--ice-blue);
  cursor: pointer;
  margin-top: 1px;
  flex-shrink: 0;
}

#kick-status-field {
  background: rgba(79, 195, 247, 0.05);
  border: 1px solid rgba(79, 195, 247, 0.18);
  border-radius: 14px;
  padding: 8px;
  gap: 6px;
}
#kick-status-field label {
  margin-bottom: 2px;
}

#kick-oauth-btn {
  padding: 9px 16px !important;
  font-size: 13px;
}

.connect-result { margin-top: 6px; font-size: 12px; position: relative; z-index: 1; }
.connect-result.ok { color: #8dffb0; }
.connect-result.pending { color: var(--accent); }
.connect-result.error { color: #ffb3b3; }

.connect-form button[type="submit"] {
  padding: 9px 20px;
  margin-top: 0;
  font-size: 13px;
}

/* Store */
.store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.store-item { background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border); border-radius: 16px; padding: 20px; text-align: center; transition: transform 0.2s ease; }
.store-item:hover { transform: translateY(-4px); }
.store-icon { font-size: 32px; margin-bottom: 10px; }
.store-name { font-size: 14px; margin-bottom: 6px; font-weight: 600; }
.store-cost { font-size: 13px; color: var(--accent); margin-bottom: 14px; }

/* Ice buttons */
.btn-ice {
  position: relative; overflow: hidden; border: none; border-radius: 12px;
  padding: 12px 22px; font-weight: 700; font-size: 14px; color: #001420; cursor: pointer;
  background: linear-gradient(160deg, #eaf9ff 0%, #a8dfff 25%, #4fc3f7 55%, #0288d1 100%);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.75), inset 0 -6px 10px rgba(0,60,100,0.4), 0 6px 14px rgba(0,30,60,0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}
.btn-ice::before {
  content: ""; position: absolute; top: -50%; left: -60%; width: 40%; height: 200%;
  background: rgba(255,255,255,0.5); transform: rotate(25deg); transition: left 0.5s ease;
}
.btn-ice:hover::before { left: 130%; }
.btn-ice:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.85), inset 0 -6px 10px rgba(0,60,100,0.45), 0 10px 20px rgba(0,40,80,0.55);
}
.btn-ice:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.3), 0 2px 6px rgba(0,30,60,0.4);
}
.btn-ice:disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.5); }
.btn-ice.cracked { animation: crack 0.4s ease; }
@keyframes crack { 0% { filter: brightness(1);} 30% { filter: brightness(1.6);} 100% { filter: brightness(1);} }

.btn-nav.is-connected {
  background: rgba(72, 199, 142, 0.15);
  border-color: rgba(72, 199, 142, 0.45);
  color: #b7f5d6;
  box-shadow: none;
}
.btn-nav.is-connected:hover {
  background: rgba(72, 199, 142, 0.22);
}

/* Footer */
.site-footer { text-align: center; padding: 24px; font-size: 12px; opacity: 0.5; }

/* Modals (connect + profile + admin PNL viewer) */
.modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,4,10,0.8); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal-ice {
  position: relative;
  max-width: 440px;
  width: 100%;
  max-height: 96vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, rgba(0,20,36,0.97), rgba(0,0,0,0.99));
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 18px 22px 20px;
  box-shadow: 0 0 60px rgba(79,195,247,0.25), inset 0 0 40px rgba(79,195,247,0.06);
  animation: modalPop 0.35s cubic-bezier(.2,1.4,.4,1);
}
@keyframes modalPop {
  0% { transform: scale(0.75) rotate(-2deg); opacity: 0; }
  60% { transform: scale(1.03) rotate(0.5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.modal-flake { position: absolute; top: 10px; left: 16px; font-size: 16px; color: var(--ice-blue); opacity: 0.5; animation: spin 8s linear infinite; }
.modal-close {
  position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--panel-border); background: rgba(255,255,255,0.05); color: var(--frost-white);
  cursor: pointer; font-size: 11px; transition: background 0.2s ease, transform 0.2s ease;
}
.modal-close:hover { background: rgba(255,90,90,0.2); transform: rotate(90deg); }
.modal-ice h2 { margin: 2px 0 4px; color: var(--ice-blue); font-size: 17px; }
.modal-ice .panel-sub { margin: 0 0 10px; font-size: 12px; line-height: 1.35; }

/* Profile modal (My Account) */
#profile-modal-backdrop .modal-ice {
  max-width: 440px;
  text-align: center;
}

.profile-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.profile-avatar-flake {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(79,195,247,0.3), rgba(127,232,255,0.15));
  border: 1px solid var(--panel-border);
  font-size: 1.2rem;
  color: var(--ice-blue);
}

.profile-username {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--frost-white);
  text-align: center;
  margin-bottom: 6px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0 20px;
  text-align: left;
}

.stat-grid .card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.stat-grid .card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}
.stat-grid .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #93a4b8;
  margin-bottom: 6px;
}
.stat-grid .value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--frost-white);
}
.stat-grid .value.gold {
  color: #ffd873;
  text-shadow: 0 0 12px rgba(255, 216, 115, 0.35);
}

.profile-subhead {
  margin-top: 18px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--silver);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
  text-align: left;
}

#profile-body { text-align: left; }
#profile-body .ice-table { width: 100%; font-size: 0.88rem; }
#profile-body .muted { text-align: center; padding: 10px 0 !important; }

#profile-hide-toggle-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 16px;
  text-align: left;
  font-size: 13px;
  opacity: 0.9;
}
#profile-hide-toggle-wrap input {
  width: 16px; height: 16px; accent-color: var(--ice-blue); cursor: pointer; margin-top: 2px; flex-shrink: 0;
}

#profile-logout-btn {
  background: linear-gradient(160deg, #ffdede, #ff9a9a, #ff5a5a);
  color: #3a0000;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.6), inset 0 -6px 10px rgba(120,0,0,0.35), 0 6px 14px rgba(60,0,0,0.4);
}

/* Admin panel additions */
.pnl-notes-text {
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--silver);
  line-height: 1.5;
}

.pnl-screenshot-img {
  max-width: 100%;
  max-height: 480px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: block;
  margin-top: 6px;
}

/* Admin login page */
.admin-login-wrap {
  min-height: calc(100vh - 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.admin-login-card {
  max-width: 420px;
  width: 100%;
  background: linear-gradient(180deg, rgba(0,20,36,0.9), rgba(0,0,0,0.95));
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 0 60px rgba(79,195,247,0.2), inset 0 0 40px rgba(79,195,247,0.06);
  position: relative;
  overflow: hidden;
}
.admin-login-card::after {
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 40px rgba(79,195,247,0.07);
  animation: frostPulse 6s ease-in-out infinite;
  pointer-events: none;
}

.admin-login-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(79,195,247,0.35), rgba(127,232,255,0.15));
  border: 1px solid var(--panel-border);
  font-size: 1.8rem;
  box-shadow: 0 0 24px rgba(79,195,247,0.35);
}

.admin-login-card h2 {
  margin: 0 0 8px;
  color: var(--ice-blue);
  font-size: 22px;
}

.admin-login-card .panel-sub {
  margin: 0 0 24px;
  text-align: center;
}

.admin-login-card .ice-field {
  text-align: left;
  margin-bottom: 18px;
}

.admin-login-card .btn-ice {
  width: 100%;
}

#admin-login-result {
  margin-top: 14px;
}

/* Admin panel (post-login) */
.admin-panel-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Utility */
.muted { opacity: 0.5; text-align: center; padding: 30px !important; }

/* ---------- Mobile header + bottom nav bar redesign ---------- */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    flex-wrap: nowrap;
  }

  .logo {
    font-size: 17px;
    flex-shrink: 0;
  }

  .logo-img {
    width: 30px;
    height: 30px;
  }

  .logo span:not(.logo-flake) {
    display: none;
  }

  /* Hide the page-link tabs from the top bar on mobile — they move to
     the bottom nav instead. Status pill + connect button remain. */
  .nav-links a {
    display: none;
  }

  .nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
  }

  .live-status-pill--nav {
    margin-left: 0;
    padding: 6px 12px;
    font-size: 11.5px;
    flex-shrink: 0;
  }

  .btn-nav {
    margin-left: 0;
    padding: 8px 14px;
    font-size: 12.5px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .container {
    padding-bottom: 100px;
  }

  /* Fixed bottom nav bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(0, 10, 20, 0.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--panel-border);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--silver);
    opacity: 0.6;
    flex: 1;
    padding: 4px 0;
    border-radius: 10px;
    transition: opacity 0.2s ease, background 0.2s ease, transform 0.15s ease;
  }

  .mobile-nav-item:active {
    transform: scale(0.94);
  }

  .mobile-nav-item.is-active {
    opacity: 1;
    color: var(--ice-blue);
    background: rgba(79, 195, 247, 0.08);
  }

  .mobile-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
  }

  .mobile-nav-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.2s ease;
  }

  .mobile-nav-item.is-active .mobile-nav-icon svg {
    filter: drop-shadow(0 0 6px rgba(79, 195, 247, 0.6));
  }

  .mobile-nav-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
  }
}

@media (max-width: 600px) {
  .header-inner { padding: 10px 14px; }
  .logo { font-size: 16px; }
  .logo-img { width: 26px; height: 26px; }
  .live-status-pill--nav { font-size: 11px; padding: 6px 10px; }
  .btn-nav { font-size: 12px; padding: 7px 12px; }

  .mobile-nav-icon { width: 20px; height: 20px; }
  .mobile-nav-label { font-size: 10px; }

  .pot-amount { font-size: 40px; }
  .ice-table th, .ice-table td { padding: 12px 10px; font-size: 13px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-login-card { padding: 32px 22px; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
