/* Base font */
@font-face {
    font-family: "Mario64";
    src: url("/Mario64.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
  --bg: #000;
  --glass: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.2);
  --accent-a: #4CAF50;
  --accent-b: #F44336;
  --accent-z: #2196F3;
  --text: #fff;
}

* { 
  box-sizing: border-box; 
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body { 
  height: 100%; 
  margin: 0; 
  background: var(--bg);
  overflow: hidden;
}

body {
  font-family: "Noto Sans", system-ui, -apple-system, sans-serif;
}

#app { 
  position: relative; 
  height: 100vh; 
  width: 100vw; 
}

#canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  outline: none;
  z-index: 1;
}

/* Top Bar Styling */
#top-bar {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  gap: 15px;
  align-items: center;
  background: var(--glass);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  color: white;
  font-size: 12px;
}

#mute-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: white;
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

#fs-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: white;
}

#status-indicator {
  font-size: 10px;
  opacity: 0.7;
  white-space: nowrap;
}

/* Custom Joystick Styling */
#joystick-zone {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 50%; 
  z-index: 10;
  touch-action: none;
}

#joystick-base {
  position: absolute;
  bottom: 40px;
  left: 40px;
  width: 140px;
  height: 140px;
  background: var(--glass);
  border: 3px solid var(--glass-border);
  border-radius: 50%;
  backdrop-filter: blur(5px);
  display: block; /* Always visible */
  pointer-events: none;
}

#joystick-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 65px;
  height: 65px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

/* Action Buttons Container */
#action-buttons-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-end;
}

.main-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.sub-row {
  display: flex;
  gap: 12px;
}

.action-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  color: white;
  font-weight: bold;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
  transition: transform 0.1s, background 0.1s;
}

.action-btn:active {
  transform: scale(0.85);
  background: rgba(255, 255, 255, 0.4);
}

.x-btn { border-color: var(--accent-a); color: var(--accent-a); width: 100px; height: 100px; font-size: 32px; }
.c-btn { border-color: var(--accent-b); color: var(--accent-b); width: 85px; height: 85px; }
.space-btn { 
  border-color: var(--accent-z); 
  color: var(--accent-z);
  width: 70px; 
  height: 70px;
  font-size: 20px;
}

.start-btn {
  width: 70px;
  height: 30px;
  border-radius: 15px;
  font-size: 10px;
  letter-spacing: 1px;
}

/* Layout for Landscape */
@media (orientation: landscape) {
  #joystick-zone { width: 40%; height: 60%; }
}



@media (max-width: 600px) {
  .action-btn { width: 70px; height: 70px; }
  .x-btn { width: 85px; height: 85px; }
  #joystick-base { width: 120px; height: 120px; bottom: 30px; left: 30px; }
}