/* Stickman Rumble — styles */

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

:root {
  --bg: #0b0e14;
  --card: #141826;
  --card-2: #1b2033;
  --text: #e8ecf5;
  --muted: #8b93a8;
  --accent: #7fe7ff;
  --accent-2: #ffd54a;
  --danger: #ff5d5d;
  --ok: #5ad86a;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* ── Top bar ── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { font-size: 20px; font-weight: 800; letter-spacing: 0.5px; }
.logo-elite {
  color: var(--accent-2);
  text-shadow: 0 0 18px rgba(255, 213, 74, 0.45);
}
.me-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.me-chip img {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

/* ── Screens ── */
.screen { height: 100vh; }
.container { height: 100%; }

.center-box {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 90px 18px 24px;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ── Spinner ── */
.spinner {
  width: 44px; height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 14px;
}
.spinner.big { width: 56px; height: 56px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Buttons ── */
.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, #5ee6ff, #2f9dff);
  color: #07131c;
  box-shadow: 0 6px 24px rgba(47, 157, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 8px 30px rgba(47, 157, 255, 0.5); }
.btn-big { font-size: 18px; padding: 15px 38px; border-radius: 14px; margin-top: 10px; }

/* ── Lobby ── */
.lobby-card { padding: 34px 36px 26px; }
.lobby-avatar-wrap { position: relative; width: 96px; height: 96px; margin: 0 auto 14px; }
.lobby-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 0 30px rgba(127, 231, 255, 0.35);
}
.lobby-avatar-fallback {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 3px dashed var(--accent-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 46px;
  color: var(--accent-2);
}
.lobby-name { font-size: 24px; margin-bottom: 6px; }
.howto {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}
.howto h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent-2); margin-bottom: 10px; }
.howto ul { list-style: none; display: grid; gap: 7px; }
.howto li { font-size: 14px; color: var(--text); }
.howto li b { color: var(--accent); }
.howto p { margin-top: 12px; }
.footer {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); text-decoration: underline; }
.footer a.support-link {
  color: #1a1406;
  background: linear-gradient(90deg, #ffd54a, #ffb347);
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  display: inline-block;
}
.footer a.support-link:hover { filter: brightness(1.12); text-decoration: none; color: #1a1406; }

.support-chip {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 20;
  pointer-events: auto;
  background: rgba(10, 12, 18, 0.75);
  border: 1px solid rgba(255, 213, 74, 0.45);
  color: var(--accent-2);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}
.support-chip:hover { background: rgba(255, 213, 74, 0.18); }

/* ── Game screen ── */
#screen-game { position: relative; background: #0b0e14; }
#game-canvas {
  position: absolute;
  inset: 0;
  display: block;
  cursor: none;
}

.hud {
  position: absolute;
  font-family: 'Segoe UI', system-ui, sans-serif;
  pointer-events: none;
  user-select: none;
  z-index: 10;
}

.hud-stats {
  top: 14px; left: 14px;
  background: rgba(10, 12, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.hud-board {
  top: 14px; right: 14px;
  background: rgba(10, 12, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 190px;
}
.board-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-2);
  margin-bottom: 7px;
}
.board-empty { font-size: 12px; color: var(--muted); }
.board-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 2.5px 0;
  border-radius: 6px;
}
.board-row.me { background: rgba(127, 231, 255, 0.14); padding: 2.5px 6px; margin: 0 -6px; }
.board-pos { width: 16px; color: var(--muted); font-weight: 700; }
.board-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-k { color: var(--accent-2); font-weight: 800; }

.hud-feed {
  top: 66px; left: 14px;
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(10, 12, 18, 0.55);
  border-radius: 10px;
  padding: 8px 12px;
  max-width: 320px;
  transition: opacity 0.4s;
}

.hud-hint {
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 12, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: opacity 1s ease;
}
.hud-hint.fade { opacity: 0; }

.hud-dead {
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(10, 12, 18, 0.85);
  border: 1px solid rgba(255, 93, 93, 0.4);
  border-radius: 16px;
  padding: 22px 40px;
  box-shadow: 0 0 60px rgba(255, 93, 93, 0.15);
}
.dead-title { font-size: 28px; font-weight: 900; color: var(--danger); }
.dead-sub { font-size: 15px; color: var(--text); margin-top: 6px; }
.dead-timer { font-size: 14px; color: var(--muted); margin-top: 10px; font-variant-numeric: tabular-nums; }

.hud-toast {
  top: 64px; left: 50%;
  transform: translateX(-50%);
  background: rgba(127, 231, 255, 0.14);
  border: 1px solid rgba(127, 231, 255, 0.45);
  color: var(--accent);
  border-radius: 10px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.hud-toast.show { opacity: 1; }
