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

:root {
  --bg: #f2f0eb;
  --text: #1a1a1a;
  --text-muted: #6b6862;
  --accent: #ff6b35;
  --platform: #3a3632;
  --card-bg: #ffffff;
  --card-border: #e0ddd6;
}

html, body {
  overflow: hidden;
  height: 100%;
  background: var(--bg);
  touch-action: manipulation;
}

#game-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* === HUD === */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  pointer-events: none;
}

.hud-floor {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.hud-floor span {
  color: var(--accent);
  transition: transform 0.2s;
  display: inline-block;
}

.hud-floor span.pulse {
  animation: pulse-num 0.3s ease;
}

@keyframes pulse-num {
  0% { transform: scale(1); }
  50% { transform: scale(1.8); color: var(--accent); }
  100% { transform: scale(1); }
}

.hud-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: var(--text-muted);
  letter-spacing: 2px;
}

/* === Info Panel === */
.info-panel {
  position: fixed;
  right: -360px;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  z-index: 20;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-panel.visible {
  right: 24px;
}

.info-period {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.info-company {
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.info-role {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.info-badge {
  display: none;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(255, 107, 53, 0.08);
  border: 1px solid rgba(255, 107, 53, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  width: fit-content;
}

.info-badge.show {
  display: inline-block;
}

.info-carousel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
}

.no-content {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.info-desc {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
}

.cta-link {
  display: block;
  text-align: center;
  padding: 10px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cta-link:hover {
  background: #e55a28;
  transform: translateY(-1px);
}

.cta-link + .cta-link {
  margin-top: 8px;
}

.cta-secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.cta-secondary:hover {
  background: var(--accent);
  color: #fff;
}

/* === Start Overlay === */
.start-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(242, 240, 235, 0.92);
  backdrop-filter: blur(8px);
  transition: opacity 0.5s ease, visibility 0.5s;
}

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

.start-content {
  text-align: center;
}

.start-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.8rem;
  color: var(--text);
  margin-bottom: 32px;
  line-height: 1.6;
}

.start-hint {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: 1px;
  animation: blink 1.2s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.start-controls {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === Mobile Controls === */
.mobile-controls {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: none;
  gap: 12px;
  align-items: center;
}

.ctrl-btn {
  width: 64px;
  height: 64px;
  border: 2px solid var(--platform);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  backdrop-filter: blur(4px);
}

.ctrl-btn.ctrl-jump {
  width: 80px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  background: rgba(255, 107, 53, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.ctrl-btn:active {
  transform: scale(0.92);
  background: rgba(0, 0, 0, 0.08);
}

@media (hover: none) and (pointer: coarse) {
  .mobile-controls {
    display: flex;
  }
}

@media (max-width: 640px) {
  .info-panel {
    width: calc(100vw - 80px);
    padding: 12px 16px;
    top: 56px;
    bottom: auto;
    transform: none;
    max-height: 30vh;
    overflow-y: auto;
  }

  .info-panel.visible {
    right: 12px;
  }

  .info-company {
    font-size: 0.95rem;
  }

  .info-role {
    font-size: 0.8rem;
  }

  .info-desc {
    font-size: 0.75rem;
  }

  .start-title {
    font-size: 1.1rem;
  }
}
