/* app.css — phone surface, presenter-driven deck model
 * ONLY tokens.css colors. No hover states. :active only.
 * 48px+ tap targets, one-handed, safe-area insets.
 * --c-practice appears NOWHERE in this file.
 */

body {
  padding-bottom: 120px;
  overscroll-behavior: none;
}
.hidden { display: none !important; }

input, button {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
}

/* ─── STICKY HEADER ─── */
.app-header {
  padding: var(--s-3) var(--s-4);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-line);
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: max(var(--s-3), env(safe-area-inset-top));
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.app-header h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

#switch-seat {
  background: transparent;
  color: var(--c-muted);
  border: 1px solid var(--c-line);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--radius);
  font-size: 0.875rem;
  min-height: 44px;
  cursor: pointer;
}
#switch-seat:active {
  background: var(--c-line);
}

/* ─── SCREENS ─── */
.screen {
  padding: var(--s-4);
  padding-left: max(var(--s-4), env(safe-area-inset-left));
  padding-right: max(var(--s-4), env(safe-area-inset-right));
}

/* ─── NAME ENTRY ─── */
.name-entry-card {
  background: var(--c-surface);
  padding: var(--s-6) var(--s-4);
  border-radius: var(--radius-lg);
  margin-top: var(--s-8);
  text-align: center;
}
.name-entry-card h2 { margin-top: 0; margin-bottom: var(--s-6); }
#name-input {
  width: 100%;
  padding: var(--s-4);
  font-size: 16px;
  border: 1px solid var(--c-line);
  background: var(--c-bg);
  color: var(--c-text);
  border-radius: var(--radius);
  margin-bottom: var(--s-4);
  outline: none;
}
#name-input:focus {
  border-color: var(--c-accent);
}
#name-submit {
  width: 100%;
  background: var(--c-accent);
  color: var(--c-bg);
  border: none;
  padding: var(--s-4);
  font-size: 1.125rem;
  font-weight: bold;
  border-radius: var(--radius);
  min-height: 48px;
  cursor: pointer;
}
#name-submit:active { opacity: 0.8; }

.error-msg {
  color: var(--c-danger);
  margin-top: var(--s-3);
  min-height: 1.5em;
}
.option-error {
  color: var(--c-danger);
  font-size: 0.875rem;
  margin-top: var(--s-2);
  min-height: 0;
}

/* ─── IDLE SCREEN ─── */
.idle-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: var(--s-6) var(--s-4);
}
.idle-name {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-3);
}
.idle-progress {
  font-size: 1rem;
  color: var(--c-muted);
  margin-bottom: var(--s-6);
}
.idle-status {
  font-size: 1rem;
  color: var(--c-dim);
  line-height: 1.6;
  max-width: 280px;
}
.idle-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--c-accent);
  border-radius: 50%;
  margin-right: var(--s-2);
  animation: idle-pulse 2.4s ease-in-out infinite;
}
@keyframes idle-pulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}

/* ─── SLOT VIEW ─── */
.slot-view {
  padding-bottom: var(--s-4);
}

.slot-header {
  margin-bottom: var(--s-4);
}
.slot-header-label {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-2) 0;
}
.slot-header-blurb {
  font-size: 0.9375rem;
  color: var(--c-muted);
  margin: 0;
  line-height: 1.5;
}

/* Phase badge at top of slot */
.phase-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-dim);
  margin-bottom: var(--s-3);
}

/* Review phase prompt */
.review-prompt {
  background: var(--c-surface-2);
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
  color: var(--c-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.review-prompt strong {
  color: var(--c-text);
}

/* ─── OPTION CARDS ─── */
.options-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.option-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-4);
  transition: border-color 0.3s var(--ease),
              background 0.3s var(--ease),
              box-shadow 0.3s var(--ease);
}

/* Highlighted card — the one currently on the TV */
.option-card.highlighted {
  border-color: var(--c-accent);
  background: var(--c-surface-2);
  box-shadow: inset 3px 0 0 var(--c-accent);
}

.option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-1);
}
.option-name {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}
.option-tag {
  background: var(--c-surface-2);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--c-dim);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: var(--s-2);
}
.option-card.highlighted .option-tag {
  background: var(--c-line);
}

.option-note {
  color: var(--c-muted);
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: var(--s-3);
}

/* ─── VOTE BUTTONS ─── */
.option-actions {
  display: flex;
  gap: var(--s-2);
}

.vote-btn {
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--c-line);
  background: var(--c-bg);
  color: var(--c-text);
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: none;
}
.vote-btn:active { opacity: 0.7; }

.btn-yes.selected   { background: var(--c-yes);   color: var(--c-bg); border-color: var(--c-yes); }
.btn-maybe.selected { background: var(--c-maybe); color: var(--c-bg); border-color: var(--c-maybe); }
.btn-pass.selected  { background: var(--c-pass);  color: var(--c-bg); border-color: var(--c-pass); }
.btn-single.selected { background: var(--c-accent); color: var(--c-bg); border-color: var(--c-accent); }

/* Read-only state — reveal phase and revealed slots */
.option-card.read-only .option-actions { display: none; }
.option-card.read-only .option-note { margin-bottom: 0; }

/* Winner styling */
.option-card.winner {
  border-color: var(--c-gold);
  box-shadow: inset 3px 0 0 var(--c-gold);
}

.revealed-score {
  font-weight: bold;
  font-size: 1.125rem;
  color: var(--c-text);
  text-align: right;
  margin-top: var(--s-2);
}
.revealed-stats {
  font-size: 0.75rem;
  color: var(--c-muted);
  font-weight: normal;
  margin-top: 4px;
}

/* Winner banner at top of revealed slot */
.revealed-banner {
  background: var(--c-gold);
  color: var(--c-bg);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
  margin-bottom: var(--s-4);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
}

/* Slot completion chip */
.slot-completion {
  font-size: 0.8125rem;
  color: var(--c-dim);
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--c-line);
}
.slot-completion strong {
  color: var(--c-text);
}

/* ─── ITINERARY ─── */
.itinerary-view {
  padding: var(--s-4);
  padding-left: max(var(--s-4), env(safe-area-inset-left));
  padding-right: max(var(--s-4), env(safe-area-inset-right));
}
.itinerary-view h2 {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-2) 0;
}
.itinerary-prompt {
  color: var(--c-muted);
  font-size: 0.9375rem;
  margin: 0 0 var(--s-5) 0;
}
.itinerary-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.itinerary-item {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-4);
  border-left: 3px solid var(--c-line);
}
.itinerary-item.has-winner {
  border-left-color: var(--c-gold);
}
.itinerary-day {
  font-size: 0.75rem;
  color: var(--c-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 2px;
}
.itinerary-label {
  font-size: 0.875rem;
  color: var(--c-muted);
  margin-bottom: 2px;
}
.itinerary-winner {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--c-gold);
}
.itinerary-pending {
  font-size: 0.9375rem;
  color: var(--c-dim);
  font-style: italic;
}

/* ─── PROGRESS FOOTER ─── */
#progress-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--c-surface);
  border-top: 1px solid var(--c-line);
  padding: var(--s-3) var(--s-4);
  padding-bottom: max(var(--s-3), env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
}
.progress-track {
  height: 6px;
  background: var(--c-line);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--s-2);
}
.progress-fill {
  height: 100%;
  background: var(--c-accent);
  width: 0%;
  transition: width 0.3s var(--ease);
}
#progress-text {
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-muted);
}

/* ─── VOTERS STATUS ─── */
.voters-status {
  margin-top: var(--s-5);
  padding: var(--s-4);
  background: var(--c-surface);
  border-radius: var(--radius);
  border: 1px solid var(--c-line);
}
.voters-status h3 {
  margin: 0 0 var(--s-3) 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-muted);
}
#voters-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.voter-pill {
  display: inline-flex;
  align-items: center;
  background: var(--c-surface-2);
  padding: var(--s-2) var(--s-3);
  border-radius: 16px;
  font-size: 0.875rem;
  color: var(--c-muted);
}
.voter-pill.done {
  border: 1px solid var(--c-accent);
  color: var(--c-accent);
}
.voter-pill.done::after {
  content: "✓";
  margin-left: 6px;
}

/* ─── DONE MESSAGE ─── */
#done-message {
  background: var(--c-gold);
  color: var(--c-bg);
  padding: var(--s-4);
  border-radius: var(--radius);
  margin-bottom: var(--s-5);
  text-align: center;
}
#done-message h2 { margin: 0 0 var(--s-2) 0; }
#done-message p { margin: 0; font-weight: bold; }

/* ─── DESYNC TOAST ─── */
.desync-toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--c-surface-2);
  color: var(--c-muted);
  text-align: center;
  padding: var(--s-2) var(--s-4);
  padding-top: max(var(--s-2), env(safe-area-inset-top));
  font-size: 0.8125rem;
  z-index: 200;
  transform: translateY(-100%);
  transition: transform 0.3s var(--ease);
}
.desync-toast.visible {
  transform: translateY(0);
}
