/*
  The splash shown from the first byte until Flutter paints its first frame
  (splash.js removes it on the "flutter-first-frame" event).

  Plain CSS in a file of its own: the Content-Security-Policy in firebase.json
  allows stylesheets from the same origin ('self') and index.html carries no
  <style> element and no style="" attribute. No image, no web font: it must
  paint before anything else has been downloaded. Colors are the Portside
  Club Design System's: the night ground (#0b1822), its glow (#173a5c), Signal
  Blue (#1f4f8f), brass (#d6ae57) and gelcoat white (#f6f5f0).
*/

html,
body {
  margin: 0;
  height: 100%;
  background: #0b1822;
}

#splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  padding: 16px;
  background: radial-gradient(circle at 50% 38%, #173a5c 0%, #0b1822 62%);
  color: #f6f5f0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-align: center;
}

/* The chip: a Signal Blue disc with a dashed rim and a brass spade, turning slowly. */
.splash-chip {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: #1f4f8f;
  border: 4px solid #f6f5f0;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  animation: splash-spin 6s linear infinite;
}

.splash-chip::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 3px dashed #f6f5f0;
}

.splash-chip::after {
  content: "\2660";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  line-height: 1;
  color: #d6ae57;
}

.splash-title {
  margin: 0;
  font-family: Didot, "Bodoni 72", Georgia, serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #f6f5f0;
}

.splash-sub {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #d6ae57;
}

/* An indeterminate bar. */
.splash-bar {
  position: relative;
  width: 160px;
  height: 4px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}

.splash-bar::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  border-radius: 2px;
  background: #d6ae57;
  animation: splash-slide 1.4s ease-in-out infinite;
}

/* After 12 s something is wrong or slow: say so (still no script). */
.splash-slow {
  margin: 16px 0 0;
  max-width: 320px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  opacity: 0;
  animation: splash-in 0.6s ease 12s forwards;
}

.splash-noscript {
  margin: 16px 0 0;
  font-size: 14px;
  color: #d6ae57;
}

/* Set by splash.js on the first Flutter frame. */
#splash.splash-done {
  pointer-events: none;
  animation: splash-out 0.3s ease forwards;
}

@keyframes splash-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes splash-slide {
  from {
    left: -40%;
  }
  to {
    left: 100%;
  }
}

@keyframes splash-in {
  to {
    opacity: 1;
  }
}

@keyframes splash-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* Debug and emulator builds only: Firebase Auth pins a 40 px "Running in emulator mode" bar over the bottom of the
   page, which covered the table's action buttons on short phones (play test, Nov 2026). Keep the warning, as a
   small tag at the top that taps go through. Release builds never connect to the emulators, so never show it. */
.firebase-emulator-warning {
  top: env(safe-area-inset-top, 0px) !important;
  bottom: auto !important;
  left: 50% !important;
  width: auto !important;
  transform: translateX(-50%);
  margin: 0 !important;
  padding: 1px 8px !important;
  font: 600 10px/1.4 system-ui, sans-serif !important;
  border-radius: 0 0 6px 6px;
  opacity: 0.85;
  pointer-events: none;
  white-space: nowrap;
}
