@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    box-sizing: border-box;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    user-select: none;
}

body {
    background-color: #0d0d1a;
    background-image: 
        linear-gradient(rgba(255, 0, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    font-family: 'Press Start 2P', cursive;
    color: #fff;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.game-container {
    background: rgba(10, 10, 20, 0.95);
    padding: 20px;
    width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1 {
    font-size: 2.5em;
    margin-top: 0;
    color: #00ffff;
    text-shadow: 3px 3px 0px #000;
    line-height: 1.4;
}

h2 {
    font-size: 1.5em;
    color: #ff00ff;
    text-shadow: 2px 2px 0px #000;
    line-height: 1.4;
    margin-bottom: 10px;
}

.teams-grid {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px auto;
}

.team-selector {
    padding: 15px;
    flex: 1;
    min-width: 200px;
}

.color-palette {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.color-button {
    width: 60px;
    height: 60px;
    border: 4px solid #333;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.1s;
    border-radius: 0;
}

.color-button:hover {
    transform: scale(1.1);
}

.color-button.selected {
    border-color: #fff;
    transform: scale(1.1);
    box-shadow: 3px 3px 0px #000;
}

.error-message {
    color: #ff0000;
    text-shadow: 2px 2px 0px #000;
    margin: 15px 0;
    font-size: 1em;
    visibility: hidden;
    height: 1.2em;
}

/* Form Elements */
input[type="text"], input[type="number"] {
    -webkit-user-select: auto;
    user-select: auto;
    font-family: 'Press Start 2P', cursive;
    background: #000;
    color: #00ffff;
    border: 3px solid #555;
    padding: 15px;
    font-size: 1.2em;
    width: 100%;
    max-width: 250px;
    margin-bottom: 15px;
    text-align: center;
}

input:focus {
    outline: none;
    border-color: #ff00ff;
    box-shadow: 0 0 15px #ff00ff;
}

.config-section {
    margin: 20px auto;
    padding: 20px;
    border: 3px dashed #333;
    background: rgba(0, 0, 0, 0.5);
    max-width: 800px;
    width: 90%;
}

button {
    font-family: 'Press Start 2P', cursive;
    padding: 20px 30px;
    font-size: 1.2em;
    border-radius: 0;
    border: 4px solid #fff;
    color: #fff;
    background-color: #000;
    cursor: pointer;
    width: 100%;
    max-width: 400px;
    margin: 15px auto;
    text-transform: uppercase;
    box-shadow: 6px 6px 0px #ff00ff;
    transition: transform 0.1s, box-shadow 0.1s;
}

button:active:not(.disabled) {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0px #ff00ff;
}

button.disabled {
    border-color: #555;
    color: #555;
    box-shadow: 6px 6px 0px #333;
    cursor: not-allowed;
}

button:hover:not(.disabled) {
    background-color: #222;
}

/* Game Page Specifics */
.score-display {
    font-size: 1em;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    background: #000;
    border: 2px solid #555;
    padding: 10px;
    flex-wrap: wrap;
}

.team-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.team-header.active {
    transform: scale(1.1);
    border-color: var(--active-team-color, #fff);
    background-color: rgba(255,255,255,0.1);
    box-shadow: 0 0 15px var(--active-team-color, #fff);
}

.team-name-label {
    margin: 0 10px;
    font-size: 0.8em;
}

.color-preview {
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
}

.score {
    font-size: 1.5em;
    text-shadow: 2px 2px 0px #000;
}

.game-area-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex: 1; /* This will make it stretch and take up all middle space */
    margin: 20px 0;
    gap: 10px;
}

.category-side {
    flex: 1;
    font-size: 0.8em;
    line-height: 1.6;
    background: #000;
    border: 2px dashed #555;
    padding: 15px;
    word-wrap: break-word;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svg-container {
    flex: 4; /* Takes up more horizontal space compared to categories */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
}

#gauge-svg {
    width: 100%;
    max-width: 95vw;
    max-height: 55vh; /* Keep it constrained vertically so it doesn't push UI off screen */
    height: auto;
    overflow: visible;
}

#gauge-svg text {
    font-family: 'Press Start 2P', cursive;
}

.buttons-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

/* Win Overlay */
.win-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.win-overlay h1 {
    font-size: 2em;
    color: #ff00ff;
    text-shadow: 4px 4px 0px #00ffff;
    margin-bottom: 20px;
}

/* Turn Overlay */
.turn-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}
.turn-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}