/* ========================================
   Game Page Styles - 3D Voxel World
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --game-primary: #0055ff;
  --game-primary-rgb: 0, 85, 255;
  --game-accent: #00e5ff;
  --game-dark: #0a0e1a;
  --game-panel: rgba(10, 14, 26, 0.85);
  --game-border: rgba(0, 229, 255, 0.2);
  --game-text: #e0e6ed;
  --game-text-dim: rgba(255, 255, 255, 0.5);
  --game-glow: 0 0 20px rgba(0, 229, 255, 0.3);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--game-dark);
  color: var(--game-text);
  -webkit-font-smoothing: antialiased;
}

/* ===== Canvas ===== */
#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
}

/* ===== Start Screen Overlay ===== */
#startScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(10, 14, 26, 0.95) 0%, rgba(0, 20, 60, 0.9) 100%);
  backdrop-filter: blur(20px);
  cursor: pointer;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#startScreen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #00e5ff 0%, #0055ff 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

.start-subtitle {
  font-size: 1.1rem;
  color: var(--game-text-dim);
  margin-bottom: 2.5rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.start-prompt {
  font-size: 1.2rem;
  color: var(--game-accent);
  padding: 0.8rem 2.5rem;
  border: 2px solid var(--game-border);
  border-radius: 50px;
  animation: promptGlow 2s ease-in-out infinite;
  backdrop-filter: blur(8px);
  background: rgba(0, 229, 255, 0.05);
}

@keyframes promptGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2), inset 0 0 10px rgba(0, 229, 255, 0.05);
    border-color: rgba(0, 229, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.4), inset 0 0 15px rgba(0, 229, 255, 0.1);
    border-color: rgba(0, 229, 255, 0.6);
  }
}

.start-controls {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 3rem;
  font-size: 0.85rem;
  color: var(--game-text-dim);
}

.start-controls div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.start-controls kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-family: 'Outfit', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--game-accent);
}

/* ===== Pause Screen ===== */
#pauseScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 90;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 26, 0.7);
  backdrop-filter: blur(10px);
}

#pauseScreen.active {
  display: flex;
}

.pause-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--game-accent);
  margin-bottom: 1rem;
}

.pause-hint {
  color: var(--game-text-dim);
  font-size: 1rem;
}

.pause-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}

.pause-btn {
  padding: 0.7rem 2rem;
  border: 1px solid var(--game-border);
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.08);
  color: var(--game-text);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-family: inherit;
}

.pause-btn:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--game-accent);
  box-shadow: var(--game-glow);
  color: #fff;
  transform: translateY(-2px);
}

/* ===== HUD ===== */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
  display: none;
}

#hud.active {
  display: block;
}

/* Crosshair */
.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
}

.crosshair::before,
.crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 1px;
}

.crosshair::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  transform: translateY(-50%);
}

.crosshair::after {
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  transform: translateX(-50%);
}

/* Coordinates Display */
.coords {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: 'Outfit', monospace;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  background: var(--game-panel);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--game-border);
  line-height: 1.6;
}

/* Back to Home Button */
.back-home {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 8px 16px;
  background: var(--game-panel);
  border: 1px solid var(--game-border);
  border-radius: 8px;
  color: var(--game-text);
  font-size: 0.85rem;
  text-decoration: none;
  pointer-events: auto;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.back-home:hover {
  background: rgba(0, 229, 255, 0.12);
  border-color: var(--game-accent);
  box-shadow: var(--game-glow);
  color: #fff;
}

/* Block Hotbar */
.hotbar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--game-panel);
  border: 1px solid var(--game-border);
  border-radius: 12px;
  backdrop-filter: blur(12px);
}

.hotbar-slot {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s ease;
}

.hotbar-slot:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.hotbar-slot.active {
  border-color: var(--game-accent);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4), inset 0 0 8px rgba(0, 229, 255, 0.1);
}

.hotbar-slot .block-preview {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  box-shadow: inset -2px -2px 4px rgba(0,0,0,0.3), inset 2px 2px 4px rgba(255,255,255,0.15);
}

.hotbar-slot .slot-key {
  position: absolute;
  top: 2px;
  left: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
}

.hotbar-slot .slot-name {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.hotbar-slot:hover .slot-name,
.hotbar-slot.active .slot-name {
  opacity: 1;
}

/* Tips */
.game-tips {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  white-space: nowrap;
}

/* ===== Loading Screen ===== */
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--game-dark);
  transition: opacity 0.6s ease;
}

#loadingScreen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(0, 229, 255, 0.15);
  border-top-color: var(--game-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

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

.loading-text {
  font-size: 1rem;
  color: var(--game-text-dim);
  letter-spacing: 1px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .start-controls {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  
  .hotbar-slot {
    width: 44px;
    height: 44px;
  }
  
  .hotbar-slot .block-preview {
    width: 26px;
    height: 26px;
  }
}
