/* Audience display: hide admin-only UI, same structure as admin for consistent layout */
.audience-view .audience-hidden,
.audience-view .control-bar,
.audience-view .setup-gate,
.audience-view .btn-timer,
.audience-view #buzzerPanel,
.audience-view .shortcuts-btn,
.audience-view #toastContainer {
  display: none !important;
}

.audience-view .audience-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: var(--bg-panel);
  border-bottom: var(--border-glow);
  flex-shrink: 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  min-height: 64px;
  position: relative;
  z-index: 2;
}

.audience-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  padding: 0;
  gap: 12px;
}

.audience-view .audience-header .audience-logo-wrap {
  flex: 0 1 auto;
  min-width: 0;
}

.audience-view .audience-header .logo {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.06em;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.35);
}

.audience-view .audience-header .logo-symbol {
  color: var(--primary);
  margin-right: 6px;
}

.audience-view .audience-header .logo-tagline {
  display: inline-block;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  font-weight: 500;
}

.audience-round-label {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: var(--radius-sharp);
  border: 1px solid rgba(255, 23, 68, 0.45);
  background: var(--primary-dim);
  color: var(--primary);
  box-shadow: 0 0 22px rgba(255, 23, 68, 0.2);
}

.audience-header.championship-round .audience-round-label {
  background: linear-gradient(135deg, rgba(255, 201, 40, 0.2) 0%, rgba(255, 23, 68, 0.15) 100%);
  color: var(--gold);
  border-color: rgba(255, 201, 40, 0.5);
  box-shadow: 0 0 28px var(--gold-glow);
  text-shadow: 0 0 20px rgba(255, 201, 40, 0.4);
}

.audience-header.semifinal-round .audience-round-label {
  background: rgba(0, 229, 255, 0.12);
  color: #7dd3fc;
  border-color: rgba(0, 229, 255, 0.4);
}

.audience-slide-wrap {
  flex: 0 0 auto;
}

.audience-view .audience-header .slide-indicator {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.audience-view .audience-header .slide-indicator.contact-email {
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  color: rgba(226, 232, 240, 0.96);
}

/* Answer view: single column (solution only) on audience */
.audience-view .answer-audience {
  grid-template-columns: 1fr;
}

.audience-view .answer-audience .answer-col-right {
  max-width: 100%;
}

/* Keep background strips moving in audience mode, same style family as presenter */
.audience-view .math-bg::before {
  animation: nexus-strips-x-medium 26s linear infinite;
}

.audience-view .math-bg::after {
  animation: nexus-strips-y-medium 30s linear infinite;
}

/* Connection hint when opened via file:// or server not reachable */
.connection-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  max-width: 480px;
  padding: 24px 28px;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 23, 68, 0.4);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.connection-hint.hidden {
  display: none !important;
}

.connection-hint-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.connection-hint-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.connection-hint-text code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Power-up effect preview overlay — matches admin reveal modal; above championship board */
.audience-powerup-reveal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: audiencePowerupRevealIn 260ms ease-out;
}

.audience-powerup-reveal.hidden {
  display: none !important;
}

.audience-powerup-reveal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  animation: audiencePowerupBackdropIn 280ms ease-out;
}

.audience-powerup-reveal-content {
  position: relative;
  z-index: 1;
  transform-origin: center;
  animation: audiencePowerupContentIn 300ms cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 0 22px rgba(255, 201, 40, 0.2));
}

/* Audience prompt — above footer, same position and look as admin toasts */
.audience-prompt {
  position: fixed;
  bottom: 104px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 90vw;
}

.audience-prompt.hidden {
  display: none !important;
}

.audience-prompt.prompt-success {
  border-color: var(--success);
  color: var(--success);
}

.audience-prompt.prompt-warning {
  border-color: var(--gold);
  color: var(--gold);
}

.audience-prompt.prompt-info {
  border-color: var(--primary);
  color: var(--primary);
}

/* Event poster — tiled eventbg.jpg covers full display; event poster (event.jpg) on top */
.audience-poster-view {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 9998;
  background-image: url(eventbg.jpg);
  background-repeat: repeat;
  background-position: 0 0;
  min-width: 100vw;
  min-height: 100vh;
}

.audience-poster-view::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(8, 12, 34, 0) 46%, rgba(8, 12, 34, 0.26) 82%, rgba(8, 12, 34, 0.42) 100%);
}

.audience-poster-view-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  position: relative;
  z-index: 1;
  display: block;
  filter: saturate(1.02) contrast(1.01) drop-shadow(0 0 18px rgba(0, 0, 0, 0.22));
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 72%, rgba(0, 0, 0, 0.94) 82%, rgba(0, 0, 0, 0.68) 90%, rgba(0, 0, 0, 0) 100%);
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 72%, rgba(0, 0, 0, 0.94) 82%, rgba(0, 0, 0, 0.68) 90%, rgba(0, 0, 0, 0) 100%);
}

.audience-poster-view.hidden {
  display: none !important;
}

.audience-poster-content {
  text-align: center;
  max-width: 720px;
}

.audience-poster-symbol {
  display: block;
  font-size: 4rem;
  color: var(--primary);
  margin-bottom: 16px;
  text-shadow: 0 0 40px rgba(0, 229, 255, 0.5);
}

.audience-poster-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.2;
  text-shadow: 0 0 24px rgba(0, 0, 0, 0.4);
}

.audience-poster-tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin: 0;
  font-weight: 500;
}

/* When in poster mode or 5s transition, hide header so poster background covers entire display */
#app.poster-mode .audience-header,
#app:has(.audience-poster-transition:not(.hidden)) .audience-header {
  display: none !important;
}
#app.poster-mode .stage {
  overflow: hidden;
}

/* Restore moving line effect over checker background */
body.audience-view {
  position: relative;
}

body.audience-view::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.14;
  background-image:
    repeating-linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.14) 0 2px,
      rgba(255, 255, 255, 0.0) 2px 22px
    );
  animation: audienceBgLinesMove 14s linear infinite;
}

/* Championship grid: ensure question blocks (5×3 cells) are always visible on audience */
.audience-display .view-championship {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.audience-display .view-championship .champ-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.audience-display .view-championship .champ-grid {
  min-height: 400px !important;
  height: 400px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.audience-display .view-championship .champ-grid .champ-grid-row {
  flex: 1 1 0;
  min-height: 52px !important;
  display: grid;
  grid-template-columns: minmax(200px, 2.2fr) repeat(3, minmax(120px, 1fr));
  gap: 8px;
  align-items: stretch;
}
.audience-display .view-championship .champ-grid .champ-grid-row.champ-grid-header {
  flex: 0 0 auto;
  min-height: 0 !important;
}

/* 5-second transition: tiled eventbg.jpg background, event poster on top */
.audience-poster-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url(eventbg.jpg);
  background-repeat: repeat;
  background-position: 0 0;
  padding: 0;
  min-width: 100vw;
  min-height: 100vh;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.audience-poster-transition::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(8, 12, 34, 0) 44%, rgba(8, 12, 34, 0.28) 80%, rgba(8, 12, 34, 0.44) 100%);
}
.audience-poster-transition.hidden {
  display: none !important;
}
.audience-poster-transition .audience-poster-transition-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  position: relative;
  z-index: 1;
  display: block;
  filter: saturate(1.02) contrast(1.01) drop-shadow(0 0 18px rgba(0, 0, 0, 0.22));
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 72%, rgba(0, 0, 0, 0.94) 82%, rgba(0, 0, 0, 0.68) 90%, rgba(0, 0, 0, 0) 100%);
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 72%, rgba(0, 0, 0, 0.94) 82%, rgba(0, 0, 0, 0.68) 90%, rgba(0, 0, 0, 0) 100%);
}

/* Arena scoreboard: show "Unavailable" when no names have been set for the round */
.arena-unavailable-cell {
  text-align: center;
  padding: 24px 16px !important;
  color: var(--text-muted, #888);
  font-style: italic;
}

/* Audience arena round tabs: buttons to switch scoreboard view (in footer) */
.audience-score-strip.score-strip {
  justify-content: center;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  z-index: 30;
}
/* Keep footer tabs visible on audience scoreboard views.
   It should only hide when JS explicitly sets .hidden (poster mode). */
body.audience-view .presenter .score-strip:not(.hidden),
body.audience-view .presenter.arena-mode .score-strip:not(.hidden),
body.audience-view .presenter.championship-mode .score-strip:not(.hidden) {
  display: flex !important;
  visibility: visible;
  opacity: 1;
}
.audience-arena-round-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
  justify-content: center;
  align-items: center;
}
.audience-score-strip .audience-arena-round-tabs {
  width: 100%;
}
.audience-arena-tab {
  padding: 10px 18px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--grid-line, rgba(255,255,255,0.2));
  border-radius: var(--radius, 6px);
  background: var(--bg-panel, rgba(255,255,255,0.06));
  color: rgba(226, 232, 240, 0.9);
  cursor: pointer;
}
.audience-arena-tab:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--primary, #00d4ff);
}
.audience-arena-tab.active {
  background: var(--primary-dim, rgba(0, 212, 255, 0.15));
  border-color: var(--primary, #00d4ff);
  color: #9deaff;
  text-shadow: 0 0 14px rgba(0, 212, 255, 0.34);
}
.audience-arena-tab.unavailable {
  color: var(--text-muted, #888);
}
.audience-arena-tab.unavailable.active {
  color: var(--primary, #00d4ff);
}
.audience-arena-tab.audience-live-tab {
  border-color: var(--primary, #00d4ff);
  color: var(--primary, #00d4ff);
}
.audience-arena-tab.audience-live-tab.active {
  background: var(--primary-dim, rgba(0, 212, 255, 0.2));
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}

/* Audience typography hierarchy and readability */
.audience-view .arena-title,
.audience-view .champ-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.1vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.035em;
  color: #f8fbff;
}

.audience-view .arena-subtitle,
.audience-view .champ-subtitle {
  font-size: clamp(0.92rem, 1.2vw, 1.02rem);
  letter-spacing: 0.02em;
  color: rgba(203, 213, 225, 0.92);
}

.audience-view .arena-scoreboard {
  font-size: 1rem;
}

.audience-view .arena-scoreboard th {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.95);
  text-align: center;
}

.audience-view .arena-scoreboard td {
  color: rgba(241, 245, 249, 0.97);
  font-weight: 500;
  text-align: center;
}

.audience-view .arena-rank,
.audience-view .arena-score,
.audience-view .arena-time-cell {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.audience-view .arena-status {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #bfdbfe;
}

.audience-view .arena-row.arena-status-inactive .arena-status,
.audience-view .arena-row.arena-status-eliminated .arena-status {
  color: #fca5a5;
}

.audience-view .arena-row.arena-status-active .arena-status {
  color: #86efac;
}

.audience-view .arena-unavailable-cell {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: rgba(148, 163, 184, 0.9);
}

.audience-view .champ-grid-col,
.audience-view .champ-grid-topic {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(226, 232, 240, 0.96);
}

.audience-view .champ-cell-label {
  font-family: var(--font-mono);
  font-weight: 700;
  color: rgba(248, 250, 252, 0.96);
}

/* Chess-themed block effects for audience content blocks */
.audience-view .arena-card,
.audience-view .champ-card,
.audience-view .awarding-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: var(--border-glow);
  box-shadow:
    0 0 18px rgba(255, 23, 68, 0.14),
    0 0 42px rgba(56, 20, 120, 0.16);
  animation: audienceChessAura 3.8s ease-in-out infinite;
}

.audience-view .arena-card > *,
.audience-view .champ-card > *,
.audience-view .awarding-card > * {
  position: relative;
  z-index: 3;
}

.audience-view .arena-card::before,
.audience-view .champ-card::before,
.audience-view .awarding-card::before {
  content: '';
  position: absolute;
  inset: -14px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
  padding: 10px;
  background:
    repeating-conic-gradient(
      from 45deg at 50% 50%,
      rgba(255, 82, 120, 0.34) 0deg 8deg,
      rgba(30, 24, 60, 0.08) 8deg 16deg
    );
  border-radius: calc(var(--radius-lg) + 14px);
  animation: audienceChessFramePulse 3.2s ease-in-out infinite;
  filter: blur(3px) saturate(1.1);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.audience-view .arena-card .arena-title,
.audience-view .champ-card .champ-title,
.audience-view .awarding-card .awarding-title {
  text-shadow:
    0 0 16px rgba(255, 23, 68, 0.2),
    0 0 24px rgba(99, 102, 241, 0.2);
}

.audience-view .arena-card::after,
.audience-view .champ-card::after,
.audience-view .awarding-card::after {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.58;
  border-radius: calc(var(--radius-lg) + 2px);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 82, 120, 0.46), rgba(255, 82, 120, 0) 32%),
    radial-gradient(circle at 100% 0%, rgba(99, 102, 241, 0.34), rgba(99, 102, 241, 0) 30%),
    radial-gradient(circle at 0% 100%, rgba(168, 85, 247, 0.3), rgba(168, 85, 247, 0) 30%),
    radial-gradient(circle at 100% 100%, rgba(255, 82, 120, 0.4), rgba(255, 82, 120, 0) 34%);
  animation: audienceChessCorners 2.6s ease-in-out infinite;
  filter: blur(8px);
}

/* Awarding card: stronger gold glow */
.audience-view .awarding-card {
  box-shadow:
    0 0 34px rgba(255, 201, 40, 0.24),
    0 0 92px rgba(255, 201, 40, 0.14);
  animation: audienceAwardingPulse 3s ease-in-out infinite;
}

.audience-view .awarding-card::before {
  opacity: 0.78;
  background:
    repeating-conic-gradient(
      from 45deg at 50% 50%,
      rgba(255, 214, 94, 0.5) 0deg 8deg,
      rgba(68, 50, 0, 0.12) 8deg 16deg
    );
  filter: blur(3px) saturate(1.12);
}

.audience-view .awarding-card::after {
  opacity: 0.66;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 235, 170, 0.62), rgba(255, 235, 170, 0) 36%),
    radial-gradient(circle at 100% 0%, rgba(255, 201, 40, 0.4), rgba(255, 201, 40, 0) 34%),
    radial-gradient(circle at 0% 100%, rgba(255, 225, 120, 0.44), rgba(255, 225, 120, 0) 34%),
    radial-gradient(circle at 100% 100%, rgba(255, 178, 46, 0.54), rgba(255, 178, 46, 0) 38%);
  animation: audienceChessCorners 2.8s ease-in-out infinite;
  filter: blur(9px);
}

/* Subtle chess-board wash inside cards without affecting readability */
.audience-view .arena-card .arena-table-wrap,
.audience-view .champ-card .champ-grid,
.audience-view .awarding-card .awarding-podium {
  position: relative;
  isolation: isolate;
}

.audience-view .arena-card .arena-table-wrap::before,
.audience-view .champ-card .champ-grid::before,
.audience-view .awarding-card .awarding-podium::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 10px;
  z-index: 1;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.012) 0 9px,
      rgba(255, 255, 255, 0.0) 9px 18px
    ),
    radial-gradient(circle at 12% 8%, rgba(100, 70, 255, 0.08), rgba(100, 70, 255, 0) 42%),
    radial-gradient(circle at 88% 14%, rgba(255, 31, 82, 0.08), rgba(255, 31, 82, 0) 44%);
}

/* Center chess-king watermark effect */
.audience-view .arena-card .arena-table-wrap::after,
.audience-view .champ-card .champ-grid::after,
.audience-view .awarding-card .awarding-podium::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  width: clamp(120px, 16vw, 240px);
  height: clamp(182px, 24vw, 320px);
  background-image:
    radial-gradient(circle, rgba(255, 31, 77, 0.9) 0 0.9px, rgba(255, 31, 77, 0) 1.3px),
    linear-gradient(145deg, rgba(255, 58, 101, 0.9), rgba(190, 0, 48, 0.86));
  background-size: 4px 4px, cover;
  background-position: 0 0, center;
  background-repeat: repeat, no-repeat;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 180'%3E%3Cg fill='white'%3E%3Crect x='56' y='8' width='8' height='22' rx='2'/%3E%3Crect x='47' y='15' width='26' height='7' rx='2'/%3E%3Cpath d='M33 48h54l-3 16H36z'/%3E%3Cpath d='M34 64h52c-1 9-3 17-9 24l-3 4 10 8c3 2 4 6 2 10l-8 18H42l-8-18c-2-4-1-8 2-10l10-8-3-4c-6-7-8-15-9-24z'/%3E%3Cpath d='M44 128h32l6 22H38z'/%3E%3Crect x='26' y='150' width='68' height='12' rx='4'/%3E%3Crect x='20' y='162' width='80' height='10' rx='4'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 180'%3E%3Cg fill='white'%3E%3Crect x='56' y='8' width='8' height='22' rx='2'/%3E%3Crect x='47' y='15' width='26' height='7' rx='2'/%3E%3Cpath d='M33 48h54l-3 16H36z'/%3E%3Cpath d='M34 64h52c-1 9-3 17-9 24l-3 4 10 8c3 2 4 6 2 10l-8 18H42l-8-18c-2-4-1-8 2-10l10-8-3-4c-6-7-8-15-9-24z'/%3E%3Cpath d='M44 128h32l6 22H38z'/%3E%3Crect x='26' y='150' width='68' height='12' rx='4'/%3E%3Crect x='20' y='162' width='80' height='10' rx='4'/%3E%3C/g%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  opacity: 0.2;
  filter: blur(1.15px) contrast(0.82) drop-shadow(0 0 12px rgba(255, 31, 77, 0.3)) drop-shadow(0 0 28px rgba(255, 0, 64, 0.18)) saturate(1.02);
  animation: audienceKingPulse 3.1s ease-in-out infinite;
}

.audience-view .awarding-card .awarding-podium::after {
  opacity: 0.24;
  filter: blur(0.6px) drop-shadow(0 0 18px rgba(255, 31, 77, 0.42)) drop-shadow(0 0 38px rgba(255, 0, 64, 0.28)) saturate(1.1);
}

.audience-view .arena-card .arena-table-wrap > *,
.audience-view .champ-card .champ-grid > *,
.audience-view .awarding-card .awarding-podium > * {
  position: relative;
  z-index: 2;
}

/* Round titles: centered for cleaner audience presentation */
.audience-view .arena-title,
.audience-view .arena-subtitle,
.audience-view .champ-title,
.audience-view .champ-subtitle {
  text-align: center;
  width: 100%;
}

/* Awarding ceremony view */
.view-awarding {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.awarding-card {
  width: min(1200px, 96%);
  margin: 8px auto 0;
  border: 1px solid rgba(255, 201, 40, 0.35);
  border-radius: 14px;
  background: radial-gradient(circle at 50% 10%, rgba(255, 201, 40, 0.12), rgba(5, 8, 30, 0.94) 45%), rgba(5, 8, 30, 0.94);
  box-shadow: 0 0 38px rgba(255, 201, 40, 0.18);
  padding: 18px;
  animation: awardingFadeIn 520ms ease-out;
}

.awarding-title {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 2.2rem);
  letter-spacing: 0.1em;
  color: #ffe39a;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(255, 201, 40, 0.3);
}

.awarding-subtitle {
  margin: 6px 0 16px;
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 240, 0.92);
}

.awarding-podium {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.award-slot {
  width: min(880px, 94%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px;
  background: rgba(8, 14, 44, 0.75);
  animation: awardPulse 2.8s ease-in-out infinite;
  text-align: center;
}

.award-champion {
  width: min(980px, 96%);
  border-color: rgba(255, 201, 40, 0.6);
  box-shadow: 0 0 24px rgba(255, 201, 40, 0.22);
  padding: 16px 14px;
}

.award-slot-label {
  font-family: var(--font-display);
  font-size: 0.86rem;
  color: rgba(191, 219, 254, 0.95);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.award-slot-name {
  margin-top: 6px;
  font-size: 1.72rem;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f8fbff;
}

.award-slot-score {
  margin-top: 4px;
  font-family: var(--font-mono);
  color: #ffd86b;
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: 0.03em;
}

.award-slot-score-hidden {
  visibility: hidden;
}

.award-champion .award-slot-label {
  font-size: 1rem;
}

.award-champion .award-slot-name {
  font-size: 2.5rem;
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(255, 201, 40, 0.28);
}

.award-champion .award-slot-score {
  font-size: 1.5rem;
}

.award-runner1 .award-slot-name {
  font-size: 2rem;
}

.award-runner1 .award-slot-score {
  font-size: 1.3rem;
}

.award-runner2 .award-slot-name {
  font-size: 1.75rem;
}

.award-runner2 .award-slot-score {
  font-size: 1.18rem;
}

.award-runner3 .award-slot-name {
  font-size: 1.5rem;
}

.award-runner3 .award-slot-score {
  display: none !important;
}

.awarding-special-wrap {
  margin-top: 14px;
  text-align: center;
}

.awarding-special-title {
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-bottom: 8px;
  text-align: center;
}

.awarding-special-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.award-special {
  border-radius: 10px;
  padding: 12px;
  border: 1px solid rgba(0, 212, 255, 0.34);
  background: rgba(5, 22, 46, 0.7);
  text-align: center;
}

.award-special-title {
  font-family: var(--font-display);
  color: #bfdbfe;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.award-special-name {
  margin-top: 6px;
  color: #f8fbff;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-align: center;
}

.awarding-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 12px;
}

/* Lively transitions for audience view/content changes */
.audience-view-enter {
  animation: audienceViewEnter 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.audience-content-enter {
  animation: audienceContentEnter 300ms ease-out;
}

/* Mobile-friendly layout profile (auto-applied by audience.js) */
body.audience-view.device-mobile {
  --audience-mobile-header-safe: var(--audience-runtime-header-h, calc(76px + env(safe-area-inset-top, 0px)));
  --audience-mobile-footer-safe: var(--audience-runtime-footer-h, calc(112px + env(safe-area-inset-bottom, 0px)));
}

body.audience-view.device-mobile .audience-header {
  position: sticky;
  top: 0;
  z-index: 80;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
  min-height: 56px;
}

body.audience-view.device-mobile .audience-header-inner {
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

body.audience-view.device-mobile .audience-header .audience-logo-wrap {
  flex: 1 1 100%;
  min-width: 0;
}

body.audience-view.device-mobile .audience-header .logo {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.audience-view.device-mobile .audience-header .logo-tagline {
  display: none;
}

body.audience-view.device-mobile .audience-round-label {
  font-size: 0.68rem;
  padding: 6px 10px;
  letter-spacing: 0.08em;
  max-width: 66vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.audience-view.device-mobile .audience-slide-wrap {
  margin-left: auto;
  min-width: 0;
}

body.audience-view.device-mobile .audience-view .audience-header .slide-indicator,
body.audience-view.device-mobile .audience-header .slide-indicator {
  font-size: 0.78rem;
  max-width: 46vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.audience-view.device-mobile .audience-view .audience-header .slide-indicator.contact-email,
body.audience-view.device-mobile .audience-header .slide-indicator.contact-email {
  font-size: 0.62rem;
  letter-spacing: 0;
}

body.audience-view.device-mobile .arena-card,
body.audience-view.device-mobile .champ-card,
body.audience-view.device-mobile .awarding-card {
  margin: 6px;
  padding: 12px;
}

body.audience-view.device-mobile .audience-view .arena-title,
body.audience-view.device-mobile .audience-view .champ-title,
body.audience-view.device-mobile .awarding-title {
  font-size: 1.15rem;
}

body.audience-view.device-mobile .audience-view .arena-subtitle,
body.audience-view.device-mobile .audience-view .champ-subtitle,
body.audience-view.device-mobile .awarding-subtitle {
  font-size: 0.84rem;
}

body.audience-view.device-mobile .arena-scoreboard th,
body.audience-view.device-mobile .arena-scoreboard td {
  padding: 8px 7px;
  font-size: 0.78rem;
}

body.audience-view.device-mobile .arena-scoreboard-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

body.audience-view.device-mobile .arena-scoreboard-wrap::-webkit-scrollbar {
  display: none;
}

body.audience-view.device-mobile .audience-arena-round-tabs {
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  justify-content: flex-start;
  padding: 2px 2px 6px;
  min-height: 44px;
  align-items: center;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

body.audience-view.device-mobile .audience-arena-round-tabs::-webkit-scrollbar {
  display: none;
}

body.audience-view.device-mobile .audience-arena-tab {
  padding: 8px 12px;
  font-size: 0.74rem;
  border-radius: 8px;
  flex: 0 0 auto;
  scroll-snap-align: center;
  min-height: 40px;
  line-height: 1.05;
}

body.audience-view.device-mobile .score-strip {
  min-height: 74px;
  padding: 10px 8px calc(14px + env(safe-area-inset-bottom, 0px));
  align-items: flex-start;
  overflow: hidden;
}

body.audience-view.device-mobile .stage {
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
  padding-top: 8px;
  padding-bottom: var(--audience-mobile-footer-safe);
  scroll-padding-top: calc(74px + env(safe-area-inset-top, 0px));
  scroll-padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
}

/* Keep scoreboard/awarding content fully visible between mobile header and footer */
body.audience-view.device-mobile .view-arena,
body.audience-view.device-mobile .view-awarding {
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  min-height: calc(100dvh - var(--audience-mobile-header-safe) - var(--audience-mobile-footer-safe));
  padding-bottom: 8px;
}

body.audience-view.device-mobile .view-arena .arena-card,
body.audience-view.device-mobile .view-awarding .awarding-card {
  margin-top: 0;
  margin-bottom: 0;
}

body.audience-view.device-mobile .champ-grid {
  min-height: 280px !important;
  height: 280px;
}

body.audience-view.device-mobile .audience-display .view-championship .champ-grid .champ-grid-row {
  grid-template-columns: minmax(120px, 1.7fr) repeat(3, minmax(70px, 1fr));
  gap: 6px;
}

body.audience-view.device-mobile .awarding-special-grid {
  grid-template-columns: 1fr;
}

/* Hard mobile fallback (works even if device class is missing) */
@media (max-width: 900px) {
  body.audience-view {
    --audience-mobile-header-safe: var(--audience-runtime-header-h, calc(76px + env(safe-area-inset-top, 0px)));
    --audience-mobile-footer-safe: var(--audience-runtime-footer-h, calc(112px + env(safe-area-inset-bottom, 0px)));
  }

  body.audience-view .audience-score-strip.score-strip {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 86px;
    padding: 10px 8px calc(14px + env(safe-area-inset-bottom, 0px));
    align-items: flex-start;
    z-index: 70;
  }

  body.audience-view .stage {
    align-items: flex-start;
    justify-content: flex-start;
    overflow-y: auto;
    padding-top: 8px;
    padding-bottom: calc(106px + env(safe-area-inset-bottom, 0px));
    scroll-padding-top: calc(74px + env(safe-area-inset-top, 0px));
    scroll-padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }

  body.audience-view .view-arena,
  body.audience-view .view-awarding {
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    min-height: calc(100dvh - var(--audience-mobile-header-safe) - var(--audience-mobile-footer-safe));
    padding-bottom: 8px;
  }

  body.audience-view .view-arena .arena-card,
  body.audience-view .view-awarding .awarding-card {
    margin-top: 0;
    margin-bottom: 0;
  }

  body.audience-view .audience-arena-round-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    justify-content: flex-start;
    min-height: 44px;
    align-items: center;
    padding: 2px 2px 6px;
  }

  body.audience-view .audience-arena-tab {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.74rem;
    line-height: 1.05;
    scroll-snap-align: center;
  }

  body.audience-view .audience-arena-round-tabs {
    scrollbar-width: none;
  }

  body.audience-view .audience-arena-round-tabs::-webkit-scrollbar {
    display: none;
  }
}

body.audience-view.device-mobile .view-question {
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

body.audience-view.device-mobile .timer-block {
  transform: scale(0.92);
  transform-origin: top center;
}

body.audience-view.device-mobile .question-block,
body.audience-view.device-mobile .answer-card {
  width: min(calc(100vw - 12px), 980px);
}

body.audience-view.device-mobile .question-text {
  font-size: clamp(1.15rem, 5vw, 1.8rem);
  line-height: 1.35;
}

body.audience-view.device-mobile .question-meta {
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

body.audience-view.device-mobile .arena-name {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

@keyframes audienceContentEnter {
  from { opacity: 0.75; transform: translateY(6px); filter: saturate(0.92); }
  to { opacity: 1; transform: translateY(0); filter: saturate(1); }
}

@keyframes awardPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes audienceChessAura {
  0%, 100% {
    box-shadow: 0 0 16px rgba(255, 23, 68, 0.12), 0 0 34px rgba(56, 20, 120, 0.12);
  }
  50% {
    box-shadow: 0 0 24px rgba(255, 23, 68, 0.2), 0 0 56px rgba(99, 102, 241, 0.18);
  }
}

@keyframes audienceChessFramePulse {
  0%, 100% { opacity: 0.62; }
  50% { opacity: 0.86; }
}

@keyframes audienceChessCorners {
  0%, 100% { opacity: 0.46; }
  50% { opacity: 0.72; }
}

@keyframes audienceAwardingPulse {
  0%, 100% {
    box-shadow: 0 0 32px rgba(255, 201, 40, 0.22), 0 0 88px rgba(255, 201, 40, 0.15);
  }
  50% {
    box-shadow: 0 0 50px rgba(255, 201, 40, 0.36), 0 0 126px rgba(255, 201, 40, 0.22);
  }
}

@keyframes audienceKingPulse {
  0%, 100% {
    opacity: 0.36;
    transform: translate(-50%, -50%) scale(0.98);
  }
  50% {
    opacity: 0.56;
    transform: translate(-50%, -50%) scale(1.04);
  }
}

@keyframes audienceBgLinesMove {
  0% { background-position: 0 0; }
  100% { background-position: 560px -320px; }
}

@keyframes audiencePowerupRevealIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes audiencePowerupBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes audiencePowerupContentIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
