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

:root {
  --bg: #04060f;
  --panel: rgba(12, 20, 40, 0.82);
  --line: rgba(120, 200, 255, 0.22);
  --accent: #5ad1ff;
  --accent-2: #ff6bd0;
  --warn: #ffd166;
   
  --gold: #b8860b;
  --danger: #ff5470;
  --text: #dff1ff;
   
  --control-h: clamp(88px, 13vh, 120px);
}

 
 
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(90, 209, 255, 0.38) transparent;
  accent-color: var(--accent);  
  color-scheme: dark;            
}
*::-webkit-scrollbar { width: 6px; height: 6px; }  
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(90, 209, 255, 0.38);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(90, 209, 255, 0.62); }
*::-webkit-scrollbar-thumb:active { background: rgba(90, 209, 255, 0.78); }
*::-webkit-scrollbar-corner { background: transparent; }  

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  overflow: hidden;
   
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

 
#game-area {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #0a1638 0%, #04060f 70%);
  overflow: hidden;
}

#game-canvas {
  display: block;
   
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 9 / 16;
  background: #02040c;
  box-shadow: 0 0 42px rgba(90, 209, 255, 0.18), inset 0 0 90px rgba(0, 0, 0, 0.6);
}

 
#hud {
  position: absolute;
   
  top: max(0px, calc(env(safe-area-inset-top) - 8px));
   
  left: calc(10px + var(--points-chip-w, 96px) + 10px);
  right: 10px;
  pointer-events: none;
  font-size: clamp(11px, 2.6vw, 15px);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}
.hidden { display: none !important; }

.hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hud-left, .hud-right { display: flex; align-items: baseline; gap: 5px; }
 
.hud-right { align-items: center; gap: 8px; }
.hud-text-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
 
.hud-score-line { display: flex; align-items: baseline; gap: 5px; }
 
.hud-level-info { display: flex; align-items: baseline; gap: 5px; }

.pause-btn {
  margin-left: 8px;
  min-width: 34px;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--accent, #7de3a0);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 7px;
  align-self: center;
  cursor: pointer;
  pointer-events: auto;  
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.pause-btn:active { background: rgba(255, 255, 255, 0.2); }
.hud-label { font-size: 0.72em; letter-spacing: 0.16em; color: #8fb6d8; }
.hud-value { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.hud-name { margin-left: 4px; font-size: 0.82em; color: #cfe8ff; opacity: 0.85; }
 
.hud-power-lv {
  flex: 0 0 auto;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
  font-size: clamp(8px, 2.2vw, 11px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--accent, #7de3a0);
}
 
.hud-account-lv {
  flex: 0 0 auto;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
  font-size: clamp(8px, 2.2vw, 11px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
  color: #b6c7d9;
}
 
.hud-level-badges {
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.hud-boss {
   
  position: absolute;
   
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--hud-viewport-w, 84vw) - 12px);
   
  top: calc(max(0px, env(safe-area-inset-top)) + 46px);
  height: 12px;
   
  z-index: 4;
  pointer-events: none;  
  border: 1px solid rgba(255, 120, 150, 0.55);
  background: rgba(40, 8, 20, 0.6);
  overflow: hidden;
}
#hud-boss-bar {
  height: 100%;
  width: 100%;
   
  background: linear-gradient(90deg, rgba(255, 84, 112, 0.5), rgba(255, 209, 102, 0.5));
  transition: width 0.12s linear;
}
#hud-boss-name {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  letter-spacing: 0.24em;
  color: #fff;
}

#level-progress {
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
#level-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
   
  background: var(--gold);
  transition: width 0.2s linear;
}

 
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
   
  padding: 6px 16px;
  background: rgba(2, 5, 14, 0.78);
  backdrop-filter: blur(3px);
  z-index: 5;
}
.overlay-card {
  width: 100%;
  max-width: 380px;
   
  max-height: calc(100% - 12px);
  overflow-y: auto;
  overscroll-behavior: contain;
   
  padding: 10px 18px 10px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(16, 30, 62, 0.94), rgba(7, 12, 28, 0.96));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}
 
.overlay-title-row {
  display: grid;
   
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
   
  margin-bottom: 10px;
}
.overlay-title-row .overlay-title {
  grid-column: 2;
  margin-bottom: 0;
   
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
 
.overlay-title-row .shop-btn { grid-column: 3; justify-self: start; align-self: center; }

.overlay-title {
   
  font-size: clamp(17px, 4.6vw, 24px);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #ffffff, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
 
.overlay-subtitle {
  margin: -4px 0 12px;
  font-size: clamp(11px, 3vw, 13px);
  letter-spacing: 0.42em;
  text-indent: 0.42em;  
  color: var(--accent);
  opacity: 0.85;
}

 
.overlay-text { font-size: clamp(11px, 3vw, 13px); line-height: 1.75; color: #b9d5ef; }
.overlay-list { list-style: none; margin: 12px 0 4px; font-size: clamp(11px, 3vw, 13px); color: #9fc4e2; }
.overlay-list li { padding: 2px 0; }
.overlay-btn {
  margin-top: 16px;
  min-width: 178px;
  padding: 10px 26px;
  font: inherit;
  font-size: clamp(13px, 3.4vw, 15px);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #04121f;
  border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(90deg, var(--accent), #8b7bff);
  box-shadow: 0 6px 22px rgba(90, 209, 255, 0.35);
  transition: transform 0.1s ease, filter 0.15s ease;
}
.overlay-btn:active { transform: scale(0.96); filter: brightness(1.15); }
.overlay-btn:focus-visible { outline: 2px solid #cdeaff; outline-offset: 3px; }
.overlay-hint { margin-top: 12px; font-size: 10px; letter-spacing: 0.1em; color: #6f93b3; }

 
.overlay-sub {
  margin-top: 10px;
  padding: 8px 16px;
  min-height: 32px;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #9fc4e2;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  cursor: pointer;
}
.overlay-sub.danger { color: #ff8fa5; border-color: rgba(255, 143, 165, 0.55); }
.overlay-sub:active { transform: scale(0.96); }

 
.shop-btn {
  z-index: 6;  
  min-width: 32px;  
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 19px;
  line-height: 1;
  color: #cfe8ff;
  background: rgba(9, 20, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.shop-btn:hover { color: var(--accent); border-color: var(--accent); }
.shop-btn:active { transform: scale(0.94); }

 
 
.shop-overlay {
  --shop-gutter-bottom: max(40px, env(safe-area-inset-bottom));
  position: fixed;
  inset: 0;
  z-index: 55;  
  display: flex;
   
  align-items: flex-start;
  justify-content: center;
  padding: max(8px, env(safe-area-inset-top)) 16px var(--shop-gutter-bottom);
  background: rgba(2, 5, 14, 0.7);
  backdrop-filter: blur(3px);
}
.shop-card {
  width: min(420px, calc(100vw - 32px));
   
  height: calc(100vh - max(8px, env(safe-area-inset-top)) - var(--shop-gutter-bottom));
  height: calc(100dvh - max(8px, env(safe-area-inset-top)) - var(--shop-gutter-bottom));
  max-height: calc(100% - max(8px, env(safe-area-inset-top)) - var(--shop-gutter-bottom));
  display: flex;
  flex-direction: column;
  padding: 14px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(16, 30, 62, 0.96), rgba(7, 12, 28, 0.97));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}
.shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.shop-title {
  margin: 0;
  font-size: clamp(15px, 4vw, 19px);
  letter-spacing: 0.1em;
  color: var(--accent);
}
.shop-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font: inherit;
  font-size: 15px;
  color: #cfe8ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.shop-close:hover { color: var(--accent); border-color: var(--accent); }
.shop-close:active { transform: scale(0.94); }
 
.shop-preview {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 6px;
  overflow: hidden;
  background: rgba(4, 6, 15, 0.92);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.shop-preview canvas {
  display: block;
  width: min(100%, 216px);
  aspect-ratio: 720 / 290;
}
 
.shop-body {
  flex: 1 1 auto;
  min-height: 160px;
  margin-top: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
 
.shop-section-title {
  margin: 14px 0 6px;
  font-size: clamp(12px, 3.4vw, 14px);
  letter-spacing: 0.14em;
  color: #9fc6ff;
}
.shop-section-title:first-child { margin-top: 0; }
 
.shop-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.shop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  font: inherit;
  font-size: clamp(12px, 3.4vw, 14px);
  color: #eaf6ff;
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
   
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.shop-item:active { transform: scale(0.97); }
 
.shop-item.selected {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: rgba(125, 227, 160, 0.12);
}
 
.shop-item.current {
  color: #cfe8ff;
  box-shadow: inset 0 0 0 1px rgba(125, 255, 176, 0.45);
  background: rgba(125, 255, 176, 0.08);
}
.shop-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-item-price {
  flex: 0 0 auto;
   
  min-width: 3.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-style: normal;
  font-size: clamp(11px, 3vw, 12px);
  color: #ffd166;
  white-space: nowrap;
}
.shop-item-price.inuse { color: #7dffb0; }
 
.shop-empty {
  grid-column: 1 / -1;
  padding: 8px 10px;
  font-size: clamp(11px, 3vw, 12px);
  line-height: 1.5;
  color: #7f96b3;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
 
.shop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.shop-price {
  font-size: clamp(12px, 3.4vw, 14px);
  color: #9fc6ff;
  white-space: nowrap;
}
.shop-confirm {
  padding: 9px 16px;
  font: inherit;
  font-size: clamp(13px, 3.6vw, 15px);
  letter-spacing: 0.04em;
  color: #04121f;
  background: linear-gradient(180deg, var(--accent), #4fd47f);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.shop-confirm:active { transform: scale(0.96); }

 
.level-pick { margin-top: 16px; }
.level-pick .level-pick-title {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: #6f93b3;
  margin-bottom: 6px;
}
.level-chips {
  display: grid;
   
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  justify-items: stretch;
}
.level-chip {
  box-sizing: border-box;  
  width: 100%;  
  min-width: 0;
  font: inherit;
  font-size: clamp(10px, 2.8vw, 11px);
   
  line-height: 16px;
  padding: 8px 9px;
  height: 32px;  
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #cfe8ff;
  background: rgba(90, 209, 255, 0.1);
  border: 1px solid rgba(90, 209, 255, 0.35);
  border-radius: 8px;
  cursor: pointer;
}
.level-chip.active {
  color: #04121f;
  background: linear-gradient(90deg, var(--accent), #8b7bff);
  border-color: transparent;
  font-weight: 700;
}
.level-chip.locked { opacity: 0.45; pointer-events: none; }
 
.level-chip-starmap { grid-column: span 2; }

.notice {
  position: absolute;
   
  top: 12%; left: 0; right: 0;
  text-align: center;
  font-size: clamp(15px, 4.6vw, 22px);
  letter-spacing: 0.3em;
  color: var(--warn);
  text-shadow: 0 0 18px rgba(255, 209, 102, 0.75);
  pointer-events: none;
  z-index: 4;
  animation: notice-pop 1.5s ease forwards;
}
@keyframes notice-pop {
  0% { opacity: 0; transform: scale(0.82); }
  18% { opacity: 1; transform: scale(1.04); }
  75% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.06); }
}

 
#control-bar {
  flex: 0 0 var(--control-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px max(10px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom))
          max(10px, env(safe-area-inset-right));
  background: linear-gradient(180deg, rgba(10, 22, 46, 0.96), rgba(3, 6, 14, 0.99));
  border-top: 1px solid var(--line);
}

 
.dpad-zone {
  position: relative;
  display: flex;
   
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  height: 100%;
}
.dpad-base {
  position: relative;
  width: calc(var(--control-h) - 26px);
  height: calc(var(--control-h) - 26px);
  max-width: 144px;
  max-height: 144px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, rgba(90, 209, 255, 0.16), rgba(6, 12, 26, 0.9) 70%);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.65);
  touch-action: none;
}
.dpad-ring {
  position: absolute; inset: 14%;
  border: 1px dashed rgba(120, 200, 255, 0.18);
  border-radius: 50%;
}
.dpad-arrow {
  position: absolute;
  font-style: normal;
  font-size: clamp(13px, 3.4vw, 17px);
  color: rgba(160, 215, 255, 0.5);
  transition: color 0.1s linear, text-shadow 0.1s linear;
}
.dpad-arrow-up { top: 3%; left: 50%; transform: translateX(-50%); }
.dpad-arrow-down { bottom: 3%; left: 50%; transform: translateX(-50%); }
.dpad-arrow-left { left: 4%; top: 50%; transform: translateY(-50%); }
.dpad-arrow-right { right: 4%; top: 50%; transform: translateY(-50%); }
.dpad-arrow.on { color: #eafaff; text-shadow: 0 0 12px var(--accent); }
.dpad-knob {
  position: absolute;
  left: 50%; top: 50%;
  width: 42%; height: 42%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 42% 34%, #eafaff, #37a9ff 58%, #123a6b 100%);
  box-shadow: 0 0 18px rgba(70, 180, 255, 0.75), inset 0 -3px 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
 
.skill-zone {
  display: flex;
  align-items: center;
  gap: clamp(6px, 2vw, 14px);
  height: 100%;
}
.skill-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
   
  width: calc(var(--control-h) - 42px);
  height: calc(var(--control-h) - 42px);
  max-width: 116px;
  max-height: 116px;
  padding: 0;
  font: inherit;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(170deg, rgba(28, 52, 96, 0.9), rgba(8, 14, 30, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 16px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  touch-action: none;
  transition: transform 0.08s ease, box-shadow 0.12s ease, opacity 0.12s linear,
              filter 0.12s linear;
}
.skill-icon { font-style: normal; font-size: clamp(19px, 5.4vw, 27px); line-height: 1; }
.skill-name { font-size: clamp(8px, 2.1vw, 10px); letter-spacing: 0.08em; color: #a8cde9; }
#skill-emp .skill-icon { color: #ff7ba0; text-shadow: 0 0 14px rgba(255, 123, 160, 0.8); }
#skill-ward .skill-icon { color: #7dffb0; text-shadow: 0 0 14px rgba(125, 255, 176, 0.8); }

.skill-cd {
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 0%;
  background: rgba(3, 8, 18, 0.74);
  pointer-events: none;
}
.skill-btn.ready { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 18px rgba(90, 209, 255, 0.3); }
.skill-btn.cooling { opacity: 0.6; }
.skill-btn.pressed { transform: scale(0.93); filter: brightness(1.45); }

 
.hud-vessels {
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: none;  
}
.vessel {
  --fill: 100%;  
  --liquid-glow: rgba(255, 255, 255, 0.5);  
  position: relative;
  flex: 0 0 auto;
  width: clamp(13px, 3vw, 17px);
  height: calc(var(--control-h) - 46px);
  max-height: 98px;
   
  border-radius: 7px 7px 10px 10px / 12px 12px 9px 9px;
   
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.14), transparent 26% 74%, rgba(255, 255, 255, 0.18)),
    rgba(6, 12, 26, 0.5);
   
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    inset 0 6px 7px -5px rgba(255, 255, 255, 0.45),
    inset 0 -8px 9px -6px rgba(150, 210, 255, 0.2),
    0 0 9px var(--liquid-glow);
}
 
.vessel::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.4), transparent 30%),
    linear-gradient(90deg, transparent 70%, rgba(255, 255, 255, 0.42)),
    radial-gradient(70% 12% at 50% 3%, rgba(255, 255, 255, 0.5), transparent 80%);
   
  mask: linear-gradient(180deg, #000, rgba(0, 0, 0, 0.4) 46%, transparent 82%),
        radial-gradient(70% 12% at 50% 3%, #000 62%, transparent 80%);
  -webkit-mask: linear-gradient(180deg, #000, rgba(0, 0, 0, 0.4) 46%, transparent 82%),
        radial-gradient(70% 12% at 50% 3%, #000 62%, transparent 80%);
  pointer-events: none;
}
 
.vessel::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: var(--fill);
  z-index: 1;
  border-radius: 5px 5px 7px 7px / 6px 6px 8px 8px;
  transition: height 0.14s ease-out;
}
 
.hp-vessel {
  --liquid-glow: rgba(255, 92, 122, 0.6);
}
.hp-vessel::after {
   
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 10%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08) 34%,
                    rgba(255, 255, 255, 0.02) 62%, rgba(255, 255, 255, 0.26)),
    linear-gradient(180deg, #ffd3de, #ff9aae 26%, #ff5470 74%, #d81f47);
  box-shadow:
    0 0 10px var(--liquid-glow),
    inset 0 1px 3px rgba(255, 255, 255, 0.6),
    inset 0 -5px 8px -4px rgba(120, 8, 34, 0.7);
}
 
.shield-vessel {
  --liquid-glow: rgba(190, 226, 255, 0.55);
}
.shield-vessel::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 10%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1) 34%,
                    rgba(255, 255, 255, 0.04) 62%, rgba(255, 255, 255, 0.3)),
    linear-gradient(180deg, #ffffff, #eef6ff 26%, #b6c7d9 74%, #7d93ad);
  box-shadow:
    0 0 10px var(--liquid-glow),
    inset 0 1px 3px rgba(255, 255, 255, 0.75),
    inset 0 -5px 8px -4px rgba(58, 82, 116, 0.6);
}
 
.vessel.lost::after { box-shadow: none; }
.vessel.lost {
  --liquid-glow: rgba(140, 170, 205, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 -8px 9px -6px rgba(150, 210, 255, 0.1);
}

 
.hud-icon-slots {
  display: flex;
   
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
   
  gap: 1px;
   
  align-self: stretch;
  height: auto;
  margin-top: 2px;
  pointer-events: none;  
}
 
.icon-slot-grid {
  display: grid;
   
  grid-template-columns: repeat(2, max-content);
  grid-auto-rows: max-content;
  justify-content: start;
  align-content: start;
   
  gap: 1px;
}
.icon-slot {
  --slot-color: #ffffff;  
  --slot-glow: rgba(255, 255, 255, 0.8);  
  --letter: '';  
   
  --slot-letter: #ffffff;
  position: relative;
  flex: 0 0 auto;
   
  width: calc(clamp(13px, 3vw, 17px) + 4px);
  aspect-ratio: 1 / 1;
}
 
.icon-slot.slot-empty {
  display: none;
}
 
.icon-slot::before {
  content: '';
  position: absolute;
  inset: -20%;
  z-index: 0;
  background: radial-gradient(circle at center, var(--slot-glow) 0%, transparent 68%);
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  pointer-events: none;
}
 
.icon-slot::after {
  content: var(--letter);
  position: absolute;
  inset: 16%;
  z-index: 1;
  display: grid;
  place-items: center;
  background: rgba(4, 8, 18, 0.72);  
  border: 1.6px solid rgba(255, 255, 255, 0.85);  
  border-radius: 3px;
  color: var(--slot-letter);  
  text-shadow: 0 0 7px var(--slot-glow);  
  font-weight: 700;
  font-size: clamp(9px, 2vw, 12px);  
  line-height: 1;
}

 
@media (max-width: 380px) {
  :root { --control-h: clamp(84px, 12vh, 110px); }
}

 
#points-chip {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 0;  
  z-index: 45;
  display: flex;
  flex-direction: column;  
  align-items: flex-start;  
  gap: 5px;
  font-size: clamp(9px, 2vw, 11px);  
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}
#points-label {
  padding-left: 8px;  
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--warn);
  background: none;
  border: none;
  white-space: nowrap;
}
 
.menu-btn {
  width: 40px;  
  padding: 2px 10px 2px 8px;
  min-height: 28px;
  font-size: clamp(13px, 2.6vw, 16px);
  line-height: 1;
  text-align: center;
  color: #a8cde9;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-left: none;
  border-radius: 0 7px 7px 0;
  opacity: 0.55;  
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.menu-btn:hover { opacity: 0.9; color: var(--accent); border-color: var(--accent); }
.menu-btn:active { background: rgba(255, 255, 255, 0.2); }

 

 
.side-panel {
  position: fixed;
   
  top: calc(max(8px, env(safe-area-inset-top)) + 79px);
  left: 0;
  z-index: 51;  
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: min(180px, 46vw);
  padding: 10px 12px 14px 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  border-radius: 0 14px 14px 0;
  box-shadow: 14px 10px 34px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  transform: translateX(-105%);  
  transition: transform 0.22s ease;
}
.side-panel.open { transform: translateX(0); }

 
.side-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 49;  
}

 
.donate-btn,
.lang-btn {
  padding: 2px 10px 2px 8px;
  min-height: 28px;
  font-size: clamp(11px, 2.5vw, 14px);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  color: #a8cde9;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-left: none;
  border-radius: 0 7px 7px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.donate-btn:hover { color: var(--warn); border-color: var(--warn); background: rgba(255, 209, 102, 0.1); }
.donate-btn:active { background: rgba(255, 255, 255, 0.2); }

 
 
.lang-btn:hover { color: var(--accent, #7de3a0); border-color: var(--accent, #7de3a0); background: rgba(125, 227, 160, 0.1); }
.lang-btn:active { background: rgba(255, 255, 255, 0.2); }

 
.audio-settings {
  display: flex;
  flex-direction: column;
  gap: 6px;
   
  padding: 4px 10px 6px 8px;
  border-left: none;
  border-radius: 0 7px 7px 0;
  background: rgba(255, 255, 255, 0.04);
}

 
.audio-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(11px, 2.5vw, 14px);
  color: #a8cde9;
  cursor: pointer;
}
.audio-label {
  flex: 0 0 auto;
  white-space: nowrap;
}

 
.volume-row { flex-wrap: wrap; }
.volume-value {
  margin-left: auto;
  font-variant-numeric: tabular-nums;  
  color: var(--text, #dff1ff);
}

 
.volume-slider {
  flex: 1 1 100%;
  width: 100%;
  height: 22px;  
  margin: 0;
  background: transparent;
  accent-color: var(--accent);  
  cursor: pointer;
   
  touch-action: none;
  -webkit-appearance: none;
  appearance: none;
}
.volume-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;  
  border: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(90, 209, 255, 0.7);
}
.volume-slider:active::-webkit-slider-thumb { background: #fff; }
.volume-slider:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.volume-slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}
.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(90, 209, 255, 0.7);
}

 
.music-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 8px;
  min-height: 28px;
  font-size: clamp(11px, 2.5vw, 14px);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  color: #a8cde9;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-left: none;
  border-radius: 0 7px 7px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.music-toggle:hover { color: var(--warn); border-color: var(--warn); background: rgba(255, 209, 102, 0.1); }
.music-toggle:active { background: rgba(255, 255, 255, 0.2); }
 
.music-toggle[aria-checked='false'] { color: #6f8ba3; text-decoration: line-through; }

 
.player-info-panel {
  position: fixed;
   
  top: calc(max(8px, env(safe-area-inset-top)) + 79px);
  left: 0;
  z-index: 51;  
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(230px, 62vw);
  padding: 10px 12px 12px 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  border-radius: 0 14px 14px 0;
  box-shadow: 14px 10px 34px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  transform: translateX(-105%);  
  transition: transform 0.22s ease;
}
.player-info-panel.open { transform: translateX(0); }

 
.player-info-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;  
}
.player-info-title {
  margin: 0;
  font-size: clamp(12px, 3vw, 14px);
  letter-spacing: 0.08em;
  color: var(--accent);
}

 
.player-info-list { display: flex; flex-direction: column; gap: 3px; }
.player-info-row {
  display: grid;
   
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  padding: 2px 8px 2px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
}
.player-info-label {
  font-size: clamp(10px, 2.4vw, 11px);
  letter-spacing: 0.06em;
  color: #8fb6d8;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.player-info-value {
  justify-self: end;
  font-size: clamp(11px, 2.6vw, 13px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
   
  max-width: 100%;
}
 
.hp-value { color: #ff9aae; }
.shield-value { color: #dfe9f5; }

 
.player-info-foot {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}
.player-info-foot .overlay-sub {
  width: 100%;
  margin-top: 0;
}


 
.donate-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;  
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 15, 0.78);
  backdrop-filter: blur(2px);
}
.donate-card {
  width: min(520px, calc(100vw - 32px));
  max-height: min(84vh, 660px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 26px calc(max(20px, env(safe-area-inset-bottom)));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 16, 32, 0.95);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.donate-title { margin: 0; font-size: 19px; letter-spacing: 1px; color: var(--warn); }
.donate-qr {
  display: block;
  margin: 16px auto 14px;
  width: min(230px, 62vw);
  height: auto;
  image-rendering: pixelated;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
}
.donate-addr {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
  user-select: all;
  cursor: text;
}
.donate-note { margin-top: 12px; font-size: 13px; line-height: 1.6; color: #8fb6d8; }
.donate-close {
  margin-top: 16px;
  padding: 9px 30px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #04060f;
  background: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.donate-close:hover { filter: brightness(1.08); }
.donate-close:active { transform: scale(0.96); }
 
.donate-close:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.7);
}
.donate-close:disabled:hover { filter: grayscale(0.7); }
.donate-close:disabled:active { transform: none; }

