@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;700;800&family=Nunito:wght@600;700;800;900&family=Outfit:wght@600;700;800;900&display=swap');

:root {
  --bg-dark: #070d14;
  --bg-card: rgba(13, 25, 41, 0.85);
  --bg-card-border: rgba(255, 215, 0, 0.25);
  --gold-primary: #ffd166;
  --gold-glow: rgba(255, 209, 102, 0.4);
  --viking-red: #d62828;
  --viking-blue: #0077b6;
  --viking-cyan: #48cae4;
  --fjord-deep: #0a192f;
  --text-main: #f1faee;
  --text-dim: #a8dadc;
  --accent-green: #06d6a0;
  --accent-red: #ef476f;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Nunito', sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* TOP NAVIGATION / HEADER */
.top-header {
  height: 60px;
  background: linear-gradient(180deg, rgba(7, 13, 20, 0.95) 0%, rgba(11, 29, 48, 0.85) 100%);
  border-bottom: 2px solid rgba(255, 209, 102, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 26px;
  filter: drop-shadow(0 0 8px rgba(255, 209, 102, 0.6));
}

.logo-title {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #ffd166 0%, #ffb703 50%, #fb8500 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 183, 3, 0.3);
}

.logo-subtitle {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-left: 8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* 3D TACTILE ARCADE BUTTONS (BLOOKET-FEEL) */
.btn {
  background: linear-gradient(180deg, #1e3a5f 0%, #0d1e33 100%);
  border: 1.5px solid rgba(255, 209, 102, 0.4);
  border-top-color: rgba(255, 255, 255, 0.3);
  color: var(--text-main);
  padding: 9px 18px;
  border-radius: 12px;
  font-family: 'Outfit', 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 5px 0 #050c14, 0 6px 14px rgba(0, 0, 0, 0.6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background: linear-gradient(180deg, #274b7a 0%, #132b49 100%);
  border-color: var(--gold-primary);
  box-shadow: 0 7px 0 #050c14, 0 10px 20px rgba(255, 209, 102, 0.35);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #050c14, 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn-primary {
  background: linear-gradient(180deg, #ff4d6d 0%, #d62828 60%, #9e1b1b 100%);
  border: 2px solid #ff758f;
  border-top-color: #ffa8b8;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  box-shadow: 0 5px 0 #5c0f0f, 0 6px 14px rgba(214, 40, 40, 0.5);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #ff758f 0%, #e63946 60%, #b31e1e 100%);
  border-color: #ffd166;
  box-shadow: 0 7px 0 #5c0f0f, 0 10px 22px rgba(255, 77, 109, 0.65);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #5c0f0f, 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn-gold {
  background: linear-gradient(180deg, #ffe082 0%, #ffb703 45%, #e85d04 100%);
  border: 2px solid #fff3b0;
  border-top-color: #ffffff;
  color: #070d14;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  box-shadow: 0 5px 0 #9d4200, 0 6px 16px rgba(251, 133, 0, 0.5);
}

.btn-gold:hover {
  background: linear-gradient(180deg, #fff3b0 0%, #ffd166 45%, #f48c06 100%);
  border-color: #ffffff;
  box-shadow: 0 7px 0 #9d4200, 0 10px 24px rgba(255, 209, 102, 0.7);
  transform: translateY(-2px);
}

.btn-gold:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #9d4200, 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* MAIN VIEWPORT */
#game-container {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#race-canvas-wrapper {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
}

#raceCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* TYPING CONSOLE / TRAY */
.typing-tray {
  min-height: 200px;
  background: linear-gradient(180deg, rgba(11, 25, 44, 0.95) 0%, rgba(5, 12, 22, 0.98) 100%);
  border-top: 2px solid rgba(255, 209, 102, 0.3);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  padding: 10px 24px;
  z-index: 50;
  position: relative;
}

/* MINI-TRACK HUD (PERIFERT BLIKK) */
.hud-mini-track {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(4, 10, 18, 0.75);
  border: 1px solid rgba(255, 209, 102, 0.22);
  border-radius: 8px;
  padding: 4px 12px;
  margin-bottom: 8px;
}

.mini-track-badge-col {
  flex-shrink: 0;
}

.mini-rank-badge {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
  background: linear-gradient(135deg, #ffd166 0%, #fb8500 100%);
  color: #070d14;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.5);
  white-space: nowrap;
  display: inline-block;
}

.mini-track-groove {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 45px;
  box-sizing: border-box;
}

.mini-track-start,
.mini-track-finish {
  position: absolute;
  font-size: 9px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  top: 50%;
  transform: translateY(-50%);
}

.mini-track-start {
  left: 6px;
}

.mini-track-finish {
  right: 6px;
  color: var(--gold-primary);
}

.mini-track-fill {
  position: absolute;
  left: 45px;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.3), rgba(251, 133, 0, 0.6));
  border-radius: 4px;
  width: 0%;
  transition: width 0.1s linear;
  max-width: calc(100% - 90px);
}

.mini-track-racers-layer {
  position: absolute;
  left: 45px;
  right: 45px;
  top: 0;
  bottom: 0;
  pointer-events: none;
}

.mini-pin {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.12s linear;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}

.mini-pin-player {
  z-index: 5;
}

.mini-pin-player .mini-pin-dot {
  width: 16px;
  height: 16px;
  background: #ffd166;
  border-color: #ffffff;
  box-shadow: 0 0 12px #ffd166, 0 0 4px #fb8500;
  animation: playerPinPulse 1s infinite alternate;
}

@keyframes playerPinPulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.15); filter: brightness(1.3); }
}

.mini-pin-ghost .mini-pin-dot {
  width: 14px;
  height: 14px;
  background: rgba(0, 245, 212, 0.7);
  border-color: #00f5d4;
  box-shadow: 0 0 10px #00f5d4;
}

/* FLOATING OVERTAKE HUD TOAST */
.hud-overtake-toast {
  position: absolute;
  top: -30px;
  right: 14px;
  z-index: 60;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.hud-overtake-toast.show-overtake {
  display: flex;
  background: linear-gradient(135deg, rgba(6, 214, 160, 0.95), rgba(17, 138, 178, 0.95));
  color: #070d14;
  border: 1px solid #06d6a0;
  animation: toastPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hud-overtake-toast.show-passed {
  display: flex;
  background: linear-gradient(135deg, rgba(239, 71, 111, 0.95), rgba(255, 159, 28, 0.95));
  color: #ffffff;
  border: 1px solid #ef476f;
  animation: toastPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastPop {
  0% { transform: translateY(8px) scale(0.9); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* BERSERK AURA ON TYPING TEXT BOX */
.text-display-box.berserk-glow {
  border-color: #ffd166 !important;
  box-shadow: 0 0 28px rgba(255, 183, 3, 0.6), inset 0 0 16px rgba(255, 112, 0, 0.3) !important;
  animation: berserkAura 0.7s infinite alternate ease-in-out;
}

@keyframes berserkAura {
  0% { border-color: #ffd166; box-shadow: 0 0 20px rgba(255, 209, 102, 0.5), inset 0 0 10px rgba(255, 159, 28, 0.2); }
  100% { border-color: #ff9f1c; box-shadow: 0 0 35px rgba(255, 159, 28, 0.8), inset 0 0 20px rgba(255, 77, 109, 0.4); }
}

.typing-header-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.hud-cockpit-gauges {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hud-speed-gauge {
  background: linear-gradient(135deg, rgba(14, 30, 50, 0.9) 0%, rgba(6, 16, 28, 0.95) 100%);
  border: 2px solid rgba(255, 209, 102, 0.4);
  border-bottom: 4px solid rgba(179, 134, 0, 0.7);
  border-radius: 14px;
  padding: 4px 12px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
}

.gauge-arc-wrap {
  position: relative;
  width: 90px;
  height: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.gauge-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.gauge-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 8;
  stroke-linecap: round;
}

.gauge-fill {
  fill: none;
  stroke: #ffd166;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 125;
  stroke-dashoffset: 125;
  transition: stroke-dashoffset 0.15s ease-out, stroke 0.2s;
  filter: drop-shadow(0 0 6px rgba(255, 209, 102, 0.8));
}

.gauge-center-readout {
  position: relative;
  z-index: 2;
  text-align: center;
  line-height: 1;
  margin-bottom: 2px;
}

.gauge-wpm-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 900;
  color: #ffd166;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.8);
  letter-spacing: -0.5px;
}

.gauge-wpm-unit {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-dim);
  display: block;
  margin-top: 1px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(14, 30, 50, 0.85) 0%, rgba(6, 16, 28, 0.95) 100%);
  padding: 6px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-bottom: 3.5px solid rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6), 0 3px 8px rgba(0, 0, 0, 0.4);
}

.stat-icon {
  font-size: 20px;
}

.stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-weight: 800;
}

.stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

/* BERSERKER RAGE METER */
.berserk-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 140px;
}

.berserk-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.berserk-label {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ff9f1c;
}

.berserk-streak-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #ff9f1c;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(255, 159, 28, 0.6);
}

.berserk-meter-bar {
  width: 140px;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 159, 28, 0.4);
}

.berserk-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff9f1c, #ff4d6d);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 10px #ff4d6d;
}

.berserk-active .berserk-fill {
  animation: pulseGlow 0.6s infinite alternate;
}

@keyframes pulseGlow {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.7); box-shadow: 0 0 16px #ff4d6d; }
}

/* TYPING TEXT BOX (STOR & KRYSTALLKLAR - BLOOKET 3D ARCADE) */
.text-display-box {
  background: rgba(3, 7, 13, 0.94);
  border: 2px solid rgba(255, 209, 102, 0.45);
  border-bottom: 5px solid rgba(255, 209, 102, 0.35);
  border-radius: 16px;
  padding: 14px 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  line-height: 1.6;
  letter-spacing: 0.6px;
  height: 104px;
  max-height: 104px;
  overflow-y: hidden;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.9), 0 8px 24px rgba(0, 0, 0, 0.5);
  position: relative;
  cursor: text;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: break-word;
  user-select: none;
  scroll-behavior: smooth;
  box-sizing: border-box;
}

/* DYNAMISK RIVAL-MODUS (KLASSEROM): EKSTRA OPP-SKALERT SKRIFT */
body.dynamic-rival-mode .text-display-box {
  font-size: 27px;
  line-height: 1.65;
  letter-spacing: 0.8px;
  height: 114px;
  max-height: 114px;
  border-color: rgba(255, 209, 102, 0.6);
  border-bottom-color: rgba(255, 209, 102, 0.5);
  box-shadow: inset 0 2px 16px rgba(0, 0, 0, 0.9), 0 0 24px rgba(255, 209, 102, 0.2);
}

.char-space {
  display: inline-block;
  min-width: 8px;
}

.char-typed {
  color: #06d6a0;
  text-shadow: 0 0 10px rgba(6, 214, 160, 0.6);
  font-weight: 600;
}

.char-current {
  background: #ffd166;
  color: #070d14;
  border-radius: 6px;
  padding: 1px 4px;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.85), 0 2px 0 #b38600;
  animation: cursorPulse 0.75s infinite alternate ease-in-out;
}

@keyframes cursorPulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.06); filter: brightness(1.25); box-shadow: 0 0 22px rgba(255, 209, 102, 1), 0 2px 0 #b38600; }
}

.char-untyped {
  color: #8da3b8;
}

.char-error {
  background: #ef476f;
  color: #ffffff;
  border-radius: 5px;
  padding: 1px 3px;
  box-shadow: 0 0 12px rgba(239, 71, 111, 0.9), 0 2px 0 #900;
  animation: shake 0.2s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* PROGRESS BAR */
.race-progress-wrapper {
  margin-top: 10px;
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.race-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #48cae4, #ffd166);
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.6);
  transition: width 0.1s linear;
}

/* MODALS & OVERLAYS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 16, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: linear-gradient(145deg, #0e1e32 0%, #071220 100%);
  border: 2px solid rgba(255, 209, 102, 0.35);
  border-radius: 12px;
  padding: 32px 36px;
  max-width: 680px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 209, 102, 0.15);
  position: relative;
}

.modal-title {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 26px;
  font-weight: 900;
  color: var(--gold-primary);
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 2px;
  text-shadow: 0 0 15px var(--gold-glow);
}

.modal-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  margin-top: -14px;
  margin-bottom: 24px;
}

/* BOATHOUSE & SHOP MODAL */
.modal-shop-card {
  max-width: 920px !important;
  width: 94% !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
}

.shop-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.shop-wallet-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.2) 0%, rgba(251, 133, 0, 0.15) 100%);
  border: 1.5px solid #ffd166;
  padding: 8px 16px;
  border-radius: 25px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #ffd166;
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.25);
}

.shop-theme-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.shop-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 8px 18px;
  border-radius: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shop-tab:hover {
  background: rgba(255, 209, 102, 0.12);
  border-color: rgba(255, 209, 102, 0.4);
  color: #ffffff;
}

.shop-tab.active {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.25) 0%, rgba(251, 133, 0, 0.2) 100%);
  border-color: #ffd166;
  color: #ffd166;
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.3);
}

.boat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .boat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.boat-card {
  background: rgba(10, 22, 38, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.boat-card:hover {
  border-color: rgba(255, 209, 102, 0.6);
  transform: translateY(-3px);
  background: rgba(16, 36, 62, 0.95);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}

.boat-card.selected {
  border-color: #ffd166;
  box-shadow: 0 0 20px rgba(255, 209, 102, 0.4);
  background: linear-gradient(160deg, rgba(28, 54, 88, 0.9) 0%, rgba(10, 22, 38, 0.95) 100%);
}

.boat-card.locked {
  opacity: 0.82;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(8, 14, 24, 0.75);
}

.boat-card-rarity {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 8px;
}

.rarity-common {
  background: rgba(100, 116, 139, 0.3);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.rarity-rare {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.rarity-epic {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.rarity-legendary {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.3) 0%, rgba(251, 133, 0, 0.3) 100%);
  color: #ffd166;
  border: 1px solid #ffd166;
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.35);
}

.boat-card img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  image-rendering: pixelated;
  transform: scaleX(-1);
  margin: 10px 0 8px 0;
  transition: transform 0.2s ease;
}

.boat-card:hover img {
  transform: scaleX(-1) scale(1.08);
}

.boat-card-name {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  line-height: 1.2;
}

.boat-card.selected .boat-card-name {
  color: #ffd166;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.5);
}

.boat-card-clan {
  font-size: 10.5px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 2px;
}

.boat-card-status-btn {
  margin-top: 10px;
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
  box-sizing: border-box;
}

.status-equipped {
  background: linear-gradient(135deg, #ffd166 0%, #fb8500 100%);
  color: #070d14;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
}

.status-owned {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}

.status-owned:hover {
  background: rgba(255, 209, 102, 0.15);
  border-color: #ffd166;
  color: #ffd166;
}

.status-locked-btn {
  background: linear-gradient(135deg, #2b1d0c 0%, #4a2800 100%);
  border: 1.5px solid #ffb703;
  color: #ffd166;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.status-locked-btn:hover {
  background: linear-gradient(135deg, #ffd166 0%, #fb8500 100%);
  color: #070d14;
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.5);
}

.shop-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
}

.shop-tip {
  font-size: 12px;
  color: #94a3b8;
  font-style: italic;
}

/* SETTINGS / FORM CONTROLS */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  background: rgba(4, 10, 18, 0.85);
  border: 1px solid rgba(255, 209, 102, 0.3);
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

/* PIN DISPLAY */
.pin-display-card {
  background: rgba(0, 0, 0, 0.6);
  border: 2px dashed var(--gold-primary);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin: 16px 0;
}

.pin-code-large {
  font-family: 'JetBrains Mono', monospace;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 12px;
  color: var(--gold-primary);
  text-shadow: 0 0 20px var(--gold-glow);
}

.player-lobby-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  margin: 16px 0;
}

.lobby-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 30, 50, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 14px;
  border-radius: 6px;
}

/* COUNTDOWN SCREEN */
.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 13, 0.7);
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.countdown-overlay.active {
  opacity: 1;
}

.countdown-number {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 120px;
  font-weight: 900;
  color: var(--gold-primary);
  text-shadow: 0 0 40px rgba(255, 209, 102, 0.8), 0 0 80px rgba(214, 40, 40, 0.6);
  animation: countdownPop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes countdownPop {
  0% { transform: scale(0.4); opacity: 0; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1.0); opacity: 1; }
}

.countdown-sub {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 20px;
  letter-spacing: 4px;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* RESULTS PODIUM & BADGES */
.results-podium-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  margin: 16px 0 20px 0;
  height: 190px;
}

/* ----------------------------------------------------
   MODERN ARCADE VICTORY & RESULTS CEREMONY SCREEN
   ---------------------------------------------------- */
.modal-results-card {
  max-width: 680px;
  background: radial-gradient(circle at 50% 15%, #182e4b 0%, #08111d 85%) !important;
  border: 2px solid rgba(255, 209, 102, 0.45) !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(255, 209, 102, 0.2) !important;
  padding: 16px 22px !important;
  animation: modalPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  max-height: 94vh;
  box-sizing: border-box;
}

@keyframes modalPopIn {
  0% { transform: scale(0.88) translateY(15px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* RESULT HEADER */
.result-header-wrap {
  position: relative;
  margin-bottom: 22px;
  z-index: 2;
}

.result-epic-title {
  font-family: 'Outfit', 'Nunito', sans-serif;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin: 0;
  background: linear-gradient(180deg, #ffffff 0%, #ffd166 50%, #f77f00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.result-epic-sub {
  font-size: 12.5px;
  color: #94a3b8;
  margin: 2px 0 0 0;
  font-weight: 600;
}

/* 3D SEIERSPALL (PODIUM) */
.results-podium-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin: 6px 0 10px 0;
  height: 165px;
  position: relative;
}

/* Roterende solstråler bak gullpallen */
.podium-sunburst {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.22) 0%, rgba(255, 209, 102, 0) 70%);
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  animation: sunburstPulse 3s ease-in-out infinite alternate;
}

@keyframes sunburstPulse {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.5; }
  100% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.85; }
}

.results-podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 125px;
  position: relative;
  z-index: 2;
}

.res-podium-2 {
  animation: podiumSlam 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.12s both;
}

.res-podium-1 {
  width: 145px;
  animation: podiumSlamGold 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.28s both;
}

.res-podium-3 {
  animation: podiumSlam 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.18s both;
}

@keyframes podiumSlam {
  0% { transform: translateY(35px) scale(0.85); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes podiumSlamGold {
  0% { transform: translateY(-40px) scale(1.2); opacity: 0; }
  70% { transform: translateY(5px) scale(0.96); }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* AVATAR & KJØRETØY-DISC */
.res-podium-avatar {
  margin-bottom: 3px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.res-podium-trophy {
  width: 26px;
  height: 26px;
  object-fit: contain;
  margin-bottom: -5px;
  z-index: 4;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.7));
}

.trophy-bounce-gold {
  width: 32px;
  height: 32px;
  margin-bottom: -7px;
  filter: drop-shadow(0 0 10px rgba(255, 209, 102, 0.8));
  animation: floatMedal 2.2s ease-in-out infinite alternate;
}

/* Kjæletøy-pidestall / disc */
.res-podium-disc {
  width: 74px;
  height: 44px;
  border-radius: 10px;
  background: rgba(13, 27, 42, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.disc-gold {
  border-color: #ffd166;
  background: radial-gradient(circle at 50% 40%, rgba(255, 209, 102, 0.25) 0%, rgba(13, 27, 42, 0.85) 90%);
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.45);
}

.disc-silver {
  border-color: #cbd5e1;
  background: radial-gradient(circle at 50% 40%, rgba(203, 213, 225, 0.2) 0%, rgba(13, 27, 42, 0.85) 90%);
}

.disc-bronze {
  border-color: #d97706;
  background: radial-gradient(circle at 50% 40%, rgba(217, 119, 6, 0.2) 0%, rgba(13, 27, 42, 0.85) 90%);
}

.res-podium-boat {
  width: 56px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
  transition: transform 0.2s ease;
}

/* "DEG"-pill tag */
.res-podium-you {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: #10b981;
  color: #ffffff;
  font-family: 'Outfit', 'Nunito', sans-serif;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 6px;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
  z-index: 5;
  animation: pulseGlowGreen 1.8s infinite alternate;
}

@keyframes pulseGlowGreen {
  0% { transform: scale(1); box-shadow: 0 0 5px rgba(16, 185, 129, 0.6); }
  100% { transform: scale(1.08); box-shadow: 0 0 12px rgba(16, 185, 129, 0.95); }
}

.res-podium-name {
  font-weight: 700;
  font-size: 11.5px;
  color: #f1f5f9;
  margin-top: 3px;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.res-winner-name {
  font-family: 'Outfit', 'Nunito', sans-serif;
  color: #ffd166;
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.5);
}

.res-podium-wpm {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 8px;
  margin-top: 1px;
  display: inline-block;
}

.res-winner-wpm {
  color: #070d14;
  background: #ffd166;
  font-weight: 900;
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.5);
}

/* PODIUM PILLARS */
.res-podium-pillar {
  width: 100%;
  border-radius: 10px 10px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-bottom: none;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.35);
  position: relative;
  overflow: hidden;
}

.res-podium-pillar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.5);
}

.pillar-gold {
  height: 75px;
  background: linear-gradient(180deg, #ffd166 0%, #f77f00 70%, #d62828 100%);
  border-color: #ffe6a7;
  box-shadow: 0 0 24px rgba(255, 209, 102, 0.45), inset 0 2px 8px rgba(255, 255, 255, 0.5);
}

.pillar-gold .pillar-num,
.pillar-gold .pillar-label {
  color: #070d14;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.pillar-silver {
  height: 52px;
  background: linear-gradient(180deg, #e2e8f0 0%, #94a3b8 70%, #475569 100%);
  border-color: #f1f5f9;
}

.pillar-silver .pillar-num {
  color: #0f172a;
}

.pillar-silver .pillar-label {
  color: #1e293b;
}

.pillar-bronze {
  height: 38px;
  background: linear-gradient(180deg, #f59e0b 0%, #b45309 70%, #78350f 100%);
  border-color: #fcd34d;
}

.pillar-bronze .pillar-num,
.pillar-bronze .pillar-label {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.pillar-num {
  font-family: 'Outfit', 'Nunito', sans-serif;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.pillar-label {
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-top: 1px;
}

/* STATISTIKK GRID */
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0;
}

.result-card {
  background: rgba(13, 27, 42, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.result-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 209, 102, 0.4);
}

.result-card-icon {
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-wpm .result-card-icon {
  background: rgba(0, 245, 212, 0.15);
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.2);
}

.stat-card-acc .result-card-icon {
  background: rgba(6, 214, 160, 0.15);
  box-shadow: 0 0 10px rgba(6, 214, 160, 0.2);
}

.stat-card-time .result-card-icon {
  background: rgba(255, 209, 102, 0.15);
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.2);
}

.result-card-content {
  flex: 1;
  overflow: hidden;
}

.result-card-val {
  font-family: 'Outfit', 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.1;
}

.result-card-val small {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  margin-left: 2px;
}

.result-card-lbl {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

.result-card-sub {
  font-size: 9px;
  font-weight: 800;
  color: #06d6a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* BLOOKET LOOT & REWARDS CARD */
.results-rewards-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.12) 0%, rgba(13, 27, 42, 0.9) 100%);
  border: 1.5px solid rgba(255, 209, 102, 0.4);
  border-radius: 12px;
  padding: 6px 12px;
  margin: 6px 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  text-align: left;
}

.results-chest-wrap {
  position: relative;
  width: 50px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chest-halo-beam {
  position: absolute;
  width: 70px;
  height: 70px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.4) 0%, rgba(255, 209, 102, 0) 70%);
  border-radius: 50%;
  animation: chestHaloSpin 6s linear infinite;
}

@keyframes chestHaloSpin {
  0% { transform: scale(0.9) rotate(0deg); }
  50% { transform: scale(1.1) rotate(180deg); }
  100% { transform: scale(0.9) rotate(360deg); }
}

.results-chest-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.8));
  animation: chestBounce 1s cubic-bezier(0.34, 1.56, 0.64, 1) infinite alternate;
}

@keyframes chestBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px) scale(1.05); }
}

.rewards-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rewards-counters-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.rewards-col {
  display: flex;
  flex-direction: column;
}

.rewards-val {
  font-family: 'Outfit', 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ffd166;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.5);
}

.reward-coin-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(255, 209, 102, 0.6));
}

.reward-star-icon {
  font-size: 15px;
  filter: drop-shadow(0 0 5px rgba(255, 209, 102, 0.6));
}

.rewards-lbl {
  font-size: 9px;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* XP PROGRESSION BAR */
.results-xp-progression {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.xp-prog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9.5px;
  font-weight: 800;
}

.xp-level-badge {
  color: #ffd166;
  background: rgba(255, 209, 102, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
}

.xp-prog-text {
  color: #94a3b8;
}

.xp-prog-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.xp-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #06d6a0 100%);
  border-radius: 5px;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.xp-prog-shine {
  position: absolute;
  top: 0;
  left: -50%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: skewX(-20deg);
  animation: shineMove 2s infinite;
}

@keyframes shineMove {
  0% { left: -50%; }
  100% { left: 150%; }
}

/* RESULTS ACHIEVEMENTS / BADGES */
.results-achievements-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 5px 0 3px 0;
}

.res-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 14px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: rgba(13, 27, 42, 0.85);
  border: 1px solid rgba(255, 209, 102, 0.3);
  color: var(--text-main);
  animation: badgePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.res-badge-gold {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.25), rgba(251, 133, 0, 0.25));
  border-color: #ffd166;
  color: #ffd166;
}

.res-badge-ghost {
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.25), rgba(0, 180, 216, 0.25));
  border-color: #00f5d4;
  color: #00f5d4;
}

.res-badge-precision {
  background: linear-gradient(135deg, rgba(6, 214, 160, 0.25), rgba(17, 138, 178, 0.25));
  border-color: #06d6a0;
  color: #06d6a0;
}

.res-badge-berserk {
  background: linear-gradient(135deg, rgba(255, 112, 0, 0.25), rgba(214, 40, 40, 0.25));
  border-color: #ff9f1c;
  color: #ff9f1c;
}

/* ACTIONS / BUTTONS */
.results-actions-wrap {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}

.btn-result-epic {
  font-size: 13.5px !important;
  font-weight: 900 !important;
  padding: 9px 20px !important;
  background: linear-gradient(180deg, #ff7b00 0%, #e63946 100%) !important;
  border: 2px solid #ffba08 !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.5), 0 0 12px rgba(255, 186, 8, 0.3) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  animation: pulseButton 2s infinite alternate;
}

@keyframes pulseButton {
  0% { transform: scale(1); box-shadow: 0 4px 16px rgba(230, 57, 70, 0.5); }
  100% { transform: scale(1.03); box-shadow: 0 6px 20px rgba(230, 57, 70, 0.7), 0 0 16px rgba(255, 186, 8, 0.5); }
}

.btn-result-epic:hover {
  transform: translateY(-2px) scale(1.04) !important;
}

.btn-result-epic:active {
  transform: translateY(1px) scale(0.98) !important;
}

.btn-result-subtle {
  font-size: 13px !important;
  padding: 9px 16px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 12px !important;
  color: #cbd5e1 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: background 0.15s, border-color 0.15s !important;
}

.btn-result-subtle:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  color: #ffffff !important;
}

.btn-kbd-hint {
  font-size: 9px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  padding: 1px 4px;
  color: rgba(255, 255, 255, 0.85);
  margin-left: 3px;
}

/* WALLET & ECONOMY DISPLAY IN HEADER / PORTAL */
.ui-coin-icon {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  object-fit: contain;
  vertical-align: -3px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  display: inline-block;
}

.user-economy-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(13, 27, 42, 0.85);
  border: 1.5px solid rgba(255, 209, 102, 0.4);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.user-coins-display {
  color: #ffd166;
  display: flex;
  align-items: center;
  gap: 5px;
}

.user-xp-display {
  color: #48cae4;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* RESULTS GRID */
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0;
}

.result-card {
  background: rgba(8, 20, 36, 0.8);
  border: 1px solid rgba(255, 209, 102, 0.25);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.result-card-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-primary);
}

.result-card-lbl {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 4px;
}


/* STORSKJERM / LÆRERMODUS (PROJECTOR & SMARTBOARD) */
.teacher-fullscreen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, #0d2238 0%, #06111e 70%, #03080f 100%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.teacher-header {
  height: 70px;
  background: rgba(4, 11, 20, 0.9);
  border-bottom: 2px solid rgba(255, 209, 102, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  backdrop-filter: blur(10px);
}

.teacher-lobby-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 40px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.big-pin-banner {
  background: linear-gradient(135deg, rgba(16, 36, 61, 0.9) 0%, rgba(8, 20, 36, 0.95) 100%);
  border: 3px solid var(--gold-primary);
  border-radius: 16px;
  padding: 24px 60px;
  text-align: center;
  box-shadow: 0 0 50px rgba(255, 209, 102, 0.25), inset 0 0 30px rgba(255, 209, 102, 0.1);
  margin-bottom: 28px;
}

.big-pin-instruction {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.big-pin-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 84px;
  font-weight: 900;
  letter-spacing: 18px;
  color: var(--gold-primary);
  text-shadow: 0 0 30px rgba(255, 209, 102, 0.8), 0 0 60px rgba(251, 133, 0, 0.5);
  line-height: 1;
  margin: 8px 0;
}

.big-pin-url {
  font-size: 16px;
  color: #48cae4;
  letter-spacing: 1px;
}

.students-roster-section {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 420px;
}

.roster-title {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 20px;
  color: var(--gold-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  width: 100%;
  overflow-y: auto;
  padding: 10px;
  background: rgba(3, 8, 15, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.student-roster-card {
  background: rgba(14, 30, 50, 0.85);
  border: 1px solid rgba(255, 209, 102, 0.3);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1.0); opacity: 1; }
}

.student-roster-card img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  transform: scaleX(-1);
}

.student-roster-name {
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-roster-clan {
  font-size: 10px;
  color: var(--text-dim);
}

/* STORSKJERM RACE VIEW */
.spectator-race-container {
  flex: 1;
  position: relative;
  display: flex;
}

.spectator-canvas-area {
  flex: 1;
  height: 100%;
  position: relative;
}

.spectator-leaderboard-sidebar {
  width: 320px;
  background: rgba(5, 13, 24, 0.95);
  border-left: 2px solid rgba(255, 209, 102, 0.25);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.spectator-table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(14, 30, 50, 0.6);
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease;
}

.spectator-table-row.rank-1 {
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.2) 0%, rgba(14, 30, 50, 0.6) 100%);
  border-color: var(--gold-primary);
}

/* KAHOOT-STYLE PODIUM */
.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
  margin: 30px 0;
  height: 280px;
}

.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 170px;
  position: relative;
}

.podium-avatar {
  margin-bottom: 12px;
  text-align: center;
}

.podium-avatar img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  transform: scaleX(-1);
  filter: drop-shadow(0 0 10px rgba(255, 209, 102, 0.5));
}

.podium-pillar {
  width: 100%;
  border-radius: 8px 8px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.podium-1 {
  height: 180px;
  background: linear-gradient(180deg, #ffd166 0%, #fb8500 100%);
  border-color: #ffe6a7;
  box-shadow: 0 0 30px rgba(255, 209, 102, 0.4);
}

.podium-2 {
  height: 130px;
  background: linear-gradient(180deg, #adb5bd 0%, #6c757d 100%);
  border-color: #dee2e6;
}

.podium-3 {
  height: 90px;
  background: linear-gradient(180deg, #cd7f32 0%, #99582a 100%);
  border-color: #dda15e;
}

/* HOVEDPORTAL & TEMA-VELGER */
/* ====================================================
   HOVEDPORTAL & SPILLMENY (ARKADE-STIL)
   ==================================================== */
.portal-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 10px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.45s ease-in-out, background-color 0.45s ease-in-out;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.portal-overlay::-webkit-scrollbar {
  display: none;
}

.portal-overlay,
.portal-overlay[data-active-theme="neutral"] {
  background: 
    radial-gradient(circle at 50% 12%, rgba(56, 95, 170, 0.38) 0%, rgba(18, 34, 65, 0.8) 45%, rgba(6, 12, 24, 0.98) 75%, #03060f 100%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 209, 102, 0.05) 0%, transparent 55%),
    #050a14;
  background-size: 100% 100%;
}

.portal-overlay[data-active-theme="viking"] {
  background-image: radial-gradient(circle at 50% 30%, rgba(14, 34, 56, 0.78) 0%, rgba(6, 16, 28, 0.94) 70%, rgba(2, 6, 11, 0.98) 100%), url('/ordkapplop/background_fjord.jpg');
}

.portal-overlay[data-active-theme="ww2"] {
  background-image: radial-gradient(circle at 50% 30%, rgba(35, 48, 22, 0.78) 0%, rgba(14, 22, 10, 0.94) 70%, rgba(3, 8, 3, 0.98) 100%), url('/ordkapplop/background_ww2.jpg');
}

.portal-overlay[data-active-theme="space"] {
  background-image: radial-gradient(circle at 50% 30%, rgba(26, 18, 56, 0.78) 0%, rgba(8, 6, 26, 0.94) 70%, rgba(2, 2, 8, 0.98) 100%), url('/ordkapplop/background_space.jpg');
}

.menu-step {
  display: flex;
  flex-direction: column;
  max-width: 980px;
  width: 100%;
  margin: auto 0;
  box-sizing: border-box;
  animation: menuFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.portal-header {
  text-align: center;
  margin-bottom: 12px;
  position: relative;
}

.portal-title {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #ffd166 0%, #ffb703 50%, #fb8500 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  text-shadow: 0 0 20px rgba(255, 183, 3, 0.4);
}

/* ----------------------------------------------------
   SKJERM 2: TEMA-TOPP-BAR (KOMPAKT & SYMMETRISK)
   ---------------------------------------------------- */
.theme-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 6px;
}

.btn-back-arcade {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
  color: #e2e8f0 !important;
  padding: 5px 14px !important;
  border-radius: 20px !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-back-arcade:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: #ffd166 !important;
  color: #ffd166 !important;
  transform: translateX(-2px);
}

.theme-step-title-group {
  text-align: center;
}

.theme-step-title {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  margin: 0;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffd166 0%, #ffb703 50%, #fb8500 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 183, 3, 0.35);
}

.theme-step-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  display: block;
  margin-top: 1px;
  letter-spacing: 0.3px;
}

.active-mode-badge {
  background: rgba(255, 209, 102, 0.12);
  border: 1.5px solid rgba(255, 209, 102, 0.35);
  color: #ffd166;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.15);
}

.mode-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 8px #ffd166;
}

/* ----------------------------------------------------
   SKJERM 2: VISUELLE TEMAKORT (KOMPAKTE)
   ---------------------------------------------------- */
.theme-cards-epic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 4px 0 6px 0;
  width: 100%;
}

.theme-epic-card {
  background: linear-gradient(160deg, rgba(16, 34, 58, 0.92) 0%, rgba(6, 15, 26, 0.98) 100%);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  outline: none;
}

.theme-epic-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 209, 102, 0.6);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65), 0 0 18px rgba(255, 209, 102, 0.25);
}

.theme-epic-card.active {
  border-color: #ffd166;
  background: linear-gradient(160deg, rgba(28, 54, 88, 0.95) 0%, rgba(10, 22, 38, 0.98) 100%);
  box-shadow: 0 0 24px rgba(255, 209, 102, 0.45), 0 10px 24px rgba(0, 0, 0, 0.65);
  transform: translateY(-2px) scale(1.01);
}

.theme-card-banner {
  height: 76px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.banner-viking {
  background: linear-gradient(180deg, rgba(14, 34, 56, 0.3) 0%, rgba(6, 16, 28, 0.88) 100%), url('/ordkapplop/background_fjord.jpg') center/cover no-repeat;
}

.banner-ww2 {
  background: linear-gradient(180deg, rgba(35, 48, 22, 0.3) 0%, rgba(14, 22, 10, 0.88) 100%), url('/ordkapplop/background_ww2.jpg') center/cover no-repeat;
}

.banner-space {
  background: linear-gradient(180deg, rgba(26, 18, 56, 0.3) 0%, rgba(8, 6, 26, 0.88) 100%), url('/ordkapplop/background_space.jpg') center/cover no-repeat;
}

.theme-card-preview-art {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.theme-card-preview-art img {
  max-height: 54px;
  max-width: 85%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
  transition: transform 0.25s ease;
}

.theme-epic-card:hover .theme-card-preview-art img {
  transform: scale(1.08);
}

.theme-card-body {
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}

.theme-card-title {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 14.5px;
  font-weight: 900;
  color: #ffffff;
  margin: 0;
  letter-spacing: 1px;
}

.theme-epic-card.active .theme-card-title {
  color: #ffd166;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.6);
}

/* ----------------------------------------------------
   TEKSTVELGER-KORT (PÅ SKJERM 2)
   ---------------------------------------------------- */
.theme-text-selector-card {
  width: 100%;
  background: rgba(10, 20, 36, 0.85);
  border: 1.5px solid rgba(255, 209, 102, 0.35);
  border-radius: 12px;
  padding: 8px 14px;
  margin: 4px 0 6px 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-sizing: border-box;
}

.theme-text-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.theme-text-header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #ffd166;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.3px;
}

.length-label-text {
  font-size: 11px;
  color: var(--text-dim);
  margin-right: 4px;
  align-self: center;
}

.theme-topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.topic-pill-btn {
  background: rgba(13, 27, 46, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 4px 11px;
  border-radius: 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.topic-pill-btn:hover {
  background: rgba(30, 58, 95, 0.9);
  border-color: #ffd166;
  color: #ffd166;
  transform: translateY(-1px);
}

.topic-pill-btn.active {
  background: linear-gradient(135deg, #ffd166 0%, #fb8500 100%);
  border-color: #ffe6a7;
  color: #070d14;
  font-weight: 900;
  box-shadow: 0 2px 10px rgba(255, 209, 102, 0.35);
}

/* CUSTOM TEXT INPUT BOX */
.custom-text-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 8px 0;
  animation: fadeIn 0.2s ease;
}

.custom-text-textarea {
  width: 100%;
  height: 65px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 209, 102, 0.4);
  background: rgba(5, 12, 22, 0.9);
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.45;
  resize: vertical;
  box-sizing: border-box;
}

.custom-text-textarea:focus {
  outline: none;
  border-color: #ffd166;
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.3);
}

.custom-text-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
}

#custom-text-word-count {
  font-weight: 800;
  color: #ffd166;
}

/* LIVE TEXT PREVIEW SNIPPET */
.text-preview-snippet {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: rgba(5, 12, 22, 0.65);
  border-radius: 6px;
  border-left: 3px solid #ffd166;
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-preview-icon {
  font-style: normal;
  font-size: 12px;
}

.text-preview-content {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----------------------------------------------------
   SKJERM 2: BUNN-DOCK (FULLSKJERM, START KNAPP, FARTØY)
   ---------------------------------------------------- */
.theme-step-dock {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 4px;
  padding: 2px 0;
}

.btn-dock-ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  padding: 6px 16px;
  border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-dock-ghost:hover {
  background: rgba(255, 209, 102, 0.12);
  border-color: #ffd166;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-epic-start {
  font-family: 'Outfit', sans-serif;
  font-size: 15px !important;
  font-weight: 900 !important;
  letter-spacing: 1.5px !important;
  padding: 9px 40px !important;
  border-radius: 30px !important;
  box-shadow: 0 4px 16px rgba(251, 133, 0, 0.5), 0 0 14px rgba(255, 209, 102, 0.4) !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-epic-start:hover {
  transform: scale(1.03) translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(255, 209, 102, 0.65) !important;
}

.btn-epic-start .btn-arrow {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.btn-epic-start:hover .btn-arrow {
  transform: translateX(3px);
}

.quick-length-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 20px 0 6px 0;
  padding: 8px 18px;
  background: rgba(14, 30, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.quick-length-label {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 12px;
  font-weight: 800;
  color: #ffd166;
}

.length-pills {
  display: flex;
  gap: 6px;
}

.length-pill-btn {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.length-pill-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 209, 102, 0.5);
}

.length-pill-btn.active {
  background: #ffd166;
  color: #070d14;
  border-color: #ffd166;
  font-weight: 900;
}

/* TIME DURATION PILLS (2, 5, 10, 15 MIN) */
.time-duration-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  width: 100%;
  margin: 6px 0 12px 0;
}

.time-dur-pill {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-dim);
  padding: 5px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.time-dur-pill:hover {
  border-color: #ffd166;
  color: #ffffff;
  background: rgba(255, 209, 102, 0.1);
}

.time-dur-pill.active {
  background: #ffd166;
  color: #070d14;
  border-color: #ffd166;
  font-weight: 900;
}

/* ====================================================
   ARCADE LOBBY HERO & MODES GRID
   ==================================================== */
.lobby-hero-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 10px;
  position: relative;
}

.lobby-game-tag {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffd166;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.35);
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 6px;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.15);
}

.lobby-main-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 3px;
  margin: 0;
  line-height: 1.05;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 2px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.9));
}

.logo-txt-word {
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
}

.logo-txt-race {
  background: linear-gradient(180deg, #ffe066 0%, #ffd166 40%, #f77f00 80%, #d62828 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(255, 209, 102, 0.6);
}

.lobby-tagline {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.4px;
  margin: 4px 0 8px 0;
}

.lobby-wallet-pill {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 209, 102, 0.45);
  border-radius: 30px;
  padding: 4px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 209, 102, 0.15);
}

.wallet-separator {
  color: rgba(255, 255, 255, 0.25);
  margin: 0 6px;
}

.lobby-section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 10px auto;
}

.lobby-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.lobby-divider-text {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: #64748b;
  text-transform: uppercase;
}

/* MODES GRID */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
}

.mode-card {
  background: linear-gradient(175deg, rgba(20, 32, 54, 0.94) 0%, rgba(10, 18, 32, 0.98) 100%);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.28);
  border-bottom: 6px solid rgba(0, 0, 0, 0.65);
  border-radius: 20px;
  padding: 16px 12px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: space-between;
  min-height: 250px;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.18s ease;
  position: relative;
  overflow: hidden;
  outline: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.mode-card-clickable {
  cursor: pointer;
}

/* Ambient glow on cards */
.mode-card-aura {
  position: absolute;
  top: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  filter: blur(35px);
  pointer-events: none;
  opacity: 0.35;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.aura-quick {
  background: #ffb703;
}

.aura-classroom {
  background: #00b4d8;
}

.aura-time {
  background: #06d6a0;
}

.aura-campaign {
  background: #9d4edd;
}

.aura-survival {
  background: #ff0054;
}

.mode-card:hover .mode-card-aura {
  opacity: 0.75;
  transform: scale(1.3);
}

/* Per-card border highlights on hover (Blooket 3D tactile lift) */
.mode-card-quick:hover {
  border-color: #ffd166;
  border-bottom-color: #b35900;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.85), 0 0 24px rgba(255, 209, 102, 0.4);
  transform: translateY(-6px) scale(1.02);
}

.mode-card-classroom:hover {
  border-color: #48cae4;
  border-bottom-color: #0077b6;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.85), 0 0 24px rgba(72, 202, 228, 0.4);
  transform: translateY(-6px) scale(1.02);
}

.mode-card-time:hover {
  border-color: #06d6a0;
  border-bottom-color: #035e47;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.85), 0 0 24px rgba(6, 214, 160, 0.4);
  transform: translateY(-6px) scale(1.02);
}

.mode-card-campaign:hover {
  border-color: #c77dff;
  border-bottom-color: #521980;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.85), 0 0 24px rgba(199, 125, 255, 0.4);
  transform: translateY(-6px) scale(1.02);
}

.mode-card-survival:hover {
  border-color: #ef476f;
  border-bottom-color: #990026;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.85), 0 0 28px rgba(239, 71, 111, 0.5);
  transform: translateY(-6px) scale(1.02);
}

.mode-badge-wrap {
  width: 74px;
  height: 74px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.mode-badge-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.85));
  transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mode-card:hover .mode-badge-img {
  transform: scale(1.1) translateY(-2px);
}

.mode-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  margin-bottom: 2px;
  z-index: 2;
}

.mode-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  line-height: 1.3;
  color: #94a3b8;
  margin-bottom: 8px;
  padding: 0 4px;
  z-index: 2;
}

/* DUAL BUTTONS IN CLASSROOM */
.mode-dual-btns {
  display: flex;
  gap: 8px;
  width: 100%;
  z-index: 2;
}

/* TIME PILLS */
.time-duration-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 100%;
  margin-bottom: 10px;
  z-index: 2;
}

.time-dur-pill {
  background: rgba(10, 18, 32, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-bottom: 3.5px solid rgba(0, 0, 0, 0.7);
  color: #94a3b8;
  padding: 6px 2px 4px 2px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.12s, color 0.12s;
}

.time-dur-pill:hover {
  border-color: #06d6a0;
  border-bottom-color: #035e47;
  color: #ffffff;
  transform: translateY(-2px);
}

.time-dur-pill.active {
  background: #06d6a0;
  border-color: #06d6a0;
  border-bottom-color: #035e47;
  color: #04101e;
  font-weight: 900;
  transform: translateY(1px);
}

/* 3D TACTILE ARCADE BUTTONS */
.btn-arcade-action {
  width: 100%;
  padding: 11px 14px 10px 14px;
  border-radius: 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
  text-transform: uppercase;
}

/* Button variants */
.btn-arcade-quick {
  background: linear-gradient(180deg, #ffd166 0%, #f77f00 100%);
  color: #070d14;
  box-shadow: 0 5px 0 #b35900, 0 8px 16px rgba(247, 127, 0, 0.4);
}

.btn-arcade-quick:hover {
  background: linear-gradient(180deg, #ffe08a 0%, #ff8c1a 100%);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #b35900, 0 10px 20px rgba(247, 127, 0, 0.6);
}

.btn-arcade-quick:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #b35900;
}

.btn-arcade-teacher {
  flex: 1;
  background: linear-gradient(180deg, #48cae4 0%, #0077b6 100%);
  color: #ffffff;
  box-shadow: 0 5px 0 #005080, 0 8px 16px rgba(0, 119, 182, 0.4);
  font-size: 12px;
  padding: 11px 6px 10px 6px;
}

.btn-arcade-teacher:hover {
  background: linear-gradient(180deg, #6adef7 0%, #0088cc 100%);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #005080, 0 10px 20px rgba(0, 119, 182, 0.6);
}

.btn-arcade-teacher:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #005080;
}

.btn-arcade-student {
  flex: 1;
  background: linear-gradient(180deg, #1e3a5f 0%, #0d1e33 100%);
  border: 1.5px solid rgba(72, 202, 228, 0.4);
  color: #ffffff;
  box-shadow: 0 5px 0 #060e18, 0 8px 16px rgba(0, 0, 0, 0.5);
  font-size: 12px;
  padding: 10px 6px 9px 6px;
}

.btn-arcade-student:hover {
  background: linear-gradient(180deg, #274b7a 0%, #132b49 100%);
  border-color: #48cae4;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #060e18, 0 10px 20px rgba(72, 202, 228, 0.3);
}

.btn-arcade-student:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #060e18;
}

.btn-arcade-time {
  background: linear-gradient(180deg, #06d6a0 0%, #058c69 100%);
  color: #04101e;
  box-shadow: 0 5px 0 #035e47, 0 8px 16px rgba(6, 214, 160, 0.4);
}

.btn-arcade-time:hover {
  background: linear-gradient(180deg, #1ae3ad 0%, #069e77 100%);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #035e47, 0 10px 20px rgba(6, 214, 160, 0.6);
}

.btn-arcade-time:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #035e47;
}

.btn-arcade-campaign {
  background: linear-gradient(180deg, #c77dff 0%, #7b2cbf 100%);
  color: #ffffff;
  box-shadow: 0 5px 0 #521980, 0 8px 16px rgba(123, 44, 191, 0.4);
}

.btn-arcade-campaign:hover {
  background: linear-gradient(180deg, #d494ff 0%, #8c36d6 100%);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #521980, 0 10px 20px rgba(123, 44, 191, 0.6);
}

.btn-arcade-campaign:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #521980;
}

.btn-arcade-survival {
  background: linear-gradient(180deg, #ff0054 0%, #d90429 100%);
  color: #ffffff;
  box-shadow: 0 5px 0 #900, 0 8px 16px rgba(217, 4, 41, 0.4);
}

.btn-arcade-survival:hover {
  background: linear-gradient(180deg, #ff2a75 0%, #ef233c 100%);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #900, 0 10px 20px rgba(239, 35, 60, 0.6);
}

.btn-arcade-survival:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #900;
}

.mode-ribbon-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  background: rgba(255, 0, 84, 0.25);
  border: 1px solid #ff0054;
  color: #ffccd5;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
}

/* SURVIVAL DANGER VIGNETTE */
.survival-danger-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.15s ease-out;
  box-shadow: inset 0 0 100px rgba(239, 71, 111, 0.8), inset 0 0 40px rgba(255, 0, 84, 0.9);
}

.survival-danger-vignette.active-danger {
  opacity: 1;
  animation: dangerPulse 0.6s infinite alternate;
}

.survival-danger-vignette.critical-danger {
  opacity: 1;
  box-shadow: inset 0 0 160px rgba(255, 0, 0, 0.95), inset 0 0 70px rgba(255, 0, 84, 1);
  animation: criticalPulse 0.3s infinite alternate;
}

@keyframes dangerPulse {
  0% { opacity: 0.5; }
  100% { opacity: 0.85; }
}

@keyframes criticalPulse {
  0% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.02); }
}

/* THREAT SHAKE EFFECT */
.threat-shake {
  animation: threatShakeAnim 0.18s infinite;
}

@keyframes threatShakeAnim {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, -2px); }
  100% { transform: translate(2px, 1px); }
}

/* SURVIVAL DANGER BAR (HUD) */
.survival-danger-bar {
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid rgba(239, 71, 111, 0.5);
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 15px rgba(239, 71, 111, 0.2);
}

.survival-threat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #f1faee;
}

.survival-threat-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ef476f;
  letter-spacing: 0.5px;
}

.survival-threat-timer {
  display: flex;
  align-items: center;
}

.survival-meter-track {
  position: relative;
  width: 100%;
  height: 14px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.survival-meter-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #06d6a0 0%, #ffd166 50%, #ef476f 100%);
  border-radius: 999px;
  transition: width 0.1s linear, filter 0.2s ease;
}

.survival-meter-fill.in-danger {
  filter: drop-shadow(0 0 8px #ef476f);
}

.survival-threat-dist-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

/* LOBBY BOTTOM DOCK */
.lobby-bottom-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.btn-dock-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 8px 18px;
  border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-dock-item:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #ffffff;
  border-color: rgba(255, 209, 102, 0.4);
  transform: translateY(-1px);
}

@media (max-width: 820px) {
  .lobby-main-logo {
    font-size: 32px;
  }
  .modes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .portal-title {
    font-size: 26px;
  }
}

@media (max-width: 820px) {
  .theme-cards-epic-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .portal-title {
    font-size: 26px;
  }
}

/* ====================================================
   LÆRERENS KONTROLLPANEL FOR SPILLMODUS & TID
   ==================================================== */
.teacher-mode-control-panel {
  background: rgba(11, 25, 44, 0.94);
  border: 1.5px solid rgba(255, 209, 102, 0.45);
  border-radius: 16px;
  padding: 14px 20px;
  margin-top: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 209, 102, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 660px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.teacher-mode-selector-tabs {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.teacher-mode-tab {
  flex: 1;
  max-width: 260px;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: #cbd5e1;
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.teacher-mode-tab:hover {
  background: rgba(255, 209, 102, 0.12);
  border-color: rgba(255, 209, 102, 0.5);
  color: #ffffff;
}

.teacher-mode-tab.active {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.25) 0%, rgba(251, 133, 0, 0.2) 100%);
  border-color: #ffd166;
  color: #ffd166;
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.35);
}

.teacher-options-view {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.teacher-ctrl-row {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.teacher-ctrl-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 180px;
}

.teacher-ctrl-lbl {
  font-family: 'Outfit', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.teacher-ctrl-select {
  width: 100%;
  padding: 8px 12px;
  background: rgba(5, 12, 22, 0.95);
  border: 1.5px solid rgba(255, 209, 102, 0.35);
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  outline: none;
}

.teacher-ctrl-select:focus {
  border-color: #ffd166;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
}

.teacher-time-config-card {
  background: rgba(5, 12, 22, 0.7);
  border: 1px solid rgba(255, 209, 102, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.time-stepper-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.time-stepper-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a5f 0%, #0d1e33 100%);
  border: 2px solid rgba(255, 209, 102, 0.5);
  color: #ffd166;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.time-stepper-btn:hover {
  background: linear-gradient(135deg, #ffd166 0%, #fb8500 100%);
  color: #070d14;
  border-color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.6);
}

.time-stepper-btn:active {
  transform: scale(0.95);
}

.time-stepper-readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 110px;
}

.time-readout-num {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  color: #ffd166;
  text-shadow: 0 0 15px rgba(255, 209, 102, 0.5);
}

.time-readout-unit {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.time-rec-badge {
  margin-top: 2px;
  font-family: 'Outfit', sans-serif;
  font-size: 9.5px;
  font-weight: 900;
  color: #070d14;
  background: linear-gradient(135deg, #ffd166 0%, #fb8500 100%);
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.4);
}

.teacher-time-quick-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.teacher-time-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-time-pill:hover {
  background: rgba(255, 209, 102, 0.15);
  border-color: #ffd166;
  color: #ffd166;
}

.teacher-time-pill.active {
  background: linear-gradient(135deg, #ffd166 0%, #fb8500 100%);
  border-color: #ffffff;
  color: #070d14;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
}

.btn-teacher-launch {
  font-family: 'Outfit', sans-serif;
  font-size: 16px !important;
  font-weight: 900 !important;
  letter-spacing: 1px !important;
  padding: 11px 32px !important;
  border-radius: 28px !important;
  margin-top: 2px;
  box-shadow: 0 6px 20px rgba(251, 133, 0, 0.5), 0 0 16px rgba(255, 209, 102, 0.4) !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-teacher-launch:hover {
  transform: scale(1.03) translateY(-2px) !important;
  box-shadow: 0 10px 28px rgba(255, 209, 102, 0.65) !important;
}

/* Storskjerm Tidsur */
.teacher-timer-card {
  background: rgba(11, 25, 44, 0.95);
  border: 2px solid #ffd166;
  border-radius: 12px;
  padding: 8px 16px;
  text-align: center;
  box-shadow: 0 0 20px rgba(255, 209, 102, 0.3);
  margin-top: 8px;
}

.timer-card-lbl {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 900;
  color: #ffd166;
  letter-spacing: 1px;
}

.timer-card-clock {
  font-family: 'Outfit', 'Nunito', sans-serif; font-weight: 800;
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(255, 209, 102, 0.6);
}

/* LIVE KLASSEROM REAKSJONSKNAPPER (BLOOKET/KAHOOT STYLE) */
.classroom-reactions-bar {
  position: absolute;
  bottom: 12px;
  right: 14px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(4, 10, 20, 0.78);
  backdrop-filter: blur(8px);
  padding: 6px 10px;
  border-radius: 40px;
  border: 1.5px solid rgba(255, 209, 102, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.teacher-reactions-bar {
  bottom: 18px;
  right: 20px;
}

.btn-reaction {
  font-size: 21px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.14s ease, border-color 0.14s ease;
  user-select: none;
}

.btn-reaction:hover {
  transform: scale(1.28) translateY(-3px);
  background: rgba(255, 209, 102, 0.25);
  border-color: #ffd166;
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.5);
}

.btn-reaction:active {
  transform: scale(0.9) translateY(2px);
}

/* SEIERSSEREMONI: SKATTEKISTE & GULLGLØD */
.results-chest-wrap {
  position: relative;
  width: 120px;
  height: 94px;
  margin: 10px auto 6px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chest-halo-beam {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.5) 0%, rgba(251, 133, 0, 0.2) 50%, transparent 70%);
  animation: chestHaloRotate 6s linear infinite;
  pointer-events: none;
}

.results-chest-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 16px rgba(255, 209, 102, 0.7));
  animation: chestDropBounce 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
  z-index: 2;
}

@keyframes chestDropBounce {
  0% { transform: scale(0.2) translateY(-60px); opacity: 0; }
  60% { transform: scale(1.18) translateY(0); opacity: 1; }
  80% { transform: scale(0.94); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes chestHaloRotate {
  0% { transform: rotate(0deg) scale(1); opacity: 0.8; }
  50% { transform: rotate(180deg) scale(1.15); opacity: 1; }
  100% { transform: rotate(360deg) scale(1); opacity: 0.8; }
}

/* ====================================================
   ELEV-LOBBY OPPVARMING & STORSKJERM SHOWCASE
   ==================================================== */
.lobby-warmup-card {
  position: relative;
  background: linear-gradient(145deg, rgba(11, 25, 44, 0.96) 0%, rgba(5, 13, 25, 0.96) 100%);
  border: 1.5px solid rgba(255, 209, 102, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.lobby-warmup-card.tier-10 {
  border-color: #ffd166;
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.28);
}

.lobby-warmup-card.tier-20 {
  border-color: #ff6b35;
  box-shadow: 0 0 22px rgba(255, 107, 53, 0.4);
}

.lobby-warmup-card.tier-30 {
  border-color: #48cae4;
  box-shadow: 0 0 24px rgba(72, 202, 228, 0.45);
}

.lobby-warmup-card.tier-40 {
  border-color: #c77dff;
  box-shadow: 0 0 26px rgba(199, 125, 255, 0.5);
}

.lobby-warmup-card.tier-50 {
  border-color: #ffd166;
  box-shadow: 0 0 30px rgba(255, 209, 102, 0.65), inset 0 0 18px rgba(255, 209, 102, 0.15);
}

.lobby-warmup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.lobby-warmup-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: #ffd166;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lobby-warmup-badges {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lobby-warmup-count-pill {
  background: linear-gradient(135deg, #ffd166 0%, #fb8500 100%);
  color: #070d14;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
}

.lobby-warmup-class-pill {
  background: rgba(72, 202, 228, 0.15);
  border: 1px solid rgba(72, 202, 228, 0.4);
  color: #48cae4;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
}

.lobby-warmup-milestones {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.warmup-ms-chip {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #64748b;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.warmup-ms-chip.unlocked {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.25) 0%, rgba(251, 133, 0, 0.25) 100%);
  border-color: #ffd166;
  color: #ffd166;
  transform: scale(1.06);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.35);
}

.lobby-warmup-typing-box {
  position: relative;
  background: rgba(3, 8, 16, 0.92);
  border: 1.5px solid rgba(72, 202, 228, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: text;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lobby-warmup-typing-box:focus-within {
  border-color: #06d6a0;
  box-shadow: 0 0 14px rgba(6, 214, 160, 0.3);
}

.lobby-warmup-sentence {
  font-family: 'Nunito', 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  color: #94a3b8;
  user-select: none;
}

.lobby-warmup-hidden-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
}

.lobby-warmup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 11.5px;
  color: #94a3b8;
  gap: 8px;
}

.lobby-warmup-leader-mini {
  color: #ffd166;
  font-weight: 800;
  white-space: nowrap;
}

.lobby-warmup-fx-layer,
.teacher-lobby-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 30;
}

.warmup-fx-particle {
  position: absolute;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  pointer-events: none;
  animation: warmupParticleFloat 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

.teacher-milestone-toast {
  position: absolute;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(11, 25, 44, 0.96) 0%, rgba(25, 12, 44, 0.96) 100%);
  border: 2px solid #ffd166;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75), 0 0 24px rgba(255, 209, 102, 0.55);
  pointer-events: none;
  z-index: 40;
  animation: teacherToastFly 2.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  white-space: nowrap;
}

@keyframes warmupParticleFloat {
  0% { transform: translateY(10px) scale(0.4); opacity: 0; }
  20% { transform: translateY(-10px) scale(1.25); opacity: 1; }
  100% { transform: translateY(-85px) scale(0.9); opacity: 0; }
}

@keyframes teacherToastFly {
  0% { transform: translate(-50%, 30px) scale(0.5); opacity: 0; }
  18% { transform: translate(-50%, 0) scale(1.08); opacity: 1; }
  75% { transform: translate(-50%, -25px) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -65px) scale(0.85); opacity: 0; }
}

/* LÆRER STORSKJERM OPPVARMINGS-DASHBOARD */
.teacher-warmup-showcase {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
  width: 100%;
  max-width: 860px;
  margin: 0 auto 10px auto;
}

.teacher-warmup-stat-box,
.teacher-warmup-leader-box {
  background: rgba(8, 19, 36, 0.92);
  border: 1.5px solid rgba(255, 209, 102, 0.35);
  border-radius: 14px;
  padding: 10px 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.teacher-warmup-lbl {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffd166;
  margin-bottom: 4px;
}

.teacher-warmup-main-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.teacher-warmup-big-num {
  font-family: 'Outfit', sans-serif;
  font-size: 30px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 16px rgba(255, 209, 102, 0.6);
  line-height: 1;
}

.teacher-warmup-unit {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
}

.teacher-warmup-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.teacher-warmup-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #06d6a0 0%, #ffd166 50%, #ff4d6d 100%);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.6);
}

.teacher-warmup-leader-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

/* ELEV-KORT PÅ TAVLA: MILEPÆL-EFFEKT (10, 20, 30, 40, 50+ ORD) */
.student-roster-card {
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.student-roster-card.warmup-tier-10 {
  border-color: #ffd166 !important;
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.35);
}

.student-roster-card.warmup-tier-20 {
  border-color: #ff6b35 !important;
  box-shadow: 0 0 18px rgba(255, 107, 53, 0.5);
  background: linear-gradient(135deg, rgba(45, 18, 10, 0.9) 0%, rgba(16, 28, 48, 0.9) 100%) !important;
}

.student-roster-card.warmup-tier-30 {
  border-color: #48cae4 !important;
  box-shadow: 0 0 20px rgba(72, 202, 228, 0.6);
  background: linear-gradient(135deg, rgba(10, 35, 55, 0.95) 0%, rgba(18, 25, 55, 0.95) 100%) !important;
}

.student-roster-card.warmup-tier-40 {
  border-color: #c77dff !important;
  box-shadow: 0 0 22px rgba(199, 125, 255, 0.65);
  background: linear-gradient(135deg, rgba(38, 14, 60, 0.95) 0%, rgba(15, 25, 48, 0.95) 100%) !important;
}

.student-roster-card.warmup-tier-50 {
  border-color: #ffd166 !important;
  box-shadow: 0 0 26px rgba(255, 209, 102, 0.8), 0 0 12px rgba(255, 77, 109, 0.5);
  background: linear-gradient(135deg, rgba(55, 38, 8, 0.96) 0%, rgba(32, 14, 45, 0.96) 100%) !important;
  transform: scale(1.04);
}

.student-warmup-badge {
  margin-left: auto;
  font-family: 'Outfit', sans-serif;
  font-size: 11.5px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.16);
  border: 1px solid rgba(255, 209, 102, 0.45);
  color: #ffd166;
  white-space: nowrap;
}
