body, html {
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    font-family: Arial, sans-serif;
}

/* Mobile Control Buttons */
#mobile-controls {
    display: none;
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    width: 100%;
    padding: 0;
    z-index: 100;
    box-sizing: border-box;
}

.control-group {
    display: inline-block;
    margin: 0;
    width: 48%; /* Allow equal columns with less space between */
    box-sizing: border-box;
}

.control-label {
    display: block;
    color: white;
    font-size: 16px;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px black;
    text-align: left;
    font-weight: bold;
    padding-left: 5px;
}

.control-buttons {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.control-btn {
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 8px 0;
    width: 100%;
    text-align: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
}

.sun-controls .control-btn {
    border-color: rgba(0, 114, 178, 0.8); /* Blue (#0072B2) with alpha */
    background-color: rgba(0, 50, 80, 0.5);
}

.ac-controls .control-btn {
    border-color: rgba(230, 159, 0, 0.8); /* Orange (#E69F00) with alpha */
    background-color: rgba(80, 60, 0, 0.5);
}

/* Star distances display for mobile */
#mobile-star-distances {
    display: none;
    position: fixed;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 100;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    left: 0;
}

#instructions, #containment-instructions {
    position: fixed;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 100;
}

#status {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 100;
}

#event-log {
    position: fixed;
    top: 60px; /* Below distance indicators */
    left: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px;
    border-radius: 8px;
    z-index: 100;
    max-width: 300px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

#distance-indicators {
    position: fixed;
    top: 10px;
    left: 10px;
    display: none; /* Default to no display */
    justify-content: space-between;
    width: 300px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px;
    border-radius: 8px;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

#distance-indicators:not(.hidden) {
    display: flex;
}

.distance-indicator {
    display: flex;
    align-items: center;
}

.distance-indicator.sun .distance-arrow {
    color: #0072B2; /* Blue (colorblind friendly) */
    margin-right: 8px;
    font-size: 24px;
    text-shadow: 0 0 5px #0072B2;
}

.distance-indicator.sun .distance-value {
    color: #0072B2; /* Blue (colorblind friendly) */
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 0 3px #0072B2;
}

.distance-indicator.alpha-centauri .distance-arrow {
    color: #E69F00; /* Orange (colorblind friendly) */
    margin-left: 8px;
    font-size: 24px;
    text-shadow: 0 0 5px #E69F00;
}

.distance-indicator.alpha-centauri .distance-value {
    color: #E69F00; /* Orange (colorblind friendly) */
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 0 3px #E69F00;
}

#event-log h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #4CAF50;
    border-bottom: 1px solid #4CAF50;
    padding-bottom: 5px;
}

#log-entries {
    font-size: 14px;
}

#log-entries p {
    margin: 5px 0;
    padding: 5px;
    border-radius: 3px;
}

#log-entries p.perturbation {
    border-left: 3px solid orange;
    background-color: rgba(255, 165, 0, 0.2);
}

#log-entries p.alignment {
    border-left: 3px solid #4CAF50;
    background-color: rgba(0, 255, 0, 0.2);
}

#log-entries p.warning {
    border-left: 3px solid red;
    background-color: rgba(255, 0, 0, 0.2);
}

#game-over, #success, #intro-screen, #containment-intro, #containment-success, #containment-failure {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 1000;
    max-width: 600px;
    width: 80%;
}

#intro-screen h1, #containment-intro h1 {
    color: #FF7E00;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #FF7E00, 0 0 20px #FF7E00, 0 0 30px #FF7E00;
    animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px #FF7E00, 0 0 20px #FF7E00, 0 0 30px #FF7E00;
    }
    to {
        text-shadow: 0 0 15px #FF7E00, 0 0 25px #FF7E00, 0 0 35px #FF7E00, 0 0 45px #FF4500;
    }
}

.intro-content {
    text-align: left;
    line-height: 1.5;
}

.intro-content p, .intro-content ul {
    margin-bottom: 15px;
}

.intro-content ul {
    text-align: left;
    padding-left: 20px;
}

.start-options {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.start-options label {
    display: flex;
    align-items: center;
    margin-left: 15px;
    font-size: 16px;
    cursor: pointer;
}

.start-options input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

.credits-link {
    margin-top: 20px;
    text-align: center;
}

.credits-link a {
    color: #4CAF50;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.3s;
    border-bottom: 1px dotted #4CAF50;
    padding-bottom: 2px;
}

.credits-link a:hover {
    opacity: 1;
    text-decoration: none;
    border-bottom: 1px solid #4CAF50;
}

#start-button, #start-containment {
    background-color: #4CAF50;
    font-size: 18px;
    padding: 12px 30px;
    max-width: 300px;
}

button {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 10px 2px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

.hidden {
    display: none;
}

.active {
    display: block;
}

/* Email signup form styles */
.bg-slate-300 {
    background-color: #e2e8f0;
    margin-top: 1.5rem;
    border-radius: 0.5rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-5 {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.text-gray-900 {
    color: #1a202c;
}

.text-indigo-600 {
    color: #5850ec;
}

.text-left {
    text-align: left;
}

.mt-3 {
    margin-top: 0.75rem;
}

.sm\:max-w-lg {
    max-width: 32rem;
}

.sm\:w-full {
    width: 100%;
}

.sm\:flex {
    display: flex;
}

.min-w-0 {
    min-width: 0;
}

.flex-1 {
    flex: 1 1 0%;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.block {
    display: block;
}

.w-full {
    width: 100%;
}

.rounded-md {
    border-radius: 0.375rem;
}

.border {
    border-width: 1px;
}

.border-gray-300 {
    border-color: #d1d5db;
}

.px-5 {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.text-base {
    font-size: 1rem;
    line-height: 1.5rem;
}

.placeholder-gray-500::placeholder {
    color: #6b7280;
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.mt-4 {
    margin-top: 1rem;
}

.sm\:mt-0 {
    margin-top: 0;
}

.sm\:ml-3 {
    margin-left: 0.75rem;
}

.border-transparent {
    border-color: transparent;
}

.bg-indigo-600 {
    background-color: #5850ec;
}

.text-white {
    color: #ffffff;
}

.font-medium {
    font-weight: 500;
}

.hover\:bg-indigo-700:hover {
    background-color: #4338ca;
}

.focus\:outline-none:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* Email form styling to match game theme */
#emailForm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 15px;
}

#hero-email {
    background-color: rgba(0, 0, 0, 0.7);
    color: #00FFFF;
    border: 2px solid #77AAFF;
    border-radius: 5px;
    padding: 10px;
    font-family: monospace;
    font-size: 16px;
    flex: 1;
}

#btnSubmit {
    background-color: rgba(0, 0, 0, 0.7);
    color: #77AAFF;
    border: 2px solid #77AAFF;
    border-radius: 5px;
    font-family: monospace;
    font-size: 16px;
    cursor: pointer;
    height: 100%;
    margin: 0;
    margin-left: 10px;
    padding: 10px 20px;
    white-space: nowrap;
}

#btnSubmit:hover {
    background-color: rgba(20, 20, 40, 0.9);
    box-shadow: 0 0 8px #77AAFF;
}

#btnSubmit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading animation for signup button */
.loading-animation {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 16px;
}

.loading-animation div {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #77AAFF;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-animation div:nth-child(1) {
    left: 8px;
    animation: loading-animation1 0.6s infinite;
}

.loading-animation div:nth-child(2) {
    left: 8px;
    animation: loading-animation2 0.6s infinite;
}

.loading-animation div:nth-child(3) {
    left: 32px;
    animation: loading-animation2 0.6s infinite;
}

.loading-animation div:nth-child(4) {
    left: 56px;
    animation: loading-animation3 0.6s infinite;
}

@keyframes loading-animation1 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes loading-animation3 {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}

@keyframes loading-animation2 {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(24px, 0);
    }
}

/* Loading overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 2000;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: #77AAFF;
    font-family: monospace;
    max-width: 600px;
}

/* Removed title and message styles */

.energy-pulse {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(119, 170, 255, 0.9) 0%, rgba(119, 170, 255, 0.1) 70%, rgba(119, 170, 255, 0) 100%);
    border-radius: 50%;
    margin: 30px auto;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(119, 170, 255, 0.7);
    }
    
    70% {
        transform: scale(1.2);
        box-shadow: 0 0 0 30px rgba(119, 170, 255, 0);
    }
    
    100% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(119, 170, 255, 0);
    }
}

/* Override default email input color */
input[type="email"] {
    color: #00FFFF;
}

@media (min-width: 640px) {
    .sm\:p-6 {
        padding: 1.5rem;
    }
    
    .sm\:rounded-lg {
        border-radius: 0.5rem;
    }
    
    .sm\:px-10 {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
    
    .sm\:block {
        display: block;
    }
}

/* Containment Phase Specific Styles */
.item-icon {
    display: inline-block;
    font-size: 24px;
    margin-right: 10px;
    vertical-align: middle;
}

.item-icon.magnetic {
    color: #FF00FF;
    text-shadow: 0 0 5px #FF00FF, 0 0 10px #FF00FF;
}

.item-icon.channel {
    color: #00FFFF;
    text-shadow: 0 0 5px #00FFFF, 0 0 10px #00FFFF;
}

#item-selector {
    position: fixed;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    border-radius: 5px;
    z-index: 100;
    text-align: center;
}

#item-selector .item {
    display: inline-block;
    cursor: pointer;
    margin: 0 10px;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#item-selector .item:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#item-selector .item.selected {
    background-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Mobile responsive styles */
@media screen and (max-width: 768px) {
    #mobile-controls:not(.hidden) {
        display: flex;
        justify-content: space-between;
        padding: 10px;
        bottom: 45px;
    }
    
    .control-group {
        display: flex;
        flex-direction: column;
        margin: 0;
        width: 45%;
    }
    
    .control-buttons {
        align-items: center;
    }
    
    .control-label {
        margin-bottom: 10px;
    }
    
    .control-buttons {
        display: flex;
        flex-direction: column;
    }
    
    .control-btn {
        margin: 4px 0;
    }
    
    #instructions {
        display: none !important;
    }
    
    #event-log {
        max-width: calc(100% - 40px); /* 20px padding on each side */
        width: calc(100% - 40px);
        max-height: 120px;
        top: 55px; /* Reduced space below distance indicators */
    }
    
    #distance-indicators {
        top: 10px;
        width: calc(100% - 40px); /* 20px padding on each side */
    }
    
    #mobile-star-distances {
        display: none; /* Hide old mobile distances since we now use the new indicators */
    }
    
    #status {
        bottom: 10px;
        max-width: 80%;
    }
}