/* ==========================================================================
   DILEMMA BABY - Mobile-First Player Styles
   Society 5.0 Festival • "Reimagining Autonomy"
   ========================================================================== */

:root {
  --bg-dark: #07090e;
  --bg-card: #0e131d;
  --bg-elevated: #161c2a;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 210, 255, 0.4);

  --text-main: #f0f4fc;
  --text-sub: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #00d2ff;
  --accent-cyan-glow: rgba(0, 210, 255, 0.3);
  --happy-green: #10b981;
  --happy-glow: rgba(16, 185, 129, 0.35);
  --distress-red: #ef4444;
  --distress-glow: rgba(239, 68, 68, 0.35);
  --warning-amber: #f59e0b;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Ambient glow in background */
.ambient-bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 15%, rgba(0, 210, 255, 0.07) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* App Container */
.app-container {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  padding: 20px 18px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

/* Persistent Top Navigation Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Happiness Vital Widget */
.vital-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-sub);
}

.vital-score {
  font-weight: 700;
  color: var(--accent-cyan);
}

/* Persistent Extend Time Button in Top Corner */
.btn-extend-timer {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-extend-timer:hover,
.btn-extend-timer:active {
  background: rgba(0, 210, 255, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Card Elements */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

/* View Sections */
.view-section {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.view-section.active {
  display: block;
}

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

/* Connecting / Cold-Start View */
.connecting-box {
  text-align: center;
  padding: 60px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(0, 210, 255, 0.15);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.connecting-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.connecting-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 340px;
}

/* Queue View */
.queue-box {
  text-align: center;
  padding: 30px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.queue-badge {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 100px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--warning-amber);
  color: var(--warning-amber);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.queue-number-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 24px var(--accent-cyan-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.queue-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
}

.queue-subtext {
  font-size: 0.92rem;
  color: var(--text-sub);
  line-height: 1.5;
  max-width: 320px;
}

/* Lobby View */
.lobby-box {
  text-align: center;
  padding: 24px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.player-slot-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.lobby-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  margin: 10px 0;
}

.slot-indicator {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.slot-indicator.active {
  border-color: var(--accent-cyan);
  background: rgba(0, 210, 255, 0.08);
}

.slot-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.slot-indicator.active .slot-dot {
  background: var(--happy-green);
  box-shadow: 0 0 8px var(--happy-glow);
}

.lobby-status-msg {
  font-size: 0.95rem;
  color: var(--text-sub);
  line-height: 1.5;
}

/* Primary Action Buttons */
.btn-main {
  width: 100%;
  padding: 16px 20px;
  border-radius: 12px;
  border: none;
  background: var(--accent-cyan);
  color: #040812;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px var(--accent-cyan-glow);
  transition: all 0.2s ease;
}

.btn-main:active {
  transform: scale(0.98);
}

/* Active Dilemma View */
.dilemma-header {
  margin-bottom: 16px;
}

.dilemma-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 4px;
}

.dilemma-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
}

.perspective-box {
  background: rgba(0, 210, 255, 0.04);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 0 10px 10px 0;
  padding: 14px 16px;
  margin-bottom: 22px;
}

.perspective-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: block;
}

.perspective-body {
  font-size: 0.98rem;
  line-height: 1.6;
  color: #dbe4f0;
}

/* Decision Voting Buttons */
.decision-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.choice-btn {
  background: var(--bg-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px 20px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--accent-cyan);
  background: rgba(0, 210, 255, 0.06);
}

.choice-btn:active:not(:disabled) {
  transform: scale(0.99);
}

.choice-btn.selected {
  border-color: var(--accent-cyan);
  background: rgba(0, 210, 255, 0.15);
  box-shadow: 0 0 20px var(--accent-cyan-glow);
}

.choice-btn.dimmed {
  opacity: 0.35;
}

.choice-btn:disabled {
  cursor: default;
}

.choice-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.choice-letter {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.choice-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

/* Submitted Status Pill */
.submitted-banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(0, 210, 255, 0.08);
  border: 1px solid var(--accent-cyan-glow);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
  animation: pulse-border 2s infinite ease-in-out;
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(0, 210, 255, 0.2); }
  50% { border-color: var(--accent-cyan); }
}

/* Reveal Result Area */
.reveal-card {
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  animation: slideUp 0.3s ease-out;
}

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

.reveal-card.consensus {
  border: 2px solid var(--happy-green);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.1) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 30px var(--happy-glow);
}

.reveal-card.discord {
  border: 2px solid var(--distress-red);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.1) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 30px var(--distress-glow);
}

.reveal-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.reveal-card.consensus .reveal-title {
  color: var(--happy-green);
}
.reveal-card.discord .reveal-title {
  color: var(--distress-red);
}

.reveal-message {
  font-size: 0.95rem;
  color: #fff;
  line-height: 1.5;
  margin-bottom: 18px;
}

.vote-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.breakdown-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.breakdown-choice {
  font-size: 0.92rem;
  font-weight: 700;
}

.breakdown-choice.choice-a {
  color: var(--accent-cyan);
}
.breakdown-choice.choice-b {
  color: var(--warning-amber);
}

.auto-advance-bar-box {
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  height: 6px;
  overflow: hidden;
}

.auto-advance-progress {
  height: 100%;
  width: 100%;
  background: var(--accent-cyan);
  transition: width 0.1s linear;
}

/* Inactivity Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.25s ease-out;
}

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

.modal-card {
  background: var(--bg-card);
  border: 2px solid var(--warning-amber);
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.35);
  border-radius: 18px;
  padding: 28px 22px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-icon {
  font-size: 2.4rem;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

.modal-text {
  font-size: 0.95rem;
  color: var(--text-sub);
  line-height: 1.5;
}

.modal-countdown-badge {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--warning-amber);
}

.btn-confirm-active {
  background: var(--warning-amber);
  color: #050811;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.3);
}

/* Footer info */
.app-footer {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  padding-top: 16px;
}
