* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --color-primary: #1a1a2e;
  --color-accent: #e94560;
  --color-surface: #16213e;
  --color-surface-light: #1f2b47;
  --color-text: #ffffff;
  --color-text-muted: #8b8da3;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  width: 100%;
  background: var(--color-primary);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

/* ── Loading Screen ── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  text-align: center;
}

.basketball {
  font-size: 64px;
  animation: bounce 1s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.loader-text {
  font-size: 28px;
  font-weight: 700;
  margin-top: 16px;
  letter-spacing: 1px;
}

.loader-sub {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  margin: 24px auto 0;
  animation: spin 0.8s linear infinite;
}

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

/* ── Landing Page ── */
#landing {
  min-height: 100vh;
  padding: calc(var(--safe-top) + 24px) 20px calc(var(--safe-bottom) + 24px);
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.6s ease 0.3s both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 40px 0 32px;
}

.hero-ball {
  font-size: 72px;
  margin-bottom: 16px;
  animation: bounce 2s ease infinite;
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.hero-sub {
  font-size: 16px;
  color: var(--color-text-muted);
  margin-top: 6px;
  font-weight: 500;
}

/* ── Action Buttons ── */
.actions {
  margin-top: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 20px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.15s ease, background 0.2s;
}

.action-btn:active {
  transform: scale(0.98);
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--color-accent), #c0392b);
  box-shadow: 0 4px 20px rgba(233, 69, 96, 0.3);
}

.btn-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.btn-label {
  display: flex;
  flex-direction: column;
  text-align: left;
  flex: 1;
}

.btn-label strong {
  font-size: 18px;
  font-weight: 700;
}

.btn-label small {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 2px;
}

.btn-arrow {
  flex-shrink: 0;
  opacity: 0.7;
}

/* ── Quick Links ── */
.quick-links {
  margin-top: 36px;
}

.quick-links h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  padding-left: 4px;
}

.links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--color-surface);
  border-radius: 14px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.quick-link:active {
  transform: scale(0.96);
  background: var(--color-surface-light);
}

.ql-icon {
  font-size: 28px;
}

/* ── Footer ── */
.landing-footer {
  margin-top: auto;
  padding-top: 40px;
  text-align: center;
}

.landing-footer p {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.footer-hint {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.6;
}

/* ── Standalone mode: hide add-to-homescreen hint ── */
@media (display-mode: standalone) {
  .landing-footer {
    display: none;
  }
}
