.lobby-shell {
  background: linear-gradient(135deg, #f8f9fb 0%, #eef2f6 100%);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.lobby-pin {
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.2rem;
  font-weight: 700;
}

.lobby-status {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
}

.lobby-card-title {
  font-weight: 600;
}

.lobby-list .list-group-item {
  border: 0;
  border-bottom: 1px dashed #dfe4ea;
}

.lobby-list .list-group-item:last-child {
  border-bottom: 0;
}

.lobby-answer-grid .btn {
  text-align: left;
}

.lobby-answer-grid .btn.answer-selected {
  border-color: #0f172a;
  box-shadow: 0 0 0 0.2rem rgba(15, 23, 42, 0.15);
}

.lobby-answer-grid .btn.answer-correct {
  background: #22c55e;
  border-color: #16a34a;
  color: #fff;
}

.lobby-answer-grid .btn.answer-wrong {
  background: #ef4444;
  border-color: #dc2626;
  color: #fff;
}

.lobby-highlight {
  background: #fff8e5;
  border: 1px solid #ffe3a3;
}

.profile-avatar {
  display: inline-block;
  object-fit: cover;
  background: #e9ecef;
}

.avatar-status {
  border: 2px solid #cbd5f5;
}

.status-online {
  border-color: #22c55e !important;
}

.status-away {
  border-color: #f59e0b !important;
}

.status-offline {
  border-color: #94a3b8 !important;
}

.status-in-game {
  border-color: #8b5cf6 !important;
}

.lobby-player-avatar.avatar-status {
  border-width: 2px !important;
  border-style: solid !important;
}

.lobby-player-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  background: #e9ecef;
}

.lobby-player-avatar.avatar-status {
  border-width: 2px;
  border-style: solid;
}

.ruler-avatar {
  width: 84px;
  height: 84px;
  border: 0;
}

.ruler-avatar-wrap {
  position: relative;
  display: inline-block;
}

.ruler-crown {
  position: absolute;
  left: -6px;
  bottom: -6px;
  color: #f4b740;
  font-size: 1.45rem;
}

.ruler-card {
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.ruler-card .card-body {
  padding: 1.5rem 1.25rem;
}

.ruler-title {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: #64748b;
}

.ruler-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.ruler-divider {
  width: 48px;
  height: 2px;
  margin: 0.5rem auto;
  background: #e2e8f0;
  border-radius: 999px;
}

.ruler-subtitle {
  font-size: 0.85rem;
}

.ruler-since {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.ruler-card-luzy {
  background: linear-gradient(180deg, #ffffff 0%, #fff9ef 100%);
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.ruler-card-luzy .ruler-divider {
  background: rgba(212, 175, 55, 0.6);
}

.ruler-card-luzy .ruler-avatar {
  border: 2px solid rgba(212, 175, 55, 0.7);
}

.ruler-card-luzy .ruler-crown {
  color: #d4af37;
}

.ruler-card-luzy .ruler-title,
.ruler-card-luzy .ruler-subtitle {
  color: #6b7280;
}

.ruler-badge {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.6);
  background: rgba(255, 245, 210, 0.8);
  color: #8a6a1e;
}

.ruler-card-vizy {
  background: linear-gradient(180deg, #ecfeff 0%, #f0f9ff 100%);
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 12px 24px rgba(14, 116, 144, 0.18);
  border-radius: 18px;
}

.ruler-card-vizy .ruler-divider {
  background: rgba(56, 189, 248, 0.6);
}

.ruler-card-vizy .ruler-avatar {
  border: 2px solid rgba(34, 211, 238, 0.75);
}

.ruler-card-vizy .ruler-crown {
  color: #38bdf8;
}

.ruler-card-vizy .ruler-title,
.ruler-card-vizy .ruler-subtitle {
  color: #0f172a;
}

.ruler-card-vizy .ruler-speed {
  margin-top: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0e7490;
  background: rgba(186, 230, 253, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.6);
}

.ruler-card-mindy {
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  border-color: rgba(22, 163, 74, 0.4);
  box-shadow: 0 16px 30px rgba(22, 163, 74, 0.26);
  border-width: 2px;
  border-left-color: rgba(234, 88, 12, 0.7);
}

.ruler-card-mindy .ruler-divider {
  background: rgba(22, 163, 74, 0.65);
  height: 3px;
}

.ruler-card-mindy .ruler-avatar {
  border: 2px solid rgba(22, 163, 74, 0.7);
}

.ruler-card-mindy .ruler-crown {
  color: #f97316;
}

.ruler-card-mindy .ruler-title,
.ruler-card-mindy .ruler-subtitle {
  color: #14532d;
}

.ruler-card-mindy .ruler-score {
  margin-top: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #9a3412;
  background: rgba(254, 215, 170, 0.7);
  border: 1px solid rgba(234, 88, 12, 0.6);
}

.leaderboard-crown {
  color: #f4b740;
  font-size: 0.95rem;
}

.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2000;
}

.confetti-piece {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 16px;
  opacity: 0.9;
  border-radius: 2px;
  animation: confetti-fall 1.2s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.9;
  }
  100% {
    transform: translateY(90vh) rotate(260deg);
    opacity: 0;
  }
}

.podium-item {
  font-weight: 600;
}

.podium-modal-content {
  background: radial-gradient(circle at top, rgba(250, 204, 21, 0.2), transparent 45%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 45%),
    #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.podium-modal-content .modal-footer,
.podium-modal-content .modal-header {
  border-color: rgba(148, 163, 184, 0.25);
}

.podium-modal-content .btn-outline-secondary {
  color: #e2e8f0;
  border-color: rgba(226, 232, 240, 0.5);
}

.podium-modal-content .btn-outline-secondary:hover {
  background: rgba(226, 232, 240, 0.15);
  color: #f8fafc;
}

.podium-modal-body {
  color: inherit;
}

.podium-modal {
  border-radius: 16px;
  padding: 1.25rem;
  position: relative;
}

.podium-stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
  text-align: center;
  margin-bottom: 1.5rem;
}

.podium-slot {
  padding: 1rem 0.75rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 16px 30px rgba(2, 6, 23, 0.4);
}

.podium-first {
  transform: translateY(-12px);
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.35), rgba(15, 23, 42, 0.6));
  border-color: rgba(250, 204, 21, 0.5);
}

.podium-second {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.35), rgba(15, 23, 42, 0.6));
}

.podium-third {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.35), rgba(15, 23, 42, 0.6));
}

.podium-rank {
  font-weight: 700;
  font-size: 1.2rem;
  color: #fde68a;
}

.podium-avatar-wrap {
  position: relative;
  display: inline-block;
  margin: 0.5rem 0 0.4rem;
}

.podium-avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 2px solid rgba(248, 250, 252, 0.8);
  object-fit: cover;
  background: #e2e8f0;
}

.podium-avatar-crown .podium-avatar {
  width: 86px;
  height: 86px;
  border-color: rgba(250, 204, 21, 0.8);
}

.podium-crown {
  position: absolute;
  top: -10px;
  right: -8px;
  font-size: 1.1rem;
  color: #facc15;
}

.podium-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.podium-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(250, 204, 21, 0.35);
  font-weight: 600;
}

.podium-speed {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: rgba(248, 250, 252, 0.7);
}

.podium-challengers {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 14px;
  padding: 0.75rem 1rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.podium-challengers-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.7);
  margin-bottom: 0.6rem;
}

.podium-challengers-list {
  display: grid;
  gap: 0.5rem;
}

.podium-challenger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(71, 85, 105, 0.4);
}

.podium-challenger-left {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.podium-challenger-rank {
  font-weight: 600;
  color: rgba(250, 204, 21, 0.85);
}

.podium-challenger-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(248, 250, 252, 0.6);
  object-fit: cover;
  background: #e2e8f0;
}

.podium-challenger-name {
  font-weight: 500;
}

.podium-challenger-score {
  font-weight: 600;
}

.podium-empty {
  font-size: 0.85rem;
  color: rgba(248, 250, 252, 0.7);
}

.podium-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.podium-modal .podium-stage,
.podium-modal .podium-challengers {
  position: relative;
  z-index: 2;
}

.podium-confetti-piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  border-radius: 2px;
  animation: podium-confetti-fall 1.4s ease-out forwards;
}

@keyframes podium-confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.9;
  }
  100% {
    transform: translateY(90%) rotate(260deg);
    opacity: 0;
  }
}

@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  @page {
    size: A4;
    margin: 12mm;
  }

  body * {
    visibility: hidden !important;
  }

  #kht-podium-modal,
  #kht-podium-modal * {
    visibility: visible !important;
  }

  #kht-podium-modal {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
  }

  #kht-podium-modal .modal-dialog {
    margin: 0 auto;
    max-width: 960px;
  }

  #kht-podium-modal .modal-content {
    background: radial-gradient(circle at top, rgba(250, 204, 21, 0.25), transparent 45%),
      radial-gradient(circle at top right, rgba(59, 130, 246, 0.2), transparent 45%),
      #0f172a;
    color: #f8fafc;
    box-shadow: none;
  }

  #kht-podium-modal .podium-slot,
  #kht-podium-modal .podium-challengers {
    box-shadow: none;
  }

  #kht-podium-modal .podium-modal {
    box-shadow: none;
  }

  #kht-podium-modal .modal-footer,
  #kht-podium-modal .modal-header .btn-close,
  #kht-podium-modal #kht-podium-print,
  #kht-podium-modal #kht-podium-download {
    display: none !important;
  }
}

@media print {
  body.host-print-mode * {
    visibility: hidden !important;
  }

  body.host-print-mode #kht-results-section,
  body.host-print-mode #kht-results-section * {
    visibility: visible !important;
  }

  body.host-print-mode #kht-results-section {
    position: absolute;
    inset: 0;
    padding: 12mm 10mm;
    width: 100%;
  }

  body.host-print-mode #kht-results-section .card {
    box-shadow: none;
    border: 1px solid #e2e8f0;
  }

  body.host-print-mode #kht-results-section .card + .card {
    margin-top: 18px;
  }
}

@media (max-width: 768px) {
  .podium-stage {
    grid-template-columns: 1fr;
  }

  .podium-first {
    transform: none;
  }
}

.recap-card {
  background: #ffffff;
  border: 1px solid #e3e7ed;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.recap-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.recap-options {
  display: grid;
  gap: 0.35rem;
}

.recap-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: #f6f8fb;
}

.recap-option.recap-correct {
  background: #e8f9f0;
  border: 1px solid #bbf7d0;
}
