/* Import Google Fonts at the top */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&family=Roboto:wght@400;500&display=swap');

/* --- CSS Variables for Theme --- */
:root {
    --primary-bg: #0d1117;
    --secondary-bg: #161b22;
    --accent-color: #00fff7;
    --accent-glow: rgba(0, 255, 247, 0.5);
    --primary-text: #e6edf3;
    --secondary-text: #8b949e;
    --border-color: #30363d;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

/* --- General Resets & Body --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Mobile Controls */
#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    overflow: hidden;
}

#mobile-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto; /* allow children to receive touch events */
    z-index: 1000;
    touch-action: none;
}

/* Hide mobile controls by default; JS shows them only for detected mobile devices */
#mobile-controls { display: none; }

/* Make sure the fullscreen exit button floats above the canvas */
#exit-fullscreen-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2002;
    pointer-events: auto;
}

.joystick-zone {
    position: absolute;
    bottom: 20%;
    left: 10%;
    width: 120px;
    height: 120px;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: 2px solid rgba(0, 255, 247, 0.3);
    touch-action: none;
}

.look-zone {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    pointer-events: auto;
    touch-action: none;
}

.jump-button {
    position: absolute;
    bottom: 20%;
    right: 10%;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(0, 255, 247, 0.2);
    border: 2px solid #00fff7;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1rem;
    pointer-events: auto;
    cursor: pointer;
    z-index: 1001;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background: var(--primary-bg);
    color: var(--primary-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Fullscreen styles --- */
body.game-fullscreen {
    overflow: hidden;
    margin: 0;
    padding: 0;
}

#game-container.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1000 !important;
}

/* --- Header & Footer --- */
header, footer {
    text-align: center;
    background: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
}

footer {
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    margin-top: auto;
    color: var(--secondary-text);
}

/* --- Typography --- */
h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 2.8rem);
    color: var(--accent-color);
    text-shadow: 0 0 8px var(--accent-glow);
    letter-spacing: 2px;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: var(--secondary-text);
    margin-top: 0.5rem;
}

/* --- Main Content & Game Section --- */
main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.game-section {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

#game-container {
    width: 800px;
    height: 600px;
    position: relative;
}

h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--primary-text);
    margin-bottom: 1rem;
}

/* --- Game Container --- */
#game-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 1rem 0;
    background: #000;
    border-radius: 8px;
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 24px var(--accent-glow);
    overflow: hidden;
    transition: all 0.3s ease-in-out; /* Smooth transition */
}

/* --- NEW: Fullscreen state for the game container --- */
#game-container.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none; /* Override max-width */
    border-radius: 0;
    border: none;
    z-index: 1000; /* Ensure it's on top of all other content */
    aspect-ratio: auto; /* Let it fill the screen dimensions */
}


/* --- UI Controls & Info --- */
.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    background: var(--accent-color);
    color: var(--primary-bg);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 255, 247, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 255, 247, 0.4);
}

.info {
    color: var(--secondary-text);
    font-size: 0.9rem;
    text-align: center;
}
