:root {
  --bg-deep: #020813;
  --hud-bg: rgba(5, 16, 30, 0.72);
  --hud-border: rgba(78, 242, 255, 0.22);
  --cyan: #4ef2ff;
  --cyan-dim: rgba(78, 242, 255, 0.55);
  --amber: #ffbe55;
  --text-main: #e6f6ff;
  --text-muted: #7aa3bd;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Noto Sans JP", system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg-deep); color: var(--text-main); font-family: var(--sans); -webkit-font-smoothing: antialiased; user-select: none; }
#ocean-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.hull-vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at center, transparent 48%, rgba(1, 6, 14, 0.78) 100%), linear-gradient(to bottom, rgba(2, 10, 20, 0.65) 0%, transparent 14%, transparent 82%, rgba(2, 8, 16, 0.82) 100%); box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.85); }
#cockpit { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: space-between; width: 100%; height: 100%; padding: 12px 20px 14px; gap: 10px; }
.hud-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 14px; background: var(--hud-bg); border: 1px solid var(--hud-border); border-radius: 10px; backdrop-filter: blur(10px); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45); }
.brand-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-badge { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; background: rgba(78, 242, 255, 0.12); border: 1px solid rgba(78, 242, 255, 0.4); font-family: var(--mono); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.12em; color: var(--cyan); }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: pulse 1.8s infinite ease-in-out; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.75); } }
.brand-titles h1 { font-size: 0.98rem; font-weight: 700; letter-spacing: 0.03em; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.16em; color: var(--text-muted); }
.sonar-widget { width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(78, 242, 255, 0.35); background: rgba(2, 16, 28, 0.85); display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: inset 0 0 12px rgba(78, 242, 255, 0.18); flex-shrink: 0; }
.viewport-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 2px 0; }
.porthole-frame { position: relative; width: min(100%, 960px); max-height: 100%; aspect-ratio: 16 / 9; padding: 12px; border-radius: 18px; background: linear-gradient(145deg, #162334, #09111c); border: 2px solid rgba(100, 165, 200, 0.35); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.78), inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 24px rgba(0, 0, 0, 0.85), 0 0 40px rgba(78, 242, 255, 0.08); display: flex; flex-direction: column; }
.rivet { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #5b7892, #1a2736); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); z-index: 6; }
.rivet.tl { top: 6px; left: 6px; } .rivet.tr { top: 6px; right: 6px; } .rivet.bl { bottom: 6px; left: 6px; } .rivet.br { bottom: 6px; right: 6px; }
.player-well { position: relative; flex: 1; width: 100%; height: 100%; border-radius: 10px; overflow: hidden; background: #020810; border: 1px solid rgba(78, 242, 255, 0.25); }
.nico-player { position: absolute; inset: 0; width: 100%; height: 100%; border: none; transition: opacity 0.65s ease; }
.nico-player.active { opacity: 1; z-index: 1; pointer-events: auto; }
.nico-player.standby { opacity: 0; z-index: 0; pointer-events: none; }
.glass-overlay { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.crosshair-h, .crosshair-v { position: absolute; background: rgba(78, 242, 255, 0.14); }
.crosshair-h { top: 50%; left: 50%; width: 36px; height: 1px; transform: translate(-50%, -50%); }
.crosshair-v { top: 50%; left: 50%; width: 1px; height: 36px; transform: translate(-50%, -50%); }
.corner-mark { position: absolute; width: 18px; height: 18px; border-color: rgba(78, 242, 255, 0.45); border-style: solid; }
.corner-mark.tl { top: 10px; left: 10px; border-width: 2px 0 0 2px; }
.corner-mark.tr { top: 10px; right: 10px; border-width: 2px 2px 0 0; }
.corner-mark.bl { bottom: 10px; left: 10px; border-width: 0 0 2px 2px; }
.corner-mark.br { bottom: 10px; right: 10px; border-width: 0 2px 2px 0; }
.scanlines { position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 0px, rgba(255, 255, 255, 0.015) 1px, transparent 1px, transparent 3px); opacity: 0.5; }
.signal-status { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(2, 10, 20, 0.76); backdrop-filter: blur(4px); font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.14em; color: var(--cyan); pointer-events: none; transition: opacity 0.3s ease; }
.signal-status.hidden { opacity: 0; }
.signal-spinner { width: 14px; height: 14px; border: 2px solid rgba(78, 242, 255, 0.25); border-top-color: var(--cyan); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dive-progress-track { margin-top: 8px; height: 4px; width: 100%; background: rgba(78, 242, 255, 0.12); border-radius: 2px; overflow: hidden; }
.dive-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #0ea5e9, var(--cyan)); box-shadow: 0 0 8px var(--cyan); transition: width 0.1s linear; }
.hud-bottom { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; background: var(--hud-bg); border: 1px solid var(--hud-border); border-radius: 10px; backdrop-filter: blur(10px); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45); }
.signal-meta { display: flex; flex-direction: column; gap: 3px; }
.meta-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-family: var(--mono); font-size: 0.74rem; }
.video-id-pill { padding: 2px 7px; border-radius: 4px; background: rgba(78, 242, 255, 0.14); border: 1px solid rgba(78, 242, 255, 0.32); color: var(--cyan); font-weight: 700; }
.meta-stat { color: var(--text-muted); }
.nico-ext-link { margin-left: auto; color: var(--amber); text-decoration: none; font-weight: 600; }
.nico-ext-link:hover { text-decoration: underline; }
.video-title { font-size: 0.94rem; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.console-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.ctrl-label { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }
.ctrl-select { padding: 7px 8px; border-radius: 6px; border: 1px solid rgba(78, 242, 255, 0.25); background: rgba(5, 18, 34, 0.92); color: var(--text-main); font-family: var(--mono); font-size: 0.75rem; cursor: pointer; outline: none; }
.ctrl-number { width: 64px; padding: 6px 8px; border-radius: 6px; border: 1px solid rgba(78, 242, 255, 0.35); background: rgba(2, 12, 24, 0.9); color: var(--cyan); font-family: var(--mono); font-size: 0.75rem; font-weight: 600; outline: none; }
.ctrl-number:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(78, 242, 255, 0.15); }
.ctrl-unit { font-family: var(--sans); font-size: 0.75rem; color: var(--text-muted); }
.volume-control { display: inline-flex; align-items: center; gap: 8px; }
.volume-slider { width: 86px; accent-color: var(--cyan); cursor: pointer; }
.hidden { display: none !important; }
.control-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; width: 100%; }
.btn { padding: 7px 12px; border-radius: 6px; border: 1px solid rgba(78, 242, 255, 0.3); background: rgba(10, 30, 52, 0.75); color: var(--text-main); font-family: var(--mono); font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all 0.15s ease; white-space: nowrap; }
.btn:hover { background: rgba(78, 242, 255, 0.16); border-color: var(--cyan); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, #0b5d7a, #0e7490); border-color: var(--cyan); color: #ffffff; }
.btn-primary:hover { background: linear-gradient(135deg, #0e7490, #0891b2); box-shadow: 0 0 14px rgba(78, 242, 255, 0.35); }
.btn-ghost.active { background: rgba(78, 242, 255, 0.16); border-color: var(--cyan); color: var(--cyan); }
.btn-ghost.held { background: rgba(255, 190, 85, 0.2); border-color: var(--amber); color: var(--amber); }
.hatch-overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at center, rgba(4, 20, 38, 0.88), rgba(1, 6, 14, 0.96)); backdrop-filter: blur(12px); transition: opacity 0.55s ease, visibility 0.55s ease; }
.hatch-overlay.dismissed { opacity: 0; visibility: hidden; pointer-events: none; }
.hatch-card { max-width: 520px; width: 100%; padding: 34px 28px; border-radius: 16px; background: linear-gradient(160deg, rgba(10, 28, 48, 0.92), rgba(4, 13, 24, 0.96)); border: 1px solid rgba(78, 242, 255, 0.35); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85), 0 0 50px rgba(78, 242, 255, 0.12); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hatch-emblem { position: relative; width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--cyan); display: flex; align-items: center; justify-content: center; background: rgba(78, 242, 255, 0.08); }
.sonar-ring { position: absolute; inset: -8px; border-radius: 50%; border: 1px solid rgba(78, 242, 255, 0.45); animation: sonar-expand 2.2s infinite ease-out; }
@keyframes sonar-expand { 0% { transform: scale(0.9); opacity: 0.9; } 100% { transform: scale(1.45); opacity: 0; } }
.emblem-code { font-family: var(--mono); font-weight: 700; font-size: 0.82rem; color: var(--cyan); letter-spacing: 0.08em; }
.hatch-title { font-size: 1.45rem; font-weight: 700; letter-spacing: 0.02em; color: #ffffff; }
.hatch-desc { font-size: 0.9rem; line-height: 1.65; color: #b4d2e6; }
.btn-hatch-start { margin-top: 6px; padding: 14px 38px; border-radius: 999px; border: 1px solid var(--cyan); background: linear-gradient(135deg, #0284c7, #06b6d4); color: #ffffff; font-family: var(--mono); font-weight: 700; font-size: 1rem; letter-spacing: 0.14em; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 0 28px rgba(6, 182, 212, 0.45); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.btn-hatch-start small { font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; opacity: 0.9; }
.btn-hatch-start:hover { transform: translateY(-2px); box-shadow: 0 0 38px rgba(78, 242, 255, 0.65); }
.hatch-hint { font-family: var(--mono); font-size: 0.68rem; color: var(--text-muted); }
@media (max-width: 768px) { #cockpit { padding: 8px 10px 10px; gap: 8px; } .hud-top { padding: 8px 10px; } .sonar-widget { width: 40px; height: 40px; } .porthole-frame { padding: 8px; border-radius: 12px; } .control-buttons { justify-content: space-between; } }