/* Landing — self-contained, mobile-first. No album CSS imports.
   Logged-out: the album's original animated penalty mini-game (game.js).
   Logged-in: the Álbum / Quiniela chooser with a prominent logout. */
:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.12);
  --blue-1: #1d4ed8;
  --blue-2: #2563eb;
  --green-1: #047857;
  --green-2: #059669;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #f1f5f9;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

/* ---------- Loading ---------- */
.loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
}
.spinner {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(37, 99, 235, 0.25);
  border-top-color: var(--blue-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login screen (copied from the album's style.css so the landing
   is self-contained and the penalty mini-game looks identical) ----------
   Full-bleed landing themed to the official 2026 logo (black/gold/white). */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 28%, #ffffff 0%, #eef0f5 62%, #e2e6ef 100%);
}

/* Decorative pixel-art game canvas: fills the screen behind the login button. */
#pitch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  z-index: 0;
  touch-action: none;
}

/* The visible "MyWCAlbum" title is drawn as pixel clouds on the canvas; keep
   the h1 in the DOM for a11y/SEO but hide it visually. */
.cloud-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Pixel-look score counter pinned top-left, above the canvas. */
.hud-score {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 2;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #10131c;
  background: #c9a227;
  padding: 6px 10px;
  border: 2px solid #10131c;
  box-shadow: 3px 3px 0 rgba(16, 19, 28, 0.55);
  image-rendering: pixelated;
  pointer-events: none;
}

/* Sign-in pill, pinned top-right over the game canvas. */
.login-btn-top {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  border: 2px solid #10131c;
  box-shadow: 4px 4px 0 rgba(16, 19, 28, 0.55); /* hard-edged pixel shadow */
}
.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  color: #1f2330;
  text-decoration: none;
  background: #fff;
  border: 1px solid #dadce0;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.login-btn .g-icon {
  width: 20px;
  height: 20px;
  flex: none;
}
.login-credit {
  position: absolute;
  z-index: 1;
  bottom: 18px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(16, 19, 28, 0.55); /* legible over the sky/grass */
}
.login-credit a {
  color: #c9a227; /* gold accent echoing the trophy */
  text-decoration: none;
  font-weight: 600;
}
.login-credit a:hover {
  text-decoration: underline;
}

/* ---------- Chooser ---------- */
.chooser {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  max-width: 44vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Split screen: stacked on phones, side-by-side on wide screens */
.panels {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.panel {
  flex: 1 1 0;
  min-height: 44vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 22px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  transition: filter 0.15s ease;
}
.panel:hover { filter: brightness(1.06); }
.panel:active { filter: brightness(0.95); }
.panel-album {
  background: linear-gradient(150deg, var(--blue-1) 0%, var(--blue-2) 100%);
}
.panel-quiniela {
  background: linear-gradient(150deg, var(--green-1) 0%, var(--green-2) 100%);
}
.panel-icon {
  font-size: 3.4rem;
  line-height: 1;
}
.panel-title {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.panel-desc {
  max-width: 22ch;
  font-size: 1rem;
  line-height: 1.4;
  opacity: 0.92;
}
.panel-cta {
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

/* Prominent logout — a real, visible button on the front page (not a chip). */
.chooser-foot {
  display: flex;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
}
.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  width: 100%;
  max-width: 360px;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #b91c1c;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.logout-btn:hover {
  background: #fef2f2;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.18);
}
.logout-btn:active { transform: translateY(1px); }

@media (min-width: 760px) {
  .panels { flex-direction: row; }
  .panel { min-height: 0; }
  .panel-album { border-right: 1px solid rgba(255, 255, 255, 0.18); }
  .panel-icon { font-size: 4.2rem; }
}

/* Hover-only refinements (copied from style.css): keep the top-right sign-in
   pill's hard pixel shadow on hover. Scoped to fine pointers so taps don't stick. */
@media (hover: hover) and (pointer: fine) {
  .login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.16);
    border-color: #c7c9cf;
  }
  .login-btn-top:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 rgba(16, 19, 28, 0.55);
    border-color: #10131c;
  }
}
