/* General Reset and Typography */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin:0; font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color:#101828; }

.gradient-bg {
  background: radial-gradient(1200px 800px at 20% 10%, #ffb3b3 0%, rgba(255, 255, 255, 0) 60%),
              radial-gradient(1000px 600px at 80% 20%, #ffd699 0%, rgba(255, 255, 255, 0) 60%),
              linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.container { max-width: 900px; margin: 0 auto; padding: 16px; }
.topbar { display:flex; align-items:center; justify-content:space-between; padding: 6px 4px; }
.label { font-weight: 600; font-size: 14px; color:#344054; }
.label.secondary { color:#667085; }

/* Overlay (Join) */
.overlay { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; padding:16px; background:linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.85)); backdrop-filter:saturate(1.2) blur(3px); z-index:10; }
.card { width:100%; max-width:420px; background:white; border-radius:14px; box-shadow:0 20px 60px rgba(16,24,40,0.18); padding:20px; }
.title { margin:0 0 12px; font-size:22px; font-weight:800; }
.form-group { margin:10px 0; }
.form-group label { display:block; font-size:12px; color:#475467; margin-bottom:6px; }
input[type=text], select { width:100%; padding:12px 14px; border:1px solid #D0D5DD; border-radius:10px; font-size:16px; outline:none; }
input[type=text]:focus, select:focus { border-color:#7F56D9; box-shadow:0 0 0 3px rgba(127,86,217,0.2); }

.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:12px 16px; border-radius:10px; border:1px solid transparent; font-weight:700; cursor:pointer; transition:transform .05s ease, background-color .2s; }
.btn.primary { background:#7F56D9; color:white; }
.btn.primary:active { transform: scale(0.98); }
.btn.sm { padding:6px 10px; font-size:12px; }
.hint { color:#667085; font-size:12px; min-height:18px; }

/* Buzzer */
.buzzer-wrap { display:flex; align-items:center; justify-content:center; flex-direction:column; padding:20px; height: calc(100vh - 80px); }

.buzzer { -webkit-tap-highlight-color: transparent; width: min(85vw, 520px); height: min(85vw, 520px); border-radius: 999px; border:none; background: radial-gradient(60% 60% at 30% 30%, #ff8a8a 0%, #ff2e2e 45%, #cc0000 100%); color:white; box-shadow: 0 24px 60px rgba(255,46,46,0.45), inset 0 4px 12px rgba(255,255,255,0.35); position:relative; }
.buzzer:disabled { background: radial-gradient(60% 60% at 30% 30%, #f0f0f0 0%, #d9d9d9 45%, #bfbfbf 100%); color:#f9fafb; box-shadow: 0 10px 30px rgba(16,24,40,0.15), inset 0 2px 6px rgba(255,255,255,0.2); cursor: not-allowed; }
.buzzer:active:not(:disabled) { transform: scale(0.98); }
.buzzer-text { font-size: clamp(28px, 12vw, 72px); font-weight: 900; letter-spacing: 1px; text-shadow: 0 2px 0 rgba(0,0,0,0.15), 0 10px 30px rgba(0,0,0,0.2); }

.status { margin-top:18px; color:#344054; font-weight:600; text-align:center; }

body.picture-buzzer #answerDisplay.answer-display {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(16px, 5vh, 64px);
  margin: 0;
  padding: 10px 14px; /* slightly reduced to keep compact */
  max-width: min(1000px, 86vw);
  z-index: 1002; /* above picture overlay */
  background: rgba(248, 250, 252, 0.92); /* subtle translucency */
}

/* Picture-Buzzer: distinct secondary small buttons */
body.picture-buzzer .btn.secondary.sm {
  background:#06B6D4;
  color:white;
  border-color:#0891B2;
}
body.picture-buzzer .btn.secondary.sm:hover { background:#0891B2; }
body.picture-buzzer .btn.secondary.sm:active { transform: scale(0.98); }

/* Event Locked Banner */
.locked-banner { position:fixed; top:12px; left:50%; transform:translateX(-50%); background:#F9FAFB; color:#344054; border:1px solid #D0D5DD; padding:10px 14px; border-radius:999px; box-shadow:0 10px 30px rgba(16,24,40,0.12); font-weight:700; z-index:20; display:flex; align-items:center; gap:8px; }
.locked-banner .dot { width:8px; height:8px; border-radius:50%; display:inline-block; background:#ef4444; box-shadow:0 0 0 3px rgba(239,68,68,0.18); }

/* Admin styles (quick) */
.admin-container { max-width:1200px; margin:0 auto; padding:16px; }
.section { background:white; border-radius:12px; box-shadow:0 6px 20px rgba(16,24,40,0.08); padding:14px; margin-bottom:14px; }
.section h2 { margin:6px 0 12px; font-size:18px; }
.grid { display:grid; gap:12px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.row { display:flex; gap:10px; align-items:flex-start; flex-wrap:wrap; }
input, select, textarea { font-family: inherit; }
textarea { width:100%; min-height:100px; padding:12px 14px; border:1px solid #D0D5DD; border-radius:10px; font-size:14px; }
.table { width:100%; border-collapse: collapse; }
.table th, .table td { padding:8px 10px; border-bottom:1px solid #eee; font-size:14px; }
.badge { display:inline-block; padding:3px 8px; border-radius:999px; font-size:12px; background:#EEF4FF; color:#3538CD; }

/* Asked question highlight in admin */
.question-item.asked {
  opacity: 0.6;
}

/* Team Selection Styling */
.team-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.team-option {
  position: relative;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  color: #475569;
  user-select: none;
}

.team-option:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.team-option.selected {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  border-color: #7c3aed;
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.team-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.team-option .team-name {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

/* Form improvements */
.form-group {
  margin: 16px 0;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: all 0.2s ease;
  background: #fafafa;
}

.form-input:focus {
  border-color: #7c3aed;
  background: white;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-input:disabled {
  background-color: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
  border-color: #d1d5db;
}

/* Presenter MCQ options - Millionaire Style */
#mcqOptions {
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 25px;
  justify-content: center;
  align-items: stretch;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 3;
}

.mcq-option {
  position: relative;
  background: 
    linear-gradient(145deg, rgba(13, 71, 161, 0.4) 0%, rgba(1, 87, 155, 0.6) 50%, rgba(0, 0, 81, 0.8) 100%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
  border: 2px solid rgba(255, 193, 7, 0.3);
  border-radius: 8px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 16px;
  color: #ffffff;
  user-select: none;
  text-align: left;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.mcq-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 193, 7, 0.2), transparent);
  transition: left 0.5s;
}

.mcq-option:hover {
  background: 
    linear-gradient(145deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 215, 0, 0.1) 50%, rgba(13, 71, 161, 0.6) 100%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, transparent 100%);
  border-color: rgba(255, 193, 7, 0.6);
  transform: translateY(-2px);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 193, 7, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  text-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 0 8px rgba(255, 193, 7, 0.3);
}

.mcq-option:hover::before {
  left: 100%;
}

.mcq-option:active {
  transform: translateY(-1px) scale(0.98);
}

.mcq-option.selected {
  background: 
    linear-gradient(145deg, rgba(255, 193, 7, 0.3) 0%, rgba(255, 215, 0, 0.2) 50%, rgba(255, 152, 0, 0.1) 100%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  border-color: rgba(255, 193, 7, 0.8);
  color: #ffffff;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 25px rgba(255, 193, 7, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
  text-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.5),
    0 0 12px rgba(255, 193, 7, 0.4);
}

.mcq-option.selected::before {
  background: linear-gradient(90deg, transparent, rgba(255, 193, 7, 0.3), transparent);
}

.mcq-option.correct {
  background: 
    linear-gradient(145deg, rgba(76, 175, 80, 0.4) 0%, rgba(56, 142, 60, 0.6) 50%, rgba(27, 94, 32, 0.8) 100%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  border-color: rgba(139, 195, 74, 0.8);
  color: #ffffff;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 25px rgba(139, 195, 74, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
  text-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.5),
    0 0 12px rgba(139, 195, 74, 0.4);
  animation: millionaire-correct 0.6s ease-out;
}

@keyframes millionaire-correct {
  0% { 
    transform: translateY(-2px) scale(1); 
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.6),
      0 0 25px rgba(139, 195, 74, 0.4);
  }
  50% { 
    transform: translateY(-4px) scale(1.02); 
    box-shadow: 
      0 12px 40px rgba(0, 0, 0, 0.7),
      0 0 40px rgba(139, 195, 74, 0.6);
  }
  100% { 
    transform: translateY(-2px) scale(1); 
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.6),
      0 0 25px rgba(139, 195, 74, 0.4);
  }
}

@media (min-width: 768px) {
  .buzzer-wrap { height: calc(100vh - 100px); }
  .team-selection {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}
