* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #161c22;
  color: #fff;
  font-family: "Lucida Sans Unicode", "Lucida Grande", "Segoe UI", sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
#c {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #161c22;
}
#login {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 28px;
  background: radial-gradient(ellipse at center, rgba(22,28,34,0.28) 0%, rgba(10,12,16,0.72) 75%);
}
.mascot {
  width: 168px;
  height: 168px;
  object-fit: contain;
  image-rendering: auto;
  border-radius: 50%;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.55));
  pointer-events: none;
}
.logo {
  margin-top: -8px;
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #7CFF2E;
  text-shadow:
    0 3px 0 #3a8a12,
    0 8px 18px rgba(0,0,0,.65);
  line-height: 1;
}
.logo span { color: #e8ffb0; }
#lastscore {
  margin-top: 18px;
  min-height: 20px;
  font-size: 15px;
  color: #fff;
}
#tips {
  margin-top: 10px;
  height: 22px;
  color: #8068C0;
  font-size: 14px;
  text-align: center;
  opacity: .95;
}
#nick_holder {
  width: 244px;
  margin-top: 22px;
  background: #4C447c;
  box-shadow: 0 6px 50px rgba(0,0,0,1);
  border-radius: 6px;
  padding: 8px 10px;
}
.sumsginp, #joinCode {
  width: 100%;
  height: 28px;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
  font-family: inherit;
  text-align: center;
}
.sumsginp::placeholder, #joinCode::placeholder { color: #cbbce8; opacity: .8; }
#play {
  margin-top: 18px;
  min-width: 168px;
  height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(#9dff4a, #5ad000);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 2px 0 rgba(0,0,0,.25);
  box-shadow: 0 4px 0 #3a8a12, 0 10px 24px rgba(0,0,0,.45);
  cursor: pointer;
}
#play:hover { filter: brightness(1.06); }
#play:active { transform: translateY(2px); box-shadow: 0 2px 0 #3a8a12; }
#friends {
  margin-top: 28px;
  width: min(360px, calc(100vw - 32px));
  text-align: center;
}
.friends-title {
  font-size: 13px;
  color: #9aa3b2;
  margin-bottom: 10px;
  letter-spacing: .4px;
}
.friend-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ghost, .tiny, .playish {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
}
.ghost {
  background: #2a3340;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 2px 0 #151a22;
}
.ghost:hover { background: #354050; }
.join-row {
  display: flex;
  gap: 6px;
  width: 244px;
  background: #2a3340;
  border-radius: 6px;
  padding: 4px 6px 4px 4px;
  align-items: center;
}
#joinCode {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 16px;
}
#lobbyBar {
  margin-top: 12px;
  background: rgba(20, 24, 32, 0.75);
  border: 1px solid #3a4454;
  border-radius: 10px;
  padding: 12px;
}
.lobby-code-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #c5cdd8;
}
#lobbyCode {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #7CFF2E;
}
.tiny {
  background: #3b4656;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.tiny.danger { background: #5a2a32; }
#lobbyPlayers {
  margin-top: 8px;
  font-size: 13px;
  color: #d0d6e0;
  min-height: 18px;
}
.bots-lab {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
  color: #c5cdd8;
}
#err {
  margin-top: 10px;
  min-height: 18px;
  color: #ff8a9a;
  font-size: 13px;
}
#skinbtn {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 21;
  color: #9aa3b2;
  font-size: 13px;
  cursor: pointer;
}
#skinbtn:hover { color: #fff; }
#skins {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
}
#skins:not([hidden]) {
  display: flex;
}
.skin-card {
  background: #1b222c;
  border: 1px solid #3a4454;
  border-radius: 12px;
  padding: 18px 22px 16px;
  width: 320px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}
.skin-title { color: #c5cdd8; margin-bottom: 8px; }
.skin-name { margin: 6px 0 10px; color: #fff; }
.skin-nav { display: flex; gap: 12px; justify-content: center; }
.skin-nav button {
  width: 44px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: #2a3340;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.playish {
  margin-top: 12px;
  background: linear-gradient(#9dff4a, #5ad000);
  padding: 8px 22px;
  border-radius: 6px;
  font-weight: 700;
}
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#longest {
  position: absolute;
  left: 12px;
  top: 10px;
  font-size: 14px;
  color: #e8e8e8;
  text-shadow: 0 1px 2px #000;
}
#lb {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 210px;
  font-size: 13px;
  text-align: right;
  text-shadow: 0 1px 2px #000;
}
#lb .row { display: flex; justify-content: flex-end; gap: 8px; white-space: nowrap; }
#lb .me { color: #ffe56a; }
#stats {
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-size: 15px;
  text-shadow: 0 1px 2px #000;
  line-height: 1.35;
}
#minimap {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 130px;
  height: 130px;
  opacity: .92;
}
#boostHint {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  color: #c5cdd8;
  font-size: 13px;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}
#boostBtn {
  position: fixed;
  right: 18px;
  bottom: 160px;
  z-index: 15;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.35);
  background: rgba(80, 200, 40, .28);
  color: #fff;
  font-weight: 800;
  letter-spacing: 1px;
  display: none;
}
#status {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  font-size: 13px;
  color: #9aa3b2;
  pointer-events: none;
}
body.playing #login, body.playing #skinbtn { display: none; }
body.playing #hud { display: block; }
body.playing #boostHint { display: block; }
body.touch.playing #boostBtn { display: block; }
body.touch.playing #boostHint { display: none; }
@media (max-width: 640px) {
  .logo { font-size: 46px; }
  .mascot { width: 128px; height: 128px; }
  #login { padding-top: 12px; }
}
