:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #e9f4f4;
  background: #101722;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: #101722;
}

#menu {
  position: relative;
  z-index: 2;
  width: min(940px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

body:has(#menu:not(.hidden)) #game { visibility: hidden; }
body:has(#menu:not(.hidden)) {
  background:
    radial-gradient(ellipse at 50% 0, #302054, transparent 65%),
    #0b0c1a;
}

header { text-align: center; margin-bottom: 32px; }
.logo {
  color: #74e6bd;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .22em;
}
.logo-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 3px solid #74e6bd;
  border-radius: 50%;
  margin-right: 7px;
}
h1 {
  font-size: clamp(42px, 8vw, 78px);
  letter-spacing: -.065em;
  line-height: 1;
  margin: 12px 0;
  color: #f7efff;
}
header p { color: #a7b6c4; margin: 0; }
h2 { font-size: 19px; margin: 0 0 18px; }

.card {
  background: #17192de8;
  border: 1px solid #8e83bf46;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 14px 40px #0003;
}
.player-card { margin-bottom: 16px; }
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.create-card { margin-top: 16px; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.section-heading h2 { margin-bottom: 12px; }
label { display: block; font-size: 13px; color: #b7c8d3; }
input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  margin: 8px 0 16px;
  padding: 11px 12px;
  border: 1px solid #405669;
  border-radius: 9px;
  outline: 0;
  background: #101b29;
  color: #f0fbfa;
}
input:focus { border-color: #75e6bd; }
input:disabled { opacity: .5; }
.primary {
  border: 0;
  border-radius: 9px;
  background: #76e3b9;
  color: #0c3025;
  padding: 11px 18px;
  font-weight: 750;
}
.primary:hover { background: #a2f5d2; }
.text-button {
  color: #8de8c5;
  border: 0;
  background: transparent;
  padding: 4px;
}
.room-list { min-height: 155px; }
.room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #314356;
  padding: 12px 0;
  gap: 10px;
}
.room-row:first-child { border-top: 0; }
.room-row small, .empty { color: #93a8b8; }
.room-row button {
  border: 1px solid #69cea8;
  background: transparent;
  color: #95edca;
  border-radius: 8px;
  padding: 7px 12px;
}
.room-row button:disabled { opacity: .45; cursor: default; }
.create-fields {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 16px;
}
.create-fields input { margin-bottom: 0; }
.privacy-field { min-height: 67px; }
.check-label { margin-bottom: 10px; }
.check-label input { accent-color: #76e3b9; }
.create-fields button { height: 44px; }
#message { min-height: 24px; color: #ffb2a7; text-align: center; }

#hud { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.hud-left, #leaderboard, .hint, #leave {
  background: #101b29cb;
  border: 1px solid #415263;
  border-radius: 10px;
  padding: 10px 14px;
}
.hud-left, .hint { position: absolute; }
.hud-left { left: 18px; top: 18px; }
.hud-left span { display: block; color: #8de8c5; margin-top: 3px; }
.hud-right {
  position: absolute;
  inset: 18px 18px 74px auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
#leaderboard { min-width: 180px; overflow: auto; pointer-events: auto; }
.leader-row { display: flex; justify-content: space-between; gap: 20px; }
#leave { margin-top: 8px; color: #fff; pointer-events: auto; }
.hint { left: 18px; bottom: 18px; color: #b5c5ce; }
#minimap {
  flex: none;
  width: clamp(90px, 13vw, 126px);
  margin: 0;
  padding: 5px;
  border: 1px solid #625a83;
  border-radius: 9px;
  background: #101222ed;
}
#map-view {
  display: block;
  width: 100%;
  height: auto;
  background: #212139;
}
#minimap figcaption {
  margin-top: 4px;
  color: #e7e1fb;
  font-size: 10px;
  text-align: center;
}
#boost-status { font-size: .8rem; color: #f4c578; }
#boost {
  position: absolute;
  right: 18px;
  bottom: 18px;
  min-width: 90px;
  padding: 12px 18px;
  border: 1px solid #f4c578;
  border-radius: 12px;
  color: #f4c578;
  background: #241a32;
  font-weight: 750;
  touch-action: none;
  pointer-events: auto;
  user-select: none;
}
#boost[aria-pressed="true"] { color: #231526; background: #f4c578; }
.share {
  position: fixed;
  z-index: 3;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #1b2b39;
  border: 1px solid #75e6bd;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.share button { background: none; border: 0; color: #8de8c5; }

@media (max-width: 680px) {
  #menu { padding-top: 26px; }
  .columns, .create-fields { grid-template-columns: 1fr; }
  .create-fields button { width: 100%; }
  .hint { display: none; }
  #leaderboard { margin-top: auto; }
  .share { bottom: 150px; width: calc(100% - 36px); }
}
