/* ==========================================================================
   Flick Vote Premium Style Sheet - Dark Theme & Glassmorphic Design System
   ========================================================================== */

/* --- CSS Variables & Design Tokens --- */
:root {
  /* HSL Color Palette */
  --bg-dark: hsl(224, 71%, 4%);
  --bg-dark-end: hsl(244, 62%, 8%);
  
  --color-primary: hsl(263, 90%, 62%);     /* Electric Violet */
  --color-primary-glow: hsla(263, 90%, 62%, 0.35);
  --color-secondary: hsl(199, 100%, 47%);   /* Neon Cyan */
  --color-secondary-glow: hsla(199, 100%, 47%, 0.3);
  --color-accent: hsl(346, 88%, 56%);       /* Hot Coral */
  --color-accent-glow: hsla(346, 88%, 56%, 0.3);
  
  --surface-glass: rgba(15, 23, 42, 0.45);
  --surface-glass-bright: rgba(30, 41, 59, 0.7);
  --surface-glass-item: rgba(255, 255, 255, 0.05);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(255, 255, 255, 0.2);
  
  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 20%, 75%);
  --text-muted: hsl(215, 15%, 50%);
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  --shadow-glow-primary: 0 0 25px var(--color-primary-glow);
  --shadow-glow-secondary: 0 0 25px var(--color-secondary-glow);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

/* --- Reset & Core Setup --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: radial-gradient(circle at 50% 0%, var(--bg-dark-end), var(--bg-dark));
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* --- Decorative Animated Background Glows --- */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
  mix-blend-mode: screen;
}

.bg-glow-1 {
  width: 45vw;
  height: 45vw;
  background: var(--color-primary);
  top: -10vw;
  left: -10vw;
  animation: float-slow 20s infinite alternate;
}

.bg-glow-2 {
  width: 40vw;
  height: 40vw;
  background: var(--color-secondary);
  bottom: -5vw;
  right: -5vw;
  animation: float-slow 25s infinite alternate-reverse;
}

.bg-glow-3 {
  width: 35vw;
  height: 35vw;
  background: var(--color-accent);
  top: 30vh;
  left: 40vw;
  opacity: 0.2;
  animation: float-slow 18s infinite alternate;
}

@keyframes float-slow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 10%) scale(1.1); }
  100% { transform: translate(-5%, -5%) scale(0.9); }
}

/* --- Layout Container --- */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  position: relative;
  z-index: 1;
}

/* --- Header Styling --- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 24px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.4));
  animation: bounce-slow 3s infinite;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary), #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity var(--transition-normal);
}

.status-badge {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: hsl(270, 100%, 80%);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.session-badge {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: hsl(210, 100%, 80%);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  font-family: monospace;
}

/* --- Common UI Components --- */

/* Glass Cards */
.glass {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glass:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.glass-item {
  background: var(--surface-glass-item);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
  text-align: center;
}

.btn-lg {
  padding: 16px 28px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), hsl(280, 85%, 55%));
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5), var(--shadow-glow-primary);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--color-secondary), hsl(210, 100%, 45%));
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5), var(--shadow-glow-secondary);
}

.btn-secondary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--color-primary);
  color: hsl(263, 100%, 80%);
}

.btn-outline-primary:hover {
  background: var(--color-primary-glow);
  box-shadow: var(--shadow-glow-primary);
}

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

.btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-glow {
  position: relative;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  box-shadow: inherit;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: -1;
}

.btn-glow:hover::after {
  opacity: 1;
}

.btn-back {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast);
  margin-bottom: 12px;
}

.btn-back:hover {
  color: var(--text-primary);
}

/* Utilities */
.hidden { display: none !important; }
.margin-top-lg { margin-top: 24px; }
.margin-bottom-sm { margin-bottom: 12px; }
.text-accent { color: var(--color-accent) !important; }
.gradient-text {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Main Content Container --- */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative; /* Required: contains absolute-positioned inactive screens */
  min-height: 0;
}

/* --- Screen Transitions --- */
.screen {
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity var(--transition-normal) ease-out, transform var(--transition-normal) ease-out;
  flex: 1;
  width: 100%;
  z-index: 2;
  /* Hidden but not removed from layout — needed for JS to find elements */
  position: absolute;
  top: 0; left: 0; right: 0;
  pointer-events: none;
  visibility: hidden;
}

.screen.active {
  opacity: 1;
  transform: translateY(0);
  position: relative;
  pointer-events: auto;
  visibility: visible;
}

/* --- SCREEN 1: WELCOME SCREEN --- */
#screen-welcome {
  justify-content: center;
  align-items: center;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 0;
  min-height: calc(100vh - 120px);
}

.hero-section {
  margin-bottom: 40px;
}

.welcome-logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.welcome-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.4));
  animation: bounce-slow 3s infinite;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 46px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  font-weight: 400;
}

.welcome-actions {
  width: 100%;
}

.name-entry-box {
  padding: 18px 24px;
  width: 100%;
  margin-bottom: 20px;
  text-align: left;
}

.name-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.name-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  transition: border-color var(--transition-fast);
}

.name-input-row:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.name-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.name-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
}

/* --- Welcome screen: two equally weighted paths ---------------------------
   Create and Join are deliberately the same size, in the same style of card,
   with the same full-width action button. Neither is the "default" — a joiner
   should not have to reason about which control is meant for them. */

.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}

@media (min-width: 720px) {
  .choice-grid {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}

.choice-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  text-align: left;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.choice-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.choice-card__icon {
  font-size: 20px;
  line-height: 1;
}

.choice-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.choice-card__hint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 16px 0;
}

/* Pins both action buttons to the bottom so the two cards line up even though
   only one of them contains a text field. */
.choice-card__action {
  margin-top: auto;
}

/* Arriving via a QR scan or a ?join= link: lead with the card they came for. */
.choice-card--highlight {
  border-color: rgba(56, 189, 248, 0.45);
}

@media (max-width: 719px) {
  .choice-card--highlight {
    order: -1;
  }
}

/* Code field on its own row — the button sits below it, matching the other card */
.input-group--solo {
  margin-bottom: 12px;
}

.input-group--solo input {
  width: 100%;
  text-align: center;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 700;
}

.input-group {
  display: flex;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  padding: 6px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.input-group input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  padding-left: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.input-group input::placeholder {
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.join-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: hsl(0, 90%, 70%);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  animation: fade-in-down 0.2s ease-out forwards;
}

.join-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

@keyframes fade-in-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- SCREEN 2: CONFIGURATION SCREEN --- */
.screen-header {
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Three equal columns on wide screens; single column on mobile */
.config-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .config-grid {
    grid-template-columns: 1fr 1.6fr 1fr;
    align-items: start;
  }
}

.config-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.card-step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--color-primary);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
  flex-shrink: 0;
}

.card-header h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
}

.card-description {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 14px;
}

/* Live movie count indicator in the filters card header */
.count-indicator {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.count-indicator__number {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 800;
}

.count-indicator__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Colour states */
.count-indicator--loading {
  border-color: rgba(255,255,255,0.08);
}
.count-indicator--loading .count-indicator__number {
  color: var(--text-muted);
}

.count-indicator--good {
  border-color: rgba(16,185,129,0.35);
  background: rgba(16,185,129,0.08);
}
.count-indicator--good .count-indicator__number { color: hsl(142,70%,55%); }

.count-indicator--ok {
  border-color: rgba(234,179,8,0.35);
  background: rgba(234,179,8,0.08);
}
.count-indicator--ok .count-indicator__number { color: hsl(45,100%,60%); }

.count-indicator--tight {
  border-color: rgba(249,115,22,0.35);
  background: rgba(249,115,22,0.08);
}
.count-indicator--tight .count-indicator__number { color: hsl(25,100%,65%); }

.count-indicator--narrow {
  border-color: rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.08);
}
.count-indicator--narrow .count-indicator__number { color: hsl(0,100%,70%); }

/* Label hint — small muted text after the label */
.label-hint {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}

/* Streaming platforms selector */
.platforms-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Filters card inner layout */
.filters-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}


/* Genre: 2-column pill grid */
.pill-selector--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* Compact pills for filter options (genre/duration/profile/era) */
.pill-selector--compact {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Streaming platforms selector */
.platforms-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.platform-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all var(--transition-fast);
}

.platform-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.platform-btn.selected {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--color-secondary);
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.2);
}

.platform-logo {
  width: 54px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: saturate(0.85);
  transition: all var(--transition-fast);
}

.platform-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.platform-btn.selected .platform-logo {
  filter: saturate(1.2);
  transform: scale(1.1);
}

.platform-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.platform-btn.selected .platform-name {
  color: var(--text-primary);
}

/* Form inputs & selectors */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '▼';
  font-size: 10px;
  color: var(--text-muted);
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.filters-form select {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.filters-form select:focus {
  border-color: var(--color-primary);
}

.year-range-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.year-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
  text-align: center;
}

.year-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

.year-input::-webkit-outer-spin-button,
.year-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.year-input {
  -moz-appearance: textfield;
}

.year-range-separator {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.pill-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.pill-btn.active {
  background: var(--color-primary-glow);
  border-color: var(--color-primary);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

/* Compact pill variant — used inside filter pill selectors */
.pill-selector--grid .pill-btn,
.pill-selector--compact .pill-btn {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 14px;
}

/* pill-hint: small secondary text inside a pill button (e.g. "< 100 mins") */
.pill-hint {
  font-size: 9px;
  opacity: 0.65;
  font-weight: 400;
  margin-left: 2px;
}

/* Duration Dual Slider */
.duration-slider-wrap {
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
}

.dual-slider-track-bg {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  pointer-events: none;
}

.dual-slider-range-fill {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 2px;
}

.dual-slider {
  position: absolute;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  outline: none;
  height: 4px;
}

.dual-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 8px var(--color-primary-glow);
  cursor: pointer;
  pointer-events: all;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.dual-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 14px var(--color-primary-glow);
}

.dual-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 8px var(--color-primary-glow);
  cursor: pointer;
  pointer-events: all;
}

.dual-slider--high::-webkit-slider-thumb {
  background: var(--color-secondary);
  box-shadow: 0 0 8px var(--color-secondary-glow);
}

.dual-slider--high::-moz-range-thumb {
  background: var(--color-secondary);
  box-shadow: 0 0 8px var(--color-secondary-glow);
}

.duration-slider-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

/* Rating Slider */
.rating-slider-value {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-heading);
}

.rating-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider-bound {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 12px;
  text-align: center;
}

.rating-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--color-primary) 0%,
    var(--color-primary) calc((var(--val, 60%) )),
    rgba(255,255,255,0.1) calc((var(--val, 60%) )),
    rgba(255,255,255,0.1) 100%
  );
  outline: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.rating-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 8px var(--color-primary-glow);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.rating-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 14px var(--color-primary-glow);
}

.rating-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 8px var(--color-primary-glow);
  cursor: pointer;
}

/* Settings Form (Toggles) */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toggle-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  gap: 16px;
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toggle-title {
  font-size: 14px;
  font-weight: 600;
}

.toggle-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  min-width: 46px;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-primary);
  transition: .3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input:checked + .slider {
  background-color: var(--color-primary);
  border-color: rgba(139, 92, 246, 0.4);
}

input:focus + .slider {
  box-shadow: 0 0 8px var(--color-primary-glow);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* --- SCREEN 3: LOBBY SCREEN --- */
.lobby-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 900px) {
  .lobby-layout {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.lobby-details, .lobby-players {
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.lobby-badge-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
  padding: 6px 14px;
  border-radius: 30px;
  width: fit-content;
  margin-bottom: 20px;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background-color: hsl(280, 100%, 65%);
  border-radius: 50%;
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(168, 85, 247, 0); }
  100% { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
}

.lobby-status-text {
  font-size: 11px;
  font-weight: 700;
  color: hsl(280, 100%, 80%);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lobby-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

.lobby-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

.room-code-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  text-align: center;
}

.code-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.code-display-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.code-text {
  font-family: 'Outfit', monospace;
  font-size: 38px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--text-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  transform: scale(1.05);
}

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
}

.qr-box {
  background: white;
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  transition: transform var(--transition-normal);
}

.qr-box:hover {
  transform: scale(1.02) rotate(1deg);
}

.qr-svg {
  display: block;
}

.qr-help {
  font-size: 12px;
  color: var(--text-muted);
}

/* Participants List */
.players-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.players-header h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.capacity-indicator {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent);
  background: rgba(244, 63, 94, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
}

.capacity-indicator.ready {
  color: hsl(142, 70%, 50%);
  background: rgba(16, 185, 129, 0.1);
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 180px;
  margin-bottom: 24px;
}

.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  animation: slide-in-left var(--transition-normal) forwards;
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-15px); }
  to { opacity: 1; transform: translateX(0); }
}

.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  color: white;
}

.player-name-container {
  display: flex;
  flex-direction: column;
}

.player-name {
  font-size: 14px;
  font-weight: 600;
}

.player-role-tag {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.player-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.player-status.voted {
  color: hsl(142, 70%, 50%);
}

.player-status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--text-muted);
  border-radius: 50%;
}

.player-row.active .player-status-dot {
  background-color: hsl(142, 70%, 50%);
  box-shadow: 0 0 8px hsl(142, 70%, 50%);
}

/* Demo Simulator Panel */
.simulator-panel {
  background: rgba(14, 165, 233, 0.05);
  border: 1px dashed rgba(14, 165, 233, 0.25);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  animation: pulse-border 3s infinite alternate;
}

@keyframes pulse-border {
  0% { border-color: rgba(14, 165, 233, 0.2); }
  100% { border-color: rgba(14, 165, 233, 0.45); }
}

.simulator-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: hsl(199, 100%, 75%);
  margin-bottom: 6px;
}

.sim-icon {
  width: 16px;
  height: 16px;
}

.sim-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}

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

.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-help-text {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* --- SCREEN 4: VOTING GRID & RANKING --- */
.voting-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.submit-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grid-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Voting countdown timer */
.voting-countdown {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.voting-countdown svg {
  width: 13px;
  height: 13px;
}

.voting-countdown.countdown--urgent {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.4);
  color: hsl(0,100%,70%);
  animation: pulse-urgent 1s ease-in-out infinite;
}

.voting-countdown.countdown--expired {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.5);
  color: hsl(0,100%,65%);
}

@keyframes pulse-urgent {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* Captain kick button */
.btn-kick {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: hsl(0,80%,65%);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-kick:hover {
  background: rgba(239,68,68,0.25);
  border-color: rgba(239,68,68,0.5);
  transform: scale(1.1);
}

.btn-kick svg { width: 12px; height: 12px; }

/* Timed-out player status */
.player-status.timed-out {
  color: hsl(0,70%,60%);
}

/* Inline kick confirmation */
.kick-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  font-size: 12px;
  color: var(--text-secondary);
  animation: fade-in-down 0.15s ease-out forwards;
  flex-wrap: wrap;
}

.kick-confirm strong {
  color: var(--text-primary);
}

.kick-confirm-yes {
  background: rgba(239,68,68,0.2);
  border: 1px solid rgba(239,68,68,0.4);
  color: hsl(0,90%,70%);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.kick-confirm-yes:hover {
  background: rgba(239,68,68,0.35);
}

.kick-confirm-no {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.kick-confirm-no:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

/* Inline exit confirmation in the header — replaces native confirm(),
   which some mobile browsers auto-dismiss. */
.exit-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  font-size: 12px;
  color: var(--text-secondary);
  animation: fade-in-down 0.15s ease-out forwards;
  flex-wrap: wrap;
}

.exit-confirm.hidden {
  display: none;
}

.exit-confirm-yes {
  background: rgba(239,68,68,0.2);
  border: 1px solid rgba(239,68,68,0.4);
  color: hsl(0,90%,70%);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.exit-confirm-yes:hover {
  background: rgba(239,68,68,0.35);
}

.exit-confirm-no {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.exit-confirm-no:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

/* Shown in the lobby when rooms are browser-local (no room server) */
.lobby-backend-note {
  margin: 8px 0 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(250,204,21,0.07);
  border: 1px solid rgba(250,204,21,0.22);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.lobby-backend-note.hidden {
  display: none;
}

/* Shown on the setup screen when no TMDB key is configured */
.tmdb-key-notice {
  margin: 10px 0 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(250,204,21,0.07);
  border: 1px solid rgba(250,204,21,0.22);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.tmdb-key-notice.hidden {
  display: none;
}

.tmdb-key-notice code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
}

/* ── Compact list view (mobile) ─────────────────────────────────────── */
.movie-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.movie-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.movie-list-row:active {
  background: rgba(255,255,255,0.07);
}

.movie-list-row.list-row--ranked {
  border-color: rgba(139,92,246,0.35);
  background: rgba(139,92,246,0.06);
}

.movie-list-row.list-row--vetoed {
  border-color: rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.05);
  opacity: 0.75;
}

.list-veto-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: hsl(0, 80%, 55%);
  border-radius: 2px 0 0 2px;
}

/* Long-press radial progress ring */
.long-press-ring {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.1s;
}

.long-press-ring.running {
  opacity: 1;
}

.long-press-svg {
  width: 36px;
  height: 36px;
  transform: rotate(-90deg);
}

.long-press-track {
  fill: none;
  stroke: rgba(239, 68, 68, 0.15);
  stroke-width: 3;
}

.long-press-progress {
  fill: none;
  stroke: hsl(0, 90%, 65%);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 94.2;   /* 2π × r=15 ≈ 94.25 */
  stroke-dashoffset: 94.2;  /* starts empty */
  transition: stroke-dashoffset v(--long-press-duration, 0.5s) linear;
}

.long-press-ring.running .long-press-progress {
  stroke-dashoffset: 0;     /* fills to complete circle over duration */
  transition: stroke-dashoffset 0.5s linear;
}

/* Flash animation when long-press fires */
@keyframes long-press-fire {
  0%   { background: rgba(239,68,68,0.25); }
  100% { background: rgba(255,255,255,0.03); }
}

.movie-list-row.long-press-fired {
  animation: long-press-fire 0.4s ease-out forwards;
}

.list-poster-wrap {
  position: relative;
  width: 44px;
  height: 66px;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .list-poster-wrap {
    width: 60px;
    height: 90px;
  }
}

.list-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.08);
  display: block;
}

/* Rank number overlay on mobile poster thumbnail */
.list-poster-rank {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 900;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  pointer-events: none;
}

.list-poster-rank--1 { background: rgba(234,179,8,0.5);   color: hsl(45,100%,80%); }
.list-poster-rank--2 { background: rgba(148,163,184,0.45); color: hsl(210,20%,92%); }
.list-poster-rank--3 { background: rgba(180,100,40,0.45);  color: hsl(25,80%,78%); }

/* Veto overlay on mobile poster thumbnail */
.list-poster-veto {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: rgba(180,30,30,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.list-poster-veto svg {
  width: 18px;
  height: 18px;
  color: hsl(0,100%,75%);
}

.list-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.list-meta {
  font-size: 10px;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .list-title { font-size: 15px; }
  .list-meta  { font-size: 12px; }
  .movie-list-row { padding: 10px 14px; gap: 14px; }
  .list-poster-rank { font-size: 28px; }
}

.list-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.list-info-btn,
.list-veto-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.list-info-btn svg,
.list-veto-btn svg {
  width: 13px;
  height: 13px;
}

.list-info-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.1); }

.list-veto-btn:hover,
.list-veto-btn.active {
  color: hsl(0,100%,70%);
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.4);
}



.grid-section {
  display: flex;
  flex-direction: column;
}

.section-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
  gap: 16px;
}

.grid-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.grid-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
}

.selection-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
}

/* Grid size toggle button group */
.grid-size-toggle {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.grid-size-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.grid-size-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.grid-size-btn.active {
  background: var(--color-primary-glow);
  border-color: var(--color-primary);
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(139,92,246,0.2);
}

/* Movie voting grid — columns driven by --grid-cols custom property set by JS */
.grid-3x3 {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, 3), 1fr);
  gap: 10px;
  width: 100%;
}

@media (max-width: 480px) {
  .grid-3x3 {
    gap: 6px;
  }
}

.movie-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 2 / 3;
  cursor: pointer;
  user-select: none;
  background-color: #0c0a09;
  border: 2px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform var(--transition-fast) ease-out, border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.movie-card:active {
  cursor: grabbing;
}

.movie-card:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 20px rgba(0,0,0,0.5), 0 0 15px rgba(255,255,255,0.05);
  z-index: 10;
}

.movie-card.dragging {
  opacity: 0.4;
  transform: scale(0.95);
  border: 2px dashed var(--color-primary);
}

.movie-card.ranked {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Large rank number overlay on desktop grid cards */
.card-rank-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 56px;
  font-weight: 900;
  pointer-events: none;
  z-index: 6;
  letter-spacing: -2px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}

.card-rank-overlay--1 {
  background: rgba(234,179,8,0.35);
  color: hsl(45,100%,75%);
}
.card-rank-overlay--2 {
  background: rgba(148,163,184,0.3);
  color: hsl(210,20%,88%);
}
.card-rank-overlay--3 {
  background: rgba(180,100,40,0.3);
  color: hsl(25,80%,72%);
}

.poster-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

.movie-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Movie Card Overlay Elements */
.movie-card-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0) 80%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.movie-card:hover .movie-card-overlay {
  opacity: 1;
}

/* Always visible title on small screens / mobile */
.movie-title-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  padding: 4px 6px;
  text-align: center;
  transition: opacity var(--transition-fast);
}

.movie-card:hover .movie-title-bar {
  opacity: 0;
}

.movie-title-small {
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-secondary);
}

.btn-veto-trigger {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 12;
  backdrop-filter: blur(4px);
  transition: all var(--transition-fast);
}

.btn-veto-trigger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.3);
  border-color: hsl(0, 100%, 65%);
  color: hsl(0, 100%, 75%);
  transform: scale(1.1);
}

.btn-veto-trigger:disabled,
.list-veto-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-veto-trigger.active {
  background: rgba(239, 68, 68, 0.4);
  border-color: hsl(0, 100%, 65%);
  color: hsl(0, 100%, 75%);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.btn-veto-trigger svg {
  width: 12px;
  height: 12px;
}

/* Vetoed card overlay */
.movie-card.vetoed {
  border-color: hsl(0, 80%, 55%) !important;
}

.veto-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(180, 30, 30, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

.veto-overlay svg {
  width: 40%;
  height: 40%;
  color: hsl(0, 100%, 70%);
  opacity: 0.75;
}

.btn-info-trigger {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  z-index: 12;
  backdrop-filter: blur(4px);
  transition: all var(--transition-fast);
}

.btn-info-trigger:hover {
  background: var(--color-primary);
  border-color: transparent;
  transform: scale(1.1);
}

.btn-info-trigger svg {
  width: 12px;
  height: 12px;
}

/* Ballot / Ranking Section */
.ballot-section {
  padding: 16px;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .ballot-section { padding: 24px; }
}

.ballot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.ballot-header h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}

.btn-clear-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-fast);
}

.btn-clear-link:hover {
  color: var(--color-accent);
}

.btn-clear-link svg {
  width: 12px;
  height: 12px;
}

.ballot-description {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 20px;
}

.ballot-slots {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  flex: 1;
}

.ballot-slot-card {
  position: relative;
  height: 68px;
  border: 2px dashed rgba(255, 255, 255, 0.12);

}

@media (min-width: 768px) {
  .ballot-slot-card { height: 80px; }
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 16px;
  transition: all var(--transition-fast);
  overflow: hidden;
}

.ballot-slot-card.drag-over {
  background: rgba(139, 92, 246, 0.08);
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.1);
  transform: scale(1.01);
}

.slot-marker {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.slot-marker.rank-1 { background: rgba(234, 179, 8, 0.15); border: 1px solid rgba(234, 179, 8, 0.4); color: hsl(45, 100%, 65%); }
.slot-marker.rank-2 { background: rgba(148, 163, 184, 0.15); border: 1px solid rgba(148, 163, 184, 0.4); color: hsl(210, 15%, 80%); }
.slot-marker.rank-3 { background: rgba(204, 120, 50, 0.15); border: 1px solid rgba(204, 120, 50, 0.4); color: hsl(25, 75%, 65%); }

.slot-content-placeholder {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.placeholder-icon { font-size: 18px; opacity: 0.6; }
.placeholder-text { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.placeholder-points {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.slot-movie-target {
  display: none; /* hidden until populated */
  align-items: center;
  gap: 16px;
  flex: 1;
  width: 100%;
}

.ballot-slot-card.filled .slot-content-placeholder {
  display: none;
}

.ballot-slot-card.filled .slot-movie-target {
  display: flex;
  animation: pop-in var(--transition-fast) forwards;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.ballot-slot-card.filled {
  border-style: solid;
  border-color: rgba(255,255,255,0.15);
  background: var(--surface-glass-bright);
}

.slot-poster {
  width: 40px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
}

.slot-movie-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.slot-movie-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

.btn-remove-slot {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-remove-slot:hover {
  background: rgba(239, 68, 68, 0.1);
  color: hsl(0, 100%, 75%);
}

.ballot-warning-text {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
}

.ballot-warning-text.ready {
  color: hsl(142, 70%, 50%);
  font-weight: 600;
}

/* --- SCREEN 5: WAITING SCREEN --- */
#screen-waiting {
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
}

.waiting-box {
  width: 100%;
  max-width: 480px;
  padding: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.waiting-animation-container {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.loader-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid rgba(139, 92, 246, 0.1);
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  animation: heartbeat 2s infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.15); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  70% { transform: scale(1); }
}

.waiting-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
}

.waiting-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 28px;
}

.voting-progress-card {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-glass);
  padding: 18px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  text-align: left;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.3);
}

.waiting-participants-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --- SCREEN 6: RESULTS SCREEN --- */
.results-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  position: relative;
}

@media (min-width: 900px) {
  .results-layout {
    grid-template-columns: 1fr 1fr;
  }
  .winner-hero {
    position: sticky;
    top: 24px;
    height: fit-content;
  }
}

.confetti-canvas {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 99;
}

/* Winner Hero Presentation */
.winner-hero {
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 2px solid rgba(139, 92, 246, 0.25);
  box-shadow: 0 12px 40px rgba(139, 92, 246, 0.15);
  overflow: hidden;
  position: relative;
}

/* Glowing halo behind winner poster */
.winner-hero::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  background: var(--color-primary);
  filter: blur(100px);
  opacity: 0.3;
  top: 30%;
  z-index: -1;
  animation: pulse-glow 4s infinite alternate;
}

@keyframes pulse-glow {
  from { opacity: 0.2; transform: scale(0.9); }
  to { opacity: 0.45; transform: scale(1.25); }
}

.winner-tag {
  background: linear-gradient(135deg, hsl(45, 100%, 50%), hsl(25, 100%, 50%));
  color: white;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.3);
  text-transform: uppercase;
}

.winner-presentation {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.winner-poster-container {
  position: relative;
  width: 180px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255,255,255,0.15);
  animation: float-winner 4s infinite ease-in-out;
}

@keyframes float-winner {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(0.5deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

.winner-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.winner-crown {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 32px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.winner-points-ribbon {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark-end);
  border: 1px solid var(--border-glass-hover);
  color: var(--color-secondary);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  white-space: nowrap;
}

.winner-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.winner-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.winner-synopsis {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 400px;
  background: rgba(0,0,0,0.15);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.03);
}

/* Leaderboard List */
.leaderboard-section {
  padding: 32px;
}

.leaderboard-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
}

.leaderboard-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.row-position {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  width: 28px;
  color: var(--text-muted);
}

/* Leaderboard starts at rank #2 (winner is in the hero card above) */
.leaderboard-row:nth-child(1) .row-position { color: hsl(210, 15%, 80%); } /* Silver (#2) */
.leaderboard-row:nth-child(2) .row-position { color: hsl(25, 75%, 65%); }  /* Bronze (#3) */

.row-poster {
  width: 32px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.row-details {
  flex: 1;
  min-width: 0; /* truncate text in flex child */
  display: flex;
  flex-direction: column;
}

.row-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-meta {
  font-size: 10px;
  color: var(--text-muted);
}

.row-votes-breakdown {
  margin-left: 12px;
  text-align: right;
}

.row-score {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
  color: var(--color-secondary);
}

.row-score-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

/* Voter attribution */
.voted-by {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

.voter-rank {
  opacity: 0.6;
  font-size: 9px;
}

.winner-voters {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 4px;
}

.winner-voters .voter-rank {
  font-size: 10px;
  opacity: 0.65;
}

/* Vetoed movies section */
.vetoed-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 20px 0 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.vetoed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.vetoed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.05);
  border: 1px solid rgba(239,68,68,0.15);
}

.vetoed-poster {
  opacity: 0.5;
  filter: grayscale(60%);
}

.vetoed-movie-title {
  text-decoration: line-through;
  opacity: 0.6;
}

.vetoed-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-left: auto;
}

.results-actions {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

/* --- DETAIL MODAL --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 6, 12, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity var(--transition-normal);
}

.modal-card {
  width: 100%;
  max-width: 550px;
  position: relative;
  overflow: hidden;
  padding: 28px;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 5;
}

.modal-close-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
  transform: scale(1.05);
}

.modal-content-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 480px) {
  .modal-content-layout {
    flex-direction: row;
    gap: 24px;
  }
}

.modal-left {
  width: 140px;
  flex-shrink: 0;
  margin: 0 auto;
}

.modal-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.modal-right {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.rating-badge {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: hsl(45, 100%, 65%);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.modal-synopsis {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
  flex: 1;
}

.modal-credits-row {
  display: flex;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.credits-label {
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 48px;
}

.credits-value {
  color: var(--text-muted);
}

.modal-services {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 14px;
}

.services-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.services-list {
  display: flex;
  gap: 6px;
}

.service-icon-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.service-icon-img {
  height: 12px;
  width: auto;
  max-width: 20px;
  object-fit: contain;
  display: block;
}

/* Scale Animation for Modal */
.animate-scale {
  animation: modal-scale var(--transition-normal) cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modal-scale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* --- TIE-BREAKER / COIN FLIP SCREEN --- */
.coin-flip-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 6, 12, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.coin-flip-container {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7);
  border-color: rgba(255,255,255,0.12);
}

.coin-flip-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.coin-flip-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 28px;
}

/* 3D Coin Animation */
.coin-scene {
  width: 100px;
  height: 100px;
  perspective: 600px;
  margin-bottom: 28px;
}

.coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 3s cubic-bezier(0.1, 0.8, 0.1, 1);
  transform: rotateX(0deg);
}

.coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5), inset 0 0 10px rgba(255,255,255,0.2);
  border: 4px solid var(--border-glass-hover);
}

.coin-front {
  background: linear-gradient(135deg, hsl(45, 100%, 60%), hsl(25, 100%, 50%));
  z-index: 2;
}

.coin-back {
  background: linear-gradient(135deg, hsl(270, 90%, 60%), hsl(346, 90%, 55%));
  transform: rotateY(180deg);
}

/* Flips to show either front or back */
.coin.flip-to-front {
  animation: flip-front 3.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.coin.flip-to-back {
  animation: flip-back 3.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes flip-front {
  0% { transform: rotateY(0) rotateX(0); }
  10% { transform: translateY(-30px) rotateX(180deg); }
  30% { transform: translateY(-50px) rotateX(720deg); }
  50% { transform: translateY(-50px) rotateX(1440deg); }
  70% { transform: translateY(-20px) rotateX(1800deg); }
  100% { transform: translateY(0) rotateX(2160deg); } /* lands on front: multiple of 360 */
}

@keyframes flip-back {
  0% { transform: rotateY(0) rotateX(0); }
  10% { transform: translateY(-30px) rotateX(180deg); }
  30% { transform: translateY(-50px) rotateX(720deg); }
  50% { transform: translateY(-50px) rotateX(1440deg); }
  70% { transform: translateY(-20px) rotateX(1800deg); }
  100% { transform: translateY(0) rotateX(2340deg); } /* lands on back: multiple of 360 + 180 */
}

.coin-flip-results {
  animation: fade-in-up 0.5s forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.coin-winner-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: hsl(142, 70%, 55%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.coin-flip-results h4 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.coin-flip-results p {
  font-size: 12px;
  color: var(--text-muted);
}

/* --- Toast Notification System --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass-hover);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  min-width: 250px;
  max-width: 320px;
  pointer-events: auto;
  animation: toast-slide-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(50px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.toast.removing {
  animation: toast-fade-out 0.25s forwards;
}

@keyframes toast-fade-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

.toast-success { border-left: 3px solid hsl(142, 70%, 55%); }
.toast-info { border-left: 3px solid hsl(199, 100%, 50%); }
.toast-error { border-left: 3px solid hsl(0, 100%, 70%); }
.toast-warning { border-left: 3px solid hsl(38, 100%, 60%); }

.toast-success i { color: hsl(142, 70%, 55%); }
.toast-info i { color: hsl(199, 100%, 50%); }
.toast-error i { color: hsl(0, 100%, 70%); }
.toast-warning i { color: hsl(38, 100%, 60%); }

/* --- Bounce Slow Animation for Logo Icon --- */
@keyframes bounce-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
