/* The Kink Index Game Styles
   Loaded AFTER Bootstrap + main site styles.
   Vote & Admin pages use the site's light theme.
   Display page uses its own dark theme. */

/* Utility — display page doesn't load Bootstrap so needs this */
.d-none { display: none !important; }

:root {
  --game-accent: #a71d2a;
  --game-accent-hover: #8b1621;
  --game-green: #198754;
  --game-yellow: #ffc107;
  --game-radius: 12px;
}

/* ── Layout ── */
.game-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.game-container--wide {
  max-width: 1000px;
}

/* ── Cards (light theme) ── */
.game-card {
  background: var(--bg-card, #EEEEEE);
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: var(--game-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

/* ── Buttons ── */
.game-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1.2;
}

.game-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.game-btn--primary {
  background: var(--game-accent);
  color: #fff;
  border-color: var(--game-accent);
}
.game-btn--primary:hover:not(:disabled) {
  background: var(--game-accent-hover);
  border-color: var(--game-accent-hover);
}

.game-btn--success {
  background: var(--game-green);
  color: #fff;
  border-color: var(--game-green);
}

.game-btn--outline {
  background: transparent;
  color: var(--text-primary, #000);
  border-color: var(--border-color, #dee2e6);
}
.game-btn--outline:hover:not(:disabled) {
  border-color: var(--text-primary, #000);
}

.game-btn--danger {
  background: #dc3545;
  color: #fff;
  border-color: #dc3545;
}

.game-btn--sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.game-btn--block {
  display: flex;
  width: 100%;
  justify-content: center;
}

/* ── Vote Toggle Buttons ── */
.vote-toggle-group {
  display: flex;
  gap: 0.75rem;
}

.vote-toggle {
  flex: 1;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  border: 2px solid var(--border-color, #dee2e6);
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary, #000);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 56px;
}

.vote-toggle:hover {
  border-color: var(--text-muted, #545454);
}

.vote-toggle[aria-pressed="true"].vote-yes {
  background: var(--game-green);
  border-color: var(--game-green);
  color: #fff;
}

.vote-toggle[aria-pressed="true"].vote-no {
  background: var(--game-accent);
  border-color: var(--game-accent);
  color: #fff;
}

/* ── Form Inputs (Admin) ── */
.game-input,
.game-select,
.game-textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: #fff;
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: 6px;
  color: var(--text-primary, #000);
  font-size: 0.95rem;
  font-family: inherit;
}

.game-input:focus,
.game-select:focus,
.game-textarea:focus {
  outline: 2px solid var(--game-accent);
  outline-offset: 1px;
}

.game-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted, #545454);
  margin-bottom: 0.3rem;
}

/* ── Admin Tabs ── */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color, #dee2e6);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.admin-tab {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted, #545454);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.admin-tab:hover {
  color: var(--text-primary, #000);
}

.admin-tab.active {
  color: var(--game-accent);
  border-bottom-color: var(--game-accent);
}

.admin-panel {
  display: none;
}
.admin-panel.active {
  display: block;
}

/* ── Status Badge ── */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge--voting { background: var(--game-green); color: #fff; }
.status-badge--closed { background: var(--game-accent); color: #fff; }
.status-badge--setup { background: var(--game-yellow); color: #1a1a1a; }

/* ── Vote Counter ── */
.vote-counter {
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  color: var(--game-green);
  line-height: 1;
}

.vote-counter-label {
  text-align: center;
  color: var(--text-muted, #545454);
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* ══════════════════════════════════════
   Display View — Dark theme (projector)
   Matches MRB site aesthetic: black bg,
   brand-red accent, bold typography
   ══════════════════════════════════════ */
.display-fullscreen {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 2rem;
  box-sizing: border-box;
  background: #000000;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(167, 29, 42, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(167, 29, 42, 0.08) 0%, transparent 50%);
  color: #ffffff;
  position: relative;
}

/* Subtle top/bottom border accent */
.display-fullscreen::before,
.display-fullscreen::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #a71d2a, transparent);
}
.display-fullscreen::before { top: 0; }
.display-fullscreen::after { bottom: 0; }

.display-logo {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  opacity: 0.8;
}

.display-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.display-subtitle {
  font-size: 1.3rem;
  color: #999;
  margin-bottom: 2rem;
}

.display-qr {
  background: #fff;
  padding: 1.5rem 1.5rem 1rem;
  border-radius: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 30px rgba(167, 29, 42, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.display-qr img,
.display-qr canvas {
  display: block;
  width: 280px;
  height: 280px;
}

.display-url {
  font-size: 1.2rem;
  font-weight: 700;
  color: #a71d2a;
  letter-spacing: 0.02em;
  margin-top: 0.5rem;
}

.display-question {
  font-size: 2rem;
  font-weight: 700;
  max-width: 800px;
  line-height: 1.3;
  margin-bottom: 1.5rem;
  color: #ffffff;
}

.display-contestant {
  font-size: 1.3rem;
  color: #a71d2a;
  font-weight: 600;
  margin-bottom: 2rem;
}

/* Display vote counter overrides */
.display-fullscreen .vote-counter {
  color: #ffffff;
  text-shadow: 0 0 20px rgba(167, 29, 42, 0.5);
}

.display-fullscreen .vote-counter-label {
  color: #999;
}

/* ── Percentage Display ── */
.pct-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  margin: 2rem 0;
}

.pct-box {
  text-align: center;
}

.pct-box__label {
  font-size: 1rem;
  color: #999;
  margin-bottom: 0.5rem;
}

.pct-box__value {
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
}

.pct-box__value--guess {
  color: #ffffff;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.pct-box__value--actual {
  color: #a71d2a;
  text-shadow: 0 0 20px rgba(167, 29, 42, 0.4);
}

.pct-vs {
  font-size: 2rem;
  color: #666;
  font-weight: 300;
}

/* ── Higher/Lower Display ── */
.hl-row {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.hl-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid #333;
  border-radius: var(--game-radius);
  padding: 1.5rem 2rem;
  text-align: center;
  min-width: 200px;
}

.hl-card__name {
  font-size: 1.1rem;
  color: #999;
  margin-bottom: 0.5rem;
}

.hl-card__guess {
  font-size: 1.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hl-card--correct {
  border-color: #a71d2a;
  background: rgba(167, 29, 42, 0.1);
}
.hl-card--correct .hl-card__guess {
  color: #a71d2a;
}

.hl-card--wrong {
  border-color: #555;
}
.hl-card--wrong .hl-card__guess {
  color: #666;
}

/* ── Animations ── */
@keyframes countUp {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.animate-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-count {
  animation: countUp 0.6s ease-out;
}

.animate-pulse {
  animation: pulse 0.6s ease-out;
}

/* ── Alert Messages ── */
.game-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.game-alert--success {
  background: rgba(25, 135, 84, 0.1);
  border: 1px solid var(--game-green);
  color: var(--game-green);
}

.game-alert--error {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid #dc3545;
  color: #dc3545;
}

/* ── Admin Question List ── */
.question-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color, #dee2e6);
}

.question-item:last-child {
  border-bottom: none;
}

.question-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--game-accent);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
}

.question-text {
  flex: 1;
  font-size: 0.95rem;
}

.question-contestant {
  font-size: 0.8rem;
  color: var(--text-muted, #545454);
}

/* ── Admin Controls Row ── */
.controls-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.5rem;
}

/* ── Thank You State ── */
.thankyou {
  text-align: center;
  padding: 3rem 1rem;
}

.thankyou-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

/* ── Display Responsive ── */
@media (max-width: 600px) {
  .display-title { font-size: 1.8rem; }
  .display-question { font-size: 1.4rem; }
  .pct-box__value { font-size: 3.5rem; }
  .pct-display { gap: 1.5rem; }
  .display-qr img,
  .display-qr canvas { width: 220px; height: 220px; }
  .hl-row { gap: 1rem; }
  .hl-card { min-width: 140px; padding: 1rem; }
}

/* ── Bilingual Text (English primary, German secondary) ── */
.bi {
  display: block;
}
.bi .de {
  display: block;
  font-size: 0.72em;
  opacity: 0.55;
  font-style: italic;
  margin-top: 0.1em;
  font-weight: inherit;
}

/* Inline variant — short labels, buttons */
.bi--inline {
  display: inline;
}
.bi--inline .de {
  display: inline;
  margin-top: 0;
  font-size: 0.85em;
}
.bi--inline .de::before {
  content: ' · ';
  font-style: normal;
  opacity: 0.4;
}

/* Button bilingual */
.btn .de, .game-btn .de {
  font-weight: 500;
}

/* Vote toggle bilingual */
.vote-toggle .de {
  display: block;
  font-size: 0.7em;
  opacity: 0.6;
  font-style: italic;
  font-weight: 500;
  margin-top: 0.15rem;
}

/* Display page bilingual overrides are in display.html <style> using vh units */

/* ── Admin Login ── */
.login-container {
  max-width: 360px;
  margin: 10vh auto;
  padding: 1rem;
}
