@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-black: #000000;
  --surface-dark: #080808;
  --surface-card: #0E0E0E;
  --surface-card-hover: #141414;
  --primary-crimson: #FF0033;
  --primary-crimson-glow: rgba(255, 0, 51, 0.35);
  --primary-gradient: linear-gradient(135deg, #FF0033 0%, #D4002B 50%, #5A0012 100%);
  --platinum-silver: #E5E4E2;
  --platinum-metallic: linear-gradient(135deg, #E5E4E2 0%, #BCC6CC 50%, #7D7D7D 100%);
  --text-primary: #FDF4E3;
  --text-muted: rgba(253, 244, 227, 0.55);
  --border-subtle: rgba(255, 0, 51, 0.2);
  --border-active: rgba(255, 0, 51, 0.75);
  --success-green: #00E676;
  --accent-thorn-dark: #061A12;
  --accent-purple: #8A2BE2;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* NO-SCROLL SINGLE SCREEN ROOT */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden; /* ABSOLUTELY ZERO SCROLL */
  background-color: var(--bg-black);
  color: var(--text-primary);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(255, 0, 51, 0.16) 0%, transparent 55%),
    radial-gradient(circle at 10% 40%, rgba(6, 36, 25, 0.25) 0%, transparent 50%);
}

/* Mobile Single Viewport App Container (Optimized for iPhone 11 Pro Max & Modern Phones) */
.app-container {
  max-width: 500px;
  width: 100%;
  height: 100dvh; /* Dynamic viewport height: accounts for mobile browser address bar */
  max-height: 100vh;
  margin: 0 auto;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Zero scroll */
  position: relative;
  z-index: 1;
}

/* Compact Mobile Topbar (Leaves maximum vertical space for the 5 contestants) */
.mobile-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: none;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  flex-direction: column;
}

.topbar-tag {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--primary-crimson);
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--primary-crimson-glow);
}

.topbar-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--text-primary);
  text-transform: uppercase;
  line-height: 1.1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(14, 14, 14, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success-green);
  box-shadow: 0 0 8px var(--success-green);
  animation: pulseDot 1.8s infinite;
}

.status-dot.paused {
  background: #FFA000;
  box-shadow: 0 0 8px #FFA000;
}

.status-dot.closed {
  background: #D32F2F;
  box-shadow: 0 0 8px #D32F2F;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* 5 Contestants Rows — Fits Entire Height with NO Scroll */
.contestant-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; /* Vital flex child constraint */
  gap: 8px;
  justify-content: space-between;
}

.contestant-card {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(14, 14, 14, 0.65);
  border: 1px solid rgba(255, 0, 51, 0.2);
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.contestant-card.voted-target {
  border-color: var(--primary-crimson);
  background: linear-gradient(90deg, rgba(255, 0, 51, 0.18) 0%, rgba(14, 14, 14, 0.85) 100%);
  box-shadow: 0 0 15px rgba(255, 0, 51, 0.25);
}

.contestant-photo-wrap {
  height: 100%;
  max-height: 110px;
  aspect-ratio: 3/4;
  border-radius: 8px;
  background: #020202;
  border: 1px solid rgba(255, 0, 51, 0.4);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.contestant-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.contestant-number-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  background: rgba(0, 0, 0, 0.85);
  color: var(--primary-crimson);
  font-size: 9px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 0, 51, 0.4);
}

.contestant-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contestant-name {
  font-size: 15px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.contestant-theme {
  font-size: 11px;
  font-weight: 700;
  color: var(--platinum-silver);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Action Vote Pill Button on Right */
.contestant-action {
  flex-shrink: 0;
}

.btn-vote {
  padding: 9px 18px;
  background: var(--primary-gradient);
  border: 1px solid rgba(255, 0, 51, 0.6);
  border-radius: 20px;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--primary-crimson-glow);
  white-space: nowrap;
  transition: all 0.2s ease;
}

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

.btn-vote:disabled {
  background: rgba(229, 228, 226, 0.08);
  border-color: rgba(229, 228, 226, 0.15);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-vote.voted {
  background: rgba(0, 230, 118, 0.15);
  border-color: var(--success-green);
  color: var(--success-green);
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.25);
}

/* Modal Popup — Dark Luxury */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: radial-gradient(circle at 50% 20%, rgba(255, 0, 51, 0.18) 0%, #0A0A0A 80%);
  border: 1px solid var(--primary-crimson);
  border-radius: 24px;
  padding: 30px 24px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 0 40px var(--primary-crimson-glow);
  animation: popModal 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popModal {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid var(--success-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.3);
}

.modal-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.modal-btn {
  width: 100%;
  padding: 12px;
  border-radius: 20px;
  background: var(--surface-card);
  border: 1px solid var(--border-active);
  color: var(--platinum-silver);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}

.modal-btn:hover {
  background: var(--primary-crimson);
  color: #fff;
  border-color: var(--primary-crimson);
}
