/* ============================================================
   🇬🇧 UK Happy Hour Countdown & Direct Fireworks Celebration
   Modern CSS styling with smooth micro-interactions & glassmorphism
   ============================================================ */

:root {
  --bg-dark: #0a0d17;
  --bg-card: rgba(19, 25, 45, 0.88);
  --bg-card-subtle: rgba(28, 36, 64, 0.6);
  --border-color: rgba(255, 255, 255, 0.12);
  --border-highlight: rgba(245, 158, 11, 0.45);
  
  --primary: #f59e0b; /* Amber Gold */
  --primary-hover: #d97706;
  --primary-glow: rgba(245, 158, 11, 0.35);
  
  --uk-red: #ef4444;
  --uk-blue: #3b82f6;
  --uk-white: #f8fafc;
  
  --accent-gold: #fbbf24;
  --accent-emerald: #10b981;
  --accent-purple: #a855f7;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 8px;
  
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  min-height: 100vh;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(239, 68, 68, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.08) 0%, transparent 60%);
  color: var(--text-main);
  font-family: var(--font-main);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  padding: 24px 16px;
}

/* Fullscreen Canvas for Fireworks */
#fireworks-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10;
}

/* App Wrapper */
.app-wrapper {
  position: relative;
  z-index: 20;
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Header */
.header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-gold);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.badge .flag {
  font-size: 1.1rem;
}

.main-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.gradient-text {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #f97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
}

.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 480px;
  line-height: 1.5;
}

/* ============================================================
   CELEBRATION BANNER (STRAIGHT TO FIREWORKS - NO BLOCKING MODAL)
   ============================================================ */
.celebration-banner {
  width: 100%;
  background: linear-gradient(145deg, rgba(28, 38, 70, 0.92), rgba(16, 22, 44, 0.95));
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  text-align: center;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(245, 158, 11, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: banner-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@keyframes banner-pop {
  0% { transform: scale(0.9) translateY(-15px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.toast-crown {
  font-size: 2.2rem;
  letter-spacing: 4px;
  animation: bounce-crown 1.8s infinite;
}

@keyframes bounce-crown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.celebration-heading {
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff 0%, #fbbf24 55%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  letter-spacing: 1px;
  text-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
}

.celebration-subhead {
  font-size: 1.25rem;
  font-weight: 800;
  color: #60a5fa;
  letter-spacing: 0.5px;
}

/* Clinking Beer Animation */
.fun-beer-animation {
  font-size: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 4px 0;
}

.clink-left {
  display: inline-block;
  animation: clink-l 1.1s ease-in-out infinite;
}

.clink-right {
  display: inline-block;
  animation: clink-r 1.1s ease-in-out infinite;
}

.sparkle-burst {
  font-size: 1.4rem;
  animation: pop-sparkle 1.1s infinite;
}

@keyframes clink-l {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  50% { transform: rotate(22deg) translateX(10px); }
}

@keyframes clink-r {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  50% { transform: rotate(-22deg) translateX(-10px); }
}

@keyframes pop-sparkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* Music Status Bar */
.music-status-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--accent-gold);
  font-weight: 600;
}

.music-wave-anim {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}

.music-wave-anim span {
  width: 3px;
  height: 100%;
  background: var(--accent-gold);
  border-radius: 2px;
  animation: music-wave 1s ease-in-out infinite alternate;
}

.music-wave-anim span:nth-child(2) { animation-delay: 0.2s; }
.music-wave-anim span:nth-child(3) { animation-delay: 0.4s; }
.music-wave-anim span:nth-child(4) { animation-delay: 0.6s; }

@keyframes music-wave {
  0% { height: 4px; }
  100% { height: 14px; }
}

.btn-song-switch {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-song-switch:hover {
  background: rgba(255, 255, 255, 0.25);
}

.celebration-controls {
  margin-top: 8px;
  width: 100%;
  max-width: 360px;
}

.btn-retry-large {
  width: 100%;
  font-size: 1.15rem;
  padding: 16px 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
  animation: pulse-retry 2s infinite alternate;
}

@keyframes pulse-retry {
  0% { box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35); }
  100% { box-shadow: 0 10px 30px rgba(245, 158, 11, 0.7); }
}

.fireworks-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* ============================================================
   TIMER CARD & COUNTDOWN
   ============================================================ */
.timer-card {
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.timer-card:hover {
  border-color: rgba(245, 158, 11, 0.3);
}

/* Progress Bar */
.progress-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #f59e0b, #ef4444);
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

/* Countdown Display */
.countdown-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.time-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.time-box {
  width: 100%;
  max-width: 140px;
  aspect-ratio: 1.1 / 1;
  background: linear-gradient(180deg, rgba(30, 41, 70, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.08),
    0 8px 20px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.time-box::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.digit {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 6.5vw, 4.2rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.time-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.separator {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
  animation: pulse-glow 1.5s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  0% { opacity: 0.4; text-shadow: 0 0 2px rgba(245, 158, 11, 0.2); }
  100% { opacity: 1; text-shadow: 0 0 16px rgba(245, 158, 11, 0.8); }
}

/* Status Text */
.timer-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.timer-status.running .status-dot {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: blink-dot 1s infinite;
}

.timer-status.paused .status-dot {
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Controls Row */
.controls-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
  flex: 1.3;
  min-width: 160px;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex: 1;
  min-width: 110px;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 13px 18px;
}

.btn-outline:hover:not(:disabled) {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

/* Presets Section */
.presets-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
}

.presets-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main);
}

.preset-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.preset-chip.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--primary);
  color: var(--accent-gold);
  font-weight: 700;
}

.preset-chip.test-chip {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
}

.preset-chip.test-chip:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fee2e2;
  border-color: var(--uk-red);
}

/* Custom Timer Accordion */
.custom-timer-accordion {
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.custom-timer-accordion:focus-within {
  border-color: var(--border-highlight);
}

.accordion-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.accordion-toggle:hover {
  color: var(--text-main);
}

.toggle-icon {
  font-size: 1rem;
  margin-right: 6px;
}

.toggle-arrow {
  font-size: 0.75rem;
  transition: transform 0.25s ease;
}

.accordion-toggle[aria-expanded="true"] .toggle-arrow {
  transform: rotate(180deg);
}

.custom-timer-form {
  display: none;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-direction: column;
  gap: 16px;
}

.custom-timer-form.open {
  display: flex;
}

.inputs-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.input-group input {
  background: rgba(10, 13, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 10px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-group input::-webkit-outer-spin-button,
.input-group input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.input-group input[type=number] {
  -moz-appearance: textfield;
}

.btn-apply {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border: 1px solid var(--primary);
  font-weight: 700;
  padding: 10px;
}

.btn-apply:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Footer / Sound & Preview */
.timer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  flex-wrap: wrap;
}

.footer-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-main);
  transition: all 0.2s ease;
}

.footer-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.footer-btn.highlight-btn {
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.08);
}

.footer-btn.highlight-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--primary);
}

/* Responsive tweaks */
@media (max-width: 540px) {
  .timer-card {
    padding: 22px 16px;
    gap: 18px;
  }
  .digit {
    font-size: 2.2rem;
  }
  .time-label {
    font-size: 0.65rem;
  }
  .controls-row {
    flex-direction: column;
  }
  .btn-primary, .btn-secondary, .btn-outline {
    width: 100%;
  }
  .inputs-row {
    grid-template-columns: 1fr;
  }
}
