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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #14161a;
  font-family: "Trebuchet MS", Arial, sans-serif;
  color: #fef08a;
}

canvas {
  display: block;
}

.hidden {
  display: none !important;
}

button {
  font-family: inherit;
  border-radius: 0;
  border: 2px solid #000000;
  cursor: pointer;
  font-weight: 900;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.65;
  cursor: default;
}

.btn-gold {
  background: #9e9100;
  color: #fef08a;
  padding: 12px 16px;
  font-size: 16px;
}

.btn-gold:hover:not(:disabled) {
  background: #b8a900;
}

.btn-sec {
  background: #334155;
  color: #facc15;
  padding: 8px 14px;
  font-size: 14px;
}

.btn-sec:hover:not(:disabled) {
  background: #475569;
}

.btn-sec.muted {
  background: #7f1d1d;
  color: #fecaca;
}

.btn-sec.active-opt {
  background: #9e9100;
  color: #fef08a;
}

.btn-sec.active-opt:hover:not(:disabled) {
  background: #b8a900;
}

.btn-red {
  background: #7f1d1d;
  color: #fecaca;
  padding: 8px 14px;
  font-size: 14px;
}

.btn-red:hover:not(:disabled) {
  background: #991b1b;
  color: #ffffff;
}

.btn-close {
  width: 36px;
  height: 28px;
  padding: 0;
  background: rgba(55, 10, 10, 0.9);
  color: #ef4444;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  background: #7f1d1d;
  color: #ffffff;
}

/* ================================
   PRIMITIVE START MENU
   ================================ */
#title-screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #14161a;
  z-index: 20;
}

#title-screen.active {
  display: flex;
}

.menu-window {
  width: 780px;
  max-width: 96vw;
  background: rgba(18, 18, 22, 0.94);
  border: 2px solid #000000;
  outline: 2px solid rgba(255, 255, 255, 0.16);
  padding: 16px 18px 18px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-window {
  width: 620px;
  max-height: 88vh;
  overflow-y: auto;
}

.info-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-cf-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #000000;
}

.info-cf-logo {
  width: 48px;
  height: 24px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 0 #000000);
}

.info-cf-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-cf-title {
  font-size: 14px;
  font-weight: 900;
  color: #facc15;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.info-cf-sub {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
}

.info-terms {
  background: rgba(34, 36, 44, 0.85);
  border: 2px solid #000000;
  padding: 10px 12px;
}

.info-terms h3,
.info-credits-text h3 {
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.info-terms p,
.info-credits-text p {
  font-size: 12px;
  line-height: 1.48;
  color: #cbd5e1;
}

.info-credits-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 10px;
  border-top: 2px solid #000000;
}

.hallpass-mark {
  width: 96px;
  height: 75px;
  flex-shrink: 0;
  background: transparent;
  overflow: hidden;
}

.hallpass-mark svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.75));
}

.info-credits-text strong {
  color: #facc15;
}

.info-audio-note {
  margin-top: 6px;
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #000000;
}

#game-title {
  font-size: 28px;
  font-weight: 900;
  color: #facc15;
  text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000;
}

.auth-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-frame {
  width: 38px;
  height: 38px;
  background: #528be8;
  border: 2px solid #000000;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-name {
  background: rgba(14, 14, 18, 0.85);
  border: 2px solid #000000;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
  color: #fef08a;
}

.menu-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}

.thumb-frame {
  background: #0f172a;
  border: 2px solid #000000;
  min-height: 260px;
  overflow: hidden;
}

#game-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.menu-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.desc-box {
  flex: 1;
  background: rgba(14, 14, 18, 0.8);
  border: 2px solid #000000;
  padding: 12px 14px;
  display: flex;
  align-items: center;
}

#game-desc {
  font-size: 14px;
  line-height: 1.55;
  color: #e2e8f0;
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#play-btn {
  width: 100%;
  font-size: 18px;
  padding: 14px 16px;
}

.menu-actions-row {
  display: flex;
  gap: 8px;
}

#open-lb-btn {
  flex: 1;
  padding: 10px 14px;
}

#open-info-btn {
  flex: 0 0 auto;
  padding: 10px 14px;
  font-size: 13px;
}

/* ================================
   POPUPS (LOGIN & LEADERBOARD)
   ================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 40;
}

#welcome-choice-popup,
#guest-confirm-popup,
#auth-popup,
#delete-account-popup {
  background: rgba(6, 8, 12, 0.74);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
}

.overlay.open {
  display: flex;
}

.popup-window {
  width: 360px;
  max-width: 95vw;
  background: rgba(18, 18, 22, 0.96);
  border: 2px solid #000000;
  outline: 2px solid rgba(255, 255, 255, 0.16);
  padding: 16px 18px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lb-window {
  width: 780px;
  max-height: 88vh;
}

.popup-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popup-title {
  font-size: 20px;
  font-weight: 900;
  color: #facc15;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lb-sort-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.welcome-copy {
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.5;
}

.welcome-actions,
.guest-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guest-warn-box {
  background: rgba(127, 29, 29, 0.3);
  border: 2px solid #991b1b;
  padding: 12px 14px;
  color: #fee2e2;
  font-size: 13px;
  line-height: 1.5;
}

.guest-warn-box ul {
  margin-top: 8px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-tab {
  background: #1e293b;
  color: #94a3b8;
  padding: 8px 10px;
  font-size: 13px;
}

.auth-tab.active {
  background: #9e9100;
  color: #fef08a;
}

.popup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popup-form input {
  width: 100%;
  padding: 10px;
  background: #0f172a;
  color: #fef08a;
  border: 2px solid #000000;
  border-radius: 0;
  font-family: inherit;
  font-size: 14px;
  user-select: text;
}

.popup-form input:focus {
  outline: none;
  border-color: #facc15;
}

.msg {
  min-height: 16px;
  font-size: 12px;
  font-weight: bold;
  color: #f87171;
  text-align: center;
}

/* Leaderboard Rows & Guest Error */
.lb-my-card {
  background: rgba(14, 14, 18, 0.9);
  border: 2px solid #facc15;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: bold;
  color: #fef08a;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 2px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(14, 14, 18, 0.85);
  border: 2px solid #000000;
  padding: 8px 12px;
}

.lb-row.me {
  border-color: #facc15;
}

.lb-rank {
  min-width: 36px;
  font-size: 16px;
  font-weight: 900;
  color: #facc15;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.lb-pic-frame {
  width: 44px;
  height: 44px;
  background: #528be8;
  border: 2px solid #000000;
  overflow: hidden;
  flex-shrink: 0;
}

.lb-pic-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lb-name-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lb-name {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-tier {
  font-size: 11px;
  font-weight: bold;
  color: #94a3b8;
}

.lb-trophy-box {
  width: 54px;
  height: 54px;
  background: #0f172a;
  border: 2px solid #000000;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-trophy-box canvas {
  width: 50px;
  height: 50px;
  display: block;
}

.lb-details-btn {
  padding: 7px 11px;
  font-size: 12px;
  flex-shrink: 0;
}

#lb-list-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#lb-detail-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 72vh;
  overflow-y: auto;
  padding-right: 4px;
}

.lb-detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.lb-detail-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lb-detail-avatar {
  width: 68px;
  height: 68px;
  background: #528be8;
  border: 2px solid #facc15;
  overflow: hidden;
  flex-shrink: 0;
}

.lb-detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lb-detail-name {
  font-size: 20px;
  font-weight: 900;
  color: #fef08a;
}

.lb-detail-sub {
  font-size: 12px;
  font-weight: bold;
  color: #cbd5e1;
}

.lb-detail-3d-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lb-detail-card {
  background: rgba(14, 14, 18, 0.9);
  border: 2px solid #000000;
  outline: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-detail-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
  color: #facc15;
}

.lb-drag-hint {
  font-size: 11px;
  color: #94a3b8;
  font-weight: bold;
}

.lb-detail-canvas-wrap {
  width: 100%;
  aspect-ratio: 280 / 220;
  background: radial-gradient(circle at 50% 45%, #1e293b 0%, #090d16 100%);
  border: 2px solid #000000;
  cursor: grab;
  overflow: hidden;
  touch-action: none;
}

.lb-detail-canvas-wrap:active {
  cursor: grabbing;
}

.lb-detail-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.lb-detail-foot {
  font-size: 12px;
  font-weight: bold;
  color: #e2e8f0;
  text-align: center;
}

.lb-detail-achs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.lb-ach-card {
  background: rgba(14, 14, 18, 0.88);
  border: 2px solid #000000;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lb-ach-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lb-ach-title {
  font-size: 13px;
  font-weight: 900;
  color: #fef08a;
}

.lb-ach-tier {
  font-size: 11px;
  font-weight: bold;
  color: #94a3b8;
}

.lb-ach-bar {
  width: 100%;
  height: 8px;
  background: #0f172a;
  border: 1px solid #000000;
  overflow: hidden;
}

.lb-ach-bar-fill {
  height: 100%;
  background: #facc15;
}

/* Hallpass Games Full Server Queue Panel */
.intro-queue-panel {
  position: fixed;
  right: 4vw;
  top: 50%;
  transform: translateY(-50%);
  width: min(460px, 90vw);
  max-height: 84vh;
  background: rgba(18, 18, 22, 0.94);
  border: 2px solid #facc15;
  outline: 2px solid #000000;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.85);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 62;
  color: #f8fafc;
}

.intro-queue-panel.hidden {
  display: none !important;
}

.intro-queue-badge {
  display: inline-block;
  background: #dc2626;
  color: #ffffff;
  border: 2px solid #000000;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.intro-queue-title {
  font-size: 22px;
  font-weight: 900;
  color: #facc15;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.intro-queue-pos {
  margin-top: 6px;
  font-size: 13px;
  font-weight: bold;
  color: #fef08a;
  line-height: 1.45;
}

.intro-queue-sub {
  font-size: 13px;
  font-weight: 800;
  color: #cbd5e1;
}

.intro-queue-players {
  max-height: 300px;
}

.lb-stats {
  display: flex;
  gap: 14px;
  font-size: 13px;
  font-weight: bold;
  color: #93c5fd;
  flex-shrink: 0;
}

.lb-stats span strong {
  color: #fef08a;
}

.lb-empty {
  background: rgba(14, 14, 18, 0.75);
  border: 2px solid #000000;
  padding: 24px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  color: #94a3b8;
}

.lb-guest-err {
  background: rgba(55, 10, 10, 0.75);
  border: 2px solid #000000;
  padding: 22px 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
  color: #fca5a5;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

/* ================================
   ESC PAUSE MENU (IN-GAME)
   ================================ */
#pause-menu {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

#pause-menu.open {
  opacity: 1;
  pointer-events: auto;
}

.pause-window {
  width: 680px;
  max-width: 95vw;
  max-height: 86vh;
  background: rgba(18, 18, 22, 0.94);
  border: 2px solid #000000;
  outline: 2px solid rgba(255, 255, 255, 0.16);
  padding: 16px 18px 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pause-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 2px solid #000000;
}

.pause-esc-hint {
  font-size: 12px;
  font-weight: bold;
  color: #94a3b8;
  background: rgba(14, 14, 18, 0.85);
  border: 2px solid #000000;
  padding: 4px 10px;
}

.pause-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
  min-height: 0;
}

.pause-col {
  background: rgba(14, 14, 18, 0.82);
  border: 2px solid #000000;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 290px;
}

.pause-actions-col {
  align-items: center;
  justify-content: center;
}

.pause-triangle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pause-tri-top {
  display: flex;
  justify-content: center;
}

.pause-tri-bottom {
  display: flex;
  justify-content: center;
  gap: 22px;
}

.pause-sq-btn {
  width: 94px;
  height: 94px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
}

.pause-sq-btn svg {
  width: 38px;
  height: 38px;
  display: block;
  filter: drop-shadow(1px 1px 0 #000);
}

.pause-section-title {
  font-size: 13px;
  font-weight: 900;
  color: #facc15;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding-bottom: 6px;
  border-bottom: 2px solid #000000;
}

.pause-vol-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(18, 18, 24, 0.9);
  border: 2px solid #000000;
  padding: 8px 10px;
}

.pause-vol-box label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: bold;
  color: #fef08a;
}

/* Blocky Theme-Fitting Range Sliders */
.pause-vol-box input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  background: transparent;
  cursor: pointer;
}

.pause-vol-box input[type="range"]:focus {
  outline: none;
}

.pause-vol-box input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 12px;
  background: #0f172a;
  border: 2px solid #000000;
  border-radius: 0;
}

.pause-vol-box input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 22px;
  background: #facc15;
  border: 2px solid #000000;
  border-radius: 0;
  margin-top: -7px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

.pause-vol-box input[type="range"]:hover::-webkit-slider-thumb {
  background: #fef08a;
}

.pause-vol-box input[type="range"]::-moz-range-track {
  width: 100%;
  height: 12px;
  background: #0f172a;
  border: 2px solid #000000;
  border-radius: 0;
}

.pause-vol-box input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 22px;
  background: #facc15;
  border: 2px solid #000000;
  border-radius: 0;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

.pause-vol-box input[type="range"]:hover::-moz-range-thumb {
  background: #fef08a;
}

.pause-players-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 260px;
  padding-right: 2px;
}

.pause-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(18, 18, 24, 0.9);
  border: 2px solid #000000;
  padding: 6px 8px;
}

.pause-player-row.me {
  border-color: #facc15;
}

.pause-player-pic {
  width: 34px;
  height: 34px;
  background: #528be8;
  border: 2px solid #000000;
  overflow: hidden;
  flex-shrink: 0;
}

.pause-player-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pause-player-name {
  flex: 1;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pause-player-tag {
  font-size: 11px;
  font-weight: bold;
  color: #93c5fd;
}

.pause-guest-note {
  font-size: 11px;
  font-weight: bold;
  color: #fca5a5;
  background: rgba(55, 10, 10, 0.65);
  border: 2px solid #000000;
  padding: 7px 8px;
  text-align: center;
}

/* ================================
   SETTINGS / OPTIONS MENU
   ================================ */
#settings-menu {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#settings-menu.open {
  opacity: 1;
  pointer-events: auto;
}

.settings-window {
  width: 560px;
  max-width: 96vw;
  max-height: 90vh;
  overflow-y: auto;
  gap: 14px;
}

.settings-section {
  background: rgba(14, 14, 18, 0.82);
  border: 2px solid #000000;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-audio-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.settings-mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-card {
  background: #1e293b;
  color: #94a3b8;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 2px solid #000000;
}

.mode-card:hover {
  background: #273549;
}

.mode-card.active {
  background: #786d00;
  color: #fef08a;
  outline: 2px solid #facc15;
}

.mode-card-canvas-wrap {
  width: 100%;
  aspect-ratio: 220 / 150;
  background: #0f172a;
  border: 2px solid #000000;
  overflow: hidden;
}

.mode-card-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.mode-card-title {
  font-size: 15px;
  font-weight: 900;
  color: #fef08a;
}

.mode-card-sub {
  font-size: 11px;
  font-weight: bold;
  color: #cbd5e1;
}

/* ================================
   HALLPASS GAMES 3D INTRO & THROBBER
   ================================ */
#intro-splash {
  position: fixed;
  inset: 0;
  background: #000000;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

#intro-splash.active {
  opacity: 1;
  pointer-events: auto;
}

#intro-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.intro-throbber {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 34px;
  height: 34px;
  border: 4px solid rgba(255, 255, 255, 0.22);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: introSpin 0.85s linear infinite;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.intro-throbber.done {
  opacity: 0;
}

@keyframes introSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 660px) {
  .menu-body,
  .pause-grid,
  .settings-audio-btns,
  .settings-mode-cards,
  .lb-sort-row,
  .lb-detail-3d-grid,
  .lb-detail-achs {
    grid-template-columns: 1fr;
  }

  .info-credits-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .intro-queue-panel {
    right: 50%;
    top: auto;
    bottom: 16px;
    transform: translateX(50%);
    max-height: 58vh;
  }

  .thumb-frame {
    min-height: 180px;
  }

  .lb-row {
    flex-wrap: wrap;
  }
}

/* ================================
   SECRET DEBUG MENU (#debug-menu)
   ================================ */
#debug-menu {
  position: fixed;
  inset: 0;
  background: #000000;
  color: #f8fafc;
  z-index: 55;
  display: none;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
}

#debug-menu.open {
  display: flex;
}

.debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid #27272a;
}

.debug-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.debug-title-wrap h2 {
  font-size: 20px;
  font-weight: 900;
  color: #facc15;
  letter-spacing: 0.6px;
}

.debug-badge {
  background: #dc2626;
  color: #ffffff;
  border: 2px solid #000000;
  outline: 1px solid #facc15;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 7px;
}

.debug-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 245px 1fr;
  gap: 14px;
}

.debug-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.debug-nav-btn {
  background: #111114;
  color: #e2e8f0;
  border: 2px solid #27272a;
  padding: 10px 12px;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.debug-nav-btn:hover {
  border-color: #facc15;
  color: #fef08a;
}

.debug-nav-btn.active {
  background: #9e9100;
  color: #fef08a;
  border-color: #facc15;
}

.debug-stage {
  background: #09090b;
  border: 2px solid #27272a;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.debug-stage h3 {
  font-size: 17px;
  font-weight: 900;
  color: #facc15;
}

.debug-sub {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.45;
}

.debug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 12px;
}

.debug-card {
  background: #111115;
  border: 2px solid #27272a;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.debug-card.secret {
  border-color: #facc15;
}

.debug-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 900;
  color: #fef08a;
}

.debug-pill {
  background: #1e293b;
  color: #93c5fd;
  border: 1px solid #334155;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 900;
}

.debug-pill.gold {
  background: #9e9100;
  color: #fef08a;
  border-color: #facc15;
}

.debug-canvas-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 6px;
  background: #050507;
  border: 1px solid #27272a;
  padding: 6px;
}

.debug-canvas {
  display: block;
  background: transparent;
}

.debug-tier-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #cbd5e1;
}

.debug-actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.debug-name-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.debug-name-row input {
  flex: 1;
  min-width: 190px;
  background: #14161d;
  border: 2px solid #27272a;
  padding: 9px 10px;
  color: #ffffff;
  font-weight: bold;
}

.debug-kv-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #cbd5e1;
}

.debug-kv-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  background: #111115;
  border: 1px solid #27272a;
}

.debug-intro-stop {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 64;
}

@media (max-width: 760px) {
  .debug-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .debug-sidebar {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .debug-nav-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}