:root {
  --deep: #021322;
  --deep-2: #041a2e;
  --ink: #eef8ff;
  --muted: #8fb3d1;
  --muted-2: #5f86a8;
  --blue: #4d6bfe;
  --blue-2: #7f9bff;
  --cyan: #5fe5ff;
  --gold: #ffd479;
  --glass: linear-gradient(155deg, rgba(15, 47, 78, 0.78), rgba(4, 20, 37, 0.72));
  --line: rgba(132, 204, 255, 0.16);
  --shadow: 0 24px 70px rgba(0, 8, 20, 0.48);
  --r: 20px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--deep);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  position: fixed;
  inset: 0;
  user-select: none;
}

button, input { font: inherit; }
button { color: inherit; }
img { display: block; }
.hide { display: none !important; }

#ocean {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 48%, rgba(0, 7, 16, 0.42) 100%),
    linear-gradient(180deg, rgba(2, 19, 34, 0.28), transparent 20%, transparent 78%, rgba(0, 9, 20, 0.5));
}

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
}

/* ---------------- top bar ---------------- */

#topbar {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 22px;
  right: 22px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  pointer-events: auto;
  opacity: 0.92;
}

.brand img {
  width: 27px;
  height: 27px;
  transform: rotate(-129deg);
  filter: drop-shadow(0 0 12px rgba(77, 107, 254, 0.7));
}

.netpill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(3, 19, 35, 0.62);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.05em;
  pointer-events: auto;
}

.netdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #52e6b0;
  box-shadow: 0 0 0 4px rgba(82, 230, 176, 0.12), 0 0 12px rgba(82, 230, 176, 0.8);
}

.netpill.warn .netdot { background: var(--gold); box-shadow: 0 0 0 4px rgba(255, 212, 121, 0.12), 0 0 12px rgba(255, 212, 121, 0.8); }
.netpill.bad .netdot { background: #ff6b7a; box-shadow: 0 0 0 4px rgba(255, 107, 122, 0.14), 0 0 12px rgba(255, 107, 122, 0.8); }

/* ---------------- HUD ---------------- */

.hud {
  position: fixed;
  z-index: 18;
  left: 22px;
  top: 72px;
  width: 338px;
  padding: 13px 15px 12px;
  border-radius: var(--r);
  display: flex;
  gap: 13px;
  animation: hudIn 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes hudIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hud-avatar {
  position: relative;
  flex: 0 0 62px;
  height: 76px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 42%, rgba(86, 128, 255, 0.35), transparent 68%),
    rgba(2, 16, 31, 0.6);
  border: 1px solid rgba(112, 165, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud-avatar img {
  width: 48px;
  height: 48px;
  transform: rotate(-129deg);
  filter: drop-shadow(0 0 10px rgba(77, 107, 254, 0.65));
}

.level-badge {
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  min-width: 45px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(129, 185, 255, 0.4);
  background: linear-gradient(180deg, #5f7cff, #334bdc);
  box-shadow: 0 4px 14px rgba(53, 82, 220, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: center;
  white-space: nowrap;
}

.hud-main { flex: 1; min-width: 0; }

.hud-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.hud-row strong {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.kills {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.xp-wrap {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: rgba(1, 12, 24, 0.72);
  border: 1px solid rgba(99, 167, 255, 0.14);
  overflow: hidden;
}

.xp-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #3d63ff, #5de3ff);
  box-shadow: 0 0 18px rgba(77, 180, 255, 0.55);
  transition: width 0.3s ease;
}

.xp-wrap span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 9px;
  font-weight: 600;
  color: rgba(235, 247, 255, 0.82);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.03em;
}

.hud-stats {
  display: flex;
  gap: 4px;
  margin: 8px 0 7px;
}

.hud-stats > div {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(3, 18, 34, 0.55);
  border: 1px solid rgba(109, 171, 255, 0.1);
}

.hud-stats b {
  font-size: 12px;
  font-weight: 750;
  color: #dceeff;
  font-variant-numeric: tabular-nums;
}

.hud-stats span {
  font-size: 8px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}

.stamina-wrap {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(1, 12, 24, 0.72);
  overflow: hidden;
}

.stamina-bar {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2a8fe8, #7ff1ff);
  box-shadow: 0 0 12px rgba(95, 229, 255, 0.45);
  transition: width 0.12s linear;
}

.stamina-wrap span {
  position: absolute;
  right: 5px;
  top: -1px;
  font-size: 7px;
  color: rgba(181, 224, 255, 0.6);
  letter-spacing: 0.1em;
}

/* ---------------- leaderboard ---------------- */

.board {
  position: fixed;
  z-index: 18;
  right: 22px;
  top: 72px;
  width: 256px;
  padding: 14px 14px 10px;
  border-radius: var(--r);
  animation: hudIn 0.55s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px 9px;
  border-bottom: 1px solid rgba(132, 204, 255, 0.1);
}

.board-head h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #cfe9ff;
}

#humanCount {
  font-size: 9px;
  color: var(--muted-2);
}

#rankList {
  list-style: none;
  margin: 6px 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rank-row {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  align-items: center;
  gap: 6px;
  padding: 5px 5px;
  border-radius: 7px;
  font-size: 10px;
  color: var(--muted);
  transition: background 0.2s ease;
}

.rank-row .rank {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.rank-row .rank-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #c9e2f5;
}

.rank-row .rank-lv {
  font-size: 8px;
  font-weight: 700;
  color: #8ba9c4;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(82, 146, 218, 0.12);
}

.rank-row .rank-k {
  font-size: 8px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.rank-row.is-self {
  background: linear-gradient(90deg, rgba(77, 107, 254, 0.24), rgba(77, 107, 254, 0.03));
  box-shadow: inset 2px 0 0 #6f8cff;
}

.rank-row.is-self .rank-name { color: #fff; }
.rank-row.is-dead { opacity: 0.45; }

.rank-row .bot-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #4a7296;
  margin-right: 5px;
  vertical-align: 1px;
}

.board-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 3px 0;
  border-top: 1px solid rgba(132, 204, 255, 0.08);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}

.live-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #52e6b0;
  box-shadow: 0 0 8px #52e6b0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------------- feed ---------------- */

.feed {
  position: fixed;
  z-index: 24;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  width: min(420px, 60vw);
}

.feed-item {
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(2, 16, 31, 0.76);
  border: 1px solid rgba(122, 191, 255, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 10px;
  color: #cfe6f7;
  letter-spacing: 0.02em;
  animation: feedIn 0.35s ease both;
  white-space: nowrap;
}

.feed-item b { color: #fff; font-weight: 700; }
.feed-item em { font-style: normal; color: var(--gold); }
.feed-item.is-self { border-color: rgba(255, 212, 121, 0.35); }

@keyframes feedIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------------- mini map ---------------- */

.mini {
  position: fixed;
  z-index: 17;
  left: 22px;
  bottom: 22px;
  width: 202px;
  padding: 7px;
  border-radius: 16px;
  animation: hudIn 0.55s 0.14s ease both;
}

#minimap {
  width: 188px;
  height: 138px;
  display: block;
  border-radius: 10px;
  background: radial-gradient(circle at 55% 45%, #0a3352, #031625 78%);
  border: 1px solid rgba(98, 169, 226, 0.16);
}

.mini-label {
  font-size: 8px;
  letter-spacing: 0.32em;
  color: var(--muted-2);
  text-align: right;
  padding: 4px 4px 1px;
}

/* ---------------- hint & tools ---------------- */

.hint {
  position: fixed;
  z-index: 17;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(2, 17, 32, 0.66);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 9px;
  color: #84a9c6;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
}

.hint-mouse {
  width: 9px;
  height: 13px;
  border: 1px solid #7ba6c9;
  border-radius: 6px;
  position: relative;
}

.hint-mouse::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  width: 1px;
  height: 4px;
  background: #7ba6c9;
  transform: translateX(-50%);
}

.tools {
  position: fixed;
  z-index: 21;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(2, 17, 32, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #a9c8e2;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.icon-btn.wide {
  width: auto;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0.06em;
}

.icon-btn:hover {
  color: #fff;
  border-color: rgba(116, 183, 255, 0.42);
  background: rgba(13, 43, 72, 0.85);
}

/* ---------------- menu ---------------- */

.menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(900px 620px at 76% 40%, rgba(56, 100, 255, 0.14), transparent 68%),
    linear-gradient(92deg, rgba(1, 12, 24, 0.94) 0%, rgba(1, 12, 24, 0.76) 42%, rgba(1, 12, 24, 0.18) 78%, rgba(1, 12, 24, 0.04) 100%);
  transition: opacity 0.65s ease, visibility 0.65s;
}

.menu.leaving { opacity: 0; visibility: hidden; pointer-events: none; }

.menu-inner {
  position: relative;
  z-index: 3;
  width: min(1340px, calc(100% - 96px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  align-items: center;
  gap: 40px;
}

.menu-copy { max-width: 590px; animation: copyIn 0.9s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

@keyframes copyIn {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: #759bc0;
  margin-bottom: 17px;
}

.eyebrow span {
  width: 23px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #6d9bd0);
}

.title {
  margin: 0;
  font-size: clamp(63px, 7.4vw, 106px);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.045em;
  color: #f2f8ff;
  text-shadow: 0 12px 60px rgba(23, 75, 190, 0.35);
}

.title span {
  display: block;
  margin-top: 2px;
  background: linear-gradient(94deg, #8fb0ff 2%, #4d6bfe 42%, #42cfff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 30px rgba(55, 117, 255, 0.35));
}

.tagline {
  margin: 22px 0 27px;
  color: #9db8cf;
  font-size: 14px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  font-weight: 400;
}

.start-card {
  width: min(468px, 100%);
  border-radius: 22px;
  padding: 17px 18px 13px;
}

.start-card label {
  display: block;
  font-size: 9px;
  color: #7493ae;
  letter-spacing: 0.16em;
  margin: 0 2px 8px;
}

.name-row { display: flex; gap: 8px; }

#nameInput {
  min-width: 0;
  flex: 1;
  height: 48px;
  border-radius: 13px;
  border: 1px solid rgba(112, 173, 238, 0.2);
  background: rgba(1, 12, 24, 0.62);
  color: #ecf8ff;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#nameInput::placeholder { color: #55758f; }
#nameInput:focus {
  border-color: rgba(111, 156, 255, 0.68);
  box-shadow: 0 0 0 3px rgba(77, 107, 254, 0.14);
}

.start-btn {
  position: relative;
  flex: 0 0 auto;
  min-width: 148px;
  height: 48px;
  padding: 0 17px;
  border: 1px solid rgba(159, 185, 255, 0.38);
  border-radius: 13px;
  background: linear-gradient(180deg, #607dfd, #3e56e4);
  box-shadow: 0 8px 24px rgba(48, 77, 220, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.start-btn i {
  font-style: normal;
  font-size: 17px;
  font-weight: 400;
  transition: transform 0.2s;
}

.start-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 12px 32px rgba(48, 77, 220, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.start-btn:hover:not(:disabled) i { transform: translateX(4px); }
.start-btn:disabled { cursor: wait; filter: grayscale(0.35) brightness(0.75); }

.menu-status {
  min-height: 15px;
  margin: 9px 2px 0;
  font-size: 9px;
  line-height: 1.5;
  color: #6688a3;
  letter-spacing: 0.03em;
}

.menu-status.bad { color: #ff9aa5; }
.menu-status.good { color: #71dfb4; }

.how {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  width: min(468px, 100%);
  margin-top: 15px;
}

.tip {
  padding: 10px 11px;
  border: 1px solid rgba(121, 186, 240, 0.1);
  border-radius: 12px;
  background: rgba(4, 20, 37, 0.36);
}

.tip .key {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #8cb5ff;
  margin-bottom: 5px;
}

.tip p {
  margin: 0;
  font-size: 9px;
  color: #7595ae;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.menu-foot {
  margin-top: 19px;
  font-size: 8px;
  letter-spacing: 0.12em;
  color: #4f7089;
}

.menu-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  z-index: 4;
  text-align: center;
  font-size: 8px;
  letter-spacing: 0.18em;
  color: #496b85;
}

.menu-bottom span { margin: 0 9px; color: #35546b; }

/* hero */

.hero {
  position: relative;
  height: min(64vh, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: heroIn 1.1s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes heroIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.hero-ring {
  position: absolute;
  width: min(30vw, 390px);
  height: min(30vw, 390px);
  border-radius: 50%;
  border: 1px solid rgba(106, 157, 255, 0.16);
  box-shadow: 0 0 0 34px rgba(73, 126, 255, 0.03), 0 0 0 78px rgba(73, 126, 255, 0.02);
}

.hero-ring::before, .hero-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(101, 166, 255, 0.14);
}
.hero-ring::before { inset: -26px; }
.hero-ring::after { inset: 36px; border-style: solid; border-color: rgba(77, 107, 254, 0.11); }

.hero-glow {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 102, 255, 0.28), rgba(51, 160, 255, 0.08) 45%, transparent 70%);
  filter: blur(10px);
}

.hero-fish {
  position: relative;
  width: min(29vw, 360px);
  height: min(29vw, 360px);
  transform: rotate(-129deg);
  filter: drop-shadow(0 0 34px rgba(66, 113, 255, 0.55)) drop-shadow(0 26px 42px rgba(0, 8, 24, 0.5));
  animation: heroFloat 6.5s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: rotate(-129deg) translateY(0) rotate(0deg); }
  50% { transform: rotate(-129deg) translateY(-16px) rotate(-1.5deg); }
}

.hero-chip {
  position: absolute;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 11px;
  border: 1px solid rgba(124, 186, 255, 0.18);
  background: rgba(4, 23, 42, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px rgba(0, 6, 16, 0.35);
}

.hero-chip b { font-size: 12px; color: #fff; font-weight: 750; }
.hero-chip span { font-size: 8px; color: #7899b4; letter-spacing: 0.04em; }

.chip-a { top: 13%; right: 6%; animation: chipFloat 5s ease-in-out infinite; }
.chip-b { bottom: 18%; left: 2%; animation: chipFloat 6s 0.8s ease-in-out infinite; }
.chip-c { right: 8%; bottom: 12%; animation: chipFloat 7s 0.3s ease-in-out infinite; }
.chip-c i {
  width: 5px; height: 5px; border-radius: 50%;
  background: #52e6b0; box-shadow: 0 0 8px #52e6b0;
  align-self: center;
}

@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

.menu-ambient { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }

.bubble {
  position: absolute;
  bottom: -40px;
  border: 1px solid rgba(133, 204, 255, 0.18);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(207, 243, 255, 0.28), transparent 45%);
  animation: rise linear infinite;
}

.b1 { left: 9%; width: 10px; height: 10px; animation-duration: 15s; animation-delay: -2s; }
.b2 { left: 23%; width: 5px; height: 5px; animation-duration: 19s; animation-delay: -7s; }
.b3 { left: 47%; width: 8px; height: 8px; animation-duration: 13s; animation-delay: -4s; }
.b4 { left: 67%; width: 14px; height: 14px; animation-duration: 21s; animation-delay: -12s; }
.b5 { left: 82%; width: 6px; height: 6px; animation-duration: 17s; animation-delay: -9s; }
.b6 { left: 92%; width: 3px; height: 3px; animation-duration: 12s; animation-delay: -5s; }

@keyframes rise {
  from { transform: translateY(0) translateX(0); opacity: 0; }
  8% { opacity: 0.7; }
  90% { opacity: 0.5; }
  to { transform: translateY(-110vh) translateX(24px); opacity: 0; }
}

/* ---------------- death ---------------- */

.death {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(2, 14, 28, 0.55), rgba(0, 5, 12, 0.78));
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease both;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.death-card {
  width: min(480px, calc(100vw - 40px));
  border-radius: 24px;
  padding: 34px 36px 28px;
  text-align: center;
  animation: deathIn 0.45s cubic-bezier(0.2, 0.9, 0.2, 1) both;
  border-color: rgba(255, 129, 147, 0.18);
}

@keyframes deathIn {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.death-kicker {
  font-size: 9px;
  letter-spacing: 0.3em;
  color: #c16d7d;
  margin-bottom: 12px;
}

.death-card h2 {
  margin: 0 0 12px;
  font-size: clamp(23px, 3vw, 29px);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.death-card h2 span { color: #ff9bac; }
.death-card p { margin: 0 auto 22px; max-width: 330px; color: #7f9db5; font-size: 11px; line-height: 1.7; }

.respawn {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  color: #eaf6ff;
}

.respawn span {
  font-size: 45px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  text-shadow: 0 0 26px rgba(255, 212, 121, 0.35);
}

.respawn small { font-size: 10px; color: #718fa8; letter-spacing: 0.08em; }

.death-bar {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-top: 17px;
}

.death-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff9b83, #ffd479);
  transform-origin: left;
}

/* ---------------- modal ---------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 8, 18, 0.68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 26px;
  padding: 32px 34px 30px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(126, 184, 255, 0.18);
  background: rgba(2, 16, 30, 0.55);
  color: #91b0c9;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.modal-card h2 {
  margin: 0 0 22px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rule {
  padding: 13px 15px;
  border-radius: 13px;
  border: 1px solid rgba(121, 183, 240, 0.1);
  background: rgba(2, 16, 30, 0.36);
}

.rule b {
  display: block;
  font-size: 10px;
  color: #9dc5ff;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.rule p { margin: 0; font-size: 10px; line-height: 1.7; color: #7897af; }

.formula {
  margin: 16px 0 20px;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(77, 107, 254, 0.08);
  border: 1px solid rgba(99, 139, 255, 0.14);
  color: #8ea9c1;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.modal-card .start-btn { width: 100%; }

/* ---------------- toast / fatal ---------------- */

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: 27%;
  transform: translate(-50%, -8px);
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(130, 191, 255, 0.22);
  background: rgba(4, 23, 43, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #e8f6ff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
  box-shadow: 0 16px 40px rgba(0, 6, 16, 0.4);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.gold { border-color: rgba(255, 212, 121, 0.4); color: var(--gold); }

.fatal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 7, 15, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 20px;
}

.fatal-card {
  width: min(430px, 100%);
  border-radius: 22px;
  padding: 30px;
  text-align: center;
}

.fatal-card h2 { margin: 0 0 9px; font-size: 22px; }
.fatal-card p { margin: 0 0 20px; color: #7997af; font-size: 11px; line-height: 1.6; }

/* ---------------- responsive ---------------- */

@media (max-width: 1080px) {
  .menu-inner { width: calc(100% - 56px); grid-template-columns: 1fr 0.72fr; gap: 18px; }
  .hero-fish { width: 280px; height: 280px; }
  .hero-ring { width: 310px; height: 310px; }
  .hud { width: 310px; }
  .board { width: 230px; }
}

@media (max-width: 820px) {
  .menu { justify-content: center; overflow-y: auto; padding: 40px 0 56px; }
  .menu-inner { display: block; width: calc(100% - 36px); }
  .menu-copy { max-width: 100%; }
  .hero { display: none; }
  .title { font-size: clamp(55px, 16vw, 78px); }
  .tagline { font-size: 12px; margin: 16px 0 20px; }
  .start-card, .how { width: 100%; }
  .how { gap: 6px; }
  .tip { padding: 9px; }
  .menu-bottom { display: none; }
  .menu-foot { margin-top: 14px; font-size: 7px; }
  .hud {
    left: 12px;
    top: 60px;
    width: min(285px, calc(100vw - 24px));
    padding: 10px;
    gap: 10px;
  }
  .hud-avatar { flex-basis: 52px; height: 68px; }
  .hud-avatar img { width: 40px; height: 40px; }
  .hud-stats { gap: 3px; }
  .board { display: none; }
  .mini { display: none; }
  .hint { display: none; }
  .feed { top: 194px; width: 82vw; }
  .tools { right: 12px; bottom: 12px; }
  #topbar { top: 12px; left: 14px; right: 14px; }
  .brand span { display: none; }
  .death-card { padding: 28px 22px 24px; }
  .rule-grid { grid-template-columns: 1fr; }
  .modal-card { padding: 26px 20px 22px; }
}

@media (max-width: 820px) and (max-height: 660px) {
  .menu { justify-content: flex-start; padding-top: 30px; }
}

@media (max-width: 480px) {
  .name-row { flex-direction: column; }
  .start-btn { width: 100%; min-width: 0; }
  .menu-status { min-height: 26px; }
  .hud { top: 56px; }
  .hud-stats span { display: none; }
  .hud-stats { gap: 4px; }
  .hud-stats > div { justify-content: center; }
  .hud-avatar { flex-basis: 48px; height: 62px; }
  .hud-row strong { font-size: 13px; }
}

@media (max-height: 720px) and (min-width: 821px) {
  .hero { height: 480px; }
  .title { font-size: clamp(58px, 6.5vw, 88px); }
  .tagline { margin: 16px 0 20px; }
  .how { margin-top: 12px; }
  .menu-foot { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
