html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #07111c;
  font-family: Inter, Arial, sans-serif;
}

#game {
  width: 100vw;
  height: 100vh;
  display: block;
}

#hud,
#playersHud,
#eventsHud,
#buildWrap,
#debugPanel {
  position: fixed;
  border-radius: 16px;
  background: rgba(8, 14, 22, 0.74);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  color: white;
  z-index: 10;
}

#hud {
  left: 18px;
  bottom: 18px;
  width: 620px;
  padding: 15px 18px;
  display: flex;
  gap: 16px;
  align-items: center;
}

#playersHud {
  top: 18px;
  right: 18px;
  width: 270px;
  padding: 18px 22px;
}

#eventsHud {
  right: 18px;
  bottom: 18px;
  width: 330px;
  padding: 15px 18px;
  pointer-events: none;
}

#buildWrap {
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

#buildToggle {
  height: 42px;
  padding: 0 22px;
  border-radius: 13px;
  border: 1px solid rgba(53,242,143,.35);
  background: linear-gradient(180deg, rgba(53,242,143,.16), rgba(53,242,143,.07));
  color: rgba(255,255,255,.96);
  font-weight: 800;
  letter-spacing: .9px;
  cursor: pointer;
}

#buildWrap.open #buildToggle {
  box-shadow: 0 0 20px rgba(53,242,143,.15);
}

#buildBar {
  display: none;
  gap: 8px;
  align-items: center;
}

#buildWrap.open #buildBar {
  display: flex;
}

#debugPanel {
  display: none;
  top: 18px;
  left: 18px;
  width: 270px;
  padding: 18px 22px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

.hud-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 78px;
}

.hud-title,
.panel-title {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.54);
}

.panel-title {
  margin-bottom: 12px;
}

.hud-value {
  font-size: 25px;
  font-weight: 750;
  line-height: 1;
}

.hud-value.small {
  font-size: 22px;
}

.green {
  color: #35f28f;
  font-size: 14px;
  margin-top: 3px;
}

.gold {
  color: #e8c85f;
  font-size: 14px;
  margin-top: 3px;
}

.soft {
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  margin-top: 3px;
}

.slider-group {
  flex: 1;
  min-width: 95px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}

.playerRow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.95);
}

.playerRow + .playerRow {
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

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

.playerPercent {
  color: rgba(255, 255, 255, 0.72);
  flex-shrink: 0;
}

.you {
  font-weight: 750;
}

.eventItem {
  padding: 6px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.86);
  opacity: 0.95;
}

.eventItem + .eventItem {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.buildItem {
  position: relative;
  width: 88px;
  height: 100px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.085), rgba(255,255,255,0.038));
  border: 1px solid rgba(255, 255, 255, 0.085);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  transition: transform .13s ease, background .13s ease, border .13s ease, box-shadow .13s ease;
}

.buildItem:hover {
  transform: translateY(-3px);
  background: linear-gradient(180deg, rgba(255,255,255,0.115), rgba(255,255,255,0.046));
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 0 20px rgba(255,255,255,0.055);
}

.buildItem.selected {
  border-color: rgba(53, 242, 143, 0.85);
  background: linear-gradient(180deg, rgba(53,242,143,0.16), rgba(53,242,143,0.065));
  box-shadow: 0 0 22px rgba(53,242,143,0.13);
}

.hotkey {
  position: absolute;
  top: 7px;
  left: 8px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.58);
}

.buildCanvas {
  width: 50px;
  height: 50px;
  display: block;
}

.buildName {
  font-size: 11px;
  color: rgba(255,255,255,.92);
  line-height: 1;
}

.buildPrice {
  font-size: 11px;
  color: rgba(232, 200, 95, 0.96);
  line-height: 1;
}

input[type="range"] {
  width: 100%;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #35f28f;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: #35f28f;
  cursor: pointer;
}

@media (max-width: 1540px) {
  #buildWrap {
    bottom: 108px;
  }
}

@media (max-width: 960px) {
  #hud {
    width: calc(100vw - 72px);
    bottom: 104px;
  }

  #eventsHud {
    display: none;
  }

  #buildWrap {
    bottom: 18px;
    max-width: calc(100vw - 36px);
  }
}


#diplomacyMenu {
  position: fixed;
  z-index: 30;
  min-width: 176px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(8, 14, 22, 0.88);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 18px 45px rgba(0,0,0,0.34);
  color: white;
}

#diplomacyMenu.hidden,
#buildingTooltip.hidden {
  display: none;
}

.diploName {
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.9);
}

#diplomacyMenu button {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.88);
  cursor: pointer;
  text-align: left;
}

#diplomacyMenu button:hover:not(:disabled) {
  background: rgba(53,242,143,0.13);
  border-color: rgba(53,242,143,0.35);
}

#diplomacyMenu button:disabled {
  opacity: 0.36;
  cursor: default;
}

#buildingTooltip {
  position: fixed;
  z-index: 25;
  min-width: 160px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(8, 14, 22, 0.84);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 15px 38px rgba(0,0,0,0.25);
  color: rgba(255,255,255,0.88);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
}


.playersHudTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

#playersHudToggle {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.86);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

#playersHud.minimized {
  width: auto;
  min-width: 72px;
  padding: 14px 16px;
}

#playersHud.minimized #playersList {
  display: none;
}

#playersHud.minimized .playersHudTop {
  margin-bottom: 0;
}

#playersHud.minimized .panel-title {
  margin-bottom: 0;
}

#playersHud.minimized #playersHudToggle {
  width: 22px;
  height: 22px;
  font-size: 14px;
}


body.menu-open #hud,
body.menu-open #playersHud,
body.menu-open #eventsHud,
body.menu-open #buildWrap,
body.menu-open #debugPanel,
body.menu-open #diplomacyMenu,
body.menu-open #buildingTooltip {
  display: none !important;
}

#startScreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background:
    linear-gradient(90deg, rgba(3,8,12,0.58), rgba(3,8,12,0.10) 28%, rgba(3,8,12,0.10) 72%, rgba(3,8,12,0.58)),
    url("assets/startscreen.png") center center / cover no-repeat;
  color: rgba(255,255,255,0.92);
  font-family: Inter, Arial, sans-serif;
}

#startScreen.hidden {
  display: none;
}

.startSidePanel {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 255px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(6, 12, 18, 0.54);
  border: 1px solid rgba(218, 183, 112, 0.18);
  box-shadow: 0 22px 55px rgba(0,0,0,0.32);
  backdrop-filter: blur(14px);
}

.startStatsPanel {
  left: 44px;
}

.startHighscorePanel {
  right: 44px;
}

.startPanelTitle {
  font-size: 11px;
  letter-spacing: 2.0px;
  color: rgba(230,205,156,0.86);
  margin-bottom: 10px;
}

.statRow,
.scoreRow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid rgba(255,255,255,0.055);
  font-size: 12px;
  color: rgba(255,255,255,0.70);
}

.statRow:first-of-type,
.scoreRow:first-child {
  border-top: 0;
}

.statRow strong,
.scoreRow strong {
  color: rgba(255,255,255,0.94);
  font-weight: 750;
}

.dailyHighscoreList.empty {
  color: rgba(255,255,255,0.52);
  font-size: 13px;
  line-height: 1.55;
}

.startBottom {
  position: absolute;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(6, 12, 18, 0.56);
  border: 1px solid rgba(218, 183, 112, 0.19);
  box-shadow: 0 22px 55px rgba(0,0,0,0.32);
  backdrop-filter: blur(14px);
}

#playerNameInput {
  width: 210px;
  height: 44px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.065);
  color: rgba(255,255,255,0.94);
  padding: 0 14px;
  font-size: 14px;
  outline: none;
}

#playerNameInput::placeholder {
  color: rgba(255,255,255,0.45);
}

#playerNameInput:focus {
  border-color: rgba(218,183,112,0.52);
  box-shadow: 0 0 0 3px rgba(218,183,112,0.10);
}

#playButton {
  height: 44px;
  min-width: 132px;
  padding: 0 28px;
  border-radius: 13px;
  border: 1px solid rgba(218,183,112,0.55);
  background: linear-gradient(180deg, rgba(218,183,112,0.22), rgba(218,183,112,0.08));
  color: rgba(255,245,225,0.96);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 2.2px;
  cursor: pointer;
}

#playButton:hover {
  background: linear-gradient(180deg, rgba(218,183,112,0.30), rgba(218,183,112,0.12));
  box-shadow: 0 0 28px rgba(218,183,112,0.12);
}



@media (max-width: 980px) {
  .startSidePanel {
    width: 210px;
    padding: 14px 16px;
  }

  .startStatsPanel {
    left: 18px;
  }

  .startHighscorePanel {
    right: 18px;
  }

  .startBottom {
    bottom: 28px;
  }
}


#buildInfoTooltip {
  position: fixed;
  z-index: 2000;
  width: 238px;
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(8, 14, 22, 0.90);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 18px 48px rgba(0,0,0,0.34);
  color: rgba(255,255,255,0.88);
  pointer-events: none;
  font-size: 12px;
  line-height: 1.42;
}

#buildInfoTooltip.hidden {
  display: none;
}

.buildInfoTitle {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.buildInfoTitle strong {
  color: rgba(255,255,255,0.96);
  font-size: 13px;
  letter-spacing: 0.3px;
}

.buildInfoPrice {
  color: rgba(232,200,95,0.96);
  font-size: 12px;
  white-space: nowrap;
}

.buildInfoDesc {
  color: rgba(255,255,255,0.72);
  margin-bottom: 8px;
}

.buildInfoStats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.065);
  color: rgba(255,255,255,0.58);
}

.buildInfoStats span {
  white-space: nowrap;
}

.buildInfoHint {
  margin-top: 8px;
  color: rgba(53,242,143,0.78);
  font-size: 11px;
}


/* v0.9g-2: remove old/native-looking hover hints around build menu.
   Only #buildInfoTooltip should explain buildings now. */
#buildBar [title],
.buildItem [title] {
  pointer-events: inherit;
}

.buildHint,
.buildTooltip,
.build-hover-hint,
.tooltip:not(#buildInfoTooltip),
.hintBubble,
.oldBuildHint {
  display: none !important;
}


#safeTimeHud {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(65, 10, 12, 0.42);
  border: 1px solid rgba(255, 72, 82, 0.28);
  color: rgba(255, 96, 106, 0.92);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  box-shadow: 0 12px 34px rgba(0,0,0,0.22);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

#safeTimeHud.hidden {
  display: none;
}

#safeTimeValue {
  color: rgba(255, 220, 220, 0.96);
}


#mapStartHint {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 52;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(7, 13, 20, 0.52);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.84);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 45px rgba(0,0,0,0.26);
  pointer-events: none;
}

#mapStartHint.hidden {
  display: none;
}


#allianceRequestHud {
  position: fixed;
  right: 22px;
  bottom: 126px;
  z-index: 45;
  width: 245px;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(7, 13, 20, 0.88);
  border: 1px solid rgba(53,242,143,0.22);
  box-shadow: 0 18px 48px rgba(0,0,0,0.34);
  backdrop-filter: blur(14px);
  color: rgba(255,255,255,0.88);
}

#allianceRequestHud.hidden {
  display: none;
}

.allianceRequestTitle {
  font-size: 12px;
  font-weight: 850;
  color: rgba(53,242,143,0.88);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.allianceRequestText {
  font-size: 13px;
  line-height: 1.42;
  color: rgba(255,255,255,0.74);
  margin-bottom: 10px;
}

.allianceRequestActions {
  display: flex;
  gap: 8px;
}

.allianceRequestActions button {
  flex: 1;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.86);
  cursor: pointer;
}

#allianceAcceptBtn {
  border-color: rgba(53,242,143,0.32);
  background: rgba(53,242,143,0.10);
}

#allianceDeclineBtn {
  border-color: rgba(255,90,90,0.22);
}


#startTagline {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  z-index: 1;
  padding: 13px 18px;
  border-radius: 18px;
  background: rgba(6, 12, 18, 0.38);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 50px rgba(0,0,0,0.26);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.82);
  font-size: 13px;
  line-height: 1.52;
  letter-spacing: 0.9px;
  text-align: center;
  text-transform: uppercase;
}

#backToMenuBtn {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 70;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.11);
  background: rgba(7, 13, 20, 0.58);
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 34px rgba(0,0,0,0.22);
  cursor: pointer;
}

#backToMenuBtn:hover {
  color: rgba(255,255,255,0.96);
  background: rgba(7, 13, 20, 0.76);
}

#backToMenuBtn.hidden {
  display: none;
}

#winOverlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 10, 0.46);
  backdrop-filter: blur(4px);
}

#winOverlay.hidden {
  display: none;
}

.winCard {
  width: min(420px, calc(100vw - 42px));
  padding: 24px 26px 22px;
  border-radius: 22px;
  background: rgba(7, 13, 20, 0.88);
  border: 1px solid rgba(53,242,143,0.22);
  box-shadow: 0 28px 80px rgba(0,0,0,0.42);
  text-align: center;
  color: rgba(255,255,255,0.90);
}

.winTitle {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.97);
  margin-bottom: 9px;
}

.winText {
  font-size: 14px;
  color: rgba(255,255,255,0.68);
  margin-bottom: 18px;
}

#continueAfterWinBtn {
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(53,242,143,0.32);
  background: rgba(53,242,143,0.10);
  color: rgba(255,255,255,0.90);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
}

#continueAfterWinBtn:hover {
  background: rgba(53,242,143,0.16);
}


#liveStreamBtn {
  position: fixed;
  top: 56px;
  left: 14px;
  z-index: 70;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.11);
  background: rgba(7, 13, 20, 0.58);
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 34px rgba(0,0,0,0.22);
  cursor: pointer;
}

#liveStreamBtn:hover {
  color: rgba(255,255,255,0.96);
  background: rgba(7, 13, 20, 0.76);
}

#liveStreamBtn.hidden {
  display: none;
}

#liveStreamMini {
  position: fixed;
  left: 14px;
  top: 98px;
  z-index: 80;
  width: 320px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(7, 13, 20, 0.88);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 22px 60px rgba(0,0,0,0.34);
  backdrop-filter: blur(14px);
}

#liveStreamMini.hidden {
  display: none;
}

#liveStreamMini.collapsed {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-420px);
}

.liveStreamHeader {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 0 12px;
  color: rgba(255,255,255,0.84);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(255,255,255,0.045);
}

#hideLiveStreamBtn {
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.70);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
}

#hideLiveStreamBtn:hover {
  color: rgba(255,255,255,0.94);
  background: rgba(255,255,255,0.10);
}

#liveStreamFrame {
  display: block;
  width: 320px;
  height: 180px;
  border: 0;
  background: #000;
}


/* Final beta livestream rebuild */
#liveStreamBtn {
  position: fixed;
  top: 56px;
  left: 14px;
  z-index: 70;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.11);
  background: rgba(7, 13, 20, 0.58);
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 34px rgba(0,0,0,0.22);
  cursor: pointer;
}

#liveStreamBtn:hover {
  color: rgba(255,255,255,0.96);
  background: rgba(7, 13, 20, 0.76);
}

#liveStreamBtn.hidden {
  display: none !important;
}

#liveStreamMini {
  position: fixed;
  left: 14px;
  top: 98px;
  z-index: 80;
  width: 340px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(7, 13, 20, 0.90);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 22px 60px rgba(0,0,0,0.36);
  backdrop-filter: blur(14px);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

#liveStreamMini.hidden {
  display: none !important;
}

#liveStreamMini.collapsed {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-440px);
}

.liveStreamHeader {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 0 12px;
  color: rgba(255,255,255,0.84);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(255,255,255,0.045);
}

.liveStreamHeaderActions {
  display: flex;
  align-items: center;
  gap: 6px;
}

#hideLiveStreamBtn,
#retryLiveStreamBtn {
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.70);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
}

#hideLiveStreamBtn:hover,
#retryLiveStreamBtn:hover {
  color: rgba(255,255,255,0.94);
  background: rgba(255,255,255,0.10);
}

.liveStreamFrameWrap {
  position: relative;
  width: 340px;
  height: 191px;
  background: #000;
}

#liveStreamFrame {
  display: block;
  width: 340px;
  height: 191px;
  border: 0;
  background: #000;
}

#liveStreamFallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px;
  text-align: center;
  background: rgba(4, 8, 12, 0.88);
  color: rgba(255,255,255,0.86);
}

#liveStreamFallback.hidden {
  display: none !important;
}

.liveFallbackTitle {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.liveFallbackText {
  max-width: 250px;
  color: rgba(255,255,255,0.60);
  font-size: 12px;
  line-height: 1.35;
}

#openLiveOnYoutube {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 31px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.90);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-decoration: none;
}


/* Final Beta exact build button left fix */
#buildWrap {
  left: 18px !important;
  bottom: 146px !important;
  transform: none !important;
  padding: 0 !important;
  display: flex !important;
  gap: 8px !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  z-index: 90 !important;
}

#buildWrap::before,
#buildWrap::after {
  display: none !important;
  content: none !important;
}

#buildToggle {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  margin: 0 !important;
  height: 42px !important;
  min-width: 118px !important;
  padding: 0 22px !important;
  border-radius: 13px !important;
  z-index: 91 !important;
}

#buildBar {
  display: none;
}

#buildWrap.open {
  left: 18px !important;
  bottom: 146px !important;
  transform: none !important;
  padding: 8px 10px !important;
  background: rgba(8, 14, 22, 0.74) !important;
  backdrop-filter: blur(18px) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22) !important;
}

#buildWrap.open #buildBar {
  display: flex !important;
}

/* remove the old bottom-center ghost handle caused by the centered build wrapper */
body:not(.menu-open) #buildWrap:not(.open) #buildBar {
  display: none !important;
}


/* Final Beta send troops removal */
#hud .slider-group {
  max-width: 260px;
}

#hud .slider-group input[type="range"] {
  width: 100%;
}


/* Final Alpha 1.0 controlled fix */


#hud .slider-group {
  max-width: 260px;
}

#hud .slider-group input[type="range"] {
  width: 100%;
}


/* Multiplayer lobby preparation */
#playButton:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.4);
  box-shadow: none;
}

.startNameError {
  position: absolute;
  left: 50%;
  bottom: -26px;
  transform: translateX(-50%);
  width: max-content;
  max-width: 520px;
  color: rgba(255, 185, 160, 0.92);
  font-size: 12px;
  letter-spacing: 0.6px;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

.startNameError.ok {
  color: rgba(150, 255, 195, 0.82);
}

#lobbyScreen {
  position: fixed;
  inset: 0;
  z-index: 999;
  background:
    linear-gradient(90deg, rgba(3,8,12,0.58), rgba(3,8,12,0.10) 28%, rgba(3,8,12,0.10) 72%, rgba(3,8,12,0.58)),
    url("assets/startscreen.png") center center / cover no-repeat;
  color: rgba(255,255,255,0.92);
  font-family: Inter, Arial, sans-serif;
}

#lobbyScreen.hidden {
  display: none;
}

#lobbyBackBtn {
  position: absolute;
  left: 24px;
  top: 24px;
  height: 40px;
  padding: 0 18px;
  border-radius: 13px;
  border: 1px solid rgba(218,183,112,0.34);
  background: rgba(6, 12, 18, 0.56);
  color: rgba(255,245,225,0.92);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 16px 44px rgba(0,0,0,0.26);
  backdrop-filter: blur(12px);
}

#lobbyBackBtn:hover {
  background: rgba(218,183,112,0.12);
  border-color: rgba(218,183,112,0.55);
}

.lobbyHeader {
  position: absolute;
  left: 50%;
  top: 86px;
  transform: translateX(-50%);
  text-align: center;
  padding: 18px 28px;
  border-radius: 22px;
  background: rgba(6, 12, 18, 0.46);
  border: 1px solid rgba(218, 183, 112, 0.16);
  box-shadow: 0 22px 60px rgba(0,0,0,0.28);
  backdrop-filter: blur(14px);
}

.lobbyWelcome {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: rgba(255,245,225,0.98);
}

.lobbySubtitle {
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: rgba(230,205,156,0.86);
}

.lobbyStatus {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.56);
}

.lobbyServerGrid {
  position: absolute;
  left: 50%;
  top: 240px;
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 80px));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.serverCard {
  min-height: 190px;
  padding: 20px;
  text-align: left;
  border-radius: 22px;
  background: rgba(6, 12, 18, 0.56);
  border: 1px solid rgba(218, 183, 112, 0.16);
  box-shadow: 0 24px 70px rgba(0,0,0,0.34);
  backdrop-filter: blur(15px);
  color: rgba(255,255,255,0.88);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.serverCard:hover {
  transform: translateY(-3px);
  border-color: rgba(218,183,112,0.42);
  background: rgba(18, 25, 33, 0.64);
  box-shadow: 0 28px 80px rgba(0,0,0,0.42);
}

.serverTopline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.serverTopline span {
  font-size: 18px;
  font-weight: 900;
  color: rgba(255,245,225,0.98);
}

.serverTopline strong {
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(150,255,195,0.82);
}

.serverMeta {
  padding: 7px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
  color: rgba(255,255,255,0.70);
}

.serverJoinHint {
  margin-top: 18px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: rgba(230,205,156,0.86);
}

.friendsPanel {
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  width: 255px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(6, 12, 18, 0.54);
  border: 1px solid rgba(218, 183, 112, 0.18);
  box-shadow: 0 22px 55px rgba(0,0,0,0.32);
  backdrop-filter: blur(14px);
}

.friendsTitle {
  font-size: 11px;
  letter-spacing: 2.0px;
  color: rgba(230,205,156,0.86);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.friendsList.empty {
  color: rgba(255,255,255,0.52);
  font-size: 13px;
  line-height: 1.55;
}

.friendRow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.055);
  color: rgba(255,255,255,0.74);
  font-size: 13px;
}

.friendDot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(150,150,150,0.72);
  box-shadow: 0 0 12px rgba(0,0,0,0.25);
}

.friendRow.online .friendDot {
  background: rgba(76,255,150,0.92);
  box-shadow: 0 0 14px rgba(76,255,150,0.32);
}

.friendRow.offline .friendDot {
  background: rgba(150,150,150,0.62);
}

#friendRequestBtn.hidden {
  display: none;
}

#formAllianceBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


/* Queue and placement fix */
.friendsPanel {
  right: auto !important;
  top: auto !important;
  left: 50% !important;
  bottom: 34px !important;
  transform: translateX(-50%) !important;
  width: min(520px, calc(100vw - 80px)) !important;
}

.queuePanel {
  position: absolute;
  left: 50%;
  top: 476px;
  transform: translateX(-50%);
  min-width: 360px;
  max-width: min(620px, calc(100vw - 80px));
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(6, 12, 18, 0.56);
  border: 1px solid rgba(218, 183, 112, 0.18);
  box-shadow: 0 22px 55px rgba(0,0,0,0.30);
  backdrop-filter: blur(14px);
  color: rgba(255,255,255,0.72);
  text-align: center;
  font-size: 13px;
}

.queuePanel.hidden {
  display: none;
}

.serverCard.running {
  opacity: 0.88;
}

.serverCard.running .serverJoinHint {
  color: rgba(255,196,130,0.92);
}

.serverCard.countdown .serverJoinHint,
.serverCard.restarting .serverJoinHint,
.serverCard.waiting .serverJoinHint {
  color: rgba(150,255,195,0.88);
}


/* Live players, selected queue and AFK fix */
.livePlayersHud {
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 1600;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(4, 16, 11, 0.62);
  border: 1px solid rgba(76, 255, 150, 0.34);
  color: rgba(115, 255, 176, 0.96);
  font-family: Inter, Arial, sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  box-shadow: 0 16px 42px rgba(0,0,0,0.34), 0 0 24px rgba(76,255,150,0.08);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.serverCard.selected {
  border-color: rgba(76, 255, 150, 0.72) !important;
  background: rgba(8, 27, 18, 0.70) !important;
  box-shadow: 0 28px 90px rgba(0,0,0,0.45), 0 0 34px rgba(76,255,150,0.14) !important;
  transform: translateY(-4px);
}

.serverCard.selected .serverJoinHint::before {
  content: "Selected · ";
  color: rgba(76,255,150,0.92);
}

.queueWaitTime {
  display: block;
  margin-top: 8px;
  color: rgba(150,255,195,0.88);
  font-weight: 800;
}

.friendsPanel {
  right: auto !important;
  top: auto !important;
  left: 50% !important;
  bottom: 34px !important;
  transform: translateX(-50%) !important;
  width: min(520px, calc(100vw - 80px)) !important;
}




.emojiActions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
}

#diplomacyMenu .emojiBtn {
  display: grid;
  place-items: center;
  width: 100%;
  margin: 0;
  padding: 8px 0;
  text-align: center;
  font-size: 19px;
  line-height: 1;
}

#diplomacyMenu .emojiBtn:disabled {
  opacity: 0.32;
}


/* Performance/stability fix: live player HUD is lobby-only. */
body:not(.menu-open) #livePlayersHud {
  display: none !important;
}
#lobbyScreen.hidden ~ #livePlayersHud {
  display: none !important;
}


#inactivityKickNotice {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 32px));
  z-index: 999999;
  padding: 14px 14px 12px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 18px;
  background: rgba(5, 10, 14, 0.84);
  box-shadow: 0 18px 48px rgba(0,0,0,0.42);
  color: rgba(255,255,255,0.88);
  font-family: Inter, system-ui, Arial, sans-serif;
  backdrop-filter: blur(14px);
}

.inactivityKickNoticeTitle {
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inactivityKickNoticeText {
  font-size: 13px;
  line-height: 1.35;
  color: rgba(255,255,255,0.70);
  padding-right: 86px;
}

#inactivityKickNoticeClose {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.86);
  font: 800 12px Inter, system-ui, Arial, sans-serif;
  padding: 8px 12px;
  cursor: pointer;
}

#inactivityKickNoticeClose:hover {
  background: rgba(255,255,255,0.14);
}

#versionBadge {
  position: fixed !important;
  left: 16px !important;
  bottom: 10px !important;
  z-index: 999999 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: rgba(255,255,255,0.70) !important;
  font-family: Inter, system-ui, Arial, sans-serif !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: 0.8px !important;
  pointer-events: none !important;
  text-shadow: 0 2px 8px rgba(0,0,0,0.72) !important;
}

body.in-game #hud,
body.in-game #buildWrap {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body.in-game #playersHud,
body.in-game #eventsHud {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}


/* Alpha 1.2 widget/freeze repair: normal panel layout, no global flex vandalism */
#playersHud {
  position: fixed !important;
  top: 18px !important;
  right: 18px !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: 260px !important;
  max-width: calc(100vw - 36px) !important;
  padding: 14px 16px !important;
  border-radius: 18px !important;
  background: rgba(8, 14, 18, 0.78) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: 0 20px 48px rgba(0,0,0,0.32) !important;
  backdrop-filter: blur(16px) !important;
  z-index: 20 !important;
  display: block !important;
  color: rgba(255,255,255,0.92) !important;
}

#playersHud .playersHudTop {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin: 0 0 10px 0 !important;
  width: 100% !important;
}

#playersHud .panel-title {
  margin: 0 !important;
  font-size: 12px !important;
  letter-spacing: 1.2px !important;
  line-height: 1 !important;
  color: rgba(255,255,255,0.56) !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

#playersHudToggle {
  position: static !important;
  flex: 0 0 auto !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  background: rgba(255,255,255,0.06) !important;
  color: rgba(255,255,255,0.82) !important;
  font-size: 16px !important;
  line-height: 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#playersList {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

#playersHud.minimized {
  width: auto !important;
  min-width: 118px !important;
  padding: 12px 14px !important;
  border-radius: 16px !important;
}

#playersHud.minimized #playersList {
  display: none !important;
}

#playersHud.minimized .playersHudTop {
  margin: 0 !important;
}

#playersHud .playerRow {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 6px 0 !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
}

#playersHud .playerName {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#playersHud .playerPercent {
  justify-self: end !important;
  min-width: 42px !important;
  text-align: right !important;
  color: rgba(255,255,255,0.70) !important;
}

#eventsHud {
  display: block !important;
  right: 18px !important;
  bottom: 18px !important;
  width: 330px !important;
  padding: 14px 18px !important;
  border-radius: 16px !important;
}

#eventsHud .panel-title {
  display: block !important;
  margin: 0 0 10px 0 !important;
  line-height: 1 !important;
}

#eventsList {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

#eventsHud .eventItem {
  display: block !important;
  padding: 6px 0 !important;
  line-height: 1.35 !important;
}


/* Alpha 1.2 Safe-Time visibility repair */
#safeTimeHud {
  position: fixed !important;
  top: 18px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 99998 !important;
  padding: 9px 14px !important;
  border-radius: 999px !important;
  background: rgba(12, 18, 22, 0.84) !important;
  border: 1px solid rgba(255,255,255,0.13) !important;
  box-shadow: 0 14px 34px rgba(0,0,0,0.32) !important;
  color: rgba(255,255,255,0.88) !important;
  font: 800 12px Inter, system-ui, Arial, sans-serif !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  pointer-events: none !important;
  backdrop-filter: blur(14px) !important;
}

#safeTimeHud.hidden {
  display: none !important;
}


/* Alpha 1.2 livestream music mini player */
.streamMusicHud {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99997;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: calc(100vw - 36px);
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(8, 14, 18, 0.78);
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 18px 46px rgba(0,0,0,0.34);
  backdrop-filter: blur(16px);
  color: rgba(255,255,255,0.90);
  font-family: Inter, system-ui, Arial, sans-serif;
}



.streamMusicPlayButton {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  font: 900 15px Inter, system-ui, Arial, sans-serif;
  cursor: pointer;
}

.streamMusicPlayButton:hover {
  background: rgba(255,255,255,0.14);
}

.streamMusicText {
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.15;
}

.streamMusicTitle {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.streamMusicLink {
  display: inline-block;
  margin-top: 3px;
  color: rgba(148, 255, 188, 0.72);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.streamMusicLink:hover {
  color: rgba(178, 255, 210, 0.94);
}

.streamMusicVolume {
  width: 64px;
  accent-color: rgba(148, 255, 188, 0.95);
}

.streamMusicFrameWrap {
  position: fixed;
  width: 1px;
  height: 1px;
  left: -10px;
  top: -10px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.streamMusicFrameWrap iframe {
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}


/* Alpha 1.2 music/notifications layout fix:
   Start + lobby keep the music player bottom-right.
   In-game moves it to the left control column so it never overlaps Events/Notifications. */
.streamMusicHud {
  right: 18px !important;
  bottom: 18px !important;
  left: auto !important;
  top: auto !important;
}

body.in-game .streamMusicHud {
  left: 18px !important;
  top: 126px !important;
  right: auto !important;
  bottom: auto !important;
  width: 252px !important;
  min-width: 252px !important;
  max-width: 252px !important;
  padding: 9px 10px !important;
  border-radius: 16px !important;
  z-index: 48 !important;
}

body.in-game .streamMusicTitle {
  max-width: 116px !important;
}

body.in-game .streamMusicVolume {
  width: 54px !important;
}

body.in-game #eventsHud {
  right: 18px !important;
  bottom: 18px !important;
  z-index: 24 !important;
}

body.in-game #playersHud {
  right: 18px !important;
  top: 18px !important;
  z-index: 24 !important;
}

body.in-game #inactivityKickNotice {
  left: 18px !important;
  bottom: 18px !important;
  transform: none !important;
  z-index: 99999 !important;
}

.serverCard.locked{opacity:.72}.serverCard.locked .serverJoinHint{color:#ffcf9a}


/* Alpha 1.2 Countdown Hint Fix: one hint only, never over the countdown number. */
#mapStartHint,
.mapStartHint {
  position: fixed !important;
  left: 50% !important;
  top: calc(50% + 64px) !important;
  transform: translateX(-50%) !important;
  max-width: min(760px, calc(100vw - 48px)) !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: center !important;
  white-space: normal !important;
  font-size: 17px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  color: rgba(255,255,255,0.82) !important;
  text-transform: none !important;
  pointer-events: none !important;
  z-index: 20 !important;
}


/* Alpha 1.2 HUD Stability Fix: prevent value-width changes from moving the HUD. */
#hud {
  width: 720px !important;
  max-width: calc(100vw - 40px) !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 178px 128px 110px minmax(210px, 1fr) !important;
  column-gap: 22px !important;
  align-items: center !important;
  overflow: hidden !important;
}

#hud .hud-section {
  width: 100% !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  box-sizing: border-box !important;
}

#hud .slider-group {
  min-width: 0 !important;
  width: 100% !important;
  flex: 0 1 auto !important;
}

#hud .hud-value,
#hud .green,
#hud .gold,
#hud .soft,
#attackValue,
.playerPercent {
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" 1, "lnum" 1 !important;
}

#troopsValue {
  display: block !important;
  min-width: 168px !important;
  white-space: nowrap !important;
}

#troopIncomeValue {
  display: block !important;
  min-width: 168px !important;
  white-space: nowrap !important;
}

#populationValue {
  display: block !important;
  min-width: 96px !important;
  white-space: nowrap !important;
}

#coinsValue {
  display: block !important;
  min-width: 86px !important;
  white-space: nowrap !important;
}

#coinIncomeValue {
  display: block !important;
  min-width: 86px !important;
  white-space: nowrap !important;
}

#playersHud {
  width: 330px !important;
}

.playerRow {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 54px !important;
  align-items: center !important;
  column-gap: 12px !important;
}

.playerName {
  min-width: 0 !important;
}

.playerRole {
  opacity: 0.62;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  #hud {
    width: min(720px, calc(100vw - 28px)) !important;
    grid-template-columns: 150px 108px 92px minmax(160px, 1fr) !important;
    column-gap: 14px !important;
  }

  #troopsValue,
  #troopIncomeValue {
    min-width: 148px !important;
  }
}


/* Alpha 1.2 HUD Values + Mini Player Align Fix */
#hud {
  left: 18px !important;
  bottom: 18px !important;
  width: min(880px, calc(100vw - 42px)) !important;
  max-width: calc(100vw - 42px) !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: minmax(210px, 230px) minmax(126px, 142px) minmax(118px, 132px) minmax(250px, 1fr) !important;
  column-gap: 24px !important;
  align-items: center !important;
  overflow: visible !important;
}

#hud .hud-section,
#hud .slider-group {
  min-width: 0 !important;
  box-sizing: border-box !important;
}

#hud .hud-title {
  white-space: nowrap !important;
}

#hud .hud-value,
#hud .green,
#hud .gold,
#hud .soft,
#attackValue {
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" 1, "lnum" 1 !important;
}

#troopsValue {
  display: block !important;
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

#troopIncomeValue {
  display: block !important;
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

#populationValue,
#populationHint {
  display: block !important;
  width: 126px !important;
  min-width: 126px !important;
  max-width: 126px !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

#coinsValue,
#coinIncomeValue {
  display: block !important;
  width: 118px !important;
  min-width: 118px !important;
  max-width: 118px !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

#hud .slider-group {
  width: 100% !important;
  min-width: 250px !important;
}

#liveStreamMini {
  left: 14px !important;
  top: 58px !important;
}

@media (max-width: 900px) {
  #hud {
    width: calc(100vw - 28px) !important;
    grid-template-columns: minmax(170px, 190px) minmax(96px, 108px) minmax(82px, 96px) minmax(150px, 1fr) !important;
    column-gap: 12px !important;
  }

  #troopsValue,
  #troopIncomeValue {
    width: 184px !important;
    min-width: 184px !important;
    max-width: 184px !important;
  }

  #populationValue,
  #populationHint {
    width: 98px !important;
    min-width: 98px !important;
    max-width: 98px !important;
  }

  #coinsValue,
  #coinIncomeValue {
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
  }

  #hud .slider-group {
    min-width: 150px !important;
  }
}


/* Alpha 1.2 Final HUD Audit Fix: clean visibility, scale and positions for every active HUD. */
#hud {
  left: 18px !important;
  bottom: 18px !important;
  width: min(760px, calc(100vw - 42px)) !important;
  max-width: calc(100vw - 42px) !important;
  min-height: 78px !important;
  padding: 13px 16px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  overflow: visible !important;
}

#hud .hud-section {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  width: auto !important;
  box-sizing: border-box !important;
}

#hud .hud-section:nth-of-type(1) {
  width: 205px !important;
}

#hud .hud-section:nth-of-type(2) {
  width: 108px !important;
}

#hud .hud-section:nth-of-type(3) {
  width: 106px !important;
}

#hud .slider-group {
  flex: 1 1 180px !important;
  min-width: 170px !important;
  max-width: 240px !important;
  box-sizing: border-box !important;
}

#hud .hud-title,
#hud .slider-header {
  white-space: nowrap !important;
}

#hud .hud-value,
#hud .green,
#hud .gold,
#hud .soft,
#attackValue,
.playerPercent {
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" 1, "lnum" 1 !important;
}

#troopsValue,
#troopIncomeValue {
  display: block !important;
  width: 205px !important;
  min-width: 205px !important;
  max-width: 205px !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

#populationValue,
#populationHint {
  display: block !important;
  width: 108px !important;
  min-width: 108px !important;
  max-width: 108px !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

#coinsValue,
#coinIncomeValue {
  display: block !important;
  width: 106px !important;
  min-width: 106px !important;
  max-width: 106px !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

#playersHud {
  top: 16px !important;
  right: 16px !important;
  width: 250px !important;
  padding: 12px 14px !important;
  border-radius: 14px !important;
  background: rgba(8, 14, 22, 0.54) !important;
  border-color: rgba(255,255,255,0.055) !important;
  box-shadow: 0 14px 42px rgba(0,0,0,0.18) !important;
  backdrop-filter: blur(14px) !important;
}

.playersHudTop {
  margin-bottom: 8px !important;
}

#playersHud .panel-title {
  font-size: 11px !important;
  letter-spacing: 0.95px !important;
}

#playersHudToggle {
  width: 22px !important;
  height: 22px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
}

.playerRow {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 46px !important;
  align-items: center !important;
  column-gap: 8px !important;
  padding: 4px 0 !important;
  font-size: 12px !important;
}

.playerName {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.playerRole {
  opacity: 0.56 !important;
  font-size: 10px !important;
  font-weight: 650 !important;
  letter-spacing: 0.1px !important;
  white-space: nowrap !important;
}

.playerPercent {
  text-align: right !important;
  font-size: 12px !important;
}

#eventsHud {
  right: 18px !important;
  bottom: 18px !important;
  width: 305px !important;
  max-height: 156px !important;
  padding: 12px 15px !important;
  overflow: hidden !important;
  background: rgba(8, 14, 22, 0.60) !important;
}

.eventItem {
  font-size: 12px !important;
  padding: 4px 0 !important;
}

#buildWrap {
  left: 50% !important;
  bottom: 18px !important;
  transform: translateX(-50%) !important;
  max-width: min(760px, calc(100vw - 42px)) !important;
  box-sizing: border-box !important;
}

#safeTimeHud {
  top: 16px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  max-width: min(360px, calc(100vw - 36px)) !important;
  text-align: center !important;
}

#backToMenuBtn {
  left: 14px !important;
  top: 14px !important;
}

#liveStreamMini {
  left: 14px !important;
  top: 58px !important;
  width: 300px !important;
}

#liveStreamFrame {
  width: 300px !important;
  height: 169px !important;
}

@media (max-width: 980px) {
  #hud {
    width: min(690px, calc(100vw - 30px)) !important;
    gap: 11px !important;
    padding: 12px 13px !important;
  }

  #hud .hud-section:nth-of-type(1),
  #troopsValue,
  #troopIncomeValue {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
  }

  #hud .hud-section:nth-of-type(2),
  #populationValue,
  #populationHint {
    width: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
  }

  #hud .hud-section:nth-of-type(3),
  #coinsValue,
  #coinIncomeValue {
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
  }

  #hud .slider-group {
    min-width: 145px !important;
  }

  #playersHud {
    width: 235px !important;
  }
}


/* Alpha 1.2 Startcoins Placement UI Fix: final visual alignment pass. */
#hud {
  left: 18px !important;
  bottom: 18px !important;
}

#buildWrap {
  position: fixed !important;
  left: 18px !important;
  bottom: 110px !important;
  transform: none !important;
  max-width: min(720px, calc(100vw - 36px)) !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  z-index: 95 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

#buildToggle {
  height: 38px !important;
  min-width: 78px !important;
  padding: 0 16px !important;
  border-radius: 999px !important;
  flex: 0 0 auto !important;
}

#buildBar {
  max-width: min(620px, calc(100vw - 132px)) !important;
  flex-wrap: wrap !important;
  align-items: center !important;
}

#backToMenuBtn {
  top: 14px !important;
  left: 14px !important;
}

#liveStreamMini {
  top: 14px !important;
  right: 14px !important;
  left: auto !important;
  width: 300px !important;
  max-width: calc(100vw - 28px) !important;
  z-index: 90 !important;
}

.liveStreamFrameWrap,
#liveStreamFrame {
  width: 300px !important;
  height: 169px !important;
  max-width: calc(100vw - 28px) !important;
}

#playersHud {
  top: 228px !important;
  right: 14px !important;
}

@media (max-width: 980px) {
  #buildWrap {
    left: 14px !important;
    bottom: 104px !important;
    max-width: calc(100vw - 28px) !important;
  }

  #buildBar {
    max-width: calc(100vw - 118px) !important;
  }

  #liveStreamMini {
    top: 14px !important;
    right: 14px !important;
    width: 260px !important;
  }

  .liveStreamFrameWrap,
  #liveStreamFrame {
    width: 260px !important;
    height: 146px !important;
  }

  #playersHud {
    top: 198px !important;
    right: 14px !important;
  }
}


/* Alpha 1.2 Factory Freeze + One Row Build Menu Fix */
#buildWrap {
  left: 18px !important;
  bottom: 110px !important;
  transform: none !important;
  width: auto !important;
  max-width: calc(100vw - 36px) !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
}

#buildBar {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  max-width: calc(100vw - 126px) !important;
  white-space: nowrap !important;
  scrollbar-width: thin !important;
  padding-bottom: 2px !important;
}

#buildBar.hidden {
  display: none !important;
}

.buildItem {
  flex: 0 0 auto !important;
  width: 74px !important;
  min-width: 74px !important;
  max-width: 74px !important;
}

.buildCanvas {
  width: 42px !important;
  height: 42px !important;
}

.buildName,
.buildPrice {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 980px) {
  #buildWrap {
    left: 14px !important;
    bottom: 104px !important;
    max-width: calc(100vw - 28px) !important;
  }

  #buildBar {
    max-width: calc(100vw - 112px) !important;
  }

  .buildItem {
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
  }
}


/* Alpha 1.5a Hotfix: stream player top-left alignment in game screen. */
body:not(.menu-open) #liveStreamMini {
  top: 56px !important;
  left: 14px !important;
  right: auto !important;
  width: 300px !important;
  max-width: min(300px, calc(100vw - 28px)) !important;
  z-index: 80 !important;
}

body:not(.menu-open) .liveStreamFrameWrap,
body:not(.menu-open) #liveStreamFrame {
  width: 300px !important;
  height: 169px !important;
  max-width: min(300px, calc(100vw - 28px)) !important;
}

body:not(.menu-open) #playersHud {
  top: 14px !important;
  right: 14px !important;
}

@media (max-width: 980px) {
  body:not(.menu-open) #liveStreamMini {
    top: 54px !important;
    left: 14px !important;
    width: 260px !important;
    max-width: calc(100vw - 28px) !important;
  }

  body:not(.menu-open) .liveStreamFrameWrap,
  body:not(.menu-open) #liveStreamFrame {
    width: 260px !important;
    height: 146px !important;
  }
}


/* Alpha 1.5c: Live Music has no visible volume slider. */
.streamMusicVolume {
  display: none !important;
}


/* Alpha 1.5e: compact Live Music HUD + clear real-player marker. */
.streamMusicHud {
  min-width: 148px !important;
  padding: 7px 9px !important;
  gap: 7px !important;
  border-radius: 14px !important;
}
.streamMusicPlayButton {
  width: 30px !important;
  height: 30px !important;
  font-size: 13px !important;
}
.streamMusicTitle {
  font-size: 11px !important;
  letter-spacing: 0.035em !important;
}
.streamMusicLink {
  display: none !important;
}
body.in-game .streamMusicHud {
  width: 166px !important;
  min-width: 166px !important;
  max-width: 166px !important;
  padding: 7px 9px !important;
}
body.in-game .streamMusicTitle {
  max-width: 86px !important;
}
#playersHud .playerRole.real {
  color: #35f28f !important;
  text-shadow: 0 0 8px rgba(53,242,143,0.30) !important;
}
#playersHud .playerRole.bot {
  color: rgba(255,255,255,0.58) !important;
}


/* Alpha 1.6c: public alpha info, cookies and feedback */
.startInfoButton {
  position: fixed;
  left: 50%;
  bottom: 126px;
  transform: translateX(-50%);
  z-index: 160;
  color: rgba(230, 245, 255, 0.82);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid rgba(180, 220, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 10, 20, 0.46);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
}
.startInfoButton:hover {
  color: #ffffff;
  border-color: rgba(88, 240, 160, 0.55);
  box-shadow: 0 0 18px rgba(88, 240, 160, 0.18);
}

.startSupportButton {
  position: fixed;
  left: 50%;
  bottom: 166px;
  transform: translateX(-50%);
  z-index: 161;
  color: rgba(255, 246, 250, 0.92);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 9px 15px;
  border: 1px solid rgba(255, 150, 185, 0.30);
  border-radius: 999px;
  background: rgba(38, 8, 20, 0.54);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.24);
}
.startSupportButton:hover {
  color: #ffffff;
  border-color: rgba(255, 155, 190, 0.70);
  box-shadow: 0 0 20px rgba(255, 115, 170, 0.22);
}
.cookieConsentBar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  color: rgba(245, 250, 255, 0.92);
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid rgba(120, 180, 220, 0.28);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.55);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.cookieConsentBar.hidden { display: none !important; }
.cookieConsentText {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
}
.cookieConsentText strong {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #72f2a4;
}
.cookieConsentText span {
  color: rgba(240, 248, 255, 0.72);
}
.cookieConsentActions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.cookieConsentActions button,
.cookieInfoLink {
  border: 1px solid rgba(180, 220, 255, 0.28);
  background: rgba(255,255,255,0.06);
  color: rgba(245, 250, 255, 0.88);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
#cookieExternalBtn {
  border-color: rgba(92, 235, 150, 0.52);
  color: #d9ffe7;
  background: rgba(60, 180, 105, 0.16);
}
.cookieConsentActions button:hover,
.cookieInfoLink:hover {
  border-color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.12);
}
@media (max-width: 720px) {
  .cookieConsentBar {
    left: 10px;
    right: 10px;
    bottom: 10px;
    align-items: stretch;
    flex-direction: column;
  }
  .cookieConsentActions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .startInfoButton {
    bottom: 116px;
    max-width: calc(100vw - 32px);
    text-align: center;
  }
}

/* Alpha 1.6R: align compact Live Music HUD directly below Back to Menu in game screen. */
body.in-game .streamMusicHud {
  left: 14px !important;
  top: 56px !important;
  right: auto !important;
  bottom: auto !important;
}

@media (max-width: 980px) {
  body.in-game .streamMusicHud {
    left: 14px !important;
    top: 54px !important;
  }
}


.demolishConfirm{
  position:fixed;
  z-index:999999;
  width:260px;
  padding:12px;
  border:1px solid rgba(255,217,124,.38);
  border-radius:14px;
  background:rgba(7,12,24,.94);
  box-shadow:0 18px 52px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
  color:#f7edcf;
  font-family:system-ui,Arial,sans-serif;
  backdrop-filter:blur(12px);
}
.demolishConfirm.hidden{display:none}
.demolishConfirmTitle{font-weight:800;font-size:14px;margin-bottom:5px;color:#ffe5a4}
.demolishConfirmText{font-size:12px;line-height:1.35;color:#d8dbe7;margin-bottom:10px}
.demolishConfirmActions{display:flex;gap:8px;justify-content:flex-end}
.demolishConfirmActions button{
  cursor:pointer;
  border-radius:10px;
  padding:7px 10px;
  font-weight:800;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);
  color:#eef4ff;
}
.demolishConfirmActions .demolishConfirmButton{
  border-color:rgba(255,180,82,.55);
  background:linear-gradient(180deg,rgba(255,188,86,.28),rgba(194,98,34,.28));
  color:#ffe9bd;
}


/* Alpha 1.6ZK · Multiplayer Highscore Torture Fix: minimizable event feed */
#eventsHud .eventsHudTop {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin: 0 0 8px 0 !important;
}

#eventsHud .eventsHudTop .panel-title {
  margin: 0 !important;
}

#eventsHudToggle {
  width: 26px !important;
  height: 24px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.20) !important;
  background: rgba(255,255,255,0.08) !important;
  color: rgba(255,255,255,0.82) !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

#eventsHudToggle:hover {
  background: rgba(255,255,255,0.14) !important;
}

#eventsHud.minimized {
  width: 174px !important;
  padding: 10px 14px !important;
}

#eventsHud.minimized #eventsList {
  display: none !important;
}

#eventsHud .eventItem.eventHumor {
  color: rgba(216, 238, 255, 0.74) !important;
  font-style: italic !important;
}


/* Alpha 1.6ZK eventfeed/kofi overrides */
#eventsHud {
  pointer-events: auto !important;
}
#eventsHudToggle,
#eventsHud .eventsHudTop,
#eventsHud #eventsList {
  pointer-events: auto !important;
}
#eventsHud.minimized {
  width: 142px !important;
  max-height: 42px !important;
  padding: 9px 12px !important;
}
#eventsHud.minimized #eventsList {
  display: none !important;
}
#eventsHud.minimized .panel-title {
  opacity: 0.72 !important;
}
.startSupportButton {
  bottom: 178px !important;
  padding: 6px 10px !important;
  font-size: 10px !important;
  letter-spacing: 0.075em !important;
  font-weight: 760 !important;
  color: rgba(255, 245, 248, 0.78) !important;
  border-color: rgba(255, 160, 190, 0.20) !important;
  background: rgba(12, 18, 28, 0.28) !important;
  box-shadow: 0 8px 18px rgba(0,0,0,0.14) !important;
  backdrop-filter: blur(8px) !important;
}
.startSupportButton:hover {
  color: rgba(255,255,255,0.94) !important;
  border-color: rgba(255, 160, 190, 0.38) !important;
  background: rgba(24, 18, 30, 0.38) !important;
  box-shadow: 0 0 14px rgba(255, 115, 170, 0.10) !important;
}


/* Alpha 1.6ZK highscore top-10 scaling guard */
.startHighscorePanel {
  max-height: min(410px, calc(100vh - 210px));
  overflow: hidden;
}
.dailyHighscoreList {
  display: flex;
  flex-direction: column;
}
.scoreRow span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scoreRow strong {
  flex: 0 0 auto;
}

/* ALPHA 1.6ZM · Real map preview boarding lobby */
.lobbyServerGrid {
  top: 214px;
  width: min(760px, calc(100vw - 72px));
  display: block;
}

.boardingCard {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 42%) minmax(260px, 1fr);
  gap: 22px;
  min-height: 300px;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(5, 12, 18, 0.78), rgba(10, 20, 27, 0.62));
  border: 1px solid rgba(218, 183, 112, 0.20);
  box-shadow: 0 30px 90px rgba(0,0,0,0.44), inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(18px);
  color: rgba(255,255,255,0.90);
  overflow: hidden;
}

.boardingCard.locked {
  border-color: rgba(96, 255, 170, 0.72);
  box-shadow: 0 30px 96px rgba(0,0,0,0.48), 0 0 38px rgba(76,255,150,0.14), inset 0 1px 0 rgba(255,255,255,0.06);
}

.boardingCard.disabled { opacity: .78; }

.boardingPreview {
  position: relative;
  border-radius: 22px;
  min-height: 264px;
  background: radial-gradient(circle at 35% 28%, rgba(255,245,190,0.20), transparent 36%), linear-gradient(150deg, rgba(66,102,70,0.82), rgba(16,38,27,0.92));
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: inset 0 0 45px rgba(0,0,0,0.24);
  overflow: hidden;
}

.boardingPreview::before,
.boardingPreview::after {
  content: "";
  position: absolute;
  inset: 18% 10%;
  border-radius: 52% 48% 45% 55%;
  border: 1px solid rgba(255,255,255,0.11);
  transform: rotate(-12deg);
}

.boardingPreview::after {
  inset: 36% 18% 24% 18%;
  transform: rotate(18deg);
  opacity: .62;
}

.boardingPreview.ice { background: radial-gradient(circle at 32% 24%, rgba(240,255,255,0.32), transparent 35%), linear-gradient(150deg, rgba(104,150,166,0.82), rgba(23,49,65,0.94)); }
.boardingPreview.art { background: radial-gradient(circle at 34% 24%, rgba(255,229,180,0.24), transparent 32%), linear-gradient(150deg, rgba(108,88,118,0.86), rgba(30,23,43,0.94)); }

.boardingMapBadge {
  position: absolute;
  left: 16px;
  top: 16px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(2,8,12,0.54);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,245,225,0.88);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.6px;
}

.boardingPulse {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(76,255,150,0.12);
  border: 1px solid rgba(76,255,150,0.36);
  box-shadow: 0 0 24px rgba(76,255,150,0.16);
}

.boardingBody { padding: 8px 8px 6px 0; display: flex; flex-direction: column; justify-content: center; }
.boardingEyebrow { font-size: 10px; font-weight: 950; letter-spacing: 2.2px; text-transform: uppercase; color: rgba(230,205,156,0.88); }
.boardingBody h2 { margin: 10px 0 12px; font-size: clamp(27px, 3.8vw, 42px); line-height: .98; color: rgba(255,245,225,0.98); }
.boardingCountdown { font-size: 15px; color: rgba(255,255,255,0.72); }
.boardingCountdown strong { color: rgba(140,255,190,0.95); font-size: 24px; margin-left: 6px; }
.boardingStats { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 10px; }
.boardingStats span { padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); font-size: 12px; color: rgba(255,255,255,0.74); }
.boardingMeta { margin-bottom: 18px; color: rgba(255,255,255,0.46); font-size: 12px; line-height: 1.45; }
.boardingActions { display: flex; gap: 10px; align-items: center; }
.boardingJoinBtn,
.boardingLeaveBtn {
  height: 44px;
  border-radius: 15px;
  border: 1px solid rgba(218,183,112,0.25);
  background: rgba(218,183,112,0.14);
  color: rgba(255,245,225,0.94);
  font-weight: 950;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 0 18px;
  cursor: pointer;
}
.boardingJoinBtn:hover:not(:disabled), .boardingLeaveBtn:hover { background: rgba(218,183,112,0.21); border-color: rgba(218,183,112,0.42); }
.boardingJoinBtn:disabled { opacity: .62; cursor: default; }
.boardingLeaveBtn { background: rgba(255,100,110,0.10); border-color: rgba(255,130,130,0.22); }
.boardingLeaveBtn.hidden { display: none; }

@media (max-width: 760px) {
  .lobbyHeader { top: 70px; width: min(520px, calc(100vw - 40px)); }
  .lobbyServerGrid { top: 205px; width: min(560px, calc(100vw - 34px)); }
  .boardingCard { grid-template-columns: 1fr; min-height: 0; gap: 14px; padding: 14px; }
  .boardingPreview { min-height: 150px; }
  .boardingBody { padding: 2px; }
  .boardingBody h2 { font-size: 30px; }
  .boardingActions { flex-direction: column; align-items: stretch; }
  .boardingJoinBtn, .boardingLeaveBtn { width: 100%; }
  .friendsPanel { display: none; }
}
.mapStartHint[data-risk="near_human"]{border-color:rgba(255,210,100,.55)!important;color:rgba(255,232,160,.96)!important}
.mapStartHint[data-risk="too_close"]{border-color:rgba(255,110,120,.65)!important;color:rgba(255,170,180,.98)!important}
@media (max-width: 920px) { .friendsPanel { display: none !important; } }


/* ALPHA 1.6ZM · Real PNG map previews in boarding lobby */
.boardingPreview.realMapPreview { background: rgba(2, 8, 12, 0.82); border-color: rgba(255, 255, 255, 0.13); }
.boardingPreview.realMapPreview::before, .boardingPreview.realMapPreview::after { display: none; }
.boardingMapImage { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.01); filter: saturate(1.04) contrast(1.04) brightness(0.92); }
.boardingMapShade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0.10), rgba(0,0,0,0.24) 58%, rgba(0,0,0,0.44)); }
.boardingPreview.realMapPreview.ice .boardingMapImage { filter: saturate(1.02) contrast(1.05) brightness(0.96); }
.boardingPreview.realMapPreview.art .boardingMapImage { filter: saturate(1.07) contrast(1.04) brightness(0.94); }
.boardingPreview.realMapPreview .boardingMapBadge { max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: rgba(2,8,12,0.64); backdrop-filter: blur(8px); }
.boardingPreview.realMapPreview .boardingPulse { background: rgba(76,255,150,0.11); backdrop-filter: blur(8px); }


/* ALPHA 1.6ZQ · Startpage Boarding UI: the separate lobby is visually retired. */
#lobbyScreen {
  display: none !important;
  pointer-events: none !important;
}

#startScreen {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(33, 55, 54, 0.28), transparent 44%),
    linear-gradient(90deg, rgba(2,7,11,0.78), rgba(3,8,12,0.30) 28%, rgba(3,8,12,0.26) 70%, rgba(2,7,11,0.80)),
    url("assets/startscreen.png") center center / cover no-repeat;
}

.startLayout {
  position: absolute;
  inset: 28px 34px 28px 34px;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(420px, 1fr) minmax(250px, 330px);
  gap: clamp(18px, 2vw, 30px);
  align-items: center;
  max-width: 1420px;
  margin: 0 auto;
}

.startLeftStack,
.startCenterStack,
.startRightStack {
  min-width: 0;
}

.startLeftStack,
.startRightStack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: start;
  padding-top: 16px;
}

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

#startScreen .startSidePanel,
#startScreen .friendsPanel,
#startScreen .startExplainPanel,
#startScreen .startLivePanel,
#startScreen .startJoinPanel,
#startScreen .startTitleBlock,
#startScreen .startSupportLine {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: auto !important;
  border-radius: 20px;
  background: rgba(5, 12, 18, 0.58);
  border: 1px solid rgba(218, 183, 112, 0.16);
  box-shadow: 0 22px 62px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.045);
  backdrop-filter: blur(16px);
}

#startScreen .startStatsPanel,
#startScreen .startHighscorePanel,
#startScreen .startFriendsPanel {
  padding: 14px 16px;
}

#startScreen .dailyHighscoreList {
  max-height: 238px;
  overflow: hidden;
}

#startScreen .scoreRow,
#startScreen .statRow {
  font-size: 12px;
  padding: 6px 0;
}

.startTitleBlock {
  width: min(620px, 100%);
  padding: 18px 24px 16px;
  text-align: center;
  background: rgba(5, 12, 18, 0.42) !important;
}
.startEyebrow {
  color: rgba(230,205,156,0.86);
  font-size: 10px;
  letter-spacing: 3px;
  font-weight: 950;
}
.startTitleBlock h1 {
  margin: 8px 0 8px;
  color: rgba(255,245,225,0.98);
  font-size: clamp(34px, 5vw, 64px);
  line-height: .9;
  letter-spacing: 2.5px;
  text-shadow: 0 12px 44px rgba(0,0,0,0.46);
}
.startTitleBlock p {
  margin: 0;
  color: rgba(255,255,255,0.64);
  font-size: 13px;
}

.startJoinPanel {
  width: min(720px, 100%);
  padding: 16px;
  background: linear-gradient(145deg, rgba(4, 10, 16, 0.78), rgba(9, 18, 24, 0.66)) !important;
}
.startJoinTopline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin: 2px 2px 12px;
  color: rgba(230,205,156,0.88);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.startJoinTopline strong {
  color: rgba(140,255,190,0.80);
  font-size: 9px;
  letter-spacing: 1.6px;
}
.startNameRow {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(170px, auto);
  gap: 10px;
  margin-bottom: 10px;
}
#startScreen .startBottom {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  display: none;
}
#startScreen #playerNameInput,
#startScreen #playButton {
  width: 100%;
  height: 44px;
}
#startScreen #playButton {
  min-width: 170px;
  padding: 0 18px;
}
#startScreen .startNameError {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  width: auto;
  max-width: none;
  min-height: 16px;
  margin: 0 2px 10px;
  text-align: left;
}
#startScreen .lobbyStatus {
  position: relative;
  margin: 6px 2px 12px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.62);
  font-size: 12px;
}
#startScreen .lobbyServerGrid {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  width: 100% !important;
  display: block !important;
  margin: 0;
}
#startScreen .boardingCard {
  grid-template-columns: minmax(190px, 42%) minmax(240px, 1fr);
  gap: 18px;
  min-height: 250px;
  padding: 14px;
  border-radius: 24px;
}
#startScreen .boardingPreview {
  min-height: 222px;
  border-radius: 19px;
}
#startScreen .boardingBody { padding: 4px 4px 4px 0; }
#startScreen .boardingBody h2 {
  font-size: clamp(26px, 3.2vw, 38px);
  margin: 8px 0 10px;
}
#startScreen .boardingStats { margin: 14px 0 10px; }
#startScreen .boardingMeta { margin-bottom: 14px; }
#startScreen .queuePanel {
  position: relative;
  margin-top: 10px;
}
.startSupportLine {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  background: rgba(5, 12, 18, 0.42) !important;
}
#startScreen .startSupportButton,
#startScreen .startInfoButton {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  text-decoration: none;
}
#startScreen .startSupportButton {
  background: rgba(255,110,145,0.10);
  border-color: rgba(255,150,175,0.18);
}
#startScreen .startInfoButton {
  background: rgba(255,255,255,0.045);
  border-color: rgba(255,255,255,0.08);
}
.startExplainPanel,
.startLivePanel {
  padding: 16px 17px;
}
.startExplainPanel p {
  margin: 10px 0 0;
  color: rgba(255,255,255,0.68);
  font-size: 13px;
  line-height: 1.45;
}
.startExplainPanel strong { color: rgba(230,205,156,0.92); }
.startLivePanel .livePlayersHud {
  position: relative !important;
  right: auto !important;
  top: auto !important;
  display: block;
  width: fit-content;
  margin: 4px 0 10px;
  z-index: 1;
}
.startLiveHint {
  color: rgba(255,255,255,0.54);
  font-size: 12px;
  line-height: 1.45;
}
body.menu-open #livePlayersHud.hidden { display: none !important; }
body:not(.menu-open) #livePlayersHud { display: none !important; }

@media (max-width: 1120px) {
  .startLayout {
    inset: 18px;
    grid-template-columns: minmax(210px, 250px) minmax(390px, 1fr);
    grid-template-areas:
      "left center"
      "right center";
    align-items: start;
    overflow-y: auto;
    padding-right: 4px;
  }
  .startLeftStack { grid-area: left; }
  .startCenterStack { grid-area: center; align-self: start; padding-top: 12px; }
  .startRightStack { grid-area: right; padding-top: 0; }
  #startScreen .boardingCard { grid-template-columns: 1fr; }
  #startScreen .boardingPreview { min-height: 190px; }
}

@media (max-width: 760px) {
  .startLayout {
    inset: 14px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }
  .startLeftStack, .startRightStack, .startCenterStack {
    width: 100%;
    padding-top: 0;
  }
  .startCenterStack { order: 1; }
  .startLeftStack { order: 2; }
  .startRightStack { order: 3; }
  .startNameRow { grid-template-columns: 1fr; }
  .startTitleBlock h1 { font-size: 36px; }
  #startScreen .boardingActions { flex-direction: column; align-items: stretch; }
  #startScreen .boardingJoinBtn, #startScreen .boardingLeaveBtn { width: 100%; }
}

/* ALPHA 1.6ZQ · visual fit pass after screenshot review */
#startScreen .startHighscorePanel {
  padding: 12px 15px;
}
#startScreen .startHighscorePanel .scoreRow {
  padding: 4px 0;
  font-size: 11px;
  line-height: 1.25;
}
#startScreen .startHighscorePanel .startPanelTitle {
  margin-bottom: 7px;
}
#startScreen .dailyHighscoreList {
  max-height: 228px;
}

@media (min-width: 1121px) and (max-height: 780px) {
  .startLayout {
    inset: 24px 34px 20px;
  }
  .startLeftStack,
  .startRightStack {
    padding-top: 0;
    gap: 12px;
  }
  .startCenterStack {
    gap: 12px;
  }
  .startTitleBlock {
    padding: 13px 22px 12px;
  }
  .startTitleBlock h1 {
    font-size: clamp(34px, 4.2vw, 52px);
    margin: 6px 0 6px;
  }
  .startTitleBlock p {
    font-size: 12px;
  }
  .startJoinPanel {
    padding: 14px;
  }
  #startScreen .boardingCard {
    min-height: 214px;
    padding: 12px;
    gap: 16px;
  }
  #startScreen .boardingPreview {
    min-height: 194px;
  }
  #startScreen .boardingBody h2 {
    font-size: clamp(25px, 3vw, 35px);
  }
  #startScreen .boardingStats {
    margin: 12px 0 8px;
  }
  #startScreen .boardingMeta {
    margin-bottom: 10px;
  }
  #startScreen .boardingJoinBtn,
  #startScreen .boardingLeaveBtn {
    height: 40px;
  }
  .startSupportLine {
    padding: 8px;
  }
}

/* ALPHA 1.6ZQ · compact 720p screenshot pass */
@media (min-width: 1121px) and (max-height: 740px) {
  .startTitleBlock {
    padding: 9px 20px 9px;
  }
  .startTitleBlock h1 {
    font-size: clamp(31px, 3.75vw, 46px);
    letter-spacing: 2px;
    margin: 4px 0;
  }
  .startEyebrow {
    font-size: 9px;
  }
  .startTitleBlock p {
    font-size: 11px;
  }
  #startScreen .boardingCard {
    min-height: 200px;
  }
  #startScreen .boardingPreview {
    min-height: 180px;
  }
  #startScreen .boardingBody h2 {
    font-size: clamp(24px, 2.7vw, 32px);
    margin-bottom: 7px;
  }
  #startScreen .boardingCountdown strong {
    font-size: 21px;
  }
  #startScreen .boardingStats span {
    padding: 6px 9px;
  }
  .startSupportLine {
    padding: 7px;
  }
  #startScreen .startSupportButton,
  #startScreen .startInfoButton {
    height: 31px;
  }
}


/* ALPHA 1.6ZR · Startpage layout stability fix
   - Title HUD above Join is removed.
   - Join Next Game card uses fixed metrics and tabular numbers so live values do not resize the layout.
   - Ko-fi/Info support row gets a stable gap and never touches the join panel. */
#startScreen .startTitleBlock {
  display: none !important;
}

#startScreen .startCenterStack {
  justify-content: center;
  gap: 18px;
  min-height: calc(100vh - 72px);
}

#startScreen .startJoinPanel {
  width: min(720px, 100%) !important;
  min-height: 455px;
  padding: 18px !important;
  overflow: hidden;
  contain: layout paint;
}

#startScreen .startJoinTopline,
#startScreen .lobbyStatus,
#startScreen .startNameError,
#startScreen .boardingCard,
#startScreen .boardingStats,
#startScreen .boardingCountdown,
#startScreen .boardingMeta,
#startScreen .livePlayersHud {
  font-variant-numeric: tabular-nums lining-nums;
}

#startScreen .startJoinTopline {
  min-height: 15px;
}

#startScreen .startNameError {
  min-height: 18px;
  line-height: 18px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#startScreen .lobbyStatus {
  min-height: 34px;
  line-height: 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#startScreen .boardingCard {
  height: 252px;
  min-height: 252px;
  max-height: 252px;
  align-items: stretch;
}

#startScreen .boardingPreview {
  height: 224px;
  min-height: 224px;
  max-height: 224px;
}

#startScreen .boardingBody {
  min-width: 0;
  height: 224px;
  justify-content: center;
}

#startScreen .boardingBody h2 {
  min-height: 43px;
  max-height: 43px;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#startScreen .boardingCountdown {
  min-height: 30px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

#startScreen .boardingCountdown strong {
  display: inline-block;
  min-width: 58px;
  text-align: left;
}

#startScreen .boardingStats {
  min-height: 32px;
  flex-wrap: nowrap;
  overflow: hidden;
}

#startScreen .boardingStats span {
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: center;
}

#startScreen .boardingStats span:nth-child(1) { min-width: 126px; }
#startScreen .boardingStats span:nth-child(2) { min-width: 108px; }
#startScreen .boardingStats span:nth-child(3) { min-width: 74px; }

#startScreen .boardingMeta {
  min-height: 34px;
  max-height: 34px;
  overflow: hidden;
}

#startScreen .boardingActions {
  min-height: 42px;
  align-items: center;
}

#startScreen .boardingJoinBtn,
#startScreen .boardingLeaveBtn {
  flex: 0 0 auto;
  min-width: 166px;
  white-space: nowrap;
}

#startScreen .startSupportLine {
  margin-top: 16px;
  padding: 10px 12px !important;
  gap: 14px !important;
  min-height: 54px;
  align-items: center;
  width: min(360px, 100%) !important;
}

#startScreen .startSupportButton,
#startScreen .startInfoButton {
  flex: 0 0 auto;
  white-space: nowrap;
}

#startScreen .livePlayersHud {
  min-width: 204px;
  text-align: center;
}

@media (min-width: 1121px) and (max-height: 780px) {
  #startScreen .startCenterStack {
    min-height: calc(100vh - 56px);
    gap: 14px;
  }
  #startScreen .startJoinPanel {
    min-height: 425px;
    padding: 16px !important;
  }
  #startScreen .boardingCard {
    height: 224px;
    min-height: 224px;
    max-height: 224px;
  }
  #startScreen .boardingPreview,
  #startScreen .boardingBody {
    height: 200px;
    min-height: 200px;
    max-height: 200px;
  }
  #startScreen .boardingBody h2 {
    min-height: 36px;
    max-height: 36px;
  }
  #startScreen .boardingMeta {
    min-height: 30px;
    max-height: 30px;
  }
  #startScreen .startSupportLine {
    margin-top: 12px;
    min-height: 48px;
  }
}

@media (max-width: 1120px) {
  #startScreen .startCenterStack {
    min-height: 0;
  }
  #startScreen .startJoinPanel {
    min-height: 0;
  }
  #startScreen .boardingCard {
    height: auto;
    min-height: 0;
    max-height: none;
  }
  #startScreen .boardingPreview,
  #startScreen .boardingBody {
    height: auto;
    max-height: none;
  }
  #startScreen .boardingBody h2,
  #startScreen .boardingMeta {
    max-height: none;
  }
  #startScreen .boardingStats {
    flex-wrap: wrap;
  }
  #startScreen .boardingStats span {
    min-width: 0 !important;
  }
  #startScreen .startSupportLine {
    margin-top: 12px;
  }
}

@media (max-width: 760px) {
  #startScreen .boardingCountdown {
    white-space: normal;
  }
  #startScreen .startSupportLine {
    width: 100% !important;
    flex-wrap: wrap;
  }
}


/* ALPHA 1.6ZR · Start page cleanup: remove Slow Horizon live/music HUD from menu/start. */
body.menu-open .streamMusicHud,
#startScreen:not(.hidden) ~ .streamMusicHud {
  display: none !important;
  pointer-events: none !important;
}

/* ALPHA 1.6ZR · bottom support row spacing guard. */
#startScreen .startSupportLine {
  column-gap: 18px !important;
  row-gap: 10px !important;
}
#startScreen .startSupportButton,
#startScreen .startInfoButton {
  margin: 0 !important;
}


/* ALPHA 1.6ZR · hard support-button geometry reset after removing fixed legacy buttons. */
#startScreen .startSupportLine {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 18px !important;
  padding: 10px 16px !important;
}
#startScreen .startSupportButton,
#startScreen .startInfoButton {
  position: static !important;
  transform: none !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}


/* ALPHA 1.6ZR · How-to HUD is collapsed by default, still expandable. */
#startScreen .startHowToPanel {
  padding: 0 !important;
  overflow: hidden;
}
#startScreen .startHowToSummary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 16px;
  user-select: none;
}
#startScreen .startHowToSummary::-webkit-details-marker {
  display: none;
}
#startScreen .startHowToToggle {
  flex: 0 0 auto;
  min-width: 54px;
  text-align: center;
  color: rgba(140,255,190,0.82);
  border: 1px solid rgba(140,255,190,0.18);
  background: rgba(140,255,190,0.055);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
#startScreen .startHowToPanel[open] .startHowToToggle {
  color: rgba(255,220,150,0.86);
  border-color: rgba(255,220,150,0.20);
  background: rgba(255,220,150,0.06);
}
#startScreen .startHowToPanel[open] .startHowToToggle::before {
  content: "Close";
}
#startScreen .startHowToPanel[open] .startHowToToggle {
  font-size: 0;
}
#startScreen .startHowToPanel[open] .startHowToToggle::before {
  font-size: 10px;
}
#startScreen .startHowToContent {
  padding: 0 16px 14px;
  border-top: 1px solid rgba(255,255,255,0.055);
}
#startScreen .startHowToContent p {
  margin: 9px 0 0;
}
#startScreen .startExplainPanel p {
  font-size: 12.5px;
}

/* ALPHA 1.6ZR · remove the last push rebound/spam click lock. Real population/recovery is the only gameplay limiter. */

/* ALPHA 1.6ZR · compact tablet/small-desktop fit after screenshot review. */
@media (max-width: 1120px) and (min-width: 761px) {
  .startLayout {
    inset: 18px 18px 18px 18px;
    grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
    grid-template-areas:
      "left center"
      "right center";
    gap: 18px;
    align-items: start;
    overflow-y: auto;
    padding-right: 4px;
  }
  .startLeftStack { grid-area: left; }
  .startRightStack { grid-area: right; }
  .startCenterStack {
    grid-area: center;
    align-self: start;
    padding-top: 0;
    gap: 12px;
  }
  #startScreen .startJoinPanel {
    min-height: 0 !important;
    padding: 12px !important;
  }
  #startScreen .startNameRow {
    gap: 8px;
    margin-bottom: 8px;
  }
  #startScreen #playerNameInput,
  #startScreen #playButton {
    height: 40px;
  }
  #startScreen .startNameError {
    margin-bottom: 8px;
    min-height: 17px;
    line-height: 17px;
  }
  #startScreen .lobbyStatus {
    min-height: 30px;
    line-height: 15px;
    margin: 5px 2px 10px;
    padding: 7px 10px;
  }
  #startScreen .boardingCard {
    grid-template-columns: minmax(145px, 40%) minmax(210px, 1fr) !important;
    gap: 12px !important;
    height: 210px !important;
    min-height: 210px !important;
    max-height: 210px !important;
    padding: 12px !important;
    align-items: stretch;
  }
  #startScreen .boardingPreview,
  #startScreen .boardingBody {
    height: 186px !important;
    min-height: 186px !important;
    max-height: 186px !important;
  }
  #startScreen .boardingBody h2 {
    font-size: clamp(24px, 3.1vw, 31px) !important;
    min-height: 33px !important;
    max-height: 33px !important;
    margin: 5px 0 7px !important;
  }
  #startScreen .boardingCountdown {
    min-height: 26px !important;
    font-size: 12px;
  }
  #startScreen .boardingCountdown strong {
    min-width: 54px;
    font-size: 24px !important;
  }
  #startScreen .boardingStats {
    min-height: 28px !important;
    margin: 8px 0 7px !important;
    gap: 6px;
    flex-wrap: nowrap !important;
  }
  #startScreen .boardingStats span {
    min-width: 0 !important;
    padding: 5px 7px !important;
    font-size: 10px !important;
  }
  #startScreen .boardingMeta {
    min-height: 28px !important;
    max-height: 28px !important;
    margin-bottom: 8px !important;
    font-size: 11px;
  }
  #startScreen .boardingActions {
    min-height: 36px !important;
  }
  #startScreen .boardingJoinBtn,
  #startScreen .boardingLeaveBtn {
    height: 36px !important;
    min-width: 136px !important;
    padding: 0 14px !important;
    font-size: 11px !important;
  }
  #startScreen .startSupportLine {
    margin-top: 10px !important;
    min-height: 52px !important;
    padding: 9px 14px !important;
  }
  #startScreen .startSupportButton,
  #startScreen .startInfoButton {
    height: 32px !important;
  }
  #startScreen .dailyHighscoreList {
    max-height: 210px;
  }
}

/* ALPHA 1.6ZR · remove version clutter from startpage so bottom support/info/live panels never collide visually. */
body.menu-open #versionBadge {
  display: none !important;
}

/* ALPHA 1.6ZR · 800x600 fit: keep live status visible without panels touching. */
@media (max-width: 900px) and (max-height: 650px) and (min-width: 761px) {
  .startLayout {
    inset: 18px 18px 12px 18px;
    gap: 12px 18px;
  }
  .startLeftStack,
  .startRightStack {
    gap: 10px;
  }
  #startScreen .startStatsPanel,
  #startScreen .startHighscorePanel,
  #startScreen .startFriendsPanel,
  #startScreen .startLivePanel {
    padding: 12px 14px;
  }
  #startScreen .startStatsPanel .statRow {
    padding: 4px 0;
    font-size: 12px;
  }
  #startScreen .startHighscorePanel .scoreRow {
    padding: 3px 0;
    font-size: 10.5px;
    line-height: 1.16;
  }
  #startScreen .dailyHighscoreList {
    max-height: 188px;
    overflow: hidden;
  }
  #startScreen .startHowToSummary {
    min-height: 42px;
    padding: 0 14px;
  }
  #startScreen .startLivePanel .livePlayersHud,
  #startScreen .livePlayersHud {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 11px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .startLiveHint {
    font-size: 11px;
    line-height: 1.25;
  }
}


/* ALPHA 1.6ZS · Startpage background UI polish
   Uses the clean generated map background, moves name entry to the right column,
   and retunes panels to a calmer premium parchment/slate style. */
#startScreen {
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 244, 219, 0.16), transparent 38%),
    linear-gradient(90deg, rgba(12,17,18,0.64), rgba(247,231,201,0.08) 33%, rgba(247,231,201,0.06) 66%, rgba(12,17,18,0.60)),
    linear-gradient(180deg, rgba(5,8,10,0.06), rgba(4,7,10,0.22)),
    url("assets/startpage_bg_zs.png") center center / cover no-repeat !important;
}

#startScreen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 49%, rgba(248,238,214,0.22), rgba(248,238,214,0.02) 36%, transparent 58%),
    linear-gradient(180deg, rgba(0,0,0,0.04), rgba(0,0,0,0.18));
  z-index: 0;
}

#startScreen .startLayout {
  z-index: 1;
  grid-template-columns: minmax(225px, 286px) minmax(430px, 1fr) minmax(265px, 342px);
  gap: clamp(20px, 2.35vw, 34px);
}

#startScreen .startSidePanel,
#startScreen .friendsPanel,
#startScreen .startExplainPanel,
#startScreen .startLivePanel,
#startScreen .startNamePanel,
#startScreen .startJoinPanel,
#startScreen .startSupportLine {
  background: linear-gradient(145deg, rgba(20,27,28,0.70), rgba(36,35,30,0.48)) !important;
  border: 1px solid rgba(226, 196, 136, 0.24) !important;
  box-shadow: 0 24px 70px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.075) !important;
  backdrop-filter: blur(18px) saturate(1.06);
  color: rgba(255,248,232,0.90);
}

#startScreen .startJoinPanel {
  background: linear-gradient(145deg, rgba(16,22,24,0.78), rgba(42,39,31,0.58)) !important;
  border-color: rgba(233,200,137,0.30) !important;
}

#startScreen .boardingCard {
  background: rgba(9, 15, 18, 0.52) !important;
  border-color: rgba(233,200,137,0.25) !important;
}

#startScreen .startPanelTitle,
#startScreen .friendsTitle,
#startScreen .boardingEyebrow,
#startScreen .startJoinTopline {
  color: rgba(238, 205, 142, 0.94) !important;
  letter-spacing: 1.75px;
}

#startScreen .statRow,
#startScreen .scoreRow,
#startScreen .startExplainPanel p,
#startScreen .startLiveHint,
#startScreen .boardingMeta,
#startScreen .boardingCountdown,
#startScreen .lobbyStatus,
#startScreen .startJoinHint {
  color: rgba(255,250,236,0.70) !important;
}

#startScreen .statRow strong,
#startScreen .scoreRow strong,
#startScreen .boardingCountdown strong,
#startScreen .livePlayersHud {
  color: rgba(164, 255, 195, 0.96) !important;
}

#startScreen .startNamePanel {
  padding: 16px 17px !important;
  border-radius: 20px;
}

#startScreen .startNamePanel .startNameRow {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 11px 0 8px;
}

#startScreen .startNamePanel #playerNameInput,
#startScreen .startNamePanel #playButton {
  height: 42px;
  width: 100%;
}

#startScreen .startNamePanel #playerNameInput {
  background: rgba(255, 248, 226, 0.10);
  border: 1px solid rgba(244, 213, 154, 0.28);
  color: rgba(255, 250, 236, 0.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}

#startScreen .startNamePanel #playerNameInput::placeholder {
  color: rgba(255,245,225,0.48);
}

#startScreen .startNamePanel #playButton,
#startScreen .boardingJoinBtn {
  background: linear-gradient(180deg, rgba(224,190,118,0.25), rgba(176,137,72,0.16));
  border: 1px solid rgba(237,203,139,0.36);
  color: rgba(255,245,225,0.96);
}

#startScreen .startNamePanel #playButton:hover:not(:disabled),
#startScreen .boardingJoinBtn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(234,202,136,0.34), rgba(190,148,78,0.22));
}

#startScreen .startNamePanel #playButton:disabled {
  opacity: .52;
}

#startScreen .startNamePanel #startNameError {
  display: block;
  min-height: 18px;
  margin: 0;
  font-size: 11px;
  color: rgba(255,202,166,0.80) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#startScreen .startNamePanel #startNameError.ok {
  color: rgba(164,255,195,0.88) !important;
}

#startScreen .startJoinHint {
  min-height: 18px;
  margin: 0 2px 10px;
  font-size: 12px;
}

#startScreen .startSupportLine {
  background: rgba(18,24,25,0.54) !important;
}

#startScreen .startSupportButton {
  background: rgba(255,118,150,0.12) !important;
  border-color: rgba(255,167,186,0.24) !important;
}

#startScreen .startInfoButton {
  background: rgba(255, 248, 226, 0.07) !important;
  border-color: rgba(244, 213, 154, 0.16) !important;
}

#startScreen .startHowToSummary {
  color: rgba(255,248,232,0.90);
}

#startScreen .startHowToToggle {
  color: rgba(164,255,195,0.88) !important;
  border-color: rgba(164,255,195,0.22) !important;
  background: rgba(164,255,195,0.06) !important;
}

@media (min-width: 1121px) and (max-height: 780px) {
  #startScreen .startNamePanel {
    padding: 13px 15px !important;
  }
  #startScreen .startNamePanel .startNameRow {
    margin: 9px 0 7px;
  }
}

@media (max-width: 1120px) {
  #startScreen .startLayout {
    grid-template-columns: minmax(210px, 255px) minmax(390px, 1fr);
    grid-template-areas:
      "left center"
      "right center";
  }
}

@media (max-width: 760px) {
  #startScreen .startNamePanel .startNameRow {
    flex-direction: column;
  }
}


/* ALPHA 1.6ZS · screenshot adjustment pass
   Keep live numbers stable, prevent stat-pill clipping, and keep compact embeds calm. */
#startScreen .boardingStats {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px !important;
  overflow: visible !important;
  min-height: 30px;
}
#startScreen .boardingStats span,
#startScreen .boardingStats span:nth-child(1),
#startScreen .boardingStats span:nth-child(2),
#startScreen .boardingStats span:nth-child(3) {
  min-width: 0 !important;
  width: auto !important;
  padding: 6px 5px !important;
  font-size: 11px !important;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1120px) {
  #startScreen .startLivePanel {
    display: none !important;
  }
  #startScreen .startRightStack {
    gap: 10px;
  }
  #startScreen .startNamePanel {
    padding: 12px 14px !important;
  }
  #startScreen .startNamePanel .startNameRow {
    margin: 8px 0 6px;
  }
  #startScreen .startNamePanel #playerNameInput,
  #startScreen .startNamePanel #playButton {
    height: 40px;
  }
}

@media (max-width: 900px) {
  #startScreen .startLeftStack {
    gap: 9px;
  }
  #startScreen .startStatsPanel,
  #startScreen .startHighscorePanel,
  #startScreen .startNamePanel {
    padding: 10px 13px !important;
  }
  #startScreen .startSidePanel .statRow,
  #startScreen .scoreRow {
    padding: 4px 0 !important;
  }
  #startScreen .startHowToSummary {
    min-height: 42px;
  }
}

/* ALPHA 1.6ZS · name panel width containment after 800px screenshot check. */
#startScreen .startNamePanel #playerNameInput,
#startScreen .startNamePanel #playButton {
  box-sizing: border-box !important;
  max-width: 100% !important;
}


/* ALPHA 1.6ZT · Startscreen join cleanup
   Name entry lives inside Join Next Game, right-side name HUD removed, info bars removed,
   and the center card sits lower/smaller so the background SLOW TERRITORIES logo stays visible. */
#startScreen .startJoinHint,
#startScreen #lobbyStatus,
#startScreen .lobbyStatus,
#startScreen .startNamePanel,
#startScreen #playButton {
  display: none !important;
}

#startScreen .startLayout {
  grid-template-columns: minmax(220px, 286px) minmax(420px, 600px) minmax(250px, 318px) !important;
  align-items: start !important;
}

#startScreen .startCenterStack {
  padding-top: clamp(150px, 22vh, 188px) !important;
  align-items: center !important;
  gap: 12px !important;
}

#startScreen .startJoinPanel {
  width: min(600px, 100%) !important;
  min-height: 0 !important;
  padding: 14px !important;
  border-radius: 22px !important;
}

#startScreen .startJoinTopline {
  margin: 0 2px 10px !important;
  min-height: 16px !important;
}

#startScreen .startInlineNameField {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  grid-template-rows: 40px 18px;
  column-gap: 10px;
  row-gap: 4px;
  align-items: center;
  margin: 0 0 10px;
}

#startScreen .startInlineNameField label {
  color: rgba(238, 205, 142, 0.88);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 1.45px;
  text-transform: uppercase;
  white-space: nowrap;
}

#startScreen .startInlineNameField #playerNameInput {
  height: 40px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background: rgba(255, 248, 226, 0.105) !important;
  border: 1px solid rgba(244, 213, 154, 0.30) !important;
  color: rgba(255, 250, 236, 0.96) !important;
  border-radius: 14px !important;
  padding: 0 13px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07) !important;
}

#startScreen .startInlineNameField #playerNameInput::placeholder {
  color: rgba(255,245,225,0.48) !important;
}

#startScreen .startInlineNameField #startNameError {
  grid-column: 2;
  min-height: 18px;
  margin: 0 !important;
  font-size: 11px !important;
  line-height: 18px;
  color: rgba(255,202,166,0.86) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#startScreen .startInlineNameField #startNameError.ok {
  color: rgba(164,255,195,0.88) !important;
}

#startScreen .boardingCard {
  grid-template-columns: minmax(150px, 38%) minmax(230px, 1fr) !important;
  min-height: 210px !important;
  height: 210px !important;
  max-height: 210px !important;
  padding: 12px !important;
  gap: 14px !important;
  border-radius: 22px !important;
}

#startScreen .boardingPreview,
#startScreen .boardingBody {
  height: 186px !important;
  min-height: 186px !important;
  max-height: 186px !important;
}

#startScreen .boardingBody h2 {
  font-size: clamp(23px, 2.8vw, 32px) !important;
  min-height: 32px !important;
  max-height: 32px !important;
  margin: 5px 0 7px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#startScreen .boardingCountdown {
  min-height: 26px !important;
  font-size: 12px !important;
}

#startScreen .boardingCountdown strong {
  min-width: 54px;
  font-size: 24px !important;
}

#startScreen .boardingStats {
  margin: 8px 0 7px !important;
  min-height: 28px !important;
}

#startScreen .boardingMeta {
  display: none !important;
}

#startScreen .boardingActions {
  min-height: 38px !important;
}

#startScreen .boardingJoinBtn,
#startScreen .boardingLeaveBtn {
  height: 38px !important;
  min-width: 154px !important;
  padding: 0 16px !important;
}

#startScreen .startSupportLine {
  margin-top: 6px !important;
  min-height: 46px !important;
  width: min(340px, 100%) !important;
  padding: 8px 12px !important;
}

#startScreen .startRightStack {
  padding-top: clamp(172px, 24vh, 210px) !important;
}

@media (max-width: 1120px) and (min-width: 761px) {
  #startScreen .startLayout {
    grid-template-columns: minmax(220px, 250px) minmax(0, 1fr) !important;
  }
  #startScreen .startCenterStack {
    padding-top: clamp(115px, 17vh, 140px) !important;
  }
  #startScreen .startRightStack {
    padding-top: 0 !important;
  }
  #startScreen .startInlineNameField {
    grid-template-columns: 1fr;
    grid-template-rows: auto 38px 18px;
  }
  #startScreen .startInlineNameField #startNameError {
    grid-column: 1;
  }
}

@media (max-width: 760px) {
  #startScreen .startCenterStack {
    padding-top: 96px !important;
  }
  #startScreen .startInlineNameField {
    grid-template-columns: 1fr;
    grid-template-rows: auto 40px 18px;
  }
  #startScreen .startInlineNameField #startNameError {
    grid-column: 1;
  }
  #startScreen .boardingCard {
    height: auto !important;
    max-height: none !important;
    grid-template-columns: 1fr !important;
  }
  #startScreen .boardingPreview,
  #startScreen .boardingBody {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
}


/* ALPHA 1.6ZT · final fit pass after browser screenshot check.
   Keep support/info above the cookie bar, shrink the join card, and preserve the top logo space. */
#startScreen .startCenterStack {
  padding-top: clamp(150px, 21vh, 178px) !important;
}
#startScreen .startJoinPanel {
  max-height: none !important;
}
#startScreen .boardingCard {
  min-height: 180px !important;
  height: 180px !important;
  max-height: 180px !important;
  padding: 10px !important;
  gap: 12px !important;
}
#startScreen .boardingPreview,
#startScreen .boardingBody {
  height: 158px !important;
  min-height: 158px !important;
  max-height: 158px !important;
}
#startScreen .boardingPreview {
  min-height: 158px !important;
}
#startScreen .boardingBody h2 {
  font-size: clamp(22px, 2.5vw, 30px) !important;
  min-height: 30px !important;
  max-height: 30px !important;
  margin: 4px 0 5px !important;
}
#startScreen .boardingCountdown {
  min-height: 24px !important;
  margin-top: 0 !important;
}
#startScreen .boardingCountdown strong {
  font-size: 22px !important;
}
#startScreen .boardingStats {
  margin: 6px 0 6px !important;
  min-height: 26px !important;
}
#startScreen .boardingStats span {
  padding-top: 5px !important;
  padding-bottom: 5px !important;
}
#startScreen .boardingActions {
  min-height: 36px !important;
}
#startScreen .boardingJoinBtn,
#startScreen .boardingLeaveBtn {
  height: 36px !important;
}
#startScreen .startSupportLine {
  margin-top: 4px !important;
  min-height: 44px !important;
  max-height: 48px !important;
  padding: 7px 12px !important;
  align-self: center !important;
}
@media (min-width: 1121px) and (max-height: 780px) {
  #startScreen .startCenterStack {
    padding-top: clamp(136px, 19vh, 160px) !important;
  }
}
@media (max-width: 1120px) and (min-width: 761px) {
  #startScreen .startCenterStack {
    padding-top: clamp(102px, 15vh, 126px) !important;
  }
  #startScreen .boardingCard {
    min-height: 174px !important;
    height: 174px !important;
    max-height: 174px !important;
  }
  #startScreen .boardingPreview,
  #startScreen .boardingBody {
    height: 152px !important;
    min-height: 152px !important;
    max-height: 152px !important;
  }
}


/* ALPHA 1.6ZT · logo visibility correction for tablet/small browser widths. */
@media (max-width: 1120px) and (min-width: 761px) {
  #startScreen .startCenterStack {
    padding-top: clamp(148px, 23vh, 188px) !important;
  }
  #startScreen .startJoinPanel {
    width: min(600px, 100%) !important;
    padding: 12px !important;
  }
  #startScreen .startInlineNameField {
    grid-template-rows: auto 36px 16px !important;
    row-gap: 3px !important;
    margin-bottom: 8px !important;
  }
  #startScreen .startInlineNameField #playerNameInput {
    height: 36px !important;
  }
  #startScreen .startInlineNameField #startNameError {
    min-height: 16px !important;
    line-height: 16px !important;
  }
  #startScreen .boardingCard {
    min-height: 148px !important;
    height: 148px !important;
    max-height: 148px !important;
    padding: 9px !important;
    gap: 10px !important;
  }
  #startScreen .boardingPreview,
  #startScreen .boardingBody {
    height: 130px !important;
    min-height: 130px !important;
    max-height: 130px !important;
  }
  #startScreen .boardingEyebrow {
    font-size: 9px !important;
  }
  #startScreen .boardingBody h2 {
    font-size: clamp(20px, 2.6vw, 27px) !important;
    min-height: 27px !important;
    max-height: 27px !important;
    margin: 3px 0 4px !important;
  }
  #startScreen .boardingCountdown {
    min-height: 22px !important;
    font-size: 11px !important;
  }
  #startScreen .boardingCountdown strong {
    font-size: 20px !important;
  }
  #startScreen .boardingStats {
    min-height: 24px !important;
    margin: 4px 0 5px !important;
    gap: 5px !important;
  }
  #startScreen .boardingStats span {
    padding: 4px 5px !important;
    font-size: 9.5px !important;
  }
  #startScreen .boardingJoinBtn,
  #startScreen .boardingLeaveBtn {
    height: 32px !important;
    min-width: 130px !important;
    font-size: 10.5px !important;
  }
  #startScreen .startSupportLine {
    min-height: 42px !important;
    max-height: 46px !important;
    padding: 6px 10px !important;
  }
}


/* ALPHA 1.6ZW · live lobby roster + lifetime highscore + Umami */
#startScreen .livePlayersExpanded {
  border-radius: 18px !important;
  padding: 10px !important;
  background: rgba(6, 18, 16, 0.58) !important;
  border: 1px solid rgba(134, 255, 190, 0.22) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 18px 42px rgba(0,0,0,0.24) !important;
  text-align: left !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
#startScreen .livePlayersSummary {
  color: rgba(164, 255, 195, 0.96);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 1.15px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
#startScreen .livePlayersList {
  display: grid;
  gap: 5px;
  max-height: min(320px, calc(100vh - 190px));
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  overscroll-behavior: contain;
}
#startScreen .livePlayersList.empty {
  color: rgba(255,250,236,0.52);
  font-size: 12px;
  line-height: 1.35;
}
#startScreen .livePlayerRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 11px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.055);
}
#startScreen .livePlayerName {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255,250,236,0.90);
  font-size: 12px;
  font-weight: 820;
}
#startScreen .livePlayerMeta {
  color: rgba(164,255,195,0.76);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.45px;
  text-transform: none;
  white-space: nowrap;
}
#startScreen .scoreRow strong {
  white-space: nowrap;
  font-size: 10.5px;
}
#startScreen .startLiveHint {
  display: none !important;
}
@media (max-height: 780px) {
  #startScreen .livePlayersList {
    max-height: min(190px, calc(100vh - 170px));
  }
  #startScreen .livePlayerRow {
    padding-top: 5px;
    padding-bottom: 5px;
  }
}

/* ALPHA 1.6ZW · keep the expanded live roster visible on the start screen instead of hiding the one thing now made useful. */
@media (max-width: 1120px) {
  #startScreen .startLivePanel {
    display: block !important;
  }
}

/* ALPHA 1.6ZX · Start HUD position fix
   - Live Server roster is pinned hard into the top-right start corner.
   - How-to-Play is gone from the start screen.
   - Join Next Game sits about 2cm / 76px higher on desktop-sized views. */
#startScreen .startHowToPanel,
#startScreen #startHowToPanel,
#startScreen #startTagline {
  display: none !important;
}

#startScreen .startLayout {
  position: absolute !important;
}

#startScreen .startRightStack {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: min(318px, calc(100vw - 48px)) !important;
  max-width: 318px !important;
  padding-top: 0 !important;
  gap: 0 !important;
  z-index: 5 !important;
  align-self: start !important;
}

#startScreen .startLivePanel {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 12px 13px !important;
  border-radius: 19px !important;
}

#startScreen .startLivePanel .startPanelTitle {
  margin-bottom: 8px !important;
}

#startScreen .startLivePanel .livePlayersHud,
#startScreen .livePlayersExpanded {
  width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

@media (min-width: 1121px) {
  #startScreen .startCenterStack {
    padding-top: clamp(74px, calc(21vh - 76px), 102px) !important;
  }
}

@media (min-width: 1121px) and (max-height: 780px) {
  #startScreen .startCenterStack {
    padding-top: clamp(60px, calc(19vh - 76px), 84px) !important;
  }
}

@media (max-width: 1120px) and (min-width: 761px) {
  #startScreen .startRightStack {
    top: 0 !important;
    right: 0 !important;
    width: min(286px, calc(100vw - 36px)) !important;
    max-width: 286px !important;
  }
  #startScreen .startCenterStack {
    padding-top: clamp(78px, calc(23vh - 76px), 112px) !important;
  }
}

@media (max-width: 760px) {
  #startScreen .startRightStack {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: none !important;
    order: 2 !important;
  }
  #startScreen .startCenterStack {
    padding-top: 74px !important;
  }
  #startScreen .startLivePanel {
    padding: 11px 12px !important;
  }
}

/* ALPHA 1.6ZX · browser-check correction: actual flex/grid alignment and box sizing. */
#startScreen .startCenterStack {
  align-self: start !important;
}
#startScreen .startLivePanel {
  box-sizing: border-box !important;
}
@media (min-width: 1121px) {
  #startScreen .startRightStack {
    top: -16px !important;
    right: -22px !important;
  }
}
@media (max-width: 1120px) and (min-width: 761px) {
  #startScreen .startRightStack {
    top: -8px !important;
    right: -8px !important;
  }
}

/* ALPHA 1.6ZX · final visual lock after browser metrics. */
#startScreen .startCenterStack {
  min-height: 0 !important;
  justify-content: flex-start !important;
}
#startScreen .startRightStack {
  grid-area: auto !important;
  grid-column: auto !important;
  grid-row: auto !important;
}

/* ALPHA 1.6ZX · compact top-right live roster on tablet/small desktop so it does not cover Join Next Game. */
@media (max-width: 1120px) and (min-width: 761px) {
  #startScreen .startLivePanel {
    padding: 5px 8px !important;
  }
  #startScreen .startLivePanel .startPanelTitle {
    margin-bottom: 3px !important;
    font-size: 9px !important;
    line-height: 11px !important;
  }
  #startScreen .livePlayersExpanded {
    padding: 6px !important;
    border-radius: 14px !important;
  }
  #startScreen .livePlayersSummary {
    font-size: 9.5px !important;
    line-height: 12px !important;
    margin-bottom: 4px !important;
    letter-spacing: .75px !important;
  }
  #startScreen .livePlayersList {
    gap: 3px !important;
    max-height: min(150px, calc(100vh - 162px)) !important;
  }
  #startScreen .livePlayerRow {
    padding: 3px 6px !important;
    border-radius: 9px !important;
  }
  #startScreen .livePlayerName {
    font-size: 10.5px !important;
  }
  #startScreen .livePlayerMeta {
    font-size: 9px !important;
  }
}


/* ALPHA 1.6ZY · Startscreen logo visibility fix
   Visual priority: keep the SLOW TERRITORIES logo/text in the background readable.
   The join card is pushed below the logo-safe zone and made more compact instead of
   parking a giant glass rectangle over the brand mark like a bureaucratic eclipse. */
#startScreen::before {
  background:
    radial-gradient(ellipse at 50% 19%, rgba(255,248,226,0.10), rgba(255,248,226,0.025) 28%, transparent 52%),
    linear-gradient(180deg, rgba(0,0,0,0.015), rgba(0,0,0,0.20)) !important;
}

@media (min-width: 1121px) {
  #startScreen .startLayout {
    inset: 24px 30px 24px 30px !important;
    grid-template-columns: minmax(220px, 286px) minmax(420px, 560px) minmax(250px, 318px) !important;
    justify-content: space-between !important;
    align-items: start !important;
  }

  #startScreen .startCenterStack {
    padding-top: clamp(270px, 31vh, 330px) !important;
    gap: 10px !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  #startScreen .startJoinPanel {
    width: min(560px, 100%) !important;
    padding: 11px 13px !important;
    border-radius: 20px !important;
    background: linear-gradient(145deg, rgba(16,22,24,0.68), rgba(42,39,31,0.46)) !important;
    box-shadow: 0 18px 50px rgba(0,0,0,0.26), inset 0 1px 0 rgba(255,255,255,0.07) !important;
  }

  #startScreen .startJoinTopline {
    margin: 0 2px 7px !important;
    min-height: 14px !important;
    font-size: 10px !important;
    line-height: 14px !important;
  }

  #startScreen .startInlineNameField {
    grid-template-columns: 86px minmax(0, 1fr) !important;
    grid-template-rows: 34px 14px !important;
    column-gap: 9px !important;
    row-gap: 3px !important;
    margin: 0 0 7px !important;
  }

  #startScreen .startInlineNameField label {
    font-size: 9.5px !important;
    letter-spacing: 1.25px !important;
  }

  #startScreen .startInlineNameField #playerNameInput {
    height: 34px !important;
    border-radius: 12px !important;
    padding: 0 11px !important;
  }

  #startScreen .startInlineNameField #startNameError {
    min-height: 14px !important;
    line-height: 14px !important;
    font-size: 10px !important;
  }

  #startScreen .boardingCard {
    grid-template-columns: minmax(144px, 37%) minmax(0, 1fr) !important;
    min-height: 150px !important;
    height: 150px !important;
    max-height: 150px !important;
    padding: 9px !important;
    gap: 10px !important;
    border-radius: 19px !important;
  }

  #startScreen .boardingPreview,
  #startScreen .boardingBody {
    height: 132px !important;
    min-height: 132px !important;
    max-height: 132px !important;
  }

  #startScreen .boardingPreview {
    border-radius: 15px !important;
  }

  #startScreen .boardingMapBadge {
    left: 9px !important;
    top: 9px !important;
    max-width: calc(100% - 18px) !important;
    padding: 5px 8px !important;
    font-size: 10px !important;
  }

  #startScreen .boardingPulse {
    width: 46px !important;
    height: 46px !important;
    right: 22px !important;
    bottom: 20px !important;
  }

  #startScreen .boardingEyebrow {
    font-size: 9px !important;
    line-height: 11px !important;
    letter-spacing: 1.65px !important;
  }

  #startScreen .boardingBody h2 {
    font-size: clamp(21px, 2.05vw, 28px) !important;
    min-height: 26px !important;
    max-height: 26px !important;
    margin: 2px 0 3px !important;
  }

  #startScreen .boardingCountdown {
    min-height: 20px !important;
    font-size: 11px !important;
    line-height: 18px !important;
  }

  #startScreen .boardingCountdown strong {
    font-size: 19px !important;
    min-width: 46px !important;
  }

  #startScreen .boardingStats {
    margin: 4px 0 5px !important;
    min-height: 23px !important;
    gap: 5px !important;
  }

  #startScreen .boardingStats span {
    padding: 4px 4px !important;
    font-size: 9.5px !important;
    line-height: 1.1 !important;
  }

  #startScreen .boardingActions {
    min-height: 31px !important;
  }

  #startScreen .boardingJoinBtn,
  #startScreen .boardingLeaveBtn {
    height: 31px !important;
    min-width: 140px !important;
    padding: 0 14px !important;
    font-size: 11px !important;
  }

  #startScreen .startSupportLine {
    margin-top: 2px !important;
    min-height: 40px !important;
    max-height: 44px !important;
    width: min(320px, 100%) !important;
    padding: 6px 10px !important;
    background: rgba(18,24,25,0.46) !important;
  }

  #startScreen .startSupportButton,
  #startScreen .startInfoButton {
    height: 30px !important;
    padding: 0 14px !important;
    font-size: 10.5px !important;
  }

  #startScreen .startRightStack {
    top: -18px !important;
    right: -24px !important;
  }
}

@media (min-width: 1121px) and (max-height: 820px) {
  #startScreen .startCenterStack {
    padding-top: clamp(252px, 34vh, 284px) !important;
  }
  #startScreen .startJoinPanel {
    width: min(548px, 100%) !important;
  }
  #startScreen .boardingCard {
    min-height: 140px !important;
    height: 140px !important;
    max-height: 140px !important;
  }
  #startScreen .boardingPreview,
  #startScreen .boardingBody {
    height: 122px !important;
    min-height: 122px !important;
    max-height: 122px !important;
  }
  #startScreen .boardingStats span {
    font-size: 9px !important;
  }
}

@media (min-width: 1121px) and (min-height: 900px) {
  #startScreen .startCenterStack {
    padding-top: clamp(314px, 32vh, 350px) !important;
  }
}

@media (max-width: 1120px) and (min-width: 761px) {
  #startScreen .startCenterStack {
    padding-top: clamp(230px, 37vh, 270px) !important;
    gap: 8px !important;
  }
  #startScreen .startJoinPanel {
    width: min(510px, 100%) !important;
    padding: 10px 11px !important;
    background: linear-gradient(145deg, rgba(16,22,24,0.68), rgba(42,39,31,0.46)) !important;
  }
  #startScreen .boardingCard {
    min-height: 132px !important;
    height: 132px !important;
    max-height: 132px !important;
    grid-template-columns: minmax(128px, 36%) minmax(0, 1fr) !important;
    padding: 8px !important;
  }
  #startScreen .boardingPreview,
  #startScreen .boardingBody {
    height: 116px !important;
    min-height: 116px !important;
    max-height: 116px !important;
  }
}

@media (max-width: 760px) {
  #startScreen .startCenterStack {
    padding-top: 162px !important;
  }
}

/* ALPHA 1.6ZY · large-screen corner lock.
   Do not let the 1420px layout cap pull the live panel away from the real browser edge. */
#startScreen .startLayout {
  max-width: none !important;
  margin: 0 !important;
}

/* ALPHA 1.6ZY · compact tablet fit so support/info does not disappear under the cookie notice. */
@media (max-width: 900px) and (min-width: 761px) {
  #startScreen .startCenterStack {
    padding-top: 214px !important;
    gap: 6px !important;
  }
  #startScreen .startJoinPanel {
    width: min(500px, calc(100vw - 286px)) !important;
    padding: 8px 10px !important;
    border-radius: 18px !important;
  }
  #startScreen .startJoinTopline {
    margin-bottom: 5px !important;
    font-size: 9px !important;
  }
  #startScreen .startInlineNameField {
    grid-template-rows: auto 30px 12px !important;
    row-gap: 2px !important;
    margin-bottom: 5px !important;
  }
  #startScreen .startInlineNameField label {
    font-size: 9px !important;
  }
  #startScreen .startInlineNameField #playerNameInput {
    height: 30px !important;
  }
  #startScreen .startInlineNameField #startNameError {
    min-height: 12px !important;
    line-height: 12px !important;
    font-size: 9px !important;
  }
  #startScreen .boardingCard {
    min-height: 116px !important;
    height: 116px !important;
    max-height: 116px !important;
    grid-template-columns: minmax(110px, 34%) minmax(0, 1fr) !important;
    padding: 7px !important;
    gap: 8px !important;
  }
  #startScreen .boardingPreview,
  #startScreen .boardingBody {
    height: 102px !important;
    min-height: 102px !important;
    max-height: 102px !important;
  }
  #startScreen .boardingMapBadge {
    font-size: 9px !important;
    padding: 4px 6px !important;
  }
  #startScreen .boardingPulse {
    width: 38px !important;
    height: 38px !important;
    right: 16px !important;
    bottom: 15px !important;
  }
  #startScreen .boardingEyebrow {
    font-size: 8.5px !important;
    line-height: 10px !important;
  }
  #startScreen .boardingBody h2 {
    font-size: 22px !important;
    min-height: 23px !important;
    max-height: 23px !important;
    margin: 1px 0 2px !important;
  }
  #startScreen .boardingCountdown {
    min-height: 17px !important;
    font-size: 10px !important;
    line-height: 16px !important;
  }
  #startScreen .boardingCountdown strong {
    font-size: 17px !important;
    min-width: 40px !important;
  }
  #startScreen .boardingStats {
    min-height: 20px !important;
    margin: 2px 0 3px !important;
    gap: 4px !important;
  }
  #startScreen .boardingStats span {
    padding: 3px 4px !important;
    font-size: 8.5px !important;
  }
  #startScreen .boardingJoinBtn,
  #startScreen .boardingLeaveBtn {
    height: 27px !important;
    min-width: 122px !important;
    font-size: 9.5px !important;
  }
  #startScreen .startSupportLine {
    min-height: 36px !important;
    max-height: 38px !important;
    padding: 5px 8px !important;
    width: min(312px, calc(100vw - 330px)) !important;
  }
  #startScreen .startSupportButton,
  #startScreen .startInfoButton {
    height: 27px !important;
    padding: 0 10px !important;
    font-size: 9.5px !important;
  }
}

/* ALPHA 1.6ZY · final 800px browser fit: keep support/info above cookie bar. */
@media (max-width: 900px) and (min-width: 761px) and (max-height: 650px) {
  #startScreen .startCenterStack {
    padding-top: 194px !important;
  }
  #startScreen .startJoinPanel {
    padding: 7px 9px !important;
  }
  #startScreen .boardingCard {
    min-height: 106px !important;
    height: 106px !important;
    max-height: 106px !important;
  }
  #startScreen .boardingPreview,
  #startScreen .boardingBody {
    height: 92px !important;
    min-height: 92px !important;
    max-height: 92px !important;
  }
  #startScreen .boardingBody h2 {
    font-size: 20px !important;
    min-height: 21px !important;
    max-height: 21px !important;
  }
  #startScreen .boardingCountdown strong {
    font-size: 16px !important;
  }
  #startScreen .boardingStats span {
    padding: 2px 4px !important;
    font-size: 8px !important;
  }
  #startScreen .boardingJoinBtn,
  #startScreen .boardingLeaveBtn {
    height: 25px !important;
  }
  #startScreen .startSupportLine {
    min-height: 34px !important;
    max-height: 36px !important;
    padding: 4px 8px !important;
  }
}


/* ALPHA 1.6ZZ · Live Server HUD top alignment fix
   Align the Live Server panel top edge with the Your Record panel top edge.
   Desktop short-height layouts remove the left-stack padding, so the right stack must do the same. */
@media (min-width: 1121px) {
  #startScreen .startRightStack {
    top: 16px !important;
  }
}
@media (min-width: 1121px) and (max-height: 780px) {
  #startScreen .startRightStack {
    top: 0 !important;
  }
}
@media (max-width: 1120px) and (min-width: 761px) {
  #startScreen .startRightStack {
    top: 16px !important;
  }
}


/* ALPHA 1.6ZZA · Highscore Player-ID Ratio Fix
   Display guard only: server lifetime ratios are shown as wins / games, never wins / decided-wins. */
