:root {
  --sat: env(safe-area-inset-top, 0);
  --sab: env(safe-area-inset-bottom, 0);
  --sal: env(safe-area-inset-left, 0);
  --sar: env(safe-area-inset-right, 0);
}

body {
    margin: 0;
    padding: 0;
    background: #0f0f23; /* Fallback color matching PixiJS background */
    font-family: 'Arial', sans-serif;
    color: #fff;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    box-sizing: border-box;
    pointer-events: none;
}

.stats-row {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    width: calc(100% - 40px);
    pointer-events: auto;
}

.stats-row > * {
    flex: 1 1 0;
    max-width: 25%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-row > div {
    background: rgba(42, 10, 10, 0.9);
    padding: 0 10px;
    border-radius: 25px;
    border: 2px solid #ff4444;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    color: #ffcccc;
    pointer-events: auto;
    white-space: nowrap;
}

.stats-row select {
    width: 100%;
    height: 36px;
    border-radius: 25px;
    border: 2px solid #ff4444;
    background: rgba(42, 10, 10, 0.9);
    color: #ffcccc;
    font-size: 16px;
    text-align: center;
    padding: 0 10px;
}

.stats-row button {
    width: 100%;
    height: 36px;
    border-radius: 25px;
    background: #fff;
    color: #222;
    font-size: 16px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 0;
}

.controls-row {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    pointer-events: auto;
}

select {
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    background: rgba(42, 10, 10, 0.9);
    color: #ffcccc;
    font-size: 14px;
    border: 1px solid #ff4444;
    cursor: pointer;
}

select:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

button {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#auto-btn {
    background: linear-gradient(45deg, #cc3333, #ff5555);
    color: white;
}

#auto-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(204, 51, 51, 0.4);
}

#auto-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#status {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(42, 10, 10, 0.9);
    padding: 10px 20px;
    border-radius: 15px;
    border: 1px solid #ff4444;
    text-align: center;
    min-width: 200px;
    color: #ffcccc;
}

#pixi-container {
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

canvas {
    display: block;
    pointer-events: auto !important;
}

/* Login Form Styles */
#login-form {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2a0a0a, #4a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-container {
    background: rgba(42, 10, 10, 0.95);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid #ff4444;
    text-align: center;
    box-shadow: 0 10px 30px rgba(42, 10, 10, 0.8);
}

.login-container h2 {
    color: #ff4444;
    margin-bottom: 30px;
    font-size: 28px;
}

.login-container input {
    width: 250px;
    padding: 15px;
    border: none;
    border-radius: 25px;
    background: rgba(74, 26, 26, 0.7);
    color: #ffcccc;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #ff4444;
}

.login-container input::placeholder {
    color: rgba(255, 204, 204, 0.7);
}

.login-container input:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.login-container button {
    width: 280px;
    padding: 15px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(45deg, #ff4444, #ff6666);
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-container button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.4);
}

#login-status {
    margin-top: 15px;
    color: #ff9999;
    font-size: 14px;
}