/* Whale Tank — executive war-room aesthetic: dark, minimal, gold accent for prestige, no clutter. */
.wt-portal, .wt-denied {
	--wt-bg: #070b14;
	--wt-surface: #0f1626;
	--wt-surface-2: #161f36;
	--wt-grid: #263252;
	--wt-text: #eef1f8;
	--wt-text-muted: #93a1c2;
	--wt-gold: #c9a227;
	--wt-gold-bright: #e6c34d;
	--wt-teal: #4fd1c9;
	--wt-danger: #ff5d7a;
	--wt-warn: #ffcc66;
	--wt-good: #7bffb0;
	--wt-radius: 14px;
	--wt-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--wt-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

	background: var(--wt-bg);
	color: var(--wt-text);
	font-family: var(--wt-font);
	border-radius: var(--wt-radius);
	padding: 28px 22px 60px;
	max-width: 900px;
	margin: 0 auto;
}

/* Light theme — same token-remap approach as the main theme's --cdi-* variables (see cdi-theme's
   main.css). --wt-gold/--wt-gold-bright/--wt-teal are left unchanged: they're used both as text
   color AND as button backgrounds paired with a hardcoded dark (#1a1400) button text color, so
   darkening them for text contrast would break that pairing. --wt-danger/--wt-warn/--wt-good are
   text-only in this file, so those are darkened for readable contrast on white. --wt-teal is
   ALSO text-only, but is kept unchanged for brand consistency since it reads acceptably against
   white in practice (numbers/labels, not body copy). */
:root[data-theme="light"] .wt-portal, :root[data-theme="light"] .wt-denied {
	--wt-bg: #f6f8fb;
	--wt-surface: #ffffff;
	--wt-surface-2: #eef1f7;
	--wt-grid: #dbe2ec;
	--wt-text: #101728;
	--wt-text-muted: #5b6779;
	--wt-danger: #c0273f;
	--wt-warn: #a15c00;
	--wt-good: #15803d;
}

.wt-portal * , .wt-denied * { box-sizing: border-box; }

.wt-back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--wt-text-muted); font-size: 0.85rem; font-weight: 600; margin-bottom: 14px; text-decoration: none; }
.wt-back-link:hover { color: var(--wt-gold-bright); }
.wt-back-link.wt-results-link { float: right; }
@media (max-width: 640px) { .wt-back-link.wt-results-link { float: none; display: flex; } }
.wt-portal-header { text-align: center; margin-bottom: 24px; }
.wt-portal-brand { font-family: var(--wt-mono); font-size: 1.6rem; font-weight: 700; letter-spacing: 0.08em; color: var(--wt-gold-bright); }
.wt-portal-mark { margin-right: 6px; }
.wt-portal-sub { color: var(--wt-text-muted); font-size: 0.85rem; margin-top: 4px; }

.wt-loading, .wt-standings-empty { color: var(--wt-text-muted); text-align: center; padding: 20px 0; }

/* ---- Live block ---- */
.wt-live-block { margin-bottom: 24px; }
.wt-live-empty { background: var(--wt-surface); border: 1px solid var(--wt-grid); border-radius: var(--wt-radius); padding: 30px; text-align: center; color: var(--wt-text-muted); }
.wt-live-concluded { border-color: var(--wt-gold); background: linear-gradient(135deg, rgba(201,162,39,0.08), var(--wt-surface)); padding: 40px 30px; }
.wt-live-concluded h2 { margin: 0 0 6px; color: var(--wt-gold-bright); font-family: var(--wt-mono); }
.wt-live-concluded p { margin: 0; }
.wt-live-card { background: var(--wt-surface); border: 1px solid var(--wt-grid); border-radius: var(--wt-radius); padding: 24px; }
.wt-live-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.wt-live-logo { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: #fff; padding: 4px; }
.wt-live-logo-fallback { display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 800; background: var(--wt-surface-2); color: var(--wt-gold); }
.wt-live-identity { flex: 1; min-width: 180px; }
.wt-live-identity h2 { margin: 0; font-size: 1.5rem; }
.wt-live-presenter { margin: 2px 0 0; color: var(--wt-text-muted); }
.wt-live-pres-title { margin: 4px 0 0; font-style: italic; color: var(--wt-teal); }
.wt-live-timer-wrap { text-align: center; }
.wt-timer { font-family: var(--wt-mono); font-size: 2.4rem; font-weight: 700; letter-spacing: 0.03em; color: var(--wt-text); }
.wt-timer-warn { color: var(--wt-warn); }
.wt-timer-critical { color: var(--wt-danger); animation: wt-pulse 1s infinite; }
.wt-timer-zero { color: var(--wt-danger); }
.wt-timer-overtime { color: var(--wt-danger); animation: wt-pulse 0.6s infinite; }
@keyframes wt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.wt-status-pill { display: inline-block; margin-top: 6px; padding: 4px 12px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.wt-status-scheduled, .wt-status-up_next { background: rgba(147,161,194,0.15); color: var(--wt-text-muted); }
.wt-status-presenting { background: rgba(79,209,201,0.15); color: var(--wt-teal); }
.wt-status-judging_open { background: rgba(201,162,39,0.2); color: var(--wt-gold-bright); }
.wt-status-judging_closed { background: rgba(255,204,102,0.15); color: var(--wt-warn); }
.wt-status-completed { background: rgba(123,255,176,0.15); color: var(--wt-good); }

.wt-live-description { margin: 16px 0 0; color: var(--wt-text-muted); font-size: 0.9rem; }
.wt-live-meta { display: flex; gap: 18px; margin-top: 16px; font-size: 0.8rem; color: var(--wt-text-muted); border-top: 1px solid var(--wt-grid); padding-top: 12px; }

/* ---- Judging block ---- */
.wt-judging-card { background: var(--wt-surface); border: 1px solid var(--wt-grid); border-radius: var(--wt-radius); padding: 24px; margin-bottom: 24px; }
.wt-judging-card h3 { margin: 0 0 4px; color: var(--wt-gold-bright); }
.wt-judging-sub { color: var(--wt-text-muted); margin: 0 0 18px; font-size: 0.88rem; }
.wt-judging-locked { text-align: center; }

.wt-dim-row { border-top: 1px solid var(--wt-grid); padding: 16px 0; }
.wt-dim-row:first-of-type { border-top: none; padding-top: 0; }
.wt-dim-label { font-weight: 700; margin-bottom: 10px; }
.wt-dim-scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.wt-dim-btn {
	aspect-ratio: 1;
	min-height: 44px;
	border-radius: 10px;
	border: 1px solid var(--wt-grid);
	background: var(--wt-surface-2);
	color: var(--wt-text);
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.12s ease;
}
.wt-dim-btn:hover { border-color: var(--wt-gold); }
.wt-dim-btn.is-selected { background: var(--wt-gold); border-color: var(--wt-gold); color: #1a1400; }

.wt-ballot-total { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 20px 0 14px; padding: 16px; background: var(--wt-surface-2); border-radius: 10px; font-family: var(--wt-mono); }
.wt-ballot-total span:first-child { color: var(--wt-text-muted); font-family: var(--wt-font); }
.wt-ballot-total strong { font-size: 1.4rem; color: var(--wt-gold-bright); }
.wt-ballot-total span:last-child { font-size: 1.1rem; color: var(--wt-teal); }

.wt-form-status { min-height: 1.2em; font-size: 0.88rem; text-align: center; }
.wt-form-success { color: var(--wt-good); }
.wt-form-error { color: var(--wt-danger); }

.wt-btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 20px; border-radius: 999px; border: 1px solid var(--wt-grid); background: var(--wt-surface-2); color: var(--wt-text); font-weight: 700; font-size: 0.9rem; cursor: pointer; text-decoration: none; }
.wt-btn-primary { background: linear-gradient(135deg, var(--wt-gold), var(--wt-gold-bright)); border-color: var(--wt-gold); color: #1a1400; }
.wt-btn-large { width: 100%; padding: 16px; font-size: 1.05rem; }
.wt-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Scoreboard ---- */
.wt-scoreboard-block { margin-bottom: 32px; }
.wt-scoreboard-card { background: var(--wt-surface); border: 1px solid var(--wt-gold); border-radius: var(--wt-radius); padding: 24px; }
.wt-scoreboard-card h3 { margin: 0; }
.wt-scoreboard-sub { color: var(--wt-text-muted); font-size: 0.85rem; margin: 2px 0 16px; }
.wt-scoreboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
.wt-scoreboard-radar canvas { max-width: 100%; }
.wt-sb-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--wt-grid); font-size: 0.9rem; }
.wt-sb-row strong { color: var(--wt-teal); font-family: var(--wt-mono); }
.wt-scoreboard-total { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--wt-grid); display: flex; justify-content: space-between; align-items: center; }
.wt-scoreboard-total span { color: var(--wt-text-muted); text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.05em; }
.wt-scoreboard-total strong { font-size: 1.8rem; font-family: var(--wt-mono); color: var(--wt-gold-bright); }
@media (max-width: 640px) { .wt-scoreboard-grid { grid-template-columns: 1fr; } }

/* ---- Standings ---- */
.wt-standings-section h2 { font-family: var(--wt-mono); text-transform: uppercase; letter-spacing: 0.05em; font-size: 1.1rem; color: var(--wt-text-muted); border-bottom: 1px solid var(--wt-grid); padding-bottom: 10px; }
.wt-standings-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wt-standings-row { display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 10px; padding: 12px 16px; background: var(--wt-surface); border: 1px solid var(--wt-grid); border-radius: 10px; }
.wt-standings-rank { font-family: var(--wt-mono); font-weight: 700; color: var(--wt-text-muted); }
.wt-standings-name { font-weight: 600; }
.wt-standings-score { font-family: var(--wt-mono); font-weight: 700; color: var(--wt-teal); }
.wt-medal-gold { border-color: #d4af37; background: linear-gradient(90deg, rgba(212,175,55,0.12), transparent); }
.wt-medal-gold .wt-standings-rank { color: #d4af37; }
.wt-medal-silver { border-color: #c0c0c0; background: linear-gradient(90deg, rgba(192,192,192,0.1), transparent); }
.wt-medal-silver .wt-standings-rank { color: #c0c0c0; }
.wt-medal-bronze { border-color: #cd7f32; background: linear-gradient(90deg, rgba(205,127,50,0.1), transparent); }
.wt-medal-bronze .wt-standings-rank { color: #cd7f32; }
.wt-standings-pending-note { color: var(--wt-text-muted); font-size: 0.82rem; margin-top: 10px; }
.wt-standings-overall { margin-top: 32px; }

/* ---- Access denied ---- */
.wt-denied { display: flex; align-items: center; justify-content: center; min-height: 50vh; }
.wt-denied-card { text-align: center; max-width: 420px; padding: 40px; }
.wt-denied-mark { font-size: 2.4rem; margin-bottom: 10px; }
.wt-denied-card h1 { font-family: var(--wt-mono); color: var(--wt-gold-bright); }
.wt-denied-note { color: var(--wt-text-muted); font-size: 0.85rem; }

/* ---- Responsive: phones (many CISOs vote from their seat) ---- */
@media (max-width: 560px) {
	.wt-portal { padding: 16px 12px 40px; }
	.wt-live-top { flex-direction: column; align-items: flex-start; }
	.wt-live-timer-wrap { align-self: stretch; text-align: left; }
	.wt-dim-scale { grid-template-columns: repeat(5, 1fr); }
	.wt-standings-row { grid-template-columns: 40px 1fr auto; padding: 10px 12px; }
}
