:root {
  color-scheme: dark;
  --amber: #ffcf57;
  --mint: #b7c7a0;
  --red: #ff4e50;
  --ink: #09090d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #05050a;
  color: #f8f0d8;
  font-family: "Trebuchet MS", Verdana, sans-serif;
}

#game-shell {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 85%, rgba(167, 133, 91, 0.12), transparent 34%),
    linear-gradient(#1c2030, #4b4f55 58%, #171715);
}

#game {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

#game-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.032) 0 1px, transparent 1px 4px),
    radial-gradient(circle at center, transparent 54%, rgba(0, 0, 0, 0.34));
  mix-blend-mode: soft-light;
}

#hud {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  pointer-events: none;
}

.hud-card {
  min-width: 112px;
  padding: 8px 12px;
  border: 2px solid #000;
  outline: 2px solid rgba(198, 187, 157, 0.85);
  outline-offset: -5px;
  background: repeating-conic-gradient(rgba(8, 9, 11, 0.92) 0% 25%, rgba(16, 17, 21, 0.92) 0% 50%) 50% / 4px 4px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.85);
  text-transform: uppercase;
  font-family: 'VT323', monospace;
  position: relative;
}

.hud-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #ffcf57; /* Default amber line */
}

/* Give different cards different neon left stripes for arcade look */
.hud-card:nth-child(1)::before { background: #ff4e50; } /* Split time */
.hud-card:nth-child(2)::before { background: #ffcf57; } /* Best time */
.hud-card:nth-child(3)::before { background: #b7c7a0; } /* Lap count */
.hud-card:nth-child(4) { display: none; } /* Speed (hidden in favor of dial cluster) */

.hud-card.big {
  min-width: 174px;
}

.label {
  display: block;
  margin-bottom: 2px;
  color: #ffcf57; /* Amber label */
  font-size: 14px;
  font-weight: normal;
  letter-spacing: 0.05em;
  font-family: 'VT323', monospace;
  text-shadow: 1px 1px 0px #000;
}

strong {
  display: block;
  color: #ffffff; /* Crisp white for main values */
  font-size: 32px;
  font-weight: normal;
  line-height: 0.9;
  font-family: 'VT323', monospace;
  text-shadow: 2px 2px 0px #000;
}

.hud-card.big strong {
  font-size: 38px;
}

#status {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 2;
  width: min(680px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  text-align: center;
  pointer-events: none;
  font-family: 'VT323', monospace;
}

#countdown {
  margin-bottom: 4px;
  color: #fff4be;
  font-size: 42px;
  font-family: 'VT323', monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

#countdown.is-final-lap {
  color: #ffcf57;
  font-size: 46px;
  text-shadow: 3px 3px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 0 0 18px rgba(255, 207, 87, 0.35);
}

#countdown.is-finished-wait {
  color: #8dffb0;
}

#hint {
  color: #d7ebff;
  font-size: 20px;
  font-family: 'VT323', monospace;
  letter-spacing: 0.05em;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

#instrument-cluster {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2;
  background: repeating-conic-gradient(rgba(8, 9, 11, 0.92) 0% 25%, rgba(16, 17, 21, 0.92) 0% 50%) 50% / 4px 4px;
  border: 2px solid #000;
  outline: 2px solid rgba(198, 187, 157, 0.85);
  outline-offset: -5px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.85);
  border-radius: 0;
  padding: 10px;
  backdrop-filter: blur(4px);
  user-select: none;
  display: none; /* Hidden by default, shown in race mode */
}

#instrument-cluster.is-active {
  display: block;
}

#gauges {
  display: block;
  width: 400px;
  height: 180px;
}

#assetNotice {
  position: fixed;
  top: 86px;
  left: 16px;
  z-index: 3;
  max-width: 390px;
  padding: 8px 10px;
  border: 2px solid rgba(255, 78, 80, 0.8);
  background: rgba(9, 9, 13, 0.82);
  color: #ffd9d9;
  font-size: 12px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

#startMenu {
  position: fixed;
  inset: 0;
  z-index: 8;
  padding: 0;
  background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.15) 30%, rgba(0,0,0,0.55) 55%, rgba(0,0,0,0.85) 85%);
  transition: opacity 150ms ease;
}

#startMenu[hidden] {
  display: none;
}

.menu-backdrop {
  width: 100%;
  height: 100%;
  display: grid;
  justify-items: end;
  align-items: stretch;
}

.menu-shell {
  width: 460px;
  height: 100vh;
  max-height: 100vh;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 24px;
  border-left: 2px solid rgba(198, 187, 157, 0.88);
  border-top: none;
  border-right: none;
  border-bottom: none;
  background: rgba(12, 13, 16, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.75);
}

.menu-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(198, 187, 157, 0.22);
}

.menu-header-copy h1 {
  margin: 8px 0 0;
  color: #f4e2b0;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 0.92;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 #000;
}

.menu-mode-pill {
  padding: 8px 12px;
  border: 2px solid rgba(255, 207, 87, 0.72);
  background: rgba(124, 47, 40, 0.42);
  color: #fff4d8;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.menu-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.menu-section {
  padding: 14px;
  border: 1px solid rgba(198, 187, 157, 0.18);
  background: rgba(0, 0, 0, 0.22);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-num {
  min-width: 34px;
  padding: 4px 0;
  border: 1px solid rgba(255, 207, 87, 0.55);
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: center;
}

.section-head h2 {
  margin: 0;
  color: #efe4c8;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.picker-grid {
  display: grid;
  gap: 10px;
}

.car-picker {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.track-picker {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.pick-card {
  position: relative;
  min-height: 92px;
  padding: 12px 13px 11px;
  border: 2px solid rgba(198, 187, 157, 0.28);
  background:
    linear-gradient(180deg, rgba(28, 30, 34, 0.96), rgba(14, 15, 17, 0.98)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent 40%);
  color: #f5ead1;
  text-align: left;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.42);
  transition:
    border-color 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

.pick-card:hover {
  border-color: rgba(255, 207, 87, 0.55);
  transform: translateY(-1px);
}

.pick-card.is-selected {
  border-color: rgba(255, 207, 87, 0.95);
  background:
    linear-gradient(180deg, rgba(52, 34, 28, 0.98), rgba(22, 16, 14, 0.98)),
    linear-gradient(90deg, rgba(255, 78, 80, 0.12), transparent 50%);
  box-shadow:
    0 0 0 1px rgba(255, 207, 87, 0.18),
    4px 4px 0 rgba(0, 0, 0, 0.5);
}

.pick-card.is-selected::after {
  content: "SELECTED";
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--amber);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.pick-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 7px;
  border: 1px solid rgba(183, 199, 160, 0.45);
  color: var(--mint);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pick-card strong {
  display: block;
  margin-bottom: 6px;
  color: #fff2c8;
  font-size: 15px;
  line-height: 1.15;
  text-shadow: 1px 1px 0 #000;
}

.pick-meta {
  display: block;
  color: #b9b1a0;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.menu-briefing {
  margin-top: 16px;
  padding: 14px 15px;
  border: 1px solid rgba(198, 187, 157, 0.28);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.18)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 2px, transparent 2px 8px);
}

.brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.brief-label {
  display: block;
  margin-bottom: 4px;
  color: var(--mint);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brief-block strong {
  display: block;
  margin-bottom: 4px;
  color: #fff0bc;
  font-size: 17px;
  line-height: 1.1;
}

.brief-block p,
.brief-notes {
  margin: 0;
  color: #d8d2bf;
  font-size: 12px;
  line-height: 1.5;
}

.brief-notes {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(198, 187, 157, 0.16);
}

.menu-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

#startButton {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 16px 18px;
  border: 2px solid rgba(255, 207, 87, 0.72);
  background: linear-gradient(180deg, #9a342d, #6d241f);
  color: #fff4d8;
  cursor: pointer;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.55);
  text-transform: uppercase;
}

#startButton:hover {
  filter: brightness(1.08);
}

.start-label {
  font-size: 18px;
  letter-spacing: 0.12em;
}

.start-sub {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffe9b0;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.eyebrow,
.menu-hint {
  color: var(--mint);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.menu-hint {
  display: block;
  text-align: center;
  margin-top: 14px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.mode-tab {
  padding: 11px 12px;
  border: 2px solid rgba(198, 187, 157, 0.35);
  background: rgba(0, 0, 0, 0.28);
  color: #d8ccb0;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.mode-tab.is-active {
  border-color: rgba(255, 207, 87, 0.9);
  background: rgba(124, 47, 40, 0.45);
  color: #fff4d8;
}

.mode-panel {
  margin-top: 14px;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  color: #d8ccb0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field-label input,
.field-label select,
.room-options select {
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  border: 2px solid rgba(198, 187, 157, 0.35);
  background: #17191b;
  color: #f5ead1;
  font: inherit;
  font-size: 14px;
}

.panel-intro {
  margin: 14px 0 0;
  color: #c8bfaa;
  font-size: 13px;
  line-height: 1.5;
}

.section-note {
  margin-left: auto;
  color: #8f8775;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-head-tight {
  margin-top: 14px;
}

.room-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.menu-grid-multi {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lobby-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lobby-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(198, 187, 157, 0.18);
  background: rgba(255, 255, 255, 0.02);
}

.step-badge {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 207, 87, 0.55);
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
}

.lobby-step strong {
  display: block;
  margin-bottom: 4px;
  color: #fff0bc;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lobby-step p {
  margin: 0 0 10px;
  color: #b9b1a0;
  font-size: 12px;
  line-height: 1.45;
}

.lobby-step button,
#createRoomButton,
#joinRoomButton {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid rgba(198, 187, 157, 0.55);
  background: #25282c;
  color: #fff0bc;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
}

#createRoomButton {
  background: linear-gradient(180deg, #9a342d, #6d241f);
}

.join-code-label {
  margin-bottom: 8px;
}

.room-status.is-live {
  border-color: rgba(255, 207, 87, 0.45);
  color: #fff0bc;
}

.room-status.is-ready {
  border-color: rgba(141, 255, 176, 0.45);
  color: #d8ffe4;
}

#resultsScreen {
  position: fixed;
  inset: 0;
  z-index: 12;
  background: rgba(0, 0, 0, 0.72);
}

#resultsScreen[hidden] {
  display: none;
}

.results-backdrop {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 18px;
}

.results-shell {
  width: min(920px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 22px 24px 20px;
  border: 2px solid rgba(255, 207, 87, 0.72);
  background:
    linear-gradient(180deg, rgba(18, 19, 22, 0.98), rgba(8, 9, 11, 0.96)),
    linear-gradient(90deg, rgba(124, 47, 40, 0.18), transparent 40%);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.62);
}

.results-header h2 {
  margin: 8px 0 6px;
  color: #f4e2b0;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1;
  text-transform: uppercase;
}

#resultsSubtitle {
  margin: 0;
  color: #c8bfaa;
  font-size: 14px;
}

.results-table-wrap {
  margin-top: 18px;
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.results-table th,
.results-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(198, 187, 157, 0.16);
  text-align: left;
  white-space: nowrap;
}

.results-table th {
  color: var(--mint);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.results-table td {
  color: #efe4c8;
}

.results-table tr.is-winner td {
  color: #fff0bc;
  background: rgba(124, 47, 40, 0.22);
}

.results-table tr.is-you td {
  box-shadow: inset 2px 0 0 rgba(255, 207, 87, 0.85);
}

.results-table .pos {
  color: var(--amber);
  font-weight: 700;
}

.results-table .gap {
  color: #9a9488;
}

#resultsContinue {
  width: 100%;
  margin-top: 18px;
  padding: 14px 18px;
  border: 2px solid rgba(255, 207, 87, 0.72);
  background: linear-gradient(180deg, #9a342d, #6d241f);
  color: #fff4d8;
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.55);
}

.lobby-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(198, 187, 157, 0.22);
  background: rgba(0, 0, 0, 0.24);
}

.lobby-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.lobby-actions {
  display: grid;
  gap: 8px;
}

.lobby-actions button,
#multiPanel .menu-actions button {
  padding: 10px 14px;
  border: 2px solid rgba(198, 187, 157, 0.55);
  background: #25282c;
  color: #fff0bc;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
}

#createRoomButton {
  background: linear-gradient(180deg, #9a342d, #6d241f);
}

.room-status {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(183, 199, 160, 0.25);
  background: rgba(0, 0, 0, 0.22);
  color: #d8d2bf;
  font-size: 13px;
}

.room-player-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.room-player-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(198, 187, 157, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: #efe4c8;
  font-size: 12px;
}

.room-player-list li.is-you {
  border-color: rgba(255, 207, 87, 0.55);
}

.compact-picker {
  margin-top: 10px;
}

.compact-picker .pick-card {
  min-height: 78px;
}

@media (max-width: 720px) {
  .menu-shell {
    padding: 16px;
  }

  .menu-header {
    flex-direction: column;
  }

  .brief-grid {
    grid-template-columns: 1fr;
  }

  .car-picker,
  .track-picker {
    grid-template-columns: 1fr;
  }

  .menu-grid-multi,
  .lobby-steps {
    grid-template-columns: 1fr;
  }

  .room-options,
  .lobby-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #hud {
    flex-wrap: wrap;
  }

  .hud-card,
  .hud-card.big {
    min-width: calc(50% - 5px);
  }

  #instrument-cluster {
    bottom: 16px;
    right: 16px;
    padding: 6px;
  }
  #gauges {
    width: 260px;
    height: 117px;
  }
}

/* CAROUSEL DESIGNS */
.carousel-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

.carousel-btn {
  background: rgba(198, 187, 157, 0.1);
  border: 1px solid rgba(198, 187, 157, 0.35);
  color: #efe4c8;
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  width: 32px;
  height: 92px;
  display: grid;
  place-items: center;
  transition: all 120ms ease;
  user-select: none;
}

.compact-carousel .carousel-btn {
  height: 78px;
}

.carousel-btn:hover {
  background: rgba(255, 207, 87, 0.22);
  border-color: rgba(255, 207, 87, 0.78);
  color: #fff;
}

.carousel-btn:active {
  transform: scale(0.93);
}

/* Hide inactive cards in carousels */
.picker-grid.car-picker,
.picker-grid.track-picker {
  display: block !important;
  flex-grow: 1;
}

.car-card, .track-card {
  display: none !important;
}

.car-card.is-selected {
  display: flex !important;
  width: 100%;
  box-sizing: border-box;
}

/* Track Card and Minimap integration */
.track-card.is-selected {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  min-height: 92px;
  box-sizing: border-box;
}

.compact-picker .track-card.is-selected {
  min-height: 78px;
  padding: 6px 10px;
}

.track-card-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.track-minimap {
  width: 110px;
  height: 72px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(198, 187, 157, 0.25);
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.8);
}

.compact-picker .track-minimap {
  width: 90px;
  height: 60px;
}

/* LOBBY OPEN ROOMS STYLES */
.open-rooms-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  margin: 10px 0;
  padding: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(198, 187, 157, 0.18);
  box-shadow: inset 1px 1px 4px rgba(0, 0, 0, 0.6);
}

.no-rooms-msg {
  color: rgba(198, 187, 157, 0.48);
  font-size: 11px;
  text-align: center;
  margin: auto;
  padding: 16px 0;
}

.open-room-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(28, 30, 34, 0.9);
  border: 1px solid rgba(198, 187, 157, 0.22);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
  transition: all 120ms ease;
}

.open-room-item:hover {
  border-color: rgba(255, 207, 87, 0.62);
  background: rgba(38, 40, 44, 0.96);
}

.room-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-id-badge {
  background: #ffcf57;
  color: #121316;
  font-weight: bold;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 3px 6px;
  border-radius: 1px;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.room-details {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.room-details strong {
  font-size: 12px;
  color: #efe4c8;
}

.room-details span {
  font-size: 10px;
  color: rgba(198, 187, 157, 0.65);
}

.room-players {
  display: flex;
  align-items: center;
  gap: 10px;
}

.players-count {
  font-size: 11px;
  color: #f5ead1;
  font-family: monospace;
}

.btn-join-room {
  background: rgba(255, 207, 87, 0.15);
  border: 1px solid rgba(255, 207, 87, 0.65);
  color: #ffcf57;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 100ms ease;
}

.btn-join-room:hover {
  background: rgba(255, 207, 87, 0.82);
  color: #121316;
}

.manual-join-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.manual-join-row input {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(198, 187, 157, 0.35);
  color: #fff;
  padding: 6px 8px;
  font-size: 12px;
  text-transform: uppercase;
  font-family: monospace;
}

.manual-join-row button {
  background: rgba(198, 187, 157, 0.12);
  border: 1px solid rgba(198, 187, 157, 0.55);
  color: #efe4c8;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
}

.manual-join-row button:hover {
  background: rgba(255, 207, 87, 0.22);
  border-color: rgba(255, 207, 87, 0.88);
  color: #fff;
}

/* RESPONSIVE DESIGN OVERRIDES FOR MOBILE DOCKING */
@media (max-width: 768px) {
  #startMenu {
    background: rgba(0, 0, 0, 0.95) !important;
    overflow-y: auto;
  }
  .menu-backdrop {
    display: block !important;
  }
  .menu-shell {
    width: 100% !important;
    height: auto !important;
    min-height: 100vh;
    border: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
  }
}

/* LIVE HUD MINIMAP */
#minimap-container {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 5;
  background: rgba(12, 13, 16, 0.72);
  border: 1.5px solid rgba(198, 187, 157, 0.35);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
  padding: 6px;
  backdrop-filter: blur(4px);
  display: none;
  border-radius: 2px;
}

#minimap-container.is-active {
  display: block;
}

#minimap {
  display: block;
  width: 160px;
  height: 160px;
}

@media (max-width: 720px) {
  #minimap-container {
    bottom: 16px;
    left: 16px;
    padding: 4px;
  }
  #minimap {
    width: 120px;
    height: 120px;
  }
}

/* PSX Style Loading Screen */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  user-select: none;
}

#loading-screen[hidden] {
  display: none;
}

.psx-boot-sequence {
  width: 100%;
  max-width: 600px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Sony Intro Screen */
.sony-intro {
  text-align: center;
  animation: fadeInOut 3.2s forwards;
}

.sony-text {
  font-size: 54px;
  font-weight: bold;
  letter-spacing: 0.15em;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.sony-subtext {
  font-size: 14px;
  letter-spacing: 0.25em;
  color: #fff;
  margin-top: 10px;
}

/* PSX logo screen */
.psx-logo-screen {
  text-align: center;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.psx-logo-screen[hidden],
.sony-intro[hidden],
.loading-console[hidden],
.press-start-screen[hidden] {
  display: none;
}

.psx-grid-bg {
  position: absolute;
  inset: -100px;
  background-size: 20px 20px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  z-index: 1;
}

.boot-logo {
  z-index: 2;
  font-size: 72px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
  color: #f8c058; /* retro yellow/orange */
  text-shadow: 4px 4px 0 #000;
}

.orange-diamond {
  color: #e54c30; /* PlayStation orange */
  animation: spinSlow 8s linear infinite;
  display: inline-block;
}

.boot-licence {
  z-index: 2;
  font-size: 12px;
  line-height: 1.8;
  color: #d8c8b0;
  max-width: 450px;
  text-transform: uppercase;
}

.licence-bold {
  font-weight: bold;
  color: #fff;
}

.licence-small {
  font-size: 10px;
  color: #8a7e68;
  margin-top: 15px;
}

/* Loading Console */
.loading-console {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80%;
  max-width: 400px;
  z-index: 2;
}

.spinning-disc {
  font-size: 48px;
  animation: spinFast 1.2s linear infinite;
  margin-bottom: 20px;
}

.loading-text {
  font-size: 18px;
  font-family: 'VT323', monospace;
  color: #ffcf57;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.progress-bar-wrap {
  width: 100%;
  height: 12px;
  border: 2px solid #555;
  background: #111;
  padding: 1px;
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.8);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    45deg,
    #ffcf57,
    #ffcf57 6px,
    #ff9f00 6px,
    #ff9f00 12px
  );
  transition: width 100ms linear;
}

.loading-status {
  font-size: 12px;
  color: #888;
  margin-top: 10px;
  text-align: center;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Press Start Screen */
.press-start-screen {
  text-align: center;
  z-index: 2;
  cursor: pointer;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.press-start-logo {
  font-size: 48px;
  font-family: 'VT323', monospace;
  color: #ffcf57;
  margin-bottom: 20px;
  text-shadow: 3px 3px 0 #000;
}

.press-start-text {
  font-size: 32px;
  font-family: 'VT323', monospace;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 2px 2px 0 #e54c30;
}

.press-start-sub {
  font-size: 13px;
  color: #888;
  margin-top: 15px;
  text-transform: uppercase;
}

.flashing {
  animation: flash 1s steps(2, start) infinite;
}

#loading-screen.dismissed {
  pointer-events: none;
}

/* Animations */
@keyframes fadeInOut {
  0% { opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinFast {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes flash {
  to { visibility: hidden; }
}

