/* ==========================================================================
   FS PERFECT POUR - STYLE SHEET
   Dark Glassmorphism, Neon Highlights & Fluid Arena
   Zero CSS Overrides for Shared Modal Classes (Directive 8 Compliant)
   ========================================================================== */

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;

  --bg-dark: #040813;
  --bg-gradient: radial-gradient(circle at 50% 18%, #0a1730 0%, #050a17 65%, #020409 100%);
  --bg-card: rgba(11, 20, 38, 0.72);
  --bg-card-border: rgba(0, 243, 255, 0.2);

  --text-main: #f0f6fc;
  --text-muted: #8b9bb4;

  --neon-cyan: #00f3ff;
  --neon-gold: #ffd700;
  --neon-magenta: #ff007f;
  --neon-green: #00e5a3;
  --neon-red: #ff3366;

  --shadow-color: rgba(0, 0, 0, 0.55);
  --glow-cyan: rgba(0, 243, 255, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body {
  font-family: var(--font-body);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Background Light */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.18;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.glow-1 {
  width: 420px;
  height: 420px;
  background: var(--neon-cyan);
  top: -80px;
  left: 20%;
}

.glow-2 {
  width: 360px;
  height: 360px;
  background: #ffb703;
  bottom: 8%;
  right: 15%;
  animation-delay: -7s;
}

.glow-3 {
  width: 280px;
  height: 280px;
  background: var(--neon-magenta);
  top: 45%;
  left: 8%;
  animation-delay: -11s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 40px) scale(1.12); }
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 8px 12px 14px;
  z-index: 1;
  gap: 8px;
}

/* Header & Nav */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.glass-btn {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
  text-decoration: none;
}

.glass-btn:hover {
  background: rgba(0, 243, 255, 0.15);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px var(--glow-cyan);
}

.title-group h1 {
  font-family: var(--font-heading);
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  background: linear-gradient(135deg, #ffffff 40%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  padding: 6px 8px;
  font-size: 0.95rem;
  min-width: 36px;
  justify-content: center;
}

.donate-btn {
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.35);
  font-weight: 600;
  font-size: 0.8rem;
}

.donate-btn:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
}

/* Stats HUD Banner */
.stats-banner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 6px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 12px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.stat-label {
  font-family: var(--font-heading);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.stat-val {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-card.highlight .stat-val {
  color: var(--neon-cyan);
  text-shadow: 0 0 12px var(--glow-cyan);
}

.stat-card.streak-card .stat-val {
  color: var(--neon-gold);
}

/* Fluid Selection Chips Scrollable Bar */
.fluid-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}
.fluid-bar::-webkit-scrollbar {
  display: none;
}

.fluid-chip {
  background: rgba(14, 24, 46, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 16px;
  font-size: 0.76rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.fluid-chip:hover {
  background: rgba(0, 243, 255, 0.12);
  border-color: rgba(0, 243, 255, 0.4);
  color: #fff;
}

.fluid-chip.active {
  background: rgba(0, 243, 255, 0.18);
  border-color: var(--neon-cyan);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.25);
}

/* Target & Volume Progress Meter */
.meter-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.liquid-name {
  color: #ffffff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.meter-text {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--neon-cyan);
  font-variant-numeric: tabular-nums;
}

.meter-track {
  width: 100%;
  height: 12px;
  background: rgba(6, 12, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0083a8, #00f3ff);
  border-radius: 8px;
  transition: width 0.05s linear;
  box-shadow: 0 0 8px rgba(0, 243, 255, 0.5);
}

.meter-target-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 98%;
  width: 3px;
  background: #ffd700;
  box-shadow: 0 0 6px #ffd700;
  z-index: 2;
}

/* Arena & Canvas Container */
.arena-container {
  flex: 1;
  position: relative;
  background: rgba(6, 12, 22, 0.88);
  border: 1px solid var(--bg-card-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), inset 0 0 24px rgba(0, 243, 255, 0.04);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  touch-action: none;
}

/* Overlays (Pause / Result) */
.canvas-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 16, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  padding: 16px;
  transition: opacity 0.25s ease;
}

.canvas-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-card {
  background: rgba(13, 22, 42, 0.95);
  border: 1px solid var(--bg-card-border);
  border-radius: 20px;
  padding: 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: popCard 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popCard {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.result-badge {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: 16px;
  letter-spacing: 0.5px;
}

.result-badge.perfect {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.result-badge.great {
  color: var(--neon-green);
  background: rgba(0, 229, 163, 0.15);
  border: 1px solid var(--neon-green);
}

.result-badge.good {
  color: var(--neon-cyan);
  background: rgba(0, 243, 255, 0.15);
  border: 1px solid var(--neon-cyan);
}

.result-badge.underfilled {
  color: #ff9800;
  background: rgba(255, 152, 0, 0.15);
  border: 1px solid #ff9800;
}

.result-badge.spill {
  color: var(--neon-red);
  background: rgba(255, 51, 102, 0.15);
  border: 1px solid var(--neon-red);
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.4);
}

.result-stars {
  font-size: 1.8rem;
  letter-spacing: 4px;
}

.primary-btn {
  background: linear-gradient(135deg, var(--neon-cyan) 0%, #00a8ff 100%);
  color: #040813;
  border: none;
  border-radius: 14px;
  padding: 12px 28px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 243, 255, 0.35);
  transition: all 0.2s ease;
  width: 100%;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 243, 255, 0.55);
}

/* Pour Controls Area */
.control-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}

.pour-btn {
  background: linear-gradient(135deg, #00f3ff 0%, #00b4d8 50%, #0077b6 100%);
  color: #040915;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  padding: 16px 24px;
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 243, 255, 0.4);
  transition: all 0.15s ease;
  touch-action: none;
}

.pour-btn:active {
  transform: scale(0.97);
  box-shadow: 0 3px 12px rgba(0, 243, 255, 0.6);
  background: linear-gradient(135deg, #ffd700 0%, #ff9800 100%);
  color: #060a12;
}

.pour-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}
