/* ==========================================================================
   THEME & SHELL LAYOUT
   CSS variables, base resets, typography, atmospheric background, and shell.
   ========================================================================== */

:root {
  --bg-top: #090d18;
  --bg-bottom: #141c31;
  --felt-light: #1e5b4d;
  --felt-mid: #16483d;
  --felt-dark: #0f342c;
  --rail-outer: #3a4666;
  --rail-mid: #28324b;
  --rail-inner: #1b2338;
  --gold-light: #ffe27a;
  --gold-mid: #f0b43a;
  --gold-dark: #9c620b;

  /* Dynamic animation durations (updated by Speed setting; Normal is default) */
  --card-flight-ms: 1350ms;
  --coin-flight-ms: 1425ms;
  --arrow-ms: 1350ms;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Nunito', sans-serif;
  background: radial-gradient(circle at 50% 18%, #1a2442 0%, #090c16 78%);
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.font-display {
  font-family: 'Fredoka', sans-serif;
}

/* Subtle dark atmospheric starfield */
.starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 14% 16%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1.2px 1.2px at 84% 14%, rgba(255, 235, 175, 0.5), transparent),
    radial-gradient(1.8px 1.8px at 24% 76%, rgba(165, 195, 255, 0.38), transparent),
    radial-gradient(1.4px 1.4px at 78% 64%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 52% 9%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1.4px 1.4px at 90% 82%, rgba(255, 220, 140, 0.4), transparent);
  animation: twinkle 7s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Compact Mobile-Portrait App Shell */
#app-shell {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  max-height: 900px;
  background: linear-gradient(180deg, #0b0f1b 0%, #141c30 48%, #0e1424 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

@media (min-width: 480px) and (min-height: 740px) {
  #app-shell {
    border-radius: 26px;
    height: min(96dvh, 860px);
    border: 2px solid rgba(118, 138, 190, 0.25);
  }
}

.arena-glow {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 170px;
  background: radial-gradient(ellipse at center, rgba(72, 114, 184, 0.22) 0%, transparent 72%);
  pointer-events: none;
}
