@import url('https://fonts.googleapis.com/css2?family=Lilita+One&family=Nunito:wght@600;700;800;900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Nunito', sans-serif;
  min-height: 100vh;
  background: #faf8f5;
  background-attachment: fixed;
  color: #1a202c;
  display: flex;
  justify-content: center;
  padding: 20px;
  overflow-x: hidden;
}

h1, h2, h3, .btn, .badge, .lobby-code-label,
.category-pill, .player-tag, .timer-ring,
.stag-name, .vote-name-full {
  font-family: 'Lilita One', 'Nunito', sans-serif;
}

.screen {
  display: none;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 1;
}

.screen.active {
  display: block;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.container { padding: 10px 0; }

.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4a5568;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding: 8px 18px;
  border-radius: 50px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.15s;
}

.back-link:hover {
  background: #f0f0f0;
  color: #1a202c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Logo - orange/red theme */
.logo-section {
  background: linear-gradient(165deg, #fb923c, #f97316, #ea580c);
  border-radius: 24px;
  padding: 40px 24px 36px;
  margin-bottom: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 2.8rem;
  font-family: 'Lilita One', sans-serif;
  border-radius: 22px;
  margin-bottom: 14px;
}

.logo {
  font-family: 'Lilita One', sans-serif;
  font-size: 2.6rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  line-height: 1.1;
}

.logo span {
  color: rgba(255, 255, 255, 0.85);
}

/* Main card panel */
.home-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 24px;
  padding: 30px 26px;
  margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
}

/* Inputs */
.input-group {
  margin-bottom: 18px;
  position: relative;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-family: 'Lilita One', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(0, 0, 0, 0.45);
  margin-bottom: 8px;
}

input[type="text"] {
  width: 100%;
  padding: 15px 18px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  color: #1a202c;
  font-size: 1.05rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  outline: none;
  transition: all 0.15s;
}

input[type="text"]:focus {
  border-color: #f97316;
  background: #ffffff;
  box-shadow: 0 0 12px rgba(249,115,22,0.15);
}

input[type="text"]::placeholder {
  color: rgba(0, 0, 0, 0.35);
  font-weight: 700;
}

.full-width { width: 100%; }

/* Buttons */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  padding: 16px 30px;
  border: none;
  border-radius: 16px;
  font-size: 1.05rem;
  font-family: 'Lilita One', sans-serif;
  cursor: pointer;
  transition: all 0.12s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: white;
  text-align: center;
  position: relative;
}

.btn-green {
  background: #22c55e;
  box-shadow: 0 2px 8px rgba(34,197,94,0.3);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.btn-green:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(34,197,94,0.4); }
.btn-green:active { transform: translateY(1px); }

.btn-purple {
  background: #8b6eb0;
  box-shadow: 0 2px 8px rgba(139,110,176,0.3);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.btn-purple:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(139,110,176,0.4); }
.btn-purple:active { transform: translateY(1px); }

.btn-orange {
  background: #f97316;
  box-shadow: 0 2px 8px rgba(249,115,22,0.3);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.btn-orange:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(249,115,22,0.4); }
.btn-orange:active { transform: translateY(1px); }

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

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0,0,0,0.12);
}
.divider span {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(0,0,0,0.35);
}

/* Join row */
.join-custom-row {
  display: flex;
  gap: 10px;
}
.join-custom-row input {
  flex: 1;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 4px;
  font-family: 'Lilita One', sans-serif;
}
.join-custom-row .btn { flex: 0 0 auto; }

/* Error / Status */
.error-msg {
  color: #ef4444;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  margin-top: 12px;
  min-height: 20px;
}

.status-msg {
  color: rgba(0,0,0,0.45);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  margin-top: 12px;
}

.status-pill {
  display: inline-block;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 50px;
  padding: 8px 22px;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(0,0,0,0.45);
  margin: 14px 0;
}

/* How to play */
.how-to-play {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 24px;
  padding: 26px;
  margin-bottom: 16px;
}

.how-to-play h3 {
  text-align: center;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(0, 0, 0, 0.4);
  margin-bottom: 18px;
}

.steps { display: flex; flex-direction: column; gap: 14px; }

.step {
  display: flex;
  align-items: center;
  gap: 14px;
}

.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: white;
  font-family: 'Lilita One', sans-serif;
  font-size: 1rem;
  border-radius: 12px;
}

.step p { font-size: 0.92rem; font-weight: 700; color: #4a5568; }

/* ===== LOBBY ===== */
.screen-header h2 {
  font-family: 'Lilita One', sans-serif;
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #1a202c;
}

.lobby-code-box {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 24px;
  padding: 22px 28px;
  text-align: center;
  margin: 14px 0 22px;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.lobby-code-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(0,0,0,0.35);
  margin-bottom: 8px;
}

.lobby-code-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.lobby-code-value span {
  font-family: 'Lilita One', sans-serif;
  font-size: 2.6rem;
  letter-spacing: 8px;
  color: #f97316;
}

.btn-copy {
  background: #f0f0f0;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  padding: 8px 14px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  color: rgba(0,0,0,0.5);
  transition: all 0.12s;
}
.btn-copy:hover { background: #e2e2e2; }

.lobby-code-hint {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(0,0,0,0.3);
  margin-top: 10px;
}

.section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(0,0,0,0.35);
  margin-bottom: 12px;
}

.lobby-players {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 14px;
}

.lobby-player-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 18px;
  padding: 14px 18px;
  animation: popIn 0.3s ease;
}

.lobby-player-card.is-you {
  border-color: rgba(249,115,22,0.3);
  background: rgba(249,115,22,0.04);
}

.player-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'Lilita One', sans-serif;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.player-info { flex: 1; }

.player-card-name {
  font-weight: 800;
  font-size: 1rem;
}

.player-badges { display: flex; gap: 6px; margin-top: 2px; }

.badge-host, .badge-you {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 6px;
}

.badge-host {
  background: rgba(249,115,22,0.15);
  color: #ea580c;
}

.badge-you {
  background: rgba(34,197,94,0.15);
  color: #16a34a;
}

.player-score-display {
  font-family: 'Lilita One', sans-serif;
  font-size: 0.95rem;
  color: rgba(0,0,0,0.3);
}

/* ===== CATEGORY PILL ===== */
.category-pill {
  display: inline-block;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 50px;
  padding: 10px 24px;
  font-family: 'Lilita One', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 1px;
  color: #1a202c;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ===== TIMER ===== */
.timer-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Lilita One', sans-serif;
  font-size: 1.3rem;
  color: #1a202c;
  margin-bottom: 12px;
  transition: border-color 0.3s;
}

.timer-ring.urgent {
  border-color: #ef4444;
  color: #ef4444;
  animation: timerPulse 0.6s ease-in-out infinite alternate;
}

@keyframes timerPulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* ===== PAIR COUNTER ===== */
.pair-counter {
  font-family: 'Lilita One', sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(0,0,0,0.35);
  margin-bottom: 20px;
}

/* ===== PAIR CARDS ===== */
.pair-cards {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-bottom: 16px;
}

.pair-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 24px 16px;
  border-radius: 24px;
  background: #ffffff;
  border: 3px solid rgba(0,0,0,0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Nunito', sans-serif;
}

.pair-card:hover:not(:disabled):not(.selected) {
  border-color: #f97316;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(249,115,22,0.2);
}

.pair-card:active:not(:disabled):not(.selected) {
  transform: translateY(-1px);
}

.pair-card.selected {
  border-color: #f97316;
  background: rgba(249,115,22,0.08);
  box-shadow: 0 4px 16px rgba(249,115,22,0.25);
}

.pair-card:disabled:not(.selected) {
  opacity: 0.5;
  cursor: not-allowed;
}

.pair-card-name {
  font-family: 'Lilita One', sans-serif;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #1a202c;
  text-align: center;
  line-height: 1.3;
}

.pair-card-value {
  font-family: 'Lilita One', sans-serif;
  font-size: 1rem;
  color: rgba(0,0,0,0.4);
  margin-top: 8px;
  letter-spacing: 1px;
}

/* VS Badge */
.vs-badge {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: white;
  font-family: 'Lilita One', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(249,115,22,0.3);
}

/* ===== PAIR REVEAL ===== */
.reveal-mode .pair-card {
  cursor: default;
}

.pair-card.reveal {
  transition: all 0.3s ease;
}

.pair-card.reveal.correct {
  border-color: #22c55e;
  background: rgba(34,197,94,0.08);
  box-shadow: 0 4px 16px rgba(34,197,94,0.2);
}

.pair-card.reveal.correct .pair-card-name {
  color: #16a34a;
}

.pair-card.reveal.correct .pair-card-value {
  color: #22c55e;
}

.pair-card.reveal.wrong {
  border-color: rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.04);
  opacity: 0.6;
}

.pair-card.reveal.wrong .pair-card-value {
  color: #ef4444;
}

/* Player reveal chips */
.reveal-players {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.reveal-player-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 12px 16px;
  animation: popIn 0.3s ease;
}

.reveal-player-chip.correct {
  border-color: rgba(34,197,94,0.3);
  background: rgba(34,197,94,0.04);
}

.reveal-player-chip.wrong {
  border-color: rgba(239,68,68,0.15);
  background: rgba(239,68,68,0.02);
}

.chip-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'Lilita One', sans-serif;
  font-size: 1rem;
  flex-shrink: 0;
}

.chip-name {
  flex: 1;
  font-weight: 800;
  font-size: 0.9rem;
}

.chip-result {
  font-family: 'Lilita One', sans-serif;
  font-size: 1rem;
  color: #22c55e;
}

.reveal-player-chip.wrong .chip-result {
  color: rgba(0,0,0,0.2);
}

/* ===== RESULTS ===== */
.results-section {
  width: 100%;
  margin-bottom: 22px;
}

.results-section h3 {
  text-align: center;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(0,0,0,0.35);
  margin-bottom: 14px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  margin-bottom: 6px;
  font-weight: 800;
}

.score-points {
  font-family: 'Lilita One', sans-serif;
  color: #f97316;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  body { padding: 12px; }
  .logo { font-size: 2rem; letter-spacing: 2px; }
  .logo-section { padding: 30px 18px 26px; }
  .home-card { padding: 24px 18px; }

  .pair-cards {
    flex-direction: column;
  }

  .pair-card {
    min-height: 100px;
    width: 100%;
  }

  .vs-badge {
    width: 40px;
    height: 40px;
    font-size: 0.8rem;
  }

  .pair-card-name {
    font-size: 1.1rem;
  }
}
