:root {
    --primary-bg: #0A0D18; /* Dark, professional background */
    --secondary-bg: #1A1F2D; /* Slightly lighter background for elements */
    --accent-blue: #00CBF6; /* Vibrant blue, similar to tech/display colors */
    --accent-red: #F02138; /* Strong red for alerts/actions */
    --text-light: #E0E0E0; /* Light grey for primary text */
    --text-dark: #A0A0A0; /* Darker grey for secondary text */
    --border-color: #3A4052; /* Subtle border for elements */
    --header-font: 'Montserrat', sans-serif;
    --body-font: 'Montserrat', sans-serif;
}

body {
    font-family: var(--body-font);
    background-color: var(--primary-bg);
    color: var(--text-light);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.screen {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* --- General Elements --- */
.logo {
    font-family: var(--header-font);
    font-size: 1.8em;
    font-weight: 700;
    color: var(--accent-blue);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.modern-button {
    background-color: var(--accent-blue);
    border: none;
    border-radius: 5px;
    color: var(--primary-bg);
    padding: 12px 25px;
    font-size: 1.1em;
    font-family: var(--body-font);
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 4px 15px rgba(0, 203, 246, 0.4);
    width: 90%;
    max-width: 350px;
}

.modern-button:hover {
    background-color: #00A6CC;
    transform: translateY(-2px);
}

.modern-button:active {
    background-color: #007A99;
    transform: translateY(0);
}

.modern-button:disabled {
    background-color: var(--text-dark);
    color: var(--primary-bg);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.utility-button {
    background-color: var(--secondary-bg);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.player-gamertag {
    font-weight: 700;
    letter-spacing: 0.05em;
    font-size: 0.9em; /* Smaller font size for gamertags */
}


/* --- Screen Specific --- */

#start-screen .screen-main, #queue-screen .screen-main, #game-over-screen .screen-main, #countdown-screen .screen-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

#countdown-display {
    font-size: 2em;
    font-weight: 700;
    color: var(--text-light);
    line-height: 1.3em;
}

#countdown-display .player-gamertag {
    display: block;
    font-size: 1.2em; /* Larger gamertag */
    margin-bottom: 10px;
}

#queue-display {
    font-size: 1.5em;
    line-height: 1.5em;
}

#queue-display .player-gamertag {
    display: block;
    margin-top: 10px;
}

/* --- Active Controller Screen --- */
#controller-screen {
    justify-content: space-between;
    padding: 10px; /* Less padding for more space */
}

#controller-screen .screen-header {
    display: flex;
    flex-direction: column; /* Stack name and HUD vertically */
    align-items: center;
    gap: 10px; /* Space between name and HUD */
    width: 100%;
    padding: 10px 20px;
    box-sizing: border-box;
}

#controller-header-title {
    font-size: 1.2em; /* 20% smaller than 1.5em */
    letter-spacing: 0.04em; /* Tighter letter spacing */
}

.hud-display {
    display: flex;
    gap: 20px;
    font-size: 1.5em;
    font-weight: 700;
}

#countdown-display .player-gamertag {
    display: block;
    font-size: 0.96em; /* 20% smaller than 1.2em */
    margin-bottom: 10px;
    letter-spacing: 0.04em; /* Tighter letter spacing */
}

.hud-display div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    box-shadow: none;
    position: relative; /* For overlaying icons */
}
.icon-button .lucide {
    stroke: var(--text-dark);
    transition: stroke 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.motion-icon {
    display: none; /* Hide all motion icons by default */
}

.icon-button:not(.active) .motion-on {
    display: block; /* Show 'enable' icon when inactive */
}
.icon-button.active .motion-off {
    display: block; /* Show 'disable' icon when active */
    stroke: var(--accent-blue); /* Color for the active state icon */
}

/* Specific styling for the composite icon */
.smartphone-overlay {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}
.hud-display .lucide { /* Icon styling */
    stroke: var(--accent-blue);
    width: 28px;
    height: 28px;
}
#hud-lives .lucide {
    stroke: var(--accent-red);
}

#controller-screen .screen-main {
    flex-grow: 1;
    padding: 0;
    width: 100%;
}

#control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    flex-grow: 1;
    width: 100%;
    height: 100%;
}

#joystick-zone, #action-zone {
    position: relative;
    background-color: var(--secondary-bg);
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-icon {
    position: absolute;
    width: 50%;
    height: 50%;
    stroke: #3A4052; /* Dark, opaque color for background icons */
    stroke-width: 1.5;
    pointer-events: none;
}

#joystick-zone {
    border-right: 1px solid var(--border-color);
}

#action-zone {
    cursor: pointer;
}


/* NippleJS custom styling */
.nipple.back, .nipple.front {
    background: transparent;
    border: none;
    box-shadow: none;
    position: absolute;
}
.nipple.back {
    display: none;
}
.nipple.front {
    background: rgba(255, 255, 255, 0.4);
    width: 80px !important;
    height: 80px !important;
}