*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-height: 100dvh;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: #0f2619;
  color: #e8f5e9;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  overscroll-behavior: none;
  overflow: hidden;
}

.hide {
  display: none !important;
}

.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
}

/* Desktop-only gate (mobile) */
.desktop-only {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 38, 25, 0.96);
}

.desktop-only-panel {
  width: min(400px, 100%);
  padding: 28px 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.desktop-only-title {
  margin: 0 0 12px;
  font-size: 1.5rem;
  font-weight: 800;
}

.desktop-only-msg {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ff6b35;
}

.desktop-only-sub {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0.85;
}

/* Landing screen */
.landing {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(ellipse at 50% 20%, #2d5a3d 0%, #0f2619 70%);
}

.landing-panel {
  width: min(520px, 100%);
  padding: clamp(20px, 4vw, 36px);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.game-title {
  margin: 0 0 4px;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.game-subtitle {
  margin: 0 0 16px;
  font-size: 1.1rem;
  opacity: 0.85;
  font-weight: 600;
}

.game-desc {
  margin: 0 0 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.9;
}

.controls-hint {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  line-height: 1.6;
  opacity: 0.85;
  text-align: left;
}

.btn-start {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #ff6b35 0%, #e85a24 100%);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 0 #b84318, 0 12px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-start:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b84318, 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Game container */
.game-root {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#root,
#container,
#hammer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#container canvas {
  display: block;
  touch-action: none;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#hammer {
  z-index: 10;
  pointer-events: auto;
}

#debug-fps {
  display: none !important;
}

/* Ellgame loading overlay (replaces Azerion splash branding) */
.game-loading {
  position: absolute;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 20%, #2d5a3d 0%, #0f2619 70%);
}

.game-loading-panel {
  text-align: center;
  padding: 24px;
}

.game-loading-title {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
}

.game-loading-sub {
  margin: 0 0 20px;
  opacity: 0.85;
  font-size: 0.95rem;
}

.game-loading-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ff6b35;
  border-radius: 50%;
  animation: firewater-spin 0.9s linear infinite;
}

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

/* Hide third-party portal splash (Azerion h5branding) */
#h5branding-container {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.game-error {
  position: absolute;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 38, 25, 0.96);
}

.game-error-panel,
.game-error {
  text-align: center;
  max-width: 420px;
}

.game-error-title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 800;
}

.game-error-msg {
  margin: 0 0 20px;
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0.9;
}

#container canvas {
  background: #000;
}
