@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #E55D87;
  --secondary: #5FC3E4;
  --accent: #F7971E;
  --light: #FFD200;
  --bg: #2C3E50;
  --bg-deep: #F8BBD0;
  --card: #FFFFFF;
  --card-hover: #FFF0F5;
  --text: #2D1B24;
  --text-secondary: #6D4C5E;
  --text-muted: #9E7A8E;
  --border: #F3D1DE;
  --border-strong: #E8A6BF;
  --success: #2E7D32;
  --warning: #E65100;
  --team-a: #880E4F;
  --team-a-light: #FCE4EC;
  --team-b: #4A148C;
  --team-b-light: #F3E5F5;
  --shadow-sm: 0 1px 3px rgba(136, 14, 79, 0.08);
  --shadow-md: 0 4px 12px rgba(136, 14, 79, 0.1);
  --shadow-lg: 0 8px 32px rgba(136, 14, 79, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

::selection {
  background: var(--light);
  color: white;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
  padding: 28px 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.app-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
  position: relative;
}

.app-subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  font-weight: 400;
  margin-top: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px 10px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--accent);
  background: var(--bg);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--bg);
}

.tab-icon {
  font-size: 1.25rem;
}

.tab-label {
  letter-spacing: 0.02em;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* Section Titles */
.section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bg);
}

/* Input Fields */
.input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.input-field {
  flex: 1;
  min-width: 140px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--card);
  transition: all 0.2s ease;
  outline: none;
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 24, 91, 0.12);
}

.input-field::placeholder {
  color: var(--text-muted);
}

.select-field {
  cursor: pointer;
}

.textarea-field {
  resize: vertical;
  min-height: 70px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 2px 8px rgba(136, 14, 79, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(136, 14, 79, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border-strong);
}

.btn-outline:hover {
  background: var(--bg);
  border-color: var(--primary);
}

.btn-outline:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-secondary {
  background: var(--bg);
  color: var(--primary);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-large {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-remove:hover {
  color: var(--accent);
  background: var(--bg);
}

/* Setup Container */
.setup-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setup-section {
  animation: fadeInUp 0.4s ease both;
}

.setup-section:nth-child(2) { animation-delay: 0.05s; }
.setup-section:nth-child(3) { animation-delay: 0.1s; }
.setup-section:nth-child(4) { animation-delay: 0.15s; }

/* Items List */
.items-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Chips */
.item-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-xl);
  font-weight: 500;
  font-size: 0.9rem;
}

.team-chip-a {
  background: var(--team-a-light);
  color: var(--team-a);
  border: 1px solid rgba(136, 14, 79, 0.2);
}

.team-chip-b {
  background: var(--team-b-light);
  color: var(--team-b);
  border: 1px solid rgba(74, 20, 140, 0.2);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* Topic Cards */
.topic-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border-left: 4px solid var(--accent);
  gap: 12px;
  width: 100%;
}

.topic-text {
  flex: 1;
  font-weight: 500;
}

.topic-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-active {
  background: var(--primary);
  color: white;
}

/* Speakers Grid */
.speakers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.team-speakers-col {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.team-col-a {
  background: var(--team-a-light);
  border-color: rgba(136, 14, 79, 0.15);
}

.team-col-b {
  background: var(--team-b-light);
  border-color: rgba(74, 20, 140, 0.15);
}

.team-col-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}

.speaker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.speaker-order {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.speaker-name {
  flex: 1;
  font-weight: 500;
}

/* Timer Info */
.timer-info {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Speaking Container */
.speaking-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Topic Banner */
.topic-banner {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.4s ease both;
}

.topic-banner-label {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.topic-banner-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
}

/* Speaker Queue */
.speaker-queue {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1.5px solid var(--border);
  min-width: 160px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.queue-item.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 24, 91, 0.15), var(--shadow-md);
  transform: scale(1.03);
}

.queue-item.done {
  opacity: 0.5;
  background: var(--bg);
}

.queue-team-a { border-left: 4px solid var(--team-a); }
.queue-team-b { border-left: 4px solid var(--team-b); }

.queue-number {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.queue-info {
  display: flex;
  flex-direction: column;
}

.queue-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.queue-team {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.queue-check {
  color: var(--success);
  font-weight: 700;
}

.queue-live {
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  animation: pulse 1.5s ease infinite;
}

/* Timer Section */
.timer-section {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.5s ease both;
}

.current-speaker-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.cs-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

.cs-name {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 4px;
}

.cs-team {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Timer Ring */
.timer-ring {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg-circle {
  fill: none;
  stroke: var(--bg);
  stroke-width: 8;
}

.timer-progress-circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

.timer-ring.warning .timer-progress-circle {
  stroke: var(--warning);
}

.timer-ring.expired .timer-progress-circle {
  stroke: #d32f2f;
}

.timer-display {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--primary);
  position: relative;
  z-index: 1;
}

.timer-ring.warning .timer-display {
  color: var(--warning);
}

.timer-ring.expired .timer-display {
  color: #d32f2f;
  animation: pulse 0.8s ease infinite;
}

/* Timer Controls */
.timer-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Scoring Container */
.scoring-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.scoring-form {
  animation: fadeInUp 0.4s ease both;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Criteria Grid */
.criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.criterion-card {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border);
}

.criterion-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.criterion-icon {
  font-size: 1.2rem;
}

.criterion-label {
  flex: 1;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

.criterion-score {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
}

/* Score Slider */
.score-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, var(--border) 0%, var(--accent) 100%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.score-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(136, 14, 79, 0.3);
  transition: transform 0.15s ease;
}

.score-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.score-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(136, 14, 79, 0.3);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Score Summary */
.score-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-deep) 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 16px;
}

.total-score-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.total-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.total-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
}

.total-max {
  font-size: 1rem;
  color: var(--text-muted);
}

/* Success Toast */
.success-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--success);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  animation: slideInRight 0.3s ease both;
}

/* Recent Scores */
.recent-scores {
  animation: fadeInUp 0.5s ease both;
  animation-delay: 0.1s;
}

.scores-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-entry {
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.score-entry-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.score-entry-name {
  font-weight: 700;
  color: var(--text);
}

.score-entry-team {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex: 1;
}

.score-entry-total {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

.score-entry-breakdown {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.score-entry-criterion {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.score-entry-notes {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Scoreboard */
.scoreboard-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Leader Banner */
.leader-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--light) 100%);
  color: white;
  padding: 24px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.5s ease both;
  position: relative;
  overflow: hidden;
}

.leader-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

.leader-trophy {
  font-size: 3rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.leader-info {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.leader-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.leader-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
}

.leader-points {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* Scoreboard Grid */
.scoreboard-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.scoreboard-section {
  animation: fadeInUp 0.5s ease both;
}

.scoreboard-section:nth-child(2) { animation-delay: 0.1s; }

/* Team Standings */
.team-standings {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-standing-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.standing-a { background: var(--team-a-light); border-left: 5px solid var(--team-a); }
.standing-b { background: var(--team-b-light); border-left: 5px solid var(--team-b); }

.standing-rank {
  font-size: 1.8rem;
  min-width: 40px;
  text-align: center;
}

.standing-main {
  flex: 1;
  min-width: 150px;
}

.standing-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.standing-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.stat-item strong {
  color: var(--primary);
}

.stat-divider {
  color: var(--text-muted);
}

.standing-criteria {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.criteria-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.criteria-mini-icon {
  font-size: 1rem;
}

.criteria-mini-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}

/* Speaker Rankings */
.speaker-rankings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.speaker-rank-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.speaker-rank-card:hover {
  background: var(--card-hover);
  transform: translateX(4px);
}

.rank-position {
  font-size: 1.3rem;
  min-width: 32px;
  text-align: center;
}

.rank-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.rank-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.rank-team {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rank-scores {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rank-total {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--primary);
  font-size: 1.05rem;
}

.rank-best {
  font-size: 1.1rem;
  cursor: help;
}

/* Empty States */
.empty-state {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 8px 0;
}

.empty-state.small {
  font-size: 0.8rem;
  padding: 4px 0;
}

.empty-state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  animation: bounceIn 0.6s ease;
}

.empty-state-container h3 {
  font-family: var(--font-display);
  color: var(--primary);
  margin-bottom: 8px;
}

/* Loading */
.loading-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.skeleton-block {
  height: 80px;
  background: linear-gradient(90deg, var(--bg) 25%, var(--bg-deep) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-md);
  animation: shimmer 1.5s ease infinite;
}

.skeleton-block.short {
  height: 40px;
  width: 60%;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes bounceIn {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.item-stagger {
  animation: fadeInUp 0.35s ease both;
}

.item-stagger:nth-child(1) { animation-delay: 0s; }
.item-stagger:nth-child(2) { animation-delay: 0.04s; }
.item-stagger:nth-child(3) { animation-delay: 0.08s; }
.item-stagger:nth-child(4) { animation-delay: 0.12s; }
.item-stagger:nth-child(5) { animation-delay: 0.16s; }
.item-stagger:nth-child(6) { animation-delay: 0.2s; }
.item-stagger:nth-child(7) { animation-delay: 0.24s; }
.item-stagger:nth-child(8) { animation-delay: 0.28s; }
.item-stagger:nth-child(9) { animation-delay: 0.32s; }
.item-stagger:nth-child(10) { animation-delay: 0.36s; }

/* Responsive */
@media (max-width: 640px) {
  .app-title {
    font-size: 1.5rem;
  }

  .main-content {
    padding: 14px;
  }

  .card {
    padding: 18px;
  }

  .input-row {
    flex-direction: column;
  }

  .input-field {
    min-width: 100%;
  }

  .timer-ring {
    width: 160px;
    height: 160px;
  }

  .timer-display {
    font-size: 2.2rem;
  }

  .cs-name {
    font-size: 1.4rem;
  }

  .timer-controls {
    gap: 8px;
  }

  .timer-controls .btn {
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .criteria-grid {
    grid-template-columns: 1fr;
  }

  .score-summary {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .total-score-display {
    justify-content: center;
  }

  .speakers-grid {
    grid-template-columns: 1fr;
  }

  .queue-item {
    min-width: 130px;
  }

  .standing-criteria {
    width: 100%;
    justify-content: space-around;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
  }

  .leader-banner {
    flex-direction: column;
    text-align: center;
  }

  .leader-trophy {
    font-size: 2.5rem;
  }
}

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to Debate Arena! Let's set up your first debate. Start by adding two teams.", "view": "setup", "highlight_selector": ".setup-section:first-child .input-field", "wait_for": "user_interaction"},
  {"step": 2, "narration": "Now add a debate topic or motion for the teams to argue.", "view": "setup", "highlight_selector": ".setup-section:nth-child(2) .input-field", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Add speakers for each team and they'll be organized by team automatically.", "view": "setup", "highlight_selector": ".setup-section:nth-child(3) .input-field", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Set how many minutes each speaker gets. The timer will count down during speeches.", "view": "setup", "highlight_selector": ".setup-section:nth-child(4) .input-field", "wait_for": "user_interaction"},
  {"step": 5, "narration": "Head to the Speaking tab to run the debate. Speakers are interleaved between teams. Hit Start to begin the countdown.", "view": "speaking", "highlight_selector": ".timer-section", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "After each speech, go to the Scoring tab to rate it on 5 criteria: Logic, Delivery, Evidence, Rebuttal, and Persuasiveness.", "view": "scoring", "highlight_selector": ".criteria-grid", "wait_for": "tap_to_continue"},
  {"step": 7, "narration": "Check the Scoreboard tab anytime to see team standings, speaker rankings, and per-criteria averages.", "view": "scoreboard", "highlight_selector": ".leader-banner", "wait_for": "tap_to_continue"}
]
-->

.judge-identity-panel {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
}

.judge-identity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.judge-identity-help {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.score-entry-meta {
  margin-bottom: 6px;
}

.score-entry-judge {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.judge-identity-panel {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
}

.judge-identity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.judge-identity-help {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.audience-presence-bar {
  margin: 16px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.audience-presence-copy {
  flex: 1;
  min-width: 220px;
}

.audience-count-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: var(--shadow-md);
}

.audience-count-number {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.audience-count-label {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.92;
}

@media (max-width: 640px) {
  .audience-presence-bar {
    margin: 14px 14px 0;
    align-items: stretch;
  }

  .audience-count-pill {
    width: 100%;
    justify-content: center;
  }

  .audience-count-number {
    font-size: 1.5rem;
  }
}

.post-debate-analysis {
  animation: fadeInUp 0.5s ease both;
}

.analysis-context {
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.analysis-loading {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.analysis-error {
  color: #c62828;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.analysis-summary {
  white-space: pre-wrap;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
}

.scoreboard-export-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.post-debate-analysis-note {
  margin-top: -4px;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.analysis-status {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.scoreboard-pdf-section {
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-ai-analysis-section {
  margin-top: 0;
}

@media (max-width: 640px) {
  .scoreboard-export-header {
    align-items: stretch;
  }

  .scoreboard-export-header .btn {
    width: 100%;
  }
}

.reaction-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeInUp 0.35s ease both;
}

.reaction-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.reaction-panel-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

.reaction-panel-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.reaction-panel-target {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: var(--radius-xl);
  white-space: nowrap;
}

.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.reaction-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  background: var(--card-hover);
}

.reaction-btn:active {
  transform: translateY(0);
}

.reaction-emoji {
  font-size: 1.05rem;
  line-height: 1;
}

.reaction-count {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 1ch;
}

@media (max-width: 640px) {
  .reaction-panel {
    gap: 12px;
  }

  .reaction-bar {
    gap: 8px;
  }

  .reaction-btn {
    padding: 9px 12px;
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }

  .reaction-panel-target {
    width: 100%;
    text-align: center;
  }
}
