/* css/layout.css — Mobile-first responsive layout */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

html {
  overflow: hidden;
}

body {
  overflow: hidden;
}

/* Background layer — full screen behind everything */
.background-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: background-image var(--transition-scene), filter var(--transition-scene);
  z-index: 0;
}

/* Dark overlay on background for text readability */
.background-layer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

/* Game container — centered mobile column, scrollable */
.game-container {
  position: relative;
  z-index: 1;
  max-width: var(--game-max-width);
  height: 100%;
  margin: 0 auto;
  padding: var(--game-padding);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--color-accent) transparent;
}

/* Spacer pushes content to bottom when it fits, collapses when it doesn't */
.game-container .game-spacer {
  flex: 1 1 auto;
}

/* Splash / loading screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  background: #12100e url('../images/backgrounds/splash.jpg') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  padding: 32px 32px 8vh;
  transition: opacity 0.6s ease;
}

/* Dark overlay for readability on splash */
.splash-screen::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: -1;
}

.splash-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-logo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(212, 160, 84, 0.4);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.splash-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  letter-spacing: 0.02em;
}

.splash-progress {
  width: 100%;
  max-width: 260px;
  text-align: center;
}

.splash-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}

.splash-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.splash-status {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}

.splash-tap {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.05em;
  animation: pulse-subtle 2s ease-in-out infinite;
  cursor: pointer;
}

.splash-tap.hidden {
  display: none;
}

/* Desktop: background art shows on sides, game column centered */
@media (min-width: 600px) {
  .game-container {
    padding: 24px 32px;
  }
}
