:root {
  --color-bg: #1a0a2e;
  --color-bg2: #2d1b55;
  --color-accent: #ff6b35;
  --color-accent2: #ffd23f;
  --color-green: #06d6a0;
  --color-red: #ef233c;
  --color-white: #f8f9fa;
  --color-gray: #adb5bd;
  --color-panel: rgba(255,255,255,0.07);
  --color-panel-border: rgba(255,255,255,0.15);
  --font-main: 'Segoe UI', 'Arial Rounded MT Bold', Arial, sans-serif;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

html {
  height: 100%;
  overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

body {
  background: var(--color-bg);
  font-family: var(--font-main);
  color: var(--color-white);
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

#game-wrapper, #loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-wrapper {
  flex-direction: column;
}

.screen {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

#screen-game {
  display: none;
  flex-direction: column;
  padding: 0;
}

#screen-game.active {
  display: flex;
}

#game-canvas {
  display: block;
  touch-action: none;
}

#loading-screen {
  background: var(--color-bg);
  flex-direction: column;
  gap: 16px;
  z-index: 999;
}

.loading-cat {
  font-size: 64px;
  animation: bounce 0.7s infinite alternate;
}

.loading-text {
  font-size: 18px;
  color: var(--color-accent2);
  letter-spacing: 1px;
}

.loading-bar-wrap {
  width: 220px;
  height: 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent2));
  border-radius: 100px;
  transition: width 0.2s;
}

/* ===== Cross-platform fixes ===== */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

#game-canvas {
  /* Prevent iOS callout on long press */
  -webkit-touch-callout: none;
}

/* PC: show keyboard hint */
@media (hover: hover) and (pointer: fine) {
  #keyboard-hint {
    display: block !important;
  }
}
