@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');
/* ==========================================================================
   BATTLESHIP: NAVAL WARFARE — Tactical Modern Warship CSS
   ========================================================================== */


:root {
  --bg-dark: #050b14;
  --bg-panel: rgba(8, 16, 30, 0.92);
  --bg-panel-border: rgba(0, 229, 255, 0.45);
  --accent-cyan: #00e5ff;
  --accent-cyan-glow: rgba(0, 229, 255, 0.4);
  --accent-blue: #0088ff;
  --accent-gold: #ffd700;
  --accent-red: #ff2a55;
  --accent-red-glow: rgba(255, 42, 85, 0.4);
  --accent-green: #00ff88;
  --text-primary: #e6f1ff;
  --text-muted: #88a2c2;
  --font-display: 'Orbitron', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-tactical: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

/* --- Common Tactical Glass Panels --- */
.tactical-panel {
  background: var(--bg-panel);
  border: 1px solid var(--bg-panel-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), inset 0 0 16px rgba(0, 229, 255, 0.05);
  position: relative;
}

.tactical-panel::before,
.tactical-panel::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--accent-cyan);
  pointer-events: none;
}

.tactical-panel::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--accent-cyan);
  border-left: 2px solid var(--accent-cyan);
}

.tactical-panel::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--accent-cyan);
  border-right: 2px solid var(--accent-cyan);
}

/* --- Main Menu (Naval Fleet Command Style) --- */
#main-menu {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 12px;
  padding: 24px 36px;
  overflow-y: auto;
  overflow-x: hidden;
  pointer-events: none;
  -webkit-overflow-scrolling: touch;
}

.menu-header {
  pointer-events: auto;
  max-width: 440px;
  width: 100%;
  background: linear-gradient(145deg, rgba(6, 18, 42, 0.94) 0%, rgba(12, 30, 64, 0.85) 100%);
  padding: 14px 20px;
  border-radius: 18px;
  border: 1.5px solid rgba(212, 175, 55, 0.55);
  box-shadow: 0 12px 32px rgba(0, 4, 16, 0.78),
              inset 0 1px 1px rgba(255, 240, 180, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.menu-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 240, 180, 0.08), transparent);
  transform: rotate(25deg);
  pointer-events: none;
}

.menu-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.28), rgba(0, 160, 255, 0.2));
  border: 1px solid rgba(255, 215, 0, 0.8);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffe899;
  margin-bottom: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.game-title {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: 4px;
  line-height: 1.05;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #fff2c6 25%, #ffd466 50%, #d4af37 75%, #8c6818 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #543d08)
          drop-shadow(0 4px 10px rgba(0, 6, 18, 0.85));
  position: relative;
  margin: 0;
}

.game-subtitle {
  font-family: var(--font-tactical);
  font-size: 0.88rem;
  letter-spacing: 2.8px;
  color: #dfd5be;
  margin-top: 4px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* --- Screen Reader Accessible Utility --- */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* --- Main Menu Body: Ornate Naval Command Stack --- */
.menu-body {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  margin: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(6, 20, 44, 0.72) 0%, rgba(2, 10, 24, 0.9) 100%);
  padding: 12px;
  border-radius: 20px;
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 18px 45px rgba(0, 4, 16, 0.8),
              inset 0 1px 1px rgba(255, 235, 170, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}

/* Luxury Naval Menu Card Button */
.tactical-btn.menu-card-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer !important;
  pointer-events: auto !important;
  border-radius: 14px;
  outline: none;
  box-shadow: 0 6px 16px rgba(0, 4, 14, 0.65),
              0 0 0 1px rgba(212, 175, 55, 0.45);
  transition: transform 0.15s ease,
              box-shadow 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  overflow: visible;
  flex-shrink: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

.tactical-btn.menu-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 4, 18, 0.85),
              0 0 0 1.5px rgba(255, 235, 140, 0.95),
              0 0 20px rgba(212, 175, 55, 0.45);
  z-index: 25;
}

.tactical-btn.menu-card-btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.75),
              0 0 0 1px rgba(212, 175, 55, 0.55);
}

.tactical-btn.menu-card-btn:focus-visible {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}

.menu-card-btn .card-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 578 / 164;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: #020b18;
  flex-shrink: 0;
}

.menu-card-btn .card-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  pointer-events: none;
  image-rendering: -webkit-optimize-contrast;
}

/* Golden Specular Light Sweep across button */
.menu-card-btn .card-specular-sweep {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    115deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 25%,
    rgba(255, 245, 200, 0.25) 45%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 245, 200, 0.25) 55%,
    transparent 75%
  );
  transform: translateX(-150%) skewX(-24deg);
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.menu-card-btn:hover .card-specular-sweep {
  transform: translateX(250%) skewX(-24deg);
}

/* Golden Interactive Chevron Arrow */
.menu-card-btn .card-chevron {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display), serif;
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
  color: #ffeb99;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.85),
               0 2px 4px rgba(0, 0, 0, 0.95);
  pointer-events: none;
  transition: transform 0.18s ease,
              color 0.18s ease,
              text-shadow 0.18s ease;
}

.menu-card-btn:hover .card-chevron {
  transform: translateY(-50%) translateX(3px);
  color: #ffffff;
  text-shadow: 0 0 14px rgba(255, 245, 170, 1),
               0 0 24px rgba(255, 215, 0, 0.95),
               0 2px 5px rgba(0, 0, 0, 0.95);
}

/* Corner Specular Flares */
.menu-card-btn .card-glint {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, rgba(255, 235, 160, 0.85) 50%, transparent 100%);
  pointer-events: none;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.menu-card-btn .card-glint.top-left {
  top: 5px;
  left: 5px;
}

.menu-card-btn .card-glint.bottom-right {
  bottom: 5px;
  right: 5px;
}

.menu-card-btn:hover .card-glint {
  opacity: 1;
  transform: scale(1.5);
  box-shadow: 0 0 10px rgba(255, 240, 160, 0.9);
}

/* --- Standard Tactical Buttons (for modals, placement & battle HUD) --- */
.tactical-btn {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 16px;
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  border: none;
  text-align: left;
  user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.15s ease;
}

.tactical-btn .btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
}

.tactical-btn .btn-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tactical-btn .btn-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  line-height: 1.15;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.tactical-btn .btn-desc {
  font-family: var(--font-tactical);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0.92;
  line-height: 1.1;
  text-transform: none;
}

.menu-footer {
  pointer-events: auto;
}

.footer-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px;
  border-radius: 20px;
  background: rgba(4, 14, 30, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.4);
  font-family: var(--font-tactical);
  font-size: 0.88rem;
  letter-spacing: 2px;
  color: #ded0b0;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd700;
  box-shadow: 0 0 10px #ffd700;
  display: inline-block;
  animation: pulse-dot 1.8s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 1; }
}

/* --- Buttons --- */
.tactical-btn {
  font-family: var(--font-tactical);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(8, 28, 54, 0.85) 0%, rgba(13, 44, 82, 0.85) 100%);
  border: 1px solid var(--accent-cyan);
  padding: 14px 28px;
  border-radius: 6px;
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative;
  z-index: 100;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 0 8px rgba(0, 229, 255, 0.1);
}

.tactical-btn:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25) 0%, rgba(13, 80, 140, 0.85) 100%);
  border-color: #ffffff;
  box-shadow: 0 0 25px var(--accent-cyan-glow);
  transform: translateY(-2px);
}

.tactical-btn:active {
  transform: translateY(1px);
}

.tactical-btn.btn-primary {
  background: linear-gradient(135deg, rgba(0, 170, 255, 0.8) 0%, rgba(0, 90, 180, 0.9) 100%);
  border-color: #00d2ff;
}

.tactical-btn.btn-gold {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.tactical-btn.btn-gold:hover {
  background: rgba(255, 215, 0, 0.15);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.35);
}

.tactical-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* --- ROSA GAMES Luxury Imperial Placement Console --- */
#placement-panel {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 400px;
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 25;
  background: radial-gradient(ellipse at 50% 15%, rgba(10, 26, 56, 0.96) 0%, rgba(3, 10, 24, 0.98) 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.65);
  outline: 1px solid rgba(255, 235, 170, 0.22);
  outline-offset: -5px;
  border-radius: 22px;
  padding: 24px 22px;
  box-shadow: 0 24px 64px rgba(0, 2, 10, 0.92),
              0 0 35px rgba(212, 175, 55, 0.22),
              inset 0 0 24px rgba(212, 175, 55, 0.08),
              inset 0 1px 2px rgba(255, 245, 190, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: panel-fade-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes panel-fade-in {
  from { opacity: 0; transform: translateX(-15px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Corner filigree for Placement Panel */
#placement-panel::before,
#placement-panel::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 5;
}

#placement-panel::before {
  top: 9px;
  left: 9px;
  border-top: 2.5px solid #ffd700;
  border-left: 2.5px solid #ffd700;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.7));
}

#placement-panel::after {
  bottom: 9px;
  right: 9px;
  border-bottom: 2.5px solid #ffd700;
  border-right: 2.5px solid #ffd700;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.7));
}

/* Panel Header & Badge */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid rgba(212, 175, 55, 0.35);
  position: relative;
}

.panel-header-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.panel-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.28), rgba(0, 160, 255, 0.2));
  border: 1px solid rgba(255, 215, 0, 0.75);
  font-family: var(--font-display);
  font-size: 0.70rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffe899;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.panel-title {
  font-family: var(--font-display) !important;
  font-size: 1.55rem !important;
  font-weight: 900 !important;
  letter-spacing: 2.5px !important;
  text-transform: uppercase !important;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF2C6 25%, #FFD466 50%, #D4AF37 75%, #8C6818 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  filter: drop-shadow(0 2px 0 #543d08) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.85)) !important;
  line-height: 1.15;
  margin: 0 !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.placement-back-btn {
  background: linear-gradient(145deg, rgba(14, 30, 60, 0.85) 0%, rgba(6, 16, 36, 0.95) 100%);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #ffe899;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 235, 170, 0.2);
}

.placement-back-btn:hover {
  border-color: #ffd700;
  color: #ffffff;
  transform: translateX(-2px);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.4);
}

/* Ship Dock Active Card */
.dock-ship-item {
  background: linear-gradient(145deg, rgba(12, 28, 58, 0.9) 0%, rgba(5, 14, 32, 0.96) 100%) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.55) !important;
  border-radius: 16px !important;
  padding: 14px 16px !important;
  margin-bottom: 14px !important;
  box-shadow: 0 8px 24px rgba(0, 4, 16, 0.65), inset 0 1px 1px rgba(255, 235, 170, 0.2) !important;
}

.ship-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.ship-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ship-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fff2c6;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.ship-size {
  font-family: var(--font-tactical);
  font-size: 0.82rem;
  color: #a8c2e4;
  letter-spacing: 0.5px;
}

.ship-remaining-pill {
  padding: 3px 10px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.25), rgba(0, 160, 255, 0.15));
  border: 1px solid rgba(255, 215, 0, 0.6);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 800;
  color: #ffe899;
  letter-spacing: 1px;
}

.ship-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  background: rgba(4, 12, 28, 0.5);
  border-radius: 10px;
  border: 1px dashed rgba(212, 175, 55, 0.35);
  margin-bottom: 4px;
}

.ship-preview {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.ship-preview.vertical {
  flex-direction: column;
}

.cell-block {
  width: 26px !important;
  height: 26px !important;
  background: linear-gradient(135deg, #FFF0B0 0%, #D4AF37 50%, #8C6818 100%) !important;
  border: 1.5px solid #FFFFFF !important;
  border-radius: 5px !important;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.7), inset 0 1px 1px #fff !important;
}

/* Dock Ready Victory/Completed State */
.dock-ready-card {
  background: linear-gradient(145deg, rgba(16, 42, 32, 0.9) 0%, rgba(6, 22, 16, 0.95) 100%);
  border: 1.5px solid rgba(0, 255, 170, 0.6);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 255, 170, 0.15), inset 0 1px 1px rgba(200, 255, 230, 0.3);
}

.dock-ready-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(0, 255, 170, 0.25), rgba(0, 200, 140, 0.35));
  border: 1px solid #00ffaa;
  color: #aeffd8;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.dock-ready-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.dock-ready-hint {
  font-family: var(--font-tactical);
  font-size: 0.80rem;
  color: #9fe2bf;
  line-height: 1.3;
}

/* Error message banner */
.placement-error-msg {
  min-height: 22px;
  margin-bottom: 12px;
  font-family: var(--font-tactical);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #ff99aa;
  text-align: center;
  transition: all 0.2s ease;
}

.placement-error-msg:not(:empty) {
  background: rgba(60, 10, 24, 0.75);
  border: 1px solid rgba(255, 60, 90, 0.6);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 0 12px rgba(255, 60, 90, 0.3);
}

/* Placement Action Buttons */
.placement-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.placement-action-btn {
  background: linear-gradient(145deg, rgba(12, 28, 56, 0.9) 0%, rgba(5, 14, 32, 0.96) 100%) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.45) !important;
  border-radius: 13px !important;
  padding: 10px 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(0, 4, 14, 0.5), inset 0 1px 1px rgba(255, 235, 170, 0.18) !important;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease !important;
}

.placement-action-btn:hover {
  transform: translateY(-2px) !important;
  border-color: rgba(255, 225, 130, 0.9) !important;
  background: linear-gradient(145deg, rgba(18, 42, 84, 0.92) 0%, rgba(8, 20, 44, 0.98) 100%) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7), 0 0 16px rgba(212, 175, 55, 0.35) !important;
}

.placement-action-btn:active {
  transform: translateY(1px) !important;
}

.btn-icon-symbol {
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-label-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.btn-main-label {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.placement-action-btn:hover .btn-main-label {
  color: #fff2c6;
}

.btn-sub-label {
  font-family: var(--font-tactical);
  font-size: 0.74rem;
  color: #9cb8dc;
  letter-spacing: 0.3px;
}

.btn-danger-action {
  border-color: rgba(212, 120, 120, 0.4) !important;
}

.btn-danger-action:hover {
  border-color: #ff5566 !important;
  box-shadow: 0 0 16px rgba(255, 80, 100, 0.4) !important;
}

.btn-danger-action .btn-icon-symbol {
  background: rgba(220, 40, 60, 0.2);
  border-color: rgba(220, 40, 60, 0.5);
}

/* Big Gold Start Battle Button */
.btn-start-battle {
  width: 100% !important;
  padding: 14px 18px !important;
  border-radius: 14px !important;
  margin-top: 4px !important;
  cursor: pointer !important;
  justify-content: center !important;
  text-align: center !important;
}

.btn-start-battle:not(:disabled) {
  background: linear-gradient(145deg, #FFF0B0 0%, #D8AB45 40%, #A47B28 100%) !important;
  border: 2px solid #FFFFFF !important;
  color: #0d0700 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 25px rgba(255, 215, 0, 0.75), inset 0 1px 2px #fff !important;
  animation: golden-pulse-battle 2s infinite ease-in-out !important;
}

@keyframes golden-pulse-battle {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 20px rgba(255, 215, 0, 0.55), inset 0 1px 2px #fff;
    transform: scale(1);
  }
  50% {
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.85), 0 0 35px rgba(255, 215, 0, 0.95), inset 0 1px 2px #fff;
    transform: scale(1.02);
  }
}

.btn-battle-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-battle-icon {
  font-size: 1.4rem;
}

.btn-battle-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 3px;
}

.btn-start-battle:disabled {
  background: linear-gradient(145deg, rgba(30, 40, 56, 0.6) 0%, rgba(14, 20, 32, 0.8) 100%) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.25) !important;
  color: rgba(255, 255, 255, 0.35) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  animation: none !important;
}

/* --- In-Game Battle HUD --- */
#battle-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 24px;
}

.hud-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.fleet-card {
  pointer-events: auto;
  width: 280px;
  padding: 14px 18px;
}

.fleet-card-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}

.fleet-card-title {
  font-family: var(--font-tactical);
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  font-weight: 700;
}

.fleet-accuracy {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.fleet-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fleet-type-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.82rem;
  transition: all 0.2s ease;
}

.fleet-type-row.sunk {
  opacity: 0.45;
  background: rgba(255, 42, 85, 0.05);
}

.fleet-type-row.sunk .fleet-type-name {
  text-decoration: line-through;
  color: var(--accent-red);
}

.fleet-type-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fleet-type-name {
  font-family: var(--font-tactical);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.fleet-type-count {
  font-size: 0.75rem;
  color: var(--accent-cyan);
}

.fleet-type-ships {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ship-pip-group {
  display: flex;
  gap: 2px;
  padding: 1px 3px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 2px;
}

.deck-pip {
  width: 7px;
  height: 9px;
  border-radius: 1px;
  background: rgba(0, 229, 255, 0.6);
}

.deck-pip.hit {
  background: var(--accent-red);
  box-shadow: 0 0 5px rgba(255, 42, 85, 0.85);
}

.ship-pip-group.sunk .deck-pip {
  background: #601424;
  opacity: 0.5;
}

/* Turn Indicator Banner */
.hud-center-banner {
  pointer-events: auto;
  text-align: center;
  max-width: 500px;
  position: relative;
}

.badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 20px;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: pulse-badge 2.4s infinite ease-in-out;
}

.turn-main {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.turn-sub {
  font-size: 0.72rem;
  letter-spacing: 1px;
  opacity: 0.88;
  margin-top: 2px;
}

.badge-primary {
  background: rgba(0, 229, 255, 0.2);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
}

.badge-success {
  background: rgba(0, 255, 136, 0.2);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
}

.badge-warning {
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
}

.badge-danger {
  background: rgba(255, 42, 85, 0.2);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.04); opacity: 1; }
}

/* HUD Bottom Bar */
.hud-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.combat-log-panel {
  pointer-events: auto;
  width: 380px;
  height: 120px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
}

.combat-log-title {
  font-family: var(--font-tactical);
  font-size: 0.9rem;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

#combat-log {
  flex: 1;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.log-entry {
  line-height: 1.3;
}

.log-time {
  color: var(--accent-cyan);
}

.log-text {
  color: var(--text-primary);
}

/* Camera & Control Tools */
.hud-controls-group {
  pointer-events: auto;
  display: flex;
  gap: 8px;
}

.tool-btn {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--bg-panel-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer !important;
  pointer-events: auto !important;
  font-size: 1.15rem;
  transition: all 0.2s ease;
}

.tool-btn:hover,
.tool-btn.active {
  background: rgba(0, 229, 255, 0.25);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan-glow);
}

/* --- Sunk Ship Notification Banner --- */
#sunk-banner {
  position: absolute;
  top: 17%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 35;
  text-align: center;
  pointer-events: none;
  animation: banner-burst 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#sunk-ship-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  padding: 8px 24px;
  background: rgba(8, 16, 28, 0.88);
  border: 1px solid rgba(255, 66, 102, 0.6);
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(255, 42, 85, 0.4);
}

@keyframes banner-burst {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.8); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  30% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(0.9); }
}

/* Floating Mobile Toast */
.mobile-toast {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  background: rgba(5, 18, 36, 0.92);
  border: 1px solid var(--accent-cyan);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 0.82rem;
  letter-spacing: 1px;
  font-family: var(--font-tactical);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 40;
}

.mobile-toast.hit { border-color: var(--accent-gold); color: var(--accent-gold); }
.mobile-toast.sunk { border-color: var(--accent-red); color: var(--accent-red); font-weight: bold; }
.mobile-toast.danger { border-color: var(--accent-red); color: #ff7088; }
.mobile-toast.miss { border-color: rgba(255, 255, 255, 0.25); color: var(--text-muted); }
.mobile-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- ROSA GAMES Luxury Imperial Naval Modals --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: radial-gradient(circle at 50% 50%, rgba(3, 10, 24, 0.82) 0%, rgba(1, 4, 12, 0.95) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 1;
  transition: opacity 0.22s ease;
}

.modal-overlay.hidden {
  display: none !important;
}

/* Modal Card: Royal Gold Framed Heavy Armor Panel */
.modal-card {
  width: 100%;
  max-width: 520px;
  background: radial-gradient(ellipse at 50% 20%, rgba(10, 26, 56, 0.97) 0%, rgba(3, 10, 24, 0.99) 100%) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.7) !important;
  outline: 1px solid rgba(255, 235, 170, 0.25);
  outline-offset: -5px;
  border-radius: 22px !important;
  padding: 28px 24px !important;
  box-shadow: 0 24px 64px rgba(0, 2, 10, 0.95),
              0 0 35px rgba(212, 175, 55, 0.25),
              inset 0 0 24px rgba(212, 175, 55, 0.08),
              inset 0 1px 2px rgba(255, 245, 190, 0.45) !important;
  position: relative;
  z-index: 1010;
  animation: modal-card-appear 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: visible;
}

@keyframes modal-card-appear {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Golden Corner Filigree Brackets */
.modal-card::before,
.modal-card::after {
  content: '' !important;
  position: absolute !important;
  width: 20px !important;
  height: 20px !important;
  pointer-events: none !important;
  z-index: 5;
}

.modal-card::before {
  top: 9px !important;
  left: 9px !important;
  border-top: 2.5px solid #ffd700 !important;
  border-left: 2.5px solid #ffd700 !important;
  border-bottom: none !important;
  border-right: none !important;
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.8));
}

.modal-card::after {
  bottom: 9px !important;
  right: 9px !important;
  border-bottom: 2.5px solid #ffd700 !important;
  border-right: 2.5px solid #ffd700 !important;
  border-top: none !important;
  border-left: none !important;
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.8));
}

/* Modal Header with Luxury Gold Typography */
.modal-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 20px !important;
  padding-bottom: 14px !important;
  border-bottom: 1.5px solid rgba(212, 175, 55, 0.4) !important;
  position: relative;
}

.modal-header-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.modal-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.28), rgba(0, 160, 255, 0.2));
  border: 1px solid rgba(255, 215, 0, 0.75);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffe899;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.modal-title {
  font-family: var(--font-display) !important;
  font-size: 1.7rem !important;
  font-weight: 900 !important;
  letter-spacing: 3px !important;
  text-transform: uppercase !important;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF2C6 25%, #FFD466 50%, #D4AF37 75%, #8C6818 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  filter: drop-shadow(0 2px 0 #543d08) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.85)) !important;
  line-height: 1.15;
  margin: 0 !important;
}

/* Close Button: Circular Gold Coin Medallion */
.close-modal-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35) 0%, rgba(6, 18, 42, 0.85) 100%) !important;
  border: 1.5px solid rgba(255, 215, 0, 0.75) !important;
  color: #ffe899 !important;
  font-size: 1.45rem !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  outline: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 240, 180, 0.5) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  flex-shrink: 0;
  margin-left: 12px;
}

.close-modal-btn:hover {
  transform: scale(1.12) rotate(90deg) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.85), inset 0 1px 2px rgba(255, 255, 255, 0.8) !important;
}

.close-modal-btn:active {
  transform: scale(0.95) !important;
}

/* Luxury Choice Cards (Difficulty Modal) */
.modal-body-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.luxury-choice-card {
  position: relative !important;
  width: 100% !important;
  background: linear-gradient(145deg, rgba(10, 26, 56, 0.88) 0%, rgba(4, 12, 28, 0.94) 100%) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.4) !important;
  border-radius: 14px !important;
  padding: 14px 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 14px !important;
  cursor: pointer !important;
  box-shadow: 0 6px 18px rgba(0, 4, 14, 0.6), inset 0 1px 1px rgba(255, 235, 170, 0.18) !important;
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease !important;
  text-align: left !important;
}

.luxury-choice-card:hover {
  transform: translateY(-2px) !important;
  border-color: rgba(255, 225, 130, 0.9) !important;
  background: linear-gradient(145deg, rgba(16, 38, 80, 0.92) 0%, rgba(6, 18, 42, 0.98) 100%) !important;
  box-shadow: 0 10px 26px rgba(0, 4, 18, 0.85),
              0 0 20px rgba(212, 175, 55, 0.4),
              inset 0 1px 1px rgba(255, 240, 180, 0.4) !important;
}

.luxury-choice-card:active {
  transform: translateY(1px) !important;
}

.luxury-choice-card.recommended {
  border-color: rgba(255, 215, 0, 0.75) !important;
  background: linear-gradient(145deg, rgba(18, 40, 84, 0.92) 0%, rgba(8, 20, 44, 0.96) 100%) !important;
  box-shadow: 0 8px 24px rgba(0, 4, 16, 0.75), 0 0 16px rgba(212, 175, 55, 0.3) !important;
}

.choice-badge {
  position: absolute;
  top: -8px;
  right: 14px;
  padding: 2px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ECC870, #C59B3F);
  color: #120b02;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  border: 1px solid #fff;
}

.choice-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25) 0%, rgba(6, 18, 42, 0.6) 100%);
  border: 1px solid rgba(255, 215, 0, 0.5);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
}

.choice-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.choice-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.luxury-choice-card:hover .choice-title {
  color: #fff2c6;
}

.choice-desc {
  font-family: var(--font-tactical);
  font-size: 0.82rem;
  color: #b5c8e2;
  line-height: 1.2;
  letter-spacing: 0.4px;
}

.choice-chevron {
  font-size: 1.6rem;
  color: rgba(212, 175, 55, 0.65);
  transition: transform 0.15s ease, color 0.15s ease;
}

.luxury-choice-card:hover .choice-chevron {
  transform: translateX(3px);
  color: #ffd700;
}

/* Settings Modal Elements */
.settings-group {
  margin-bottom: 18px;
}

.settings-label {
  font-family: var(--font-display) !important;
  font-size: 0.96rem !important;
  font-weight: 800 !important;
  letter-spacing: 1.5px !important;
  color: #ffd700 !important;
  text-transform: uppercase !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.weather-modal-grid,
.quality-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.quality-modal-grid {
  grid-template-columns: repeat(4, 1fr);
}

.weather-modal-btn,
.quality-modal-btn {
  background: linear-gradient(145deg, rgba(8, 22, 46, 0.85) 0%, rgba(4, 12, 26, 0.95) 100%) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.35) !important;
  border-radius: 10px !important;
  padding: 8px 10px !important;
  font-family: var(--font-display) !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  color: #d8e5f4 !important;
  letter-spacing: 0.8px !important;
  text-align: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 235, 170, 0.12) !important;
  transition: all 0.16s ease !important;
}

.weather-modal-btn:hover,
.quality-modal-btn:hover {
  border-color: rgba(255, 225, 130, 0.8) !important;
  background: linear-gradient(145deg, rgba(16, 36, 76, 0.9) 0%, rgba(6, 18, 40, 0.98) 100%) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

.weather-modal-btn.active,
.quality-modal-btn.active {
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.35) 0%, rgba(18, 44, 90, 0.95) 100%) !important;
  border-color: #ffd700 !important;
  color: #fff4d0 !important;
  font-weight: 900 !important;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.5), inset 0 1px 1px rgba(255, 240, 180, 0.6) !important;
}

#btn-modal-mute {
  background: linear-gradient(145deg, rgba(12, 28, 60, 0.9) 0%, rgba(6, 16, 36, 0.96) 100%) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.5) !important;
  color: #ffe899 !important;
  border-radius: 10px !important;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 235, 170, 0.2) !important;
}

#btn-modal-mute:hover {
  border-color: #ffd700 !important;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.6) !important;
}

/* Luxury Golden Slider Inputs */
.slider-input {
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.2) 0%, rgba(6, 18, 42, 0.6) 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 6px;
  outline: none;
  accent-color: #ffd700;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff0b0, #d4af37, #8c6818);
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 215, 0, 0.8);
  cursor: pointer;
}

/* Statistics Grid & Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-box {
  background: linear-gradient(145deg, rgba(8, 22, 48, 0.85) 0%, rgba(3, 10, 24, 0.95) 100%) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.35) !important;
  border-left: 3.5px solid #d4af37 !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  box-shadow: 0 4px 14px rgba(0, 4, 14, 0.5), inset 0 1px 1px rgba(255, 235, 170, 0.12) !important;
}

.stat-label {
  font-family: var(--font-tactical);
  font-size: 0.80rem !important;
  color: #afc4df !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  font-weight: 600;
}

.stat-value {
  font-family: var(--font-display) !important;
  font-size: 1.9rem !important;
  font-weight: 900 !important;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF2C6 30%, #FFD466 65%, #D4AF37 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8)) !important;
  margin-top: 4px;
  line-height: 1.1;
}

.stat-value.text-danger {
  background: linear-gradient(180deg, #FFFFFF 0%, #FFA8B6 40%, #FF3B5C 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* Rules Modal Styling */
.rules-container {
  line-height: 1.6;
  color: #dfebf8;
  font-size: 0.96rem;
  padding-right: 6px;
}

.rules-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffd700;
  letter-spacing: 1.5px;
  margin-top: 14px;
  margin-bottom: 8px;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.rules-fleet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.rules-fleet-item {
  background: linear-gradient(145deg, rgba(8, 22, 48, 0.8) 0%, rgba(3, 10, 24, 0.9) 100%);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fleet-count-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ECC870, #C59B3F);
  color: #0d0800;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.fleet-desc-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.fleet-desc-sub {
  font-family: var(--font-tactical);
  font-size: 0.76rem;
  color: #a4bedc;
}

.rules-highlight-box {
  background: linear-gradient(145deg, rgba(14, 32, 64, 0.75) 0%, rgba(4, 12, 28, 0.85) 100%);
  border-left: 3px solid #ffd700;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  color: #d8e5f4;
  font-size: 0.92rem;
  line-height: 1.5;
}

.rules-highlight-box strong {
  color: #ffe699;
}

/* Primary and Action Buttons in Modals */
.modal-card .tactical-btn.btn-primary {
  background: linear-gradient(145deg, #ECC870 0%, #C59B3F 45%, #8F6A22 100%) !important;
  border: 1.5px solid #FFE899 !important;
  color: #120b00 !important;
  font-family: var(--font-display) !important;
  font-weight: 900 !important;
  letter-spacing: 2px !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 18px rgba(212, 175, 55, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.7) !important;
  text-align: center !important;
  justify-content: center !important;
}

.modal-card .tactical-btn.btn-primary:hover {
  background: linear-gradient(145deg, #FFF0B0 0%, #D8AB45 45%, #A47B28 100%) !important;
  border-color: #FFFFFF !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 215, 0, 0.75), inset 0 1px 2px rgba(255, 255, 255, 0.9) !important;
  transform: translateY(-2px) !important;
  color: #080400 !important;
}

.modal-card .tactical-btn:not(.btn-primary):not(.difficulty-btn):not(.weather-modal-btn):not(.quality-modal-btn) {
  background: linear-gradient(145deg, rgba(14, 32, 64, 0.9) 0%, rgba(6, 16, 36, 0.95) 100%) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.45) !important;
  border-radius: 12px !important;
  color: #ffffff !important;
  font-family: var(--font-display) !important;
  font-weight: 800 !important;
  letter-spacing: 1.5px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 235, 170, 0.18) !important;
  text-align: center !important;
  justify-content: center !important;
}

.modal-card .tactical-btn:not(.btn-primary):not(.difficulty-btn):not(.weather-modal-btn):not(.quality-modal-btn):hover {
  border-color: rgba(255, 225, 130, 0.9) !important;
  background: linear-gradient(145deg, rgba(22, 48, 92, 0.95) 0%, rgba(10, 24, 52, 0.98) 100%) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 16px rgba(212, 175, 55, 0.35) !important;
  transform: translateY(-2px) !important;
  color: #fff2c6 !important;
}

#rules-modal p,
#rules-modal li {
  color: #dfebf8;
  font-size: 0.95rem;
  line-height: 1.55;
}

#game-over-modal .tactical-btn {
  font-size: 0.92rem;
  letter-spacing: 1px;
  white-space: nowrap;
  padding: 12px 14px;
}

#game-over-title {
  font-family: var(--font-display);
  font-size: 2.3rem;
  letter-spacing: 3px;
  line-height: 1.2;
}

/* Utilities & Tailwind Polyfills */
.hidden {
  display: none !important;
}

.text-accent { color: var(--accent-cyan); }
.text-danger { color: var(--accent-red); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900 !important; }
.text-3xl { font-size: 2.2rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.text-center { text-align: center !important; }
.text-xs { font-size: 0.78rem !important; }
.text-sm { font-size: 0.88rem !important; }

/* ==========================================================================
   Mobile Tactical Board Switcher (Hidden on desktop / landscape)
   ========================================================================== */
.mobile-board-switcher {
  display: none;
}

/* ==========================================================================
   Responsive Adaptations Across Different Screen Formats
   ========================================================================== */

/* 1. Mobile Portrait (Smartphones & small tablets in portrait, width <= 768px) */
@media (max-width: 768px) {
  #main-menu {
    padding: calc(12px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overflow-x: hidden;
  }
  .menu-header {
    padding: 12px 16px;
    border-radius: 16px;
  }
  .menu-body {
    max-width: 100%;
    width: 100%;
    padding: 10px 8px;
    gap: 8px;
    border-radius: 18px;
  }
  .game-title {
    font-size: clamp(1.8rem, 7vw, 2.3rem);
    letter-spacing: 2.5px;
  }
  .game-subtitle {
    font-size: 0.82rem;
    letter-spacing: 1.8px;
  }
  .tactical-btn.menu-card-btn {
    border-radius: 13px;
  }
  .menu-card-btn .card-inner {
    border-radius: 13px;
  }
  .menu-card-btn .card-art-img {
    border-radius: 13px;
  }
  .menu-card-btn .card-chevron {
    right: 12px;
    font-size: 1.45rem;
  }
  .tactical-btn {
    padding: 10px 14px;
    gap: 10px;
    border-radius: 14px;
  }

  /* Placement Panel as bottom drawer */
  #placement-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-height: 48vh;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    border-top: 2px solid rgba(212, 175, 55, 0.75);
    outline-offset: -3px;
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .placement-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .placement-action-btn {
    padding: 8px 10px !important;
  }
  .btn-start-battle {
    grid-column: span 2;
    padding: 12px 14px !important;
  }
  .btn-sub-label {
    display: none;
  }

  /* Battle HUD Top Bar Grid (Side-by-side fleets with Turn Banner centered) */
  .hud-top-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 4px 8px;
    padding: calc(4px + env(safe-area-inset-top)) 8px 0;
    align-items: center;
  }
  .hud-center-banner {
    grid-column: 1 / -1;
    order: -1;
    margin-bottom: 2px;
  }
  .fleet-card {
    width: 100%;
    padding: 5px 8px;
    border-radius: 12px;
  }
  .fleet-card-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
    padding-bottom: 2px;
  }
  .fleet-card-title {
    font-size: 0.78rem;
    letter-spacing: 1px;
  }
  .fleet-accuracy {
    font-size: 0.68rem;
  }
  .fleet-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 4px;
  }
  .fleet-ship-badge {
    font-size: 0.65rem;
    padding: 2px 4px;
  }
  .badge {
    padding: 4px 12px;
  }
  .turn-main {
    font-size: 0.82rem;
  }
  .turn-sub {
    font-size: 0.62rem;
  }

  /* Mobile Tactical Board Switcher */
  .mobile-board-switcher {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 4px auto 0;
    width: 100%;
    max-width: 360px;
    pointer-events: auto;
    z-index: 20;
  }
  .mobile-board-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    background: linear-gradient(135deg, rgba(8, 20, 46, 0.94) 0%, rgba(14, 32, 68, 0.90) 100%);
    border: 1.5px solid rgba(212, 175, 55, 0.45);
    border-radius: 20px;
    color: #e8f2ff;
    font-family: var(--font-tactical);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 4, 16, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s ease;
  }
  .mobile-board-tab.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.4) 0%, rgba(160, 120, 20, 0.32) 100%);
    border-color: #ffd700;
    color: #fff;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }

  /* Bottom Controls */
  .hud-bottom-bar {
    padding: 0 8px calc(8px + env(safe-area-inset-bottom));
    justify-content: center;
  }
  .combat-log-panel {
    display: none;
  }
  .hud-controls-group {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 320px;
  }
  .tool-btn {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}

/* 2. Mobile Landscape (Smartphones rotated horizontally, height <= 520px) */
@media (max-height: 520px) and (orientation: landscape) {
  #main-menu {
    width: 310px;
    max-width: 330px;
    padding: calc(6px + env(safe-area-inset-top)) 10px calc(6px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    gap: 6px;
    overflow-y: auto;
  }
  .menu-header {
    padding: 8px 12px;
    border-radius: 12px;
  }
  .menu-badge {
    margin-bottom: 2px;
    font-size: 0.65rem;
  }
  .game-title {
    font-size: 1.45rem;
    letter-spacing: 2px;
  }
  .game-subtitle {
    font-size: 0.72rem;
    letter-spacing: 1.5px;
  }
  .menu-body {
    padding: 6px;
    gap: 6px;
    border-radius: 14px;
  }
  .menu-card-btn {
    border-radius: 10px;
  }
  .menu-footer {
    display: none;
  }

  /* Placement Panel as sleek LEFT DRAWER in landscape */
  #placement-panel {
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: auto !important;
    transform: none !important;
    width: 295px !important;
    max-height: 100vh !important;
    border-radius: 0 18px 18px 0 !important;
    border-left: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-right: 2px solid rgba(212, 175, 55, 0.7) !important;
    padding: calc(8px + env(safe-area-inset-top)) 12px calc(8px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left)) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .panel-header {
    margin-bottom: 6px;
  }
  .panel-title {
    font-size: 1.05rem;
  }
  .dock-ship-item {
    padding: 4px 6px;
    margin-bottom: 4px;
  }
  .dock-ship-name {
    font-size: 0.75rem;
  }
  .placement-actions {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }
  .placement-action-btn {
    padding: 6px 8px !important;
    font-size: 0.76rem;
  }
  .btn-start-battle {
    grid-column: span 2;
    padding: 9px 12px !important;
  }

  /* Battle HUD in Landscape */
  .hud-top-bar {
    display: flex !important;
    justify-content: space-between;
    padding: calc(4px + env(safe-area-inset-top)) 12px 0;
    gap: 8px;
  }
  .fleet-card {
    width: 200px;
    padding: 4px 8px;
  }
  .fleet-card-title {
    font-size: 0.75rem;
  }
  .fleet-list {
    grid-template-columns: 1fr 1fr;
    gap: 1px 4px;
  }
  .badge {
    padding: 3px 10px;
  }
  .turn-main {
    font-size: 0.78rem;
  }
  .turn-sub {
    font-size: 0.6rem;
  }
  .mobile-board-switcher {
    display: none !important;
  }

  /* Compact modals in landscape */
  .modal-card {
    max-height: 92vh;
    padding: 12px 18px;
    overflow-y: auto;
  }
  .modal-title {
    font-size: 1.15rem;
  }
  .settings-group {
    margin-bottom: 8px;
  }
  .weather-modal-grid, .quality-modal-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* 3. Extra-compact screens (iPhone SE, Galaxy Fold cover, width <= 375px) */
@media (max-width: 375px) {
  #main-menu {
    padding: calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom));
  }
  .menu-header {
    padding: 10px 12px;
  }
  .game-title {
    font-size: 1.7rem;
    letter-spacing: 1.5px;
  }
  .game-subtitle {
    font-size: 0.72rem;
  }
  .menu-body {
    padding: 6px;
    gap: 6px;
  }
  .tactical-btn.menu-card-btn {
    border-radius: 10px;
  }
  #placement-panel {
    max-height: 52vh;
    padding: 10px 10px calc(12px + env(safe-area-inset-bottom));
  }
  .cell-block {
    width: 14px;
    height: 14px;
  }
  .dock-ship-item {
    padding: 4px 6px;
  }
  .placement-action-btn {
    padding: 6px 6px !important;
    font-size: 0.72rem;
  }
  .btn-start-battle {
    padding: 10px 12px !important;
  }
  .fleet-card {
    padding: 4px 6px;
  }
  .fleet-card-title {
    font-size: 0.72rem;
  }
  .tool-btn {
    width: 34px;
    height: 34px;
  }
}

/* 4. Ultrawide Monitors (21:9 and 32:9 displays, aspect-ratio >= 2.0) */
@media (min-aspect-ratio: 2/1) {
  #main-menu {
    max-width: 460px;
    padding-left: calc(max(36px, (100vw - 1800px) / 2));
  }
  #placement-panel {
    left: calc(max(24px, (100vw - 1800px) / 2));
  }
  .hud-top-bar {
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
  }
  .hud-bottom-bar {
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
  }
}

/* ==========================================================================
   Top Tactical Quick Controls Bar (Sound & Weather)
   ========================================================================== */
.top-controls-bar {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  user-select: none;
}

.top-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  background: linear-gradient(135deg, rgba(8, 20, 46, 0.88) 0%, rgba(18, 38, 76, 0.78) 100%);
  border: 1.5px solid rgba(0, 229, 255, 0.45);
  border-radius: 30px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 8, 24, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.22s ease;
}

.top-ctrl-btn:hover {
  border-color: rgba(0, 229, 255, 0.85);
  box-shadow: 0 10px 28px rgba(0, 229, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.top-ctrl-btn:active {
  transform: translateY(1px);
}

.top-ctrl-btn.muted {
  border-color: rgba(255, 59, 92, 0.6);
  background: linear-gradient(135deg, rgba(48, 14, 24, 0.9) 0%, rgba(72, 18, 32, 0.8) 100%);
  color: #ff8ca3;
}

.top-ctrl-btn.muted:hover {
  border-color: rgba(255, 59, 92, 0.9);
  box-shadow: 0 10px 28px rgba(255, 59, 92, 0.35);
}

.weather-widget {
  position: relative;
  font-family: var(--font-display);
  user-select: none;
}

.weather-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(8, 20, 46, 0.88) 0%, rgba(18, 38, 76, 0.78) 100%);
  border: 1.5px solid rgba(0, 229, 255, 0.45);
  border-radius: 30px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 8, 24, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.22s ease;
}

.weather-pill-btn:hover {
  border-color: rgba(0, 229, 255, 0.85);
  box-shadow: 0 10px 28px rgba(0, 229, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.weather-pill-btn:active {
  transform: translateY(1px);
}

.weather-caret {
  font-size: 0.75rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.weather-widget.open .weather-caret {
  transform: rotate(180deg);
}

.weather-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: linear-gradient(145deg, rgba(6, 16, 38, 0.95) 0%, rgba(14, 28, 56, 0.92) 100%);
  border: 1.5px solid rgba(0, 229, 255, 0.35);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 24px rgba(0, 229, 255, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: weatherFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.weather-dropdown.hidden {
  display: none;
}

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

.weather-dropdown-header {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-cyan, #00e5ff);
  padding: 6px 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.weather-opt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #d8e8f8;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.weather-opt-btn:hover {
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.3);
  color: #fff;
  transform: translateX(2px);
}

.weather-opt-btn.active {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.25), rgba(0, 160, 255, 0.15));
  border-color: rgba(0, 229, 255, 0.6);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 0 12px rgba(0, 229, 255, 0.2);
}

/* Weather buttons in Settings Modal */
.weather-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.weather-modal-btn {
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.weather-modal-btn.active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.35) 0%, rgba(0, 140, 255, 0.25) 100%);
  border-color: var(--accent-cyan, #00e5ff);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.35);
  color: #fff;
  font-weight: 800;
}

/* Graphics Quality Buttons in Settings Modal */
.quality-modal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.quality-modal-btn {
  padding: 8px 6px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.quality-modal-btn.active {
  background: linear-gradient(135deg, rgba(255, 180, 0, 0.35) 0%, rgba(200, 140, 0, 0.25) 100%);
  border-color: var(--accent-gold, #f3b944);
  box-shadow: 0 0 16px rgba(255, 180, 0, 0.35);
  color: #fff;
  font-weight: 800;
}

@media (max-width: 768px) {
  .top-controls-bar {
    top: 12px;
    right: 12px;
    gap: 6px;
  }
  .ctrl-label,
  .weather-pill-label {
    display: none;
  }
  .top-ctrl-btn,
  .weather-pill-btn {
    padding: 7px 11px;
    gap: 3px;
  }
  .weather-modal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quality-modal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   ROSA GAMES — ONLINE MULTIPLAYER (CROSS-PLATFORM P2P / REALTIME)
   ========================================================================== */

/* Online Modal Components */
.online-profile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(3, 10, 24, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 18px;
}

.online-input-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #dfb76c;
}

.callsign-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 26, 56, 0.9);
  border: 1px solid rgba(0, 210, 255, 0.4);
  border-radius: 8px;
  padding: 4px 10px;
}

.online-text-input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  width: 140px;
}

.online-modes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.online-action-card {
  background: radial-gradient(ellipse at 50% 20%, rgba(13, 38, 72, 0.8) 0%, rgba(4, 13, 28, 0.95) 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 16px;
  padding: 16px;
  transition: all 0.2s ease;
}

.online-action-card:hover {
  border-color: rgba(212, 175, 55, 0.8);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.online-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.online-card-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.online-card-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.online-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
}

.online-card-sub {
  font-size: 0.78rem;
  color: #9cb8da;
}

.room-code-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(3, 10, 24, 0.9);
  border: 1.5px solid #d4af37;
  border-radius: 12px;
  padding: 12px;
  box-shadow: inset 0 0 16px rgba(212, 175, 55, 0.15);
}

.room-code-label {
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  color: #dfb76c;
  font-weight: 800;
}

.room-code-val {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: #00d2ff;
  text-shadow: 0 0 14px rgba(0, 210, 255, 0.7), 0 2px 4px rgba(0, 0, 0, 0.9);
  font-family: monospace, inherit;
}

.online-spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.sonar-ping-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00d2ff;
  box-shadow: 0 0 10px #00d2ff;
  animation: sonar-pulse 1.4s infinite ease-out;
}

@keyframes sonar-pulse {
  0% { transform: scale(0.8); opacity: 1; box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.8); }
  70% { transform: scale(1.4); opacity: 0.8; box-shadow: 0 0 0 8px rgba(0, 210, 255, 0); }
  100% { transform: scale(0.8); opacity: 1; box-shadow: 0 0 0 0 rgba(0, 210, 255, 0); }
}

.online-waiting-label {
  font-size: 0.85rem;
  color: #b8d4f4;
  font-weight: 600;
}

.online-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  font-size: 0.82rem;
  color: #a4c2e6;
  font-weight: 600;
}

.online-opponent-dock-status {
  background: rgba(3, 10, 24, 0.85);
  border: 1px solid rgba(0, 210, 255, 0.4);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #00d2ff;
  text-align: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffb700;
  box-shadow: 0 0 6px #ffb700;
}

.status-dot.connected {
  background: #00ff88;
  box-shadow: 0 0 8px #00ff88;
}

.status-dot.error {
  background: #ff3344;
  box-shadow: 0 0 8px #ff3344;
}

/* Radio Quick Signals Popover */
.radio-signals-popover {
  position: fixed;
  bottom: 84px;
  right: 18px;
  background: radial-gradient(ellipse at 50% 20%, rgba(10, 26, 56, 0.98) 0%, rgba(3, 10, 24, 0.99) 100%);
  border: 1.5px solid #d4af37;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 24px rgba(212, 175, 55, 0.3);
  z-index: 800;
  width: 270px;
  animation: modal-card-appear 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.radio-signals-popover.hidden {
  display: none !important;
}

.radio-popover-header {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #dfb76c;
  text-align: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.radio-signals-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radio-signal-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 38, 72, 0.7);
  border: 1px solid rgba(0, 210, 255, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.radio-signal-btn:hover {
  background: rgba(0, 210, 255, 0.2);
  border-color: #00d2ff;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
  transform: translateX(3px);
}

/* Floating Radio Message Banner */
.radio-message-banner {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 20%, rgba(13, 38, 72, 0.97) 0%, rgba(3, 10, 24, 0.98) 100%);
  border: 1.5px solid #00d2ff;
  border-radius: 14px;
  padding: 10px 20px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 24px rgba(0, 210, 255, 0.4);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  animation: banner-appear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.radio-message-banner.hidden {
  display: none !important;
}

@keyframes banner-appear {
  from { opacity: 0; transform: translate(-50%, -15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.radio-banner-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.radio-sender-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #00d2ff;
  text-transform: uppercase;
}

.radio-banner-content {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}
