:root {
  --hud: #ffb347;
  --hud-dim: rgba(255, 179, 71, 0.55);
  --hud-bg: rgba(10, 8, 6, 0.45);
  --danger: #ff4a3a;
  --ok: #7fe0ff;
}
* { box-sizing: border-box; }
html, body { touch-action: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--hud);
  font-family: "Consolas", "Menlo", "DejaVu Sans Mono", monospace; user-select: none; }
#game { display: block; width: 100vw; height: 100vh; }
.hidden { display: none !important; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#reticle { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
#reticle svg { overflow: visible; }
#reticle line, #reticle .ring { stroke: var(--hud-dim); stroke-width: 1.5; fill: none; }
#reticle .dot { fill: var(--hud); }
#reticle .stick { fill: none; stroke: var(--ok); stroke-width: 2; }

.panel { position: absolute; top: 16px; background: var(--hud-bg); border: 1px solid var(--hud-dim);
  padding: 10px 14px; min-width: 210px; font-size: 13px; letter-spacing: 0.08em; }
#panel-left { left: 16px; }
#panel-right { right: 16px; }
.row { display: flex; align-items: baseline; gap: 8px; margin: 3px 0; }
.row.small { font-size: 11px; opacity: 0.6; }
.lbl { flex: 1; opacity: 0.75; font-size: 11px; }
.val { font-size: 22px; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.unit { font-size: 11px; opacity: 0.6; width: 32px; }
.tag { padding: 1px 6px; border: 1px solid var(--hud-dim); font-size: 11px; }
.tag.on { color: #000; background: var(--hud); }
.bar { margin-top: 8px; }
.bar .lbl { margin-bottom: 3px; }
.track { height: 8px; border: 1px solid var(--hud-dim); }
.fill { height: 100%; width: 0; background: var(--hud); transition: width 0.08s linear; }
.fill.shield { background: var(--ok); }
.fill.boost { background: #ff6a3a; }
.fill.low { background: var(--danger); }

#race { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 18px;
  background: var(--hud-bg); border: 1px solid var(--hud-dim); padding: 6px 14px; font-size: 13px;
  letter-spacing: 0.08em; font-variant-numeric: tabular-nums; white-space: nowrap; }
#race-time { font-size: 18px; color: #ffd27a; }
#race span { align-self: center; }
#markers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.marker { position: absolute; left: 0; top: 0; display: none; }
.marker .dia { width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid #ffa040; transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(255,160,64,0.8); }
.marker.enemy .dia { width: 22px; height: 22px; margin: -11px 0 0 -11px; transform: none; border-color: #ff3b30;
  box-shadow: 0 0 6px rgba(255,59,48,0.7); }
.marker.edge .dia { background: rgba(255,160,64,0.45); }
.marker.enemy.edge .dia { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: rgba(255,59,48,0.6); }
.marker span { position: absolute; left: 14px; top: -8px; font-size: 11px; color: #ffd27a; white-space: nowrap; }
.marker.enemy span { color: #ff8a80; }
#minimap { position: absolute; right: 16px; bottom: 44px; width: 220px; height: 220px; border-radius: 50%;
  border: 1px solid var(--hud-dim); background: rgba(0,0,0,0.35); }
#warn { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); color: var(--danger);
  font-size: 18px; letter-spacing: 0.3em; text-shadow: 0 0 8px rgba(255,60,40,0.7); }
#toast { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); font-size: 16px;
  letter-spacing: 0.25em; opacity: 0; transition: opacity 0.3s; text-shadow: 0 0 6px rgba(255,160,60,0.6); }
#toast.show { opacity: 1; }
#hint { position: absolute; bottom: 12px; left: 16px; right: 260px; font-size: 11px; opacity: 0.5; }

#overlay { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(14,9,5,0.8), rgba(0,0,0,0.93)); backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px); overflow: auto; padding: 16px; }
#overlay .box { max-width: 640px; width: 100%; text-align: center; margin: auto 0; } /* centred, but scrolls from the top when taller than the screen */
h1 { font-size: 46px; letter-spacing: 0.2em; margin: 0 0 6px; color: #ffd27a; text-shadow: 0 0 18px rgba(255,170,60,0.5); }
h1 span { display: block; font-size: 18px; letter-spacing: 0.6em; color: var(--hud); }
.sub { opacity: 0.7; margin: 10px 0 18px; }
button { font: inherit; font-size: 20px; letter-spacing: 0.3em; padding: 12px 48px; cursor: pointer;
  color: #000; background: var(--hud); border: 0; }
#modes { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
#modes button { display: flex; flex-direction: column; gap: 4px; padding: 12px 18px; min-width: 170px;
  font-size: 16px; letter-spacing: 0.15em; background: transparent; color: var(--hud); border: 1px solid var(--hud); }
#modes button small { font-size: 11px; letter-spacing: 0.05em; opacity: 0.75; }
#modes button:not(:disabled):hover, #modes button.current { background: var(--hud); color: #000; }
#resume { margin-bottom: 4px; }
button:disabled { opacity: 0.4; cursor: wait; }
button:not(:disabled):hover { background: #ffd27a; }
#settings { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; text-align: left; margin: 22px 0 10px;
  font-size: 13px; }
#settings label { cursor: pointer; }
#settings .range { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
#settings input[type=range] { flex: 1; accent-color: var(--hud); }
#settings input[type=checkbox] { accent-color: var(--hud); }
.keys { margin: 14px auto 0; font-size: 12px; border-collapse: collapse; text-align: left; }
.keys td { padding: 3px 10px; border-bottom: 1px solid rgba(255,179,71,0.15); }
.keys td:first-child { color: #ffd27a; white-space: nowrap; }

@media (max-width: 700px) {
  .panel { min-width: 0; font-size: 11px; padding: 6px 8px; }
  .val { font-size: 16px; min-width: 40px; }
  #minimap { width: 140px; height: 140px; }
  #hint { display: none; }
  #race { top: auto; bottom: 12px; gap: 8px; font-size: 11px; }
  #race-time { font-size: 14px; }
  #settings { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }
}

/* --- Touch controls ------------------------------------------------------------------------- */
.touch-help { display: none; font-size: 13px; opacity: 0.85; margin: 14px 0 0; }
body.touch .touch-help { display: block; }
body.touch .keys, body.touch #hint, body.touch #reticle .stick { display: none; }
#touch { position: fixed; inset: 0; z-index: 5; pointer-events: none; user-select: none; -webkit-user-select: none; }
#touch > * { pointer-events: auto; touch-action: none; }
.joy-zone { position: absolute; left: 0; bottom: 0; width: 50%; height: 75%; }
.joy-base { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%;
  border: 2px solid rgba(255,179,71,0.5); background: rgba(255,179,71,0.08); pointer-events: none !important;
  opacity: 0.45; transition: opacity 0.15s; left: max(110px, 16%); top: calc(100% - 110px); }
.joy-base::after { content: 'STER'; position: absolute; left: 0; right: 0; top: 128px; text-align: center;
  font-size: 10px; letter-spacing: 0.2em; color: var(--hud); opacity: 0.8; }
.joy-base.on::after { content: none; }
.joy-base.on { opacity: 1; }
.joy-knob { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%;
  background: rgba(255,179,71,0.55); box-shadow: 0 0 12px rgba(255,179,71,0.5); }
.tbtn { position: absolute; border-radius: 50%; padding: 0; font-size: 12px; letter-spacing: 0.05em;
  color: var(--hud); background: rgba(10,8,6,0.45); border: 2px solid var(--hud-dim); }
.tbtn:hover { background: rgba(10,8,6,0.45); color: var(--hud); }
.tbtn.down, .tbtn.down:hover { background: var(--hud); color: #000; }
.tbtn.fire { width: 92px; height: 92px; right: max(24px, env(safe-area-inset-right)); bottom: 26px;
  font-size: 14px; border-color: #ff5a4a; color: #ff8a7a; }
.tbtn.fire.down, .tbtn.fire.down:hover { background: #ff5a4a; color: #000; }
.tbtn.boost { width: 64px; height: 64px; right: calc(max(24px, env(safe-area-inset-right)) + 104px); bottom: 34px; }
.tbtn.brake { width: 56px; height: 56px; right: calc(max(24px, env(safe-area-inset-right)) + 22px); bottom: 132px; }
.tbtn.foil { width: 56px; height: 56px; right: calc(max(24px, env(safe-area-inset-right)) + 96px); bottom: 116px; font-size: 10px; }
.tbtn.cam { width: 46px; height: 46px; right: calc(max(24px, env(safe-area-inset-right)) + 160px); bottom: 170px; font-size: 10px; }
.tbtn.pause { width: 42px; height: 42px; left: 50%; margin-left: -21px; top: 8px; border-radius: 8px; font-size: 14px; }
.throttle { position: absolute; right: calc(max(24px, env(safe-area-inset-right)) + 190px); bottom: 26px; width: 38px; height: 130px;
  border: 2px solid var(--hud-dim); background: rgba(10,8,6,0.45); border-radius: 8px; overflow: hidden; }
.throttle .fill { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255,179,71,0.6); }
.throttle { overflow: visible; }
.throttle .fill { border-radius: 0 0 6px 6px; }
.throttle .knob { position: absolute; left: -8px; right: -8px; height: 6px; margin-bottom: -3px; bottom: 0;
  background: #ffd27a; border-radius: 3px; box-shadow: 0 0 8px rgba(255,200,100,0.9); pointer-events: none; }
.throttle span { position: absolute; bottom: -22px; left: -20px; right: -20px; text-align: center; font-size: 9px;
  color: var(--hud); line-height: 1.2; pointer-events: none; white-space: nowrap; }
.throttle span b { margin-left: 4px; font-size: 12px; color: #ffd27a; }

body.touch #panel-right { display: none; }
body.touch #panel-left { top: 8px; left: max(8px, env(safe-area-inset-left)); }
body.touch #minimap { top: 8px; bottom: auto; right: max(8px, env(safe-area-inset-right)); width: 110px; height: 110px; }
body.touch #race { top: 56px; bottom: auto; }
body.touch #toast { top: 32%; font-size: 13px; white-space: nowrap; }
body.touch #warn { top: 55%; font-size: 14px; }

#rotate { display: none; }
/* body.portrait is set from JS (touch.js) — the CSS orientation query is unreliable on iOS Safari */
body.touch.playing.portrait:not(.rotate-ok) #rotate { flex-direction: column; gap: 10px; text-align: center; display: flex; position: fixed; inset: 0; z-index: 20; align-items: center;
  justify-content: center; background: rgba(0,0,0,0.85); font-size: 20px; color: var(--hud); }
body.touch .panel { min-width: 0; padding: 5px 8px; font-size: 10px; }
body.touch .val { font-size: 15px; min-width: 40px; }
body.touch .bar { margin-top: 4px; }
body.touch #race { font-size: 11px; padding: 4px 10px; gap: 10px; }
body.touch #race-time { font-size: 14px; }

.attrib { font-size: 11px; opacity: 0.6; margin: 10px 0 0; }
.attrib:empty { display: none; }

/* --- Leaderboard ----------------------------------------------------------------------------- */
.link-btn { background: transparent; color: var(--hud); border: 1px solid var(--hud-dim); font-size: 14px;
  padding: 8px 22px; margin-top: 14px; letter-spacing: 0.2em; }
.link-btn:not(:disabled):hover { background: rgba(255,179,71,0.15); color: var(--hud); }
#lb { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.78); padding: 16px; overflow: auto; }
.lb-box { width: 100%; max-width: 460px; background: rgba(16,12,8,0.95); border: 1px solid var(--hud);
  padding: 18px 20px; text-align: center; box-shadow: 0 0 30px rgba(255,160,60,0.25); }
.lb-box h2 { margin: 0 0 8px; letter-spacing: 0.3em; color: #ffd27a; font-size: 22px; }
#lb-result { font-size: 26px; color: #ffd27a; margin: 6px 0 12px; font-variant-numeric: tabular-nums; }
#lb-result:empty { display: none; }
#lb-form { display: flex; gap: 8px; margin-bottom: 8px; }
#lb-form.hidden { display: none; }
#lb-nick { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px; background: #0c0a08;
  color: var(--hud); border: 1px solid var(--hud-dim); outline: none; letter-spacing: 0.08em; }
#lb-nick:focus { border-color: var(--hud); }
#lb-form button { font-size: 15px; padding: 10px 18px; letter-spacing: 0.15em; }
#lb-msg { min-height: 18px; font-size: 13px; margin-bottom: 8px; }
#lb-msg.err { color: var(--danger); }
.lb-tabs { display: flex; gap: 6px; justify-content: center; margin: 6px 0 8px; }
.lb-tabs button { background: transparent; color: var(--hud); border: 1px solid var(--hud-dim); font-size: 12px;
  padding: 6px 14px; letter-spacing: 0.15em; }
.lb-tabs button.on, .lb-tabs button.on:hover { background: var(--hud); color: #000; }
#lb-list { list-style: none; margin: 0 0 14px; padding: 0; text-align: left; font-size: 14px; max-height: 46vh; overflow: auto; }
#lb-list li { display: flex; gap: 10px; padding: 5px 8px; border-bottom: 1px solid rgba(255,179,71,0.15); }
#lb-list li .r { width: 28px; opacity: 0.6; text-align: right; }
#lb-list li .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lb-list li .s { font-variant-numeric: tabular-nums; color: #ffd27a; }
#lb-list li.me { background: rgba(255,179,71,0.18); }
#lb-list li.empty { justify-content: center; opacity: 0.6; }
#lb-list li:nth-child(1) .r { color: #ffd700; opacity: 1; }
#lb-list li:nth-child(2) .r { color: #d0d0d0; opacity: 1; }
#lb-list li:nth-child(3) .r { color: #cd7f32; opacity: 1; }

#lb-result .detail { font-size: 13px; color: var(--hud); opacity: 0.8; margin-top: 4px; letter-spacing: 0.05em; }
#lb-list li .d { font-size: 11px; opacity: 0.6; white-space: nowrap; align-self: center; }

/* Loading state: spinner next to the status text */
body.loading #loading { opacity: 1; color: #ffd27a; font-size: 15px; }
body.loading #loading::before { content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 10px;
  vertical-align: -2px; border: 2px solid rgba(255,210,122,0.3); border-top-color: #ffd27a; border-radius: 50%;
  animation: xw-spin 0.8s linear infinite; }
@keyframes xw-spin { to { transform: rotate(360deg); } }
/* while loading, the rest of the menu is not usable yet: keep the screen focused on progress */
body.loading #modes, body.loading #settings, body.loading .keys, body.loading .touch-help, body.loading #show-ranking, body.loading #attrib { display: none; }

/* Short screens (phones in landscape) */
@media (max-height: 500px) {
  #overlay { padding: 10px 16px; }
  h1 { font-size: 26px; margin: 0; }
  h1 span { font-size: 12px; letter-spacing: 0.45em; }
  .sub { margin: 6px 0 10px; font-size: 13px; }
  #modes { margin-top: 6px; gap: 8px; }
  #modes button { padding: 8px 12px; min-width: 140px; font-size: 13px; }
  #settings { margin: 12px 0 6px; font-size: 12px; }
  .link-btn { margin-top: 8px; padding: 6px 18px; font-size: 12px; }
}

/* Torpedo lock: four corner brackets that close in on the target as the lock builds up,
   then clamp tight, turn red and pulse once locked */
.marker .lock { display: none; position: absolute; left: 0; top: 0; width: 0; height: 0;
  --d: calc(15px + (1 - var(--lock, 0)) * 50px); --c: #ffd27a; opacity: calc(0.35 + var(--lock, 0) * 0.65); }
.marker .lock i { position: absolute; left: 0; top: 0; width: 13px; height: 13px; border: 2.5px solid var(--c);
  box-shadow: 0 0 6px rgba(255,200,100,0.6); }
.marker .lock i:nth-child(1) { transform: translate(calc(-1 * var(--d) - 13px), calc(-1 * var(--d) - 13px)); border-right: 0; border-bottom: 0; }
.marker .lock i:nth-child(2) { transform: translate(var(--d), calc(-1 * var(--d) - 13px)); border-left: 0; border-bottom: 0; }
.marker .lock i:nth-child(3) { transform: translate(calc(-1 * var(--d) - 13px), var(--d)); border-right: 0; border-top: 0; }
.marker .lock i:nth-child(4) { transform: translate(var(--d), var(--d)); border-left: 0; border-top: 0; }
.marker.locking .lock, .marker.locked .lock { display: block; }
.marker.locked .lock { --d: 11px; --c: #ff3b30; opacity: 1; animation: xw-lock 0.35s steps(2) infinite; }
.marker.locked .lock i { box-shadow: 0 0 8px rgba(255,59,48,0.8); }
.marker.locked .dia { border-color: #ff3b30; transform: rotate(45deg) scale(0.8); }
.marker.locked span { color: #ff6a5a; font-weight: bold; left: 50px; }
@keyframes xw-lock { 50% { opacity: 0.35; } }
.tbtn.torp { width: 56px; height: 56px; right: calc(max(24px, env(safe-area-inset-right)) + 104px); bottom: 182px;
  font-size: 10px; border-color: #7fb4ff; color: #a9cbff; }

.lb-actions { display: flex; gap: 10px; justify-content: center; }
.lb-actions button { font-size: 15px; padding: 10px 28px; letter-spacing: 0.2em; }
#lb-menu { background: transparent; color: var(--hud); border: 1px solid var(--hud); }
#lb-menu.hidden { display: none; }

/* Locked: four sharp triangles snap in from N/E/S/W, pointing at the target, blinking */
.marker .tri { display: none; position: absolute; left: 0; top: 0; width: 0; height: 0; }
.marker.locked .tri { display: block; animation: xw-tri-in 0.18s ease-out, xw-tri-blink 0.22s steps(2) 0.18s infinite; }
.marker .tri b { position: absolute; left: -7px; top: -12px; width: 14px; height: 24px; background: #ff3b30;
  filter: drop-shadow(0 0 4px rgba(255,59,48,0.9)); clip-path: polygon(50% 100%, 0 0, 100% 0); }
.marker .tri b:nth-child(1) { transform: translateY(-34px); }
.marker .tri b:nth-child(2) { transform: rotate(90deg) translateY(-34px); }
.marker .tri b:nth-child(3) { transform: rotate(180deg) translateY(-34px); }
.marker .tri b:nth-child(4) { transform: rotate(270deg) translateY(-34px); }
@keyframes xw-tri-in { from { transform: scale(2.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes xw-tri-blink { 50% { opacity: 0.15; } }

/* Torpedo gauge: ring fills while reloading; blue glow when ready, dim when out of ammo.
   Desktop: next to the minimap. Mobile: inside the TORP button. */
.torp-gauge { --p: 1; --c: #ffb347; position: absolute; color: #ffd27a; }
/* top-left corner of the minimap's square (outside the round map) */
#torp-gauge { right: 208px; bottom: 236px; width: 54px; height: 54px; border-radius: 50%;
  background: rgba(10,8,6,0.5); border: 1px solid var(--hud-dim); }
.torp-gauge .ring { position: absolute; inset: 3px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 360deg), rgba(255,179,71,0.14) 0);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%); }
.torp-gauge .ticon { position: absolute; left: 22%; top: 22%; width: 56%; height: 56%; opacity: 0.45; transition: opacity 0.2s; }
.torp-gauge .cnt { position: absolute; right: 2px; bottom: -2px; font-size: 12px; font-weight: bold; color: #ffd27a;
  text-shadow: 0 0 3px #000; }
.torp-gauge.ready { --c: #7fb4ff; color: #cfe2ff; }
.torp-gauge.ready .ticon { opacity: 1; filter: drop-shadow(0 0 4px #7fb4ff); }
.torp-gauge.ready .ring { filter: drop-shadow(0 0 4px #7fb4ff); }
.torp-gauge.empty { opacity: 0.35; }
.tbtn.torp.torp-gauge { position: absolute; padding: 0; color: #a9cbff; }
.tbtn.torp.torp-gauge .cnt { right: -2px; bottom: -4px; }
body.touch #torp-gauge { display: none; }
@media (max-width: 700px) { #torp-gauge { right: 122px; bottom: 148px; width: 44px; height: 44px; } }
/* Torpedo gauge colours (desktop and mobile): grey icon + yellow ring while reloading,
   icon and ring blue when ready */
.torp-gauge { --c: #ffd23a; color: #8c8c8c; }
.torp-gauge .ticon { opacity: 1; }
.torp-gauge .ring { background: conic-gradient(var(--c) calc(var(--p) * 360deg), rgba(255,210,58,0.15) 0); }
.torp-gauge.ready { --c: #4f9dff; color: #7fb4ff; }
.torp-gauge.ready .ticon, .torp-gauge.ready .ring { filter: drop-shadow(0 0 5px #4f9dff); }
.torp-gauge .cnt { color: #ffd27a; }
#torp-gauge { border-color: #6e6e6e; }
#torp-gauge.ready, .tbtn.torp.torp-gauge.ready { border-color: #4f9dff; }
.tbtn.torp.torp-gauge { border-color: #6e6e6e; }
#torp-gauge .ticon path, .tbtn.torp.torp-gauge .ticon path { fill: #8c8c8c; }
#torp-gauge.ready .ticon path, .tbtn.torp.torp-gauge.ready .ticon path { fill: #7fb4ff; }
#torp-gauge .ticon rect, .tbtn.torp.torp-gauge .ticon rect { fill: #6a6a6a; }
#torp-gauge.ready .ticon rect, .tbtn.torp.torp-gauge.ready .ticon rect { fill: #cfe2ff; }

/* Ripple when a torpedo finishes loading */
.torp-gauge::before, .torp-gauge::after { content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #4f9dff; opacity: 0; pointer-events: none; }
.torp-gauge.pulse::before { animation: xw-ripple 1.1s ease-out; }
.torp-gauge.pulse::after { animation: xw-ripple 1.1s ease-out 0.35s; }
@keyframes xw-ripple { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(2.4); opacity: 0; } }

/* Torpedo dot under the reticle: grey while loading, blue when ready */
#reticle-torp { position: absolute; left: calc(50% - 39px); top: calc(50% - 39px); width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%; background: #8c8c8c; opacity: 0.8; pointer-events: none; }
#reticle-torp.ready { background: #4f9dff; opacity: 1; box-shadow: 0 0 6px #4f9dff, 0 0 12px rgba(79,157,255,0.6); }
@keyframes xw-ready-flash { 50% { opacity: 0.2; } }

/* ripple waves from the reticle dot when the torpedo is loaded */
#reticle-torp::before, #reticle-torp::after { content: ''; position: absolute; inset: -1px; border-radius: 50%;
  border: 1.5px solid #4f9dff; opacity: 0; pointer-events: none; }
#reticle-torp.pulse::before { animation: xw-ripple-dot 1s ease-out; }
#reticle-torp.pulse::after { animation: xw-ripple-dot 1s ease-out 0.3s; }
@keyframes xw-ripple-dot { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(4); opacity: 0; } }

.credits { font-size: 14px; margin: 0 0 14px; letter-spacing: 0.04em; }
.credits b { font-size: 15px; }
.credits b { color: #ffd27a; font-weight: normal; }
.credits a { color: var(--hud); text-decoration: none; border-bottom: 1px solid var(--hud-dim); }
.credits a:hover { color: #ffd27a; border-color: #ffd27a; }

/* Cookie / analytics consent banner */
#consent { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 50; width: min(560px, calc(100% - 24px));
  background: rgba(16,12,8,0.96); border: 1px solid var(--hud); padding: 12px 14px; display: flex; gap: 12px; align-items: center;
  font-size: 12px; line-height: 1.4; box-shadow: 0 0 20px rgba(0,0,0,0.6); }
#consent.hidden { display: none; }
#consent p { margin: 0; flex: 1; }
#consent div { display: flex; gap: 8px; }
#consent button { font-size: 12px; padding: 8px 12px; letter-spacing: 0.1em; }
#consent #consent-no { background: transparent; color: var(--hud); border: 1px solid var(--hud-dim); }
@media (max-width: 600px) { #consent { flex-direction: column; align-items: stretch; } #consent div { justify-content: flex-end; } }
