/* ============================================
   OCEAN DASH ADVENTURE — Styles
   Strict mobile-first, zero-zoom, kid-safe
   ============================================ */

/* ─── RESET & STRICT MOBILE LOCKS ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  touch-action: pan-x pan-y;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

img, svg, canvas, video {
  -webkit-user-drag: none;
  user-drag: none;
  display: block;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #01579B;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── GAME CONTAINER ─── */
#gameContainer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #01579B;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ─── OVERLAY BASE ─── */
.overlay, .modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 20, 50, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 1;
  transition: opacity 0.25s ease;
}

.overlay.hidden, .modal-overlay.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

/* ─── CARD SHARED ─── */
.overlay-card, .modal-card {
  background: linear-gradient(135deg, #0288D1 0%, #01579B 60%, #004D40 100%);
  border: 1px solid rgba(79, 195, 247, 0.3);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 380px;
  width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  color: #fff;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(79, 195, 247, 0.1);
}

/* ─── AUTH OVERLAY ─── */
.overlay-header {
  text-align: center;
  margin-bottom: 20px;
}

.overlay-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
}

.overlay-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.overlay-header p {
  font-size: 14px;
  color: #B3E5FC;
}

.auth-status {
  text-align: center;
  margin: 16px 0;
  font-size: 13px;
  color: #B3E5FC;
}

#loginSection {
  text-align: center;
  margin: 12px 0;
}

.paid-badge {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #76FF03;
  margin: 12px 0;
}

.auth-unpaid p {
  text-align: center;
  font-size: 14px;
  margin-bottom: 12px;
}

.auth-unpaid .note {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 8px;
}

/* ─── BUTTONS ─── */
.btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
  text-align: center;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #76FF03, #64DD17);
  color: #1B5E20;
  box-shadow: 0 4px 16px rgba(118, 255, 3, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #B3E5FC;
  border: 1px solid rgba(79, 195, 247, 0.3);
}

.btn-accent {
  background: linear-gradient(135deg, #FFD740, #FFC107);
  color: #5D4037;
  box-shadow: 0 4px 16px rgba(255, 215, 64, 0.3);
}

.btn-link {
  background: none;
  color: #4FC3F7;
  font-size: 13px;
  padding: 8px;
  text-decoration: underline;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Google sign-in container spacing */
.g_id_signin {
  margin: 16px auto;
  display: flex;
  justify-content: center;
}

/* ─── COOKIE BANNER ─── */
.modal-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background: rgba(0, 30, 60, 0.95);
  border-top: 2px solid rgba(79, 195, 247, 0.4);
  padding: 16px;
  color: #fff;
  backdrop-filter: blur(8px);
}

.modal-banner.hidden {
  display: none;
}

.banner-content p {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
  color: #B3E5FC;
}

.banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.banner-actions .btn {
  flex: 1;
  min-width: 80px;
  padding: 10px 12px;
  font-size: 14px;
}

/* ─── MODAL CARD ─── */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(79, 195, 247, 0.2);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #FFD740;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-close:active {
  color: #fff;
}

.modal-body {
  font-size: 13px;
  line-height: 1.7;
}

.modal-body h4 {
  font-size: 15px;
  font-weight: 600;
  color: #4FC3F7;
  margin: 14px 0 6px;
}

.modal-body p {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.85);
}

.modal-body ul {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}

.modal-body ul li {
  padding: 4px 0 4px 20px;
  position: relative;
  color: rgba(255, 255, 255, 0.8);
}

.modal-body ul li::before {
  content: '•';
  position: absolute;
  left: 6px;
  color: #4FC3F7;
}

.modal-body a {
  color: #4FC3F7;
  text-decoration: none;
}

.modal-body a:active {
  color: #FFD740;
}

.legal-line {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 12px;
}

.disclaimer {
  font-size: 11px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 8px;
}

/* ─── FOOTER ─── */
#gameFooter {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: rgba(0, 20, 40, 0.9);
  padding: 8px 12px 12px;
  text-align: center;
  backdrop-filter: blur(4px);
}

#gameFooter.hidden {
  display: none;
}

.footer-links {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.footer-link {
  background: none;
  border: none;
  color: rgba(79, 195, 247, 0.7);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
}

.footer-link:active {
  color: #FFD740;
}

.dot {
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
}

.footer-brand {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 3px;
}

.footer-copyright {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.3);
}

/* ─── UTILITY ─── */
.hidden {
  display: none !important;
}

/* ─── RESPONSIVE ─── */
@media (min-width: 768px) {
  .overlay-card, .modal-card {
    max-width: 420px;
    padding: 32px 28px;
  }
}

@media (min-width: 1024px) {
  #gameCanvas {
    max-width: 100vw;
    max-height: 100vh;
  }
}

/* Landscape phone — make sure canvas fills */
@media (orientation: landscape) and (max-height: 500px) {
  .overlay-card, .modal-card {
    max-height: 95vh;
    padding: 16px;
  }
  .modal-banner {
    padding: 8px 12px;
  }
  .banner-content p {
    font-size: 11px;
    margin-bottom: 6px;
  }
}

/* ═══════════════════════════════════════════
   AD BANNER COMPONENTS
   ═══════════════════════════════════════════ */

/* ─── Shared ad bar (leaderboard, exabytes) ─── */
.ad-leaderboard, .ad-exabytes {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 800;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
  transition: transform 0.3s ease;
}

.ad-leaderboard { top: 0; }
.ad-exabytes { bottom: 0; border-bottom: none; border-top: 1px solid rgba(59, 130, 246, 0.2); }

.ad-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  max-width: 900px;
  margin: 0 auto;
}

.ad-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #fbbf24;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
}

.ad-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  animation: ad-pulse 1.5s ease-in-out infinite;
}

.ad-dot.blue {
  background: #3b82f6;
  animation-name: ad-pulse-blue;
}

@keyframes ad-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes ad-pulse-blue {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.ad-x {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 8px;
  line-height: 1;
}

.ad-x:active { color: #fff; }

.ad-body {
  padding: 8px 12px 10px;
  max-width: 900px;
  margin: 0 auto;
  animation: ad-slide-down 0.2s ease-out;
}

@keyframes ad-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ad-body a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.ad-img {
  flex-shrink: 0;
  width: 80px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
}

@media (min-width: 640px) {
  .ad-img { width: 96px; height: 56px; }
}

.ad-text strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-exabytes .ad-text strong { color: #60a5fa; }

.ad-text p {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-cta {
  font-size: 10px;
  font-weight: 700;
  color: #14b8a6;
  margin-top: 2px;
  display: inline-block;
}

.ad-cta.blue { color: #fb923c; }

/* ─── Wasza Floating Banner ─── */
.ad-wasza {
  position: fixed;
  bottom: 80px;
  right: 12px;
  z-index: 850;
  max-width: 140px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #4c1d95, #312e81);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  opacity: 0.88;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ad-wasza:active { opacity: 1; transform: translateY(-2px); }

.ad-wasza-x {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  padding: 1px 5px;
  line-height: 1;
}

.ad-wasza a {
  display: block;
  text-decoration: none;
  color: #fff;
  padding: 6px;
}

.ad-wasza-img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 4px;
}

.ad-wasza-label {
  text-align: center;
}

.ad-wasza-label strong {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}

.ad-wasza-label span {
  font-size: 9px;
  font-weight: 700;
  color: #67e8f9;
}

/* ─── AdSense Slot ─── */
.adsense-slot {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 790;
  background: rgba(0, 20, 40, 0.8);
  padding: 4px;
  text-align: center;
}

/* ─── Paid users: hide all ads ─── */
body.paid .ad-leaderboard,
body.paid .ad-exabytes,
body.paid .ad-wasza,
body.paid .adsense-slot {
  display: none !important;
}

@media (orientation: landscape) and (max-height: 500px) {
  .ad-wasza { max-width: 110px; bottom: 60px; right: 8px; }
  .ad-wasza-img { height: 40px; }
  .ad-body { padding: 4px 8px 6px; }
}
