/* Root variables for easy theming - Grebban inspired */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-card: rgba(255,255,255,0.04);
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border-subtle: rgba(255,255,255,0.08);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --coin-size: 34px;
  --coin-color: #ffc94d;
  --coin-edge: #d9a016;
  --transition-fast: 180ms;
  --shadow-subtle: 0 4px 12px -4px rgba(0,0,0,0.4);
  --shadow-elevated: 0 8px 24px -8px rgba(0,0,0,0.5);
  --font-stack: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}

/* Login screen styles */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1a2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 400ms ease-out;
  margin: 0;
  padding: 0;
}
.login-container {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border: 2px solid var(--accent);
  border-radius: 2rem;
  padding: 3.5rem 3rem;
  max-width: 450px;
  width: 90%;
  text-align: center;
  box-shadow: 
    0 32px 100px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset,
    0 8px 32px rgba(37, 99, 235, 0.15);
  animation: modalPop 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(20px);
  position: relative;
  margin: auto;
  flex-shrink: 0;
}
.login-container::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), transparent, var(--accent));
  border-radius: inherit;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0.8;
}
.login-emoji {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  animation: fadeIn 600ms ease-out 200ms both;
}
.login-container h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
  letter-spacing: -0.03em;
}
.login-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin: 0 0 2rem;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.login-input {
  appearance: none;
  width: 100%;
  padding: 1.2rem 1.5rem;
  font-size: 1.05rem;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--bg-primary), rgba(26, 26, 26, 0.8));
  border: 2px solid var(--border-subtle);
  border-radius: 1rem;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-stack);
  backdrop-filter: blur(10px);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.login-input:focus {
  border-color: var(--accent);
  box-shadow: 
    0 0 0 4px rgba(37, 99, 235, 0.2),
    0 8px 25px -5px rgba(37, 99, 235, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.9), var(--bg-primary));
}
.login-input:hover {
  border-color: rgba(37, 99, 235, 0.6);
  transform: translateY(-0.5px);
}
.login-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
  font-weight: 400;
}
.login-button {
  appearance: none;
  width: 100%;
  padding: 1.2rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  border: 2px solid transparent;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 15px rgba(37, 99, 235, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-family: var(--font-stack);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.025em;
}
.login-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}
.login-button:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 8px 25px rgba(37, 99, 235, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, #3b82f6, var(--accent-hover));
}
.login-button:hover::before {
  left: 100%;
}
.login-button:active {
  transform: translateY(-1px);
  box-shadow: 
    0 4px 15px rgba(37, 99, 235, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.1);
}
.login-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 0.5rem;
  color: #fca5a5;
  font-size: 0.95rem;
}
.login-footer {
  margin-top: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  opacity: 0.8;
}

* { box-sizing: border-box; }
html, body { 
  height: 100%; 
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font-stack);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  position: relative;
}
body.app-loaded {
  display: flex;
  flex-direction: column;
}

h1 { 
  margin: 0 0 .5rem; 
  font-size: clamp(2rem,4.5vw,3rem); 
  font-weight: 600; 
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 8s ease infinite;
  text-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.tagline { margin: 0; font-weight: 400; color: var(--text-secondary); font-size: clamp(0.95rem,2vw,1.1rem); }

.app-header, .app-footer { text-align: center; padding: 2rem 1rem; border-bottom: 1px solid var(--border-subtle); }
.app-header { padding-top: 3rem; position: relative; }

.user-section {
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.user-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.user-info:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
  background: rgba(100, 180, 255, 0.1);
}

.logout-btn {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.logout-btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 0.5rem;
  padding: 2px;
  background: linear-gradient(
    90deg,
    rgba(239, 68, 68, 0) 0%,
    rgba(239, 68, 68, 0.9) 15%,
    rgba(220, 38, 38, 0.9) 30%,
    rgba(239, 68, 68, 0.9) 45%,
    rgba(255, 255, 0, 0.9) 50%,
    rgba(239, 68, 68, 0.9) 55%,
    rgba(220, 38, 38, 0.9) 70%,
    rgba(239, 68, 68, 0.9) 85%,
    rgba(239, 68, 68, 0) 100%
  );
  background-size: 200% 100%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  filter: blur(1px) brightness(1.5);
}

.logout-btn:hover {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  box-shadow: 
    0 0 10px rgba(239, 68, 68, 0.4),
    0 0 20px rgba(239, 68, 68, 0.3),
    0 0 30px rgba(239, 68, 68, 0.2),
    inset 0 0 10px rgba(239, 68, 68, 0.1);
  animation: electricPulse 0.1s ease-in-out infinite;
}

.logout-btn:hover::before {
  opacity: 1;
  animation: electricFlow 0.8s linear infinite;
}

@keyframes electricFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes electricPulse {
  0%, 100% { 
    box-shadow: 
      0 0 10px rgba(239, 68, 68, 0.4),
      0 0 20px rgba(239, 68, 68, 0.3),
      0 0 30px rgba(239, 68, 68, 0.2),
      inset 0 0 10px rgba(239, 68, 68, 0.1);
  }
  50% { 
    box-shadow: 
      0 0 15px rgba(239, 68, 68, 0.5),
      0 0 25px rgba(239, 68, 68, 0.4),
      0 0 35px rgba(239, 68, 68, 0.3),
      inset 0 0 15px rgba(239, 68, 68, 0.15);
  }
}

.logout-btn:active {
  transform: scale(0.95);
}

.app-footer { 
  font-size: .85rem; 
  color: var(--text-secondary); 
  border-bottom: none; 
  border-top: 1px solid var(--border-subtle); 
  margin-top: auto; 
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.history-btn {
  appearance: none;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-stack);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-subtle);
}

.history-btn:hover {
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  border-color: var(--accent);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.history-btn:active {
  transform: translateY(0);
}

.app-main { flex: 1; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 2rem 1.5rem; gap: 2rem; }
.layout { width: 100%; max-width: 1200px; margin: 0 auto; display: flex; flex-direction: row; justify-content: center; gap: 3rem; align-items: flex-start; }
.summary { width: clamp(300px, 32vw, 420px); display: flex; flex-direction: column; gap: 1.25rem; align-items: flex-start; padding: 1.5rem 2rem 2rem; border-radius: .75rem; background: var(--bg-card); border: 1px solid var(--border-subtle); backdrop-filter: blur(8px); box-shadow: var(--shadow-subtle); animation: fadeIn .5s ease-out; }
.summary-title { margin: 0 0 .5rem; font-size: clamp(1.3rem,2.5vw,1.75rem); letter-spacing: -0.01em; font-weight: 600; color: var(--text-primary); }
.summary #coinCount { align-self: flex-start; }
.summary .member-stats { justify-content: flex-start; }

/* Scene (jar) */
.scene { position: relative; width: min(680px, 100%); display: flex; justify-content: center; flex-direction: column; align-items: center; padding: 3.3rem 1.4rem 1.4rem .6rem; gap: .75rem; }
.below-jar { margin-top: 1rem; border: none; display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
/* Reset button spacing below jar */
.scene .reset { margin-top: .6rem; }
/* shelf removed per request */

.jar {
  position: relative;
  width: clamp(240px, 48vw, 360px);
  height: clamp(380px, 60vw, 560px);
  background: 
    linear-gradient(135deg, rgba(100, 180, 255, 0.25) 0%, rgba(60, 140, 240, 0.18) 35%, rgba(30, 100, 220, 0.12) 65%, rgba(20, 80, 200, 0.15) 100%),
    radial-gradient(ellipse at 30% 35%, rgba(150, 200, 255, 0.3) 0%, rgba(100, 180, 255, 0.15) 25%, transparent 60%),
    radial-gradient(circle at 70% 60%, rgba(80, 160, 255, 0.2) 0%, transparent 40%);
  backdrop-filter: blur(12px) saturate(180%);
  border: 3px solid rgba(120, 200, 255, 0.5);
  border-top: 4px solid rgba(180, 220, 255, 0.7);
  border-bottom: 3px solid rgba(60, 140, 240, 0.4);
  border-left: 3px solid rgba(140, 210, 255, 0.6);
  border-right: 3px solid rgba(80, 160, 240, 0.45);
  border-radius: 2rem 2rem 2.6rem 2.6rem;
  box-shadow:
    inset 0 2px 0 0 rgba(200, 230, 255, 0.6),
    inset 0 0 0 2px rgba(120, 200, 255, 0.35),
    inset -4px 0 16px -2px rgba(150, 210, 255, 0.5),
    inset 4px 0 16px -2px rgba(60, 140, 240, 0.4),
    inset 0 -40px 60px -20px rgba(100, 180, 255, 0.25),
    0 8px 0 -2px rgba(80, 160, 240, 0.3),
    0 20px 40px -16px rgba(37, 99, 235, 0.6),
    0 40px 60px -24px rgba(37, 99, 235, 0.4),
    0 2px 8px rgba(37, 99, 235, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible; /* Allow overflow coins to spill outside */
  padding: .85rem .65rem 1.25rem;
  transform: translateZ(0);
}
.jar::before, .jar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}
/* Comic-style shine strip with random sparkles */
.jar::before {
  width: 100%;
  height: 100%;
  right: auto;
  left: 0;
  top: 0;
  mix-blend-mode: overlay;
  opacity: 1;
  animation: sparkleRandom 3s ease-in-out infinite;
}
/* Bright rim & comic cel-shading with sparkle animation */
.jar::after {
  background:
    radial-gradient(ellipse at 50% 3%, rgba(240,250,255,0.8) 0%, rgba(200,230,255,0.4) 5%, transparent 12%),
    radial-gradient(ellipse at 50% 8%, rgba(180,220,255,0.3) 0%, transparent 18%),
    linear-gradient(to right, rgba(150,210,255,0.2) 0%, transparent 15%, transparent 85%, rgba(80,160,240,0.25) 100%),
    linear-gradient(180deg, rgba(200,230,255,0.25) 0%, transparent 25%, transparent 75%, rgba(60,140,240,0.2) 100%);
  mix-blend-mode: overlay;
  animation: jarShine 4s ease-in-out infinite;
}

@keyframes jarShine {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}
.jar-neck {
  position: absolute;
  top: -3.3rem; left: 50%; transform: translateX(-50%);
  width: 58%; height: 2.9rem;
  background: 
    linear-gradient(180deg, rgba(180,220,255,0.35) 0%, rgba(120,190,255,0.25) 40%, rgba(80,160,240,0.2) 100%),
    radial-gradient(ellipse at 50% 20%, rgba(200,230,255,0.4) 0%, transparent 60%);
  border: 3px solid rgba(140, 210, 255, 0.6);
  border-left: 3px solid rgba(180, 230, 255, 0.7);
  border-right: 3px solid rgba(100, 180, 240, 0.5);
  border-bottom: none;
  border-radius: 1.2rem 1.2rem 0 0;
  backdrop-filter: blur(10px) saturate(160%);
  box-shadow: 
    inset 0 2px 0 rgba(220,240,255,0.7),
    inset 0 0 12px rgba(150,210,255,0.4),
    inset -2px 0 8px rgba(180,220,255,0.5),
    0 4px 0 -1px rgba(100,180,240,0.4),
    0 6px 16px -10px rgba(37, 99, 235, 0.6);
}
.jar-gloss {
  position: absolute;
  top: 12%; left: 8%; 
  width: 28%; 
  height: 45%;
  background: 
    radial-gradient(ellipse at 35% 30%, rgba(255,255,255,0.85) 0%, rgba(240,250,255,0.6) 15%, rgba(200,230,255,0.35) 35%, transparent 65%);
  pointer-events: none;
  border-radius: 50%;
  filter: blur(12px);
  animation: glossPulse 6s ease-in-out infinite;
  mix-blend-mode: overlay;
}
.jar-inner { position: absolute; inset: 0; padding: .75rem .6rem 1.2rem; overflow: hidden; /* Clip coins inside jar */ }

/* Random sparkle animation for jar */
@keyframes sparkleRandom {
  0% {
    background: 
      linear-gradient(95deg, 
        rgba(255,255,255,0.7) 0%, 
        rgba(220,240,255,0.5) 4%, 
        rgba(180,220,255,0.3) 10%, 
        rgba(140,200,255,0.1) 18%,
        rgba(255,255,255,0) 25%
      ),
      radial-gradient(circle at 20% 25%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,1) 100%),
      radial-gradient(circle at 70% 40%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%),
      radial-gradient(circle at 35% 65%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%),
      radial-gradient(circle at 80% 70%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%),
      radial-gradient(circle at 50% 30%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%);
  }
  25% {
    background: 
      linear-gradient(95deg, 
        rgba(255,255,255,0.7) 0%, 
        rgba(220,240,255,0.5) 4%, 
        rgba(180,220,255,0.3) 10%, 
        rgba(140,200,255,0.1) 18%,
        rgba(255,255,255,0) 25%
      ),
      radial-gradient(circle at 20% 25%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%),
      radial-gradient(circle at 70% 40%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,1) 100%),
      radial-gradient(circle at 35% 65%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0.8) 100%),
      radial-gradient(circle at 80% 70%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%),
      radial-gradient(circle at 50% 30%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%);
  }
  50% {
    background: 
      linear-gradient(95deg, 
        rgba(255,255,255,0.7) 0%, 
        rgba(220,240,255,0.5) 4%, 
        rgba(180,220,255,0.3) 10%, 
        rgba(140,200,255,0.1) 18%,
        rgba(255,255,255,0) 25%
      ),
      radial-gradient(circle at 20% 25%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%),
      radial-gradient(circle at 70% 40%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%),
      radial-gradient(circle at 35% 65%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%),
      radial-gradient(circle at 80% 70%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,1) 100%),
      radial-gradient(circle at 50% 30%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0.9) 100%);
  }
  75% {
    background: 
      linear-gradient(95deg, 
        rgba(255,255,255,0.7) 0%, 
        rgba(220,240,255,0.5) 4%, 
        rgba(180,220,255,0.3) 10%, 
        rgba(140,200,255,0.1) 18%,
        rgba(255,255,255,0) 25%
      ),
      radial-gradient(circle at 20% 25%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%),
      radial-gradient(circle at 70% 40%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%),
      radial-gradient(circle at 35% 65%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,1) 100%),
      radial-gradient(circle at 80% 70%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%),
      radial-gradient(circle at 50% 30%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0.7) 100%);
  }
  100% {
    background: 
      linear-gradient(95deg, 
        rgba(255,255,255,0.7) 0%, 
        rgba(220,240,255,0.5) 4%, 
        rgba(180,220,255,0.3) 10%, 
        rgba(140,200,255,0.1) 18%,
        rgba(255,255,255,0) 25%
      ),
      radial-gradient(circle at 20% 25%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,1) 100%),
      radial-gradient(circle at 70% 40%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%),
      radial-gradient(circle at 35% 65%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%),
      radial-gradient(circle at 80% 70%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%),
      radial-gradient(circle at 50% 30%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 99%, rgba(255,255,255,0) 100%);
  }
}

/* SWING ANIMATION */

/* Coin styling */
.coin {
  position: absolute;
  width: var(--coin-size); height: var(--coin-size);
  background: radial-gradient(circle at 30% 30%, #ffe9b4, var(--coin-color) 55%, #f3b52c 70%);
  border-radius: 50%;
  border: 3px solid var(--coin-edge);
  box-shadow: 0 2px 4px rgba(0,0,0,.25), var(--coin-glow);
  transform: translateY(-160%) scale(.7);
  opacity: 0;
  transition: box-shadow .4s ease;
}
.coin:hover { box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 10px -2px rgba(255,191,105,.9); }

/* Overflow coins spilling down the sides */
.coin.overflow {
  opacity: 0.95;
  box-shadow: 
    0 4px 8px rgba(0,0,0,.4), 
    0 8px 16px rgba(0,0,0,.25),
    var(--coin-glow);
  z-index: 10; /* appear above jar */
}
.coin.overflow:hover { 
  box-shadow: 0 6px 12px rgba(0,0,0,.45), 0 0 12px -2px rgba(255,191,105,1); 
}

/* Random coin colors */
.coin.coin-gold {
  background: radial-gradient(circle at 30% 30%, #ffe9b4, #f4c542 55%, #f3b52c 70%);
  --coin-edge: #d4a02a;
  --coin-glow: 0 0 8px -2px rgba(244, 197, 66, 0.6);
}
.coin.coin-silver {
  background: radial-gradient(circle at 30% 30%, #f5f5f5, #d4d4d4 55%, #b8b8b8 70%);
  border-color: #9a9a9a;
  box-shadow: 0 2px 4px rgba(0,0,0,.25), 0 0 8px -2px rgba(212, 212, 212, 0.6);
}
.coin.coin-silver::after {
  color: #5a5a5a;
}
.coin.coin-bronze {
  background: radial-gradient(circle at 30% 30%, #f4c5a0, #cd7f32 55%, #b8722e 70%);
  border-color: #a0651f;
  box-shadow: 0 2px 4px rgba(0,0,0,.25), 0 0 8px -2px rgba(205, 127, 50, 0.6);
}
.coin.coin-bronze::after {
  color: #5a3d1f;
}

.coin::after {
  content: "5:-";
  font-weight: 700;
  font-size: .9rem;
  color: #7d560a;
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}
@keyframes coinFall {
  0% { transform: var(--start-transform); opacity: 0; }
  50% { opacity: 1; }
  70% { transform: translate(var(--target-x), calc(var(--target-y) - 6px)) scale(1.05); }
  100% { transform: translate(var(--target-x), var(--target-y)) scale(1); }
}
@keyframes coinSettle {
  0% { transform: translate(var(--target-x), var(--target-y)) scale(1); }
  40% { transform: translate(var(--target-x), calc(var(--target-y) + 2px)) scale(1); }
  100% { transform: translate(var(--target-x), var(--target-y)) scale(1); }
}

@keyframes jarSwing {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(2deg); }
  30% { transform: rotate(-2deg); }
  50% { transform: rotate(1.5deg); }
  70% { transform: rotate(-1deg); }
  90% { transform: rotate(0.5deg); }
}

.jar.swinging {
  animation: jarSwing 0.8s ease-in-out;
  transform-origin: center bottom;
}

/* Lid lift animation */
@keyframes lidLift {
  0% { 
    transform: translateX(-50%) translateY(0) rotateX(0deg);
    opacity: 1;
  }
  25% { 
    transform: translateX(-50%) translateY(-15px) rotateX(-8deg);
    opacity: 0.95;
  }
  50% { 
    transform: translateX(-50%) translateY(-20px) rotateX(-10deg);
    opacity: 0.9;
  }
  75% { 
    transform: translateX(-50%) translateY(-15px) rotateX(-8deg);
    opacity: 0.95;
  }
  100% { 
    transform: translateX(-50%) translateY(0) rotateX(0deg);
    opacity: 1;
  }
}

.jar-neck.lifting {
  animation: lidLift 0.6s ease-in-out;
  transform-origin: center bottom;
}

@media (prefers-reduced-motion: reduce) {
  .coin { animation: none !important; opacity: 1 !important; transform: translate(var(--target-x), var(--target-y)) scale(1) !important; }
  .jar.swinging { animation: none !important; }
}

/* Controls */
.controls { margin-top: 2.2rem; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }

.member-heading {
  margin: 1.5rem 0 0.75rem;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  letter-spacing: -0.01em;
}

.member-buttons { border: none; display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin: 0; padding: 0; }
.member-buttons .member-btn {
  background: var(--bg-card);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-subtle);
  padding: .7rem 1.2rem;
  font-size: .9rem;
  border-radius: .5rem;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
}

.member-buttons .member-btn:hover { 
  background: 
    linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%),
    rgba(255,255,255,0.05);
  background-size: 200% 200%, 100%;
  background-clip: text, padding-box;
  -webkit-background-clip: text, padding-box;
  -webkit-text-fill-color: transparent;
  border-color: rgba(102, 126, 234, 0.4);
  transform: translateY(-1px);
  box-shadow: 
    0 4px 12px -4px rgba(0,0,0,0.3),
    0 0 8px rgba(102, 126, 234, 0.2);
  animation: gradientShift 8s ease infinite;
}
.member-buttons .member-btn:active { transform: translateY(0); box-shadow: var(--shadow-subtle); }
.member-buttons .member-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Cooldown loader */
.cooldown-loader {
  margin: 1.5rem auto 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  max-width: 300px;
  text-align: center;
  animation: fadeIn 0.3s ease-out;
}

.loader-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.loader-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent));
  border-radius: 4px;
  width: 100%;
  animation: progressCountdown 30s linear forwards;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

@keyframes progressCountdown {
  from { width: 100%; }
  to { width: 0%; }
}

.loader-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.loader-text span {
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
}

.member-stats { display: flex; flex-wrap: wrap; gap: .6rem .9rem; justify-content: flex-start; font-size: .85rem; max-width: 680px; }
.member-stats .stat { background: var(--bg-secondary); color: var(--text-secondary); padding: .5rem .8rem; border-radius: .5rem; border: 1px solid var(--border-subtle); }
.member-stats .stat.gold { background: linear-gradient(135deg,#ffc94d,#f59e0b); color: #0a0a0a; font-weight:700; position:relative; padding-left:2.2rem; border-color: #f59e0b; }
.member-stats .stat.silver { background: linear-gradient(135deg,#e5e7eb,#9ca3af); color: #0a0a0a; font-weight:600; position:relative; padding-left:2.2rem; border-color: #9ca3af; }
.member-stats .stat.bronze { background: linear-gradient(135deg,#f59e0b,#d97706); color: #0a0a0a; font-weight:600; position:relative; padding-left:2.2rem; border-color: #d97706; }
.member-stats .stat.gold::before,
.member-stats .stat.silver::before,
.member-stats .stat.bronze::before { content:""; position:absolute; left:.7rem; top:50%; transform:translateY(-50%); font-size:1rem; line-height:1; }
.member-stats .stat.gold::before { content:"🥇"; }
.member-stats .stat.silver::before { content:"🥈"; }
.member-stats .stat.bronze::before { content:"🥉"; }

/* Screen reader only utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Member coin color accents */
.coin.isac { border-color: #ff9f1c; }
.coin.hannah { border-color: #ff477e; }
.coin.andreas { border-color: #1e90ff; }
.coin.karl { border-color: #6a4c93; }
.coin.daniel { border-color: #2ec4b6; }
.coin.doug { border-color: #ffbf69; }
.coin.marina { border-color: #8338ec; }
.add-coin, .reset {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: .95rem;
  padding: .8rem 1.5rem;
  border-radius: .5rem;
  cursor: pointer;
  font-weight: 500;
  box-shadow: var(--shadow-subtle);
  transition: all var(--transition-fast);
}
.add-coin:hover, .reset:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-elevated); }
.add-coin:active, .reset:active { transform: translateY(0); box-shadow: var(--shadow-subtle); }
.add-coin:focus-visible, .reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.reset { background: var(--bg-secondary); border-color: var(--border-subtle); color: var(--text-primary); font-size: .85rem; padding: .7rem 1.2rem; }
.reset:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }

.counter { font-size: .95rem; font-weight: 500; background: var(--bg-secondary); color: var(--text-primary); padding: .75rem 1.2rem; border-radius: .5rem; border: 1px solid var(--border-subtle); }
.counter span#countValue { font-size: 1.4rem; color: var(--accent); font-weight: 600; }

/* Fun cheat popup modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 300ms ease-out;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  animation: fadeIn 300ms ease-out;
}
.modal-content {
  position: relative;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border: 2px solid var(--accent);
  border-radius: 1rem;
  padding: 2.5rem 2rem 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  animation: modalPop 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: shake 500ms ease-in-out;
}
.modal-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}
.modal-message {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 0 1.75rem;
}
.modal-close {
  appearance: none;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.85rem 2.5rem;
  border-radius: 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.modal-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
  background: #3b82f6;
}
.modal-close:active {
  transform: translateY(0);
}
@keyframes modalPop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg); }
  20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

/* History Modal Specific Styles */
.history-modal-content {
  max-width: 600px;
  max-height: 80vh;
  width: 95%;
}

.history-content {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  text-align: left;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.375rem;
  border-left: 3px solid var(--accent);
  transition: background-color 0.2s ease;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.history-item:last-child {
  margin-bottom: 0;
}

.history-details {
  flex: 1;
}

.history-action {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.history-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.history-timestamp {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
}

.history-empty {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 2rem;
}

/* Scrollbar styling for history content */
.history-content::-webkit-scrollbar {
  width: 6px;
}

.history-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.history-content::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.history-content::-webkit-scrollbar-thumb:hover {
  background: #3b82f6;
}

/* Statistics Modal Specific Styles */
.stats-modal-content {
  max-width: 700px;
  max-height: 85vh;
  width: 95%;
}

.stats-content {
  max-height: 500px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  text-align: center;
}

.stats-summary {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 0.5rem;
  color: var(--text-secondary);
}

.chart-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.chart-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  padding: 0.25rem;
  gap: 0.25rem;
}

.chart-toggle-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.chart-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.chart-toggle-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.chart-toggle-btn.active:hover {
  background: #3b82f6;
  color: #ffffff;
}

.stats-chart-container {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.stats-chart-container canvas {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
}

.stats-legend {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 2px;
}

.stats-table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0.5rem;
  overflow: hidden;
}

.stats-table th,
.stats-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-table th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  color: var(--text-primary);
}

.stats-table td {
  color: var(--text-secondary);
}

.stats-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.stats-number {
  font-weight: 600;
  color: var(--accent);
}

/* Scrollbar styling for stats content */
.stats-content::-webkit-scrollbar {
  width: 6px;
}

.stats-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.stats-content::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.stats-content::-webkit-scrollbar-thumb:hover {
  background: #3b82f6;
}

/* Line Chart Legend Styles */
.line-legend-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
}

.legend-section h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
}

.legend-members {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.legend-line-solid {
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  position: relative;
  margin: 0.5rem 0;
}

.legend-line-solid::after {
  content: '●';
  position: absolute;
  right: -8px;
  top: -8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-line-dashed {
  width: 20px;
  height: 2px;
  background: linear-gradient(to right, var(--text-secondary) 50%, transparent 50%);
  background-size: 4px 2px;
  position: relative;
  margin: 0.5rem 0;
}

.legend-line-dashed::after {
  content: '◆';
  position: absolute;
  right: -8px;
  top: -8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Responsive legend adjustments */
@media (max-width: 600px) {
  .line-legend-container {
    gap: 0.75rem;
  }
  
  .legend-members {
    gap: 0.5rem;
  }
  
  .legend-item {
    font-size: 0.8rem;
  }
}

/* Responsive tweaks */
@media (max-width: 600px) {
  .scene { margin-top: 1.5rem; }
  .controls { margin-top: 1.5rem; }
  .layout { flex-direction: column-reverse; gap: 1.5rem; }
  .summary { width: 100%; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity:1; transform: translateY(0);} }
@keyframes glossPulse { 0%,100% { opacity: .5; } 50% { opacity: .3; } }

/* Withdraw Button Styles */
.withdraw-btn {
  appearance: none;
  background: linear-gradient(135deg, #059669, #10b981);
  border: 1px solid #059669;
  border-radius: 0.5rem;
  color: #ffffff;
  cursor: pointer;
  font-family: var(--font-stack);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
  margin-top: 0.5rem;
}

.withdraw-btn:hover {
  background: linear-gradient(135deg, #047857, #059669);
  border-color: #047857;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
}

.withdraw-btn:active {
  transform: translateY(0);
}

/* Withdraw Modal Styles */
.withdraw-modal-content {
  max-width: 500px;
  width: 95%;
}

.withdraw-summary {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.3);
  border-radius: 0.5rem;
  text-align: center;
}

.withdraw-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: #10b981;
  margin-bottom: 0.5rem;
}

.withdraw-details {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.withdraw-form {
  margin-bottom: 1rem;
  text-align: left;
}

.withdraw-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.withdraw-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  outline: none;
  transition: all 0.2s ease;
  font-family: var(--font-stack);
}

.withdraw-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.withdraw-error {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 0.375rem;
  color: #fca5a5;
  font-size: 0.9rem;
  text-align: center;
}

.withdraw-warning {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 0.5rem;
  text-align: center;
}

.withdraw-warning p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: #f59e0b;
}

.withdraw-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.modal-close.secondary {
  background: var(--bg-secondary);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.modal-close.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.modal-close.danger {
  background: linear-gradient(135deg, #059669, #10b981);
  border-color: #059669;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.modal-close.danger:hover {
  background: linear-gradient(135deg, #047857, #059669);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
}

/* Withdrawals History Modal Styles */
.withdrawals-modal-content {
  max-width: 700px;
  max-height: 85vh;
  width: 95%;
}

.withdrawals-content {
  max-height: 450px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  text-align: left;
}

.withdrawal-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

.withdrawal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(5, 150, 105, 0.1);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.2s ease;
}

.withdrawal-header:hover {
  background: rgba(5, 150, 105, 0.15);
}

.withdrawal-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.withdrawal-date {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.withdrawal-note {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-style: italic;
}

.withdrawal-header-right {
  text-align: right;
}

.withdrawal-amount-badge {
  font-size: 1.25rem;
  font-weight: 700;
  color: #10b981;
}

.withdrawal-coins-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.withdrawal-details-panel {
  display: none;
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.1);
}

.withdrawal-details-panel.expanded {
  display: block;
}

.withdrawal-section {
  margin-bottom: 1rem;
}

.withdrawal-section:last-child {
  margin-bottom: 0;
}

/* Expandable sections */
.withdrawal-expandable .withdrawal-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0.375rem;
  transition: background 0.2s ease;
}

.withdrawal-expandable .withdrawal-section-header:hover {
  background: rgba(255, 255, 255, 0.06);
}

.withdrawal-expandable .withdrawal-section-title {
  margin-bottom: 0;
}

.section-expand-indicator {
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.withdrawal-expandable.section-expanded .section-expand-indicator {
  transform: rotate(90deg);
}

.withdrawal-expandable .withdrawal-section-content {
  display: none;
  padding-top: 0.75rem;
}

.withdrawal-expandable.section-expanded .withdrawal-section-content {
  display: block;
}

.withdrawal-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.withdrawal-leaderboard {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.withdrawal-member-stat {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-subtle);
}

.withdrawal-member-stat.gold {
  background: linear-gradient(135deg, #ffc94d, #f59e0b);
  color: #0a0a0a;
  font-weight: 600;
}

.withdrawal-member-stat.silver {
  background: linear-gradient(135deg, #e5e7eb, #9ca3af);
  color: #0a0a0a;
  font-weight: 500;
}

.withdrawal-member-stat.bronze {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0a0a0a;
  font-weight: 500;
}

.withdrawal-period {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: 0.375rem;
}

.withdrawal-chart-container {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.375rem;
  padding: 0.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 150px;
}

.withdrawal-chart-container canvas {
  max-width: 100%;
  height: auto;
}

.withdrawal-history-list {
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border-radius: 0.375rem;
  padding: 0.5rem;
}

.withdrawal-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.withdrawal-history-item:last-child {
  border-bottom: none;
}

.withdrawal-history-action {
  color: var(--text-primary);
}

.withdrawal-history-action strong {
  color: var(--accent);
}

.withdrawal-history-time {
  color: var(--text-secondary);
  font-size: 0.75rem;
  white-space: nowrap;
  margin-left: 0.5rem;
}

.withdrawal-history-empty {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 1rem;
}

.withdrawal-history-more {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 0.5rem;
  font-style: italic;
}

/* Scrollbar for withdrawal history list */
.withdrawal-history-list::-webkit-scrollbar {
  width: 4px;
}

.withdrawal-history-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.withdrawal-history-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 2px;
}

.withdrawals-empty {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 3rem 2rem;
}

.withdrawals-total {
  text-align: center;
  padding: 1rem;
  background: rgba(5, 150, 105, 0.1);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.withdrawals-total-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: #10b981;
}

.withdrawals-total-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Scrollbar styling for withdrawals content */
.withdrawals-content::-webkit-scrollbar {
  width: 6px;
}

.withdrawals-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.withdrawals-content::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.withdrawals-content::-webkit-scrollbar-thumb:hover {
  background: #3b82f6;
}

/* Expand/collapse indicator */
.expand-indicator {
  font-size: 1rem;
  transition: transform 0.2s ease;
  color: var(--text-secondary);
}

.withdrawal-header.expanded .expand-indicator {
  transform: rotate(180deg);
}
