@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --color-bg: #070b28;
  --color-primary: #32f4d1;
  --color-secondary: #feb700;
  --color-tertiary: #44a5ff;
  --color-on-surface: #e2e3ff;
  --color-on-surface-variant: #a5a9ce;
  --color-surface-container: #10163a;
  --color-surface-container-low: #0b1031;
  --color-surface-container-lowest: #000000;
  --color-surface-container-high: #161c43;
  --color-surface-container-highest: #1b224c;
  --color-outline-variant: #414665;
  --color-on-primary: #005749;
  --color-error: #ff716c;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--color-bg);
  background-image: radial-gradient(circle at 50% -20%, var(--color-surface-container-high) 0%, var(--color-bg) 70%);
  color: var(--color-on-surface);
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  justify-content: center;
}

#app-container {
  width: 100%;
  max-width: 480px;
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography styles */
.font-space { font-family: 'Space Grotesk', sans-serif; }
.tracking-widest-plus { letter-spacing: 0.3em; }
.micro-label { text-transform: uppercase; font-size: 10px; font-weight: 600; }

/* SVG Noise Grain */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0.03;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  z-index: 1000;
  pointer-events: none;
}

/* Glass panel */
.glass-panel {
  background: rgba(16, 22, 58, 0.6);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(65, 70, 101, 0.15);
  border-radius: 1rem;
}

/* Ambient glow */
.glow-primary {
  box-shadow: 0 0 20px rgba(50, 244, 209, 0.25);
}
.glow-secondary {
  box-shadow: 0 0 20px rgba(254, 183, 0, 0.2);
}
.bg-blob {
  position: fixed;
  filter: blur(100px);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
.blob-1 {
  background-color: rgba(50, 244, 209, 0.05);
  width: 300px;
  height: 300px;
  top: 10%;
  left: -20%;
}
.blob-2 {
  background-color: rgba(254, 183, 0, 0.05);
  width: 400px;
  height: 400px;
  bottom: 0%;
  right: -30%;
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border-radius: 0.75rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
  border: none;
  height: 56px;
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(to right, var(--color-primary), #03e6c3);
  color: var(--color-on-primary);
  box-shadow: 0 4px 15px rgba(3, 230, 195, 0.3);
}
.btn-secondary {
  background: linear-gradient(to right, var(--color-secondary), #ecaa00);
  color: #533a00;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--color-outline-variant);
  color: var(--color-on-surface);
}

/* Icons */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300;
}
.icon-fill {
  font-variation-settings: 'FILL' 1, 'wght' 300;
}

/* UI Elements */
.chip {
  padding: 8px 16px;
  border-radius: 9999px;
  background: rgba(22, 28, 67, 0.8);
  border: 1px solid rgba(65, 70, 101, 0.4);
  color: var(--color-on-surface-variant);
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
  cursor: pointer;
}
.chip.active {
  background: rgba(50, 244, 209, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

input {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--color-outline-variant);
  color: var(--color-on-surface);
  padding: 16px;
  border-radius: 0.75rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  font-size: 16px;
  box-sizing: border-box;
}
input:focus {
  border-color: var(--color-primary);
}
input::placeholder {
  color: var(--color-on-surface-variant);
}

/* Tactical Corners */
.tactical-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
}
.tactical-tl { top: 16px; left: 16px; border-top-color: rgba(50,244,209,0.4); border-left-color: rgba(50,244,209,0.4); }
.tactical-tr { top: 16px; right: 16px; border-top-color: rgba(50,244,209,0.4); border-right-color: rgba(50,244,209,0.4); }
.tactical-bl { bottom: 16px; left: 16px; border-bottom-color: rgba(50,244,209,0.4); border-left-color: rgba(50,244,209,0.4); }
.tactical-br { bottom: 16px; right: 16px; border-bottom-color: rgba(50,244,209,0.4); border-right-color: rgba(50,244,209,0.4); }

/* Layouts */
.screen {
  display: none;
  flex-direction: column;
  padding: 76px 16px 80px 16px; /* Space for Top/Bottom bars */
  min-height: 100%;
  box-sizing: border-box;
  animation: fadeIn 0.3s ease-out;
}
.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(65, 70, 101, 0.5);
  border-radius: 4px;
}

/* Hide scrollbar for chips */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Animations */
.animate-pulse-ring {
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(254, 183, 0, 0.4); }
  70% { box-shadow: 0 0 0 20px rgba(254, 183, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(254, 183, 0, 0); }
}

/* Top App Bar */
.top-bar {
  position: fixed;
  top: 0;
  width: 100%;
  max-width: 480px;
  height: 64px;
  background: rgba(7, 11, 40, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(50, 244, 209, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-sizing: border-box;
  z-index: 50;
}

/* Bottom Nav Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  height: 72px;
  background: rgba(7, 11, 40, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(50, 244, 209, 0.1);
  border-radius: 32px 32px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  box-sizing: border-box;
  z-index: 50;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  color: rgba(226, 227, 255, 0.4);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-item.active {
  color: var(--color-primary);
  background: rgba(50, 244, 209, 0.1);
  box-shadow: 0 0 0 1px rgba(50, 244, 209, 0.3) inset;
}
.nav-item .material-symbols-outlined { margin-bottom: -2px; }

/* SVG Progress Timer */
.timer-svg {
  transform: rotate(-90deg);
  width: 200px;
  height: 200px;
}
.timer-bg {
  fill: none;
  stroke: var(--color-surface-container-high);
  stroke-width: 8;
}
.timer-progress {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 565;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 6px rgba(50, 244, 209, 0.6));
}

.player-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-surface-container-high);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-primary);
  border: 1px solid var(--color-outline-variant);
  position: relative;
}
.avatar-empty {
  border: 1px dashed var(--color-outline-variant);
  color: var(--color-on-surface-variant);
  background: transparent;
}
.host-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--color-primary);
  color: var(--color-bg);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.host-badge .material-symbols-outlined {
  font-size: 14px;
}

/* User vote card */
.vote-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(16, 22, 58, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(65, 70, 101, 0.15);
  margin-bottom: 8px;
}
.vote-card .avatar-circle {
  width: 40px; height: 40px; font-size: 16px;
}
