/* ==========================================================================
   GAME SECTION — Unity WebGL embed
   ========================================================================== */
.game {
  background: var(--paper-2);
  position: relative;
}

.game-wrap {
  max-width: 1100px;
  margin: 3rem auto 0;
}

.game-frame {
  position: relative;
  background: var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
  border: 2px solid var(--ink);
}

.unity-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050505;
}

/* The canvas Unity mounts onto */
#unityCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  outline: none;
}

/* ==========================================================================
   LOADER OVERLAY — shown while Unity boots
   ========================================================================== */
.unity-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a1612 0%, #050505 80%);
  z-index: 20;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}

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

.loader-card {
  width: min(90%, 440px);
  padding: 2rem 2.25rem;
  background: rgba(244, 234, 213, 0.04);
  border: 1px solid rgba(201, 145, 59, 0.35);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--paper);
  backdrop-filter: blur(6px);
}

.loader-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--brass-2);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.loader-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-style: italic;
  margin-bottom: 1.5rem;
  color: var(--paper);
}

.loader-progress {
  width: 100%;
  height: 8px;
  background: rgba(244, 234, 213, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.loader-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brass), var(--brass-2));
  box-shadow: 0 0 12px var(--brass);
  transition: width 0.2s ease-out;
  border-radius: 4px;
}

.loader-percent {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--paper-3);
}

/* ==========================================================================
   START OVERLAY — shown before user clicks "All Aboard"
   ========================================================================== */
.unity-start {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  background:
    radial-gradient(ellipse at center, rgba(26, 22, 18, 0.6) 0%, rgba(5, 5, 5, 0.92) 80%),
    linear-gradient(180deg, #1e3a2e 0%, #050505 100%);
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}

.unity-start.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-card {
  width: min(90%, 540px);
  padding: 2.5rem 2.5rem;
  text-align: center;
  color: var(--paper);
}

.start-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--brass-2);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.start-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--paper);
}

.start-title em {
  font-style: italic;
  color: var(--brass-2);
}

.start-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--paper-3);
  margin-bottom: 2rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   MISSING BUILD PLACEHOLDER — shown if Unity files not found
   ========================================================================== */
.unity-missing {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 18;
  background:
    radial-gradient(ellipse at center, rgba(26, 22, 18, 0.5) 0%, rgba(5, 5, 5, 0.95) 80%),
    linear-gradient(180deg, #1e3a2e 0%, #050505 100%);
  padding: 2rem;
  overflow-y: auto;
}

.missing-card {
  width: min(100%, 560px);
  padding: 2rem 2rem;
  text-align: left;
  color: var(--paper);
  border: 1px dashed rgba(201, 145, 59, 0.5);
  border-radius: var(--radius-lg);
  background: rgba(201, 145, 59, 0.04);
}

.missing-icon {
  font-size: 2.5rem;
  color: var(--brass-2);
  margin-bottom: 0.75rem;
  text-align: center;
  animation: missingSpin 8s linear infinite;
  display: inline-block;
  width: 100%;
}

@keyframes missingSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.coming-soon-card {
  text-align: center;
  border: 1px solid rgba(201, 145, 59, 0.3);
  background: rgba(201, 145, 59, 0.06);
}

.coming-soon-card .missing-icon {
  animation: none;
  font-size: 3rem;
}

.missing-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--paper);
  margin-bottom: 0.75rem;
  text-align: center;
}

.missing-card p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--paper-3);
  margin-bottom: 0.9rem;
}

.missing-card code {
  font-family: var(--font-mono);
  background: rgba(244, 234, 213, 0.08);
  color: var(--brass-2);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
}

.missing-card pre {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: rgba(244, 234, 213, 0.05);
  color: var(--paper-3);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 0.9rem;
  border: 1px solid rgba(244, 234, 213, 0.08);
  line-height: 1.6;
}

.missing-hint {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--paper-3);
  text-align: center;
  margin-top: 0.5rem;
}

/* ==========================================================================
   FULLSCREEN BUTTON — visible after Unity loads
   ========================================================================== */
.unity-fullscreen {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: rgba(26, 22, 18, 0.7);
  color: var(--paper);
  border: 1px solid rgba(244, 234, 213, 0.2);
  border-radius: var(--radius);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(4px);
  transition: all 0.2s var(--ease);
}

.unity-fullscreen:hover {
  background: var(--brass);
  color: var(--ink);
  border-color: var(--brass);
}

/* ==========================================================================
   BELOW-GAME ROW — tip + manual score link
   ========================================================================== */
.game-below {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0 0.5rem;
}

.game-tip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  opacity: 0.7;
  text-transform: uppercase;
}

.game-tip span {
  color: var(--crimson);
  font-weight: 600;
}

@media (max-width: 640px) {
  .game-below {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}
