:root {
    --neon-pink: #ff00ff;
    --neon-cyan: #00ffff;
    --neon-purple: #9d00ff;
    --dark-bg: #1a001a;
    --text-glow: 0 0 5px var(--neon-cyan), 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan), 0 0 30px var(--neon-pink), 0 0 40px var(--neon-pink);
    --border-glow: 0 0 5px var(--neon-pink), 0 0 10px var(--neon-pink);
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    background-color: var(--dark-bg);
    background-image: url('../IMAGES/background.png');
    background-size: cover;
    background-position: center;
    color: var(--neon-cyan);
    font-family: 'VT323', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 24px;
    padding-top: 2vh; /* Add some padding at the top */
}

#game-container {
    width: 100%;
    max-width: 1200px; /* Increased max-width for value boards */
    height: 95vh; /* Make height flexible based on viewport height */
    min-height: 700px; /* Ensure a minimum height for larger desktops */
    border: 3px solid var(--neon-pink);
    box-shadow: var(--border-glow);
    background-color: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden; /* Prevent confetti overflow */
}

#animation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

#host-placeholder {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 250px;
    z-index: 10;
    pointer-events: none; /* Make sure it doesn't block clicks on other elements */
}

.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px; /* Reduced gap */
    padding-bottom: 50px; /* Reduced padding further to give more room */
    box-sizing: border-box;
    position: relative; /* For layout context */
}

.title {
    font-family: 'Press Start 2P', cursive;
    font-size: 3rem;
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink), 0 0 20px var(--neon-pink), 0 0 40px #ff00ff;
    animation: flicker 1.5s infinite alternate;
    line-height: 1.5;
}

.game-button {
    font-family: 'Press Start 2P', cursive;
    background-color: var(--neon-cyan);
    color: var(--dark-bg);
    border: none;
    padding: 15px 30px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan);
    transition: all 0.2s ease-in-out;
}

.game-button:hover {
    transform: scale(1.1);
    background-color: var(--neon-pink);
    box-shadow: 0 0 10px var(--neon-pink), 0 0 20px var(--neon-pink);
    animation: flash-animation 0.5s infinite alternate;
}

.game-button.not {
    background-color: var(--neon-pink);
    box-shadow: 0 0 10px var(--neon-pink), 0 0 20px var(--neon-pink);
}
.game-button.not:hover {
     background-color: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan);
}


.host-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.host-image {
    width: 150px;
    height: 150px;
    animation: float 4s ease-in-out infinite;
}

.host-dialogue {
    background-color: rgba(0,0,0,0.8);
    border: 2px solid var(--neon-cyan);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
    text-shadow: var(--text-glow);
    width: 100%; /* Make it responsive */
    box-sizing: border-box;
}

#comparison-host-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    width: 250px;
    pointer-events: none; /* So it doesn't block the "Play Again" button */
}

#comparison-host-container .host-image {
     width: 150px;
    height: 150px;
    animation: float 4s ease-in-out infinite;
}

#comparison-host-container .host-dialogue {
    background-color: rgba(0,0,0,0.8);
    border: 2px solid var(--neon-cyan);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
    text-shadow: var(--text-glow);
    max-width: 80%;
    width: 100%;
}

.game-screen-layout {
    display: flex;
    justify-content: center; /* Center content when value board is on one side */
    align-items: flex-start;
    width: 100%;
    height: calc(100% - 200px); /* Full height minus host area */
    padding: 0 20px;
    box-sizing: border-box;
    position: relative; /* For absolute positioning of value board */
}

.value-board-container {
    display: flex;
    flex-direction: row; /* Changed to row to place columns next to each other */
    gap: 10px; /* Gap between columns */
    height: 100%;
    position: absolute; /* Position absolutely to one side */
    left: 20px; /* Align to the left */
    top: 0;
    justify-content: flex-start;
    padding-top: 10px; /* Add some padding from the top */
}

.value-column {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: rgba(0,0,0,0.4);
    padding: 10px;
    border-radius: 5px;
}

.value-item {
    padding: 2px 8px;
    font-family: 'Press Start 2P';
    font-size: 0.7rem;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.value-item.active {
    color: var(--dark-bg);
    background-color: var(--neon-cyan);
    text-shadow: none;
}

.value-item.eliminated {
    color: #555;
    background-color: #222;
    text-decoration: line-through;
}

.game-board {
    padding: 0;
    justify-content: flex-start;
    height: 100%;
    max-width: 700px; /* Constrain game board width */
    margin-left: 300px; /* Pushed game board further right to make space for two value columns */
    margin-top: -50px; /* Pushes the game board up */
}

.orbs-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px; /* Reduced gap between orbs */
    margin-top: 10px; /* Reduced margin */
    position: relative; /* Needed for shuffle animation children */
}

.orbs-grid.shuffling {
    pointer-events: none; /* Prevent clicks during shuffle */
}

.orb {
    width: 70px; /* Further reduced orb size */
    height: 70px; /* Further reduced orb size */
    background-image: url('../IMAGES/orb.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem; /* Reduced font size for numbers */
    font-family: 'Press Start 2P';
    color: white;
    text-shadow: 0 0 5px black, 0 0 10px black;
}

.orb:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px var(--neon-cyan));
}

.orb.selected {
    filter: drop-shadow(0 0 20px var(--neon-pink)) brightness(1.5);
    transform: scale(1.2);
}

.orb.opened {
    opacity: 0.5;
    cursor: default;
    filter: grayscale(1);
    visibility: hidden; /* Hide opened orbs to prevent them from taking up space */
}

.orb.hidden-player-orb {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.reveal-content-text, .reveal-value-text {
    font-size: 1.5rem;
    padding: 0 30px;
    opacity: 0;
    transform: translateY(20px);
}

.reveal-value-text {
    font-family: 'Press Start 2P';
    color: var(--neon-pink);
    font-size: 2.5rem;
    text-shadow: var(--text-glow);
}

.reveal-item-image {
    max-width: 200px;
    max-height: 200px;
    margin: 15px 0;
    opacity: 0;
    transform: scale(0.5);
    filter: drop-shadow(0 0 15px var(--neon-cyan));
}


.player-orb-container {
    position: absolute;
    bottom: 40px; /* Positioned above the host */
    right: 20px;
    text-align: center;
    z-index: 5; /* Ensure it's above game board but below modals */
}

.player-orb-container .orb {
    cursor: default;
}
.player-orb-container .orb:hover {
    transform: none;
    filter: drop-shadow(0 0 15px var(--neon-pink));
}

.message-area {
    font-size: 1.2rem; /* Adjusted font size */
    text-shadow: var(--text-glow);
    padding: 10px;
    min-height: 40px; /* Give it a minimum height to prevent layout shifts */
    flex-shrink: 0; /* Prevent the message area from shrinking */
}

.offer-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 0, 26, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    z-index: 20;
}

.offer-modal-content {
    border: 3px solid var(--neon-pink);
    box-shadow: var(--border-glow);
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    position: relative; /* Needed for host positioning */
}

.offer-host-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
}

.offer-host-container .host-image {
    width: 100px;
    height: 100px;
    animation: float 4s ease-in-out infinite;
}

.offer-host-container .host-dialogue {
    background-color: rgba(0,0,0,0.8);
    border: 2px solid var(--neon-cyan);
    padding: 15px;
    border-radius: 10px;
    text-shadow: var(--text-glow);
    max-width: 90%;
    width: auto;
}

.offer-value {
    font-family: 'Press Start 2P';
    font-size: 3rem;
    color: var(--neon-cyan);
    padding: 20px;
    border: 2px solid var(--neon-pink);
    border-radius: 10px;
    background: var(--dark-bg);
    box-shadow: var(--border-glow);
}

.offer-item-image {
    width: 150px;
    height: 150px;
    object-fit: contain;
    animation: float 4s ease-in-out infinite;
}

.offer-buttons {
    display: flex;
    gap: 20px;
}

.final-reveal {
    font-size: 2.5rem;
    color: var(--neon-pink);
    text-shadow: var(--text-glow);
}

.final-choice-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#comparison-reveal-container {
    opacity: 0;
    transform: translateY(30px);
    margin-top: 25px;
    padding: 20px;
    border: 2px dashed var(--neon-cyan);
    border-radius: 10px;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 80%;
    max-width: 500px;
    position: relative; /* For absolutely positioned children if needed */
}

#comparison-reveal-container h3 {
    margin: 0 0 10px 0;
    font-family: 'Press Start 2P';
    font-size: 1rem;
    color: var(--neon-cyan);
}

.comparison-orb-container {
    height: 70px; /* Reserve space for the orb */
}

.comparison-orb-container .orb {
    width: 70px;
    height: 70px;
}

.comparison-details {
    position: absolute;
    top: 55px; /* Position it where the orb was */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    opacity: 0; /* Initially hidden */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.comparison-item-image {
    max-width: 100px;
    max-height: 100px;
    margin-bottom: 10px;
}

.comparison-value {
    font-family: 'Press Start 2P';
    font-size: 1.5rem;
    color: var(--neon-pink);
    text-shadow: var(--text-glow);
}

.comparison-text {
    font-size: 1rem;
    color: var(--neon-cyan);
}

.play-again-button {
    position: absolute;
    bottom: 30px; /* Position it at the bottom of the screen */
}

.final-orbs {
    display: flex;
    gap: 50px;
    margin-top: 20px;
}

.final-orb-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.final-orb-choice .orb {
    cursor: pointer;
}

.final-orb-choice .orb:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px var(--neon-cyan));
}

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 100;
}

.confetti-piece {
    position: absolute;
    width: 15px;
    height: 15px;
    background-image: url('../IMAGES/confetti.png');
    background-size: contain;
    background-repeat: no-repeat;
    top: -20px;
    opacity: 0;
}

@keyframes flicker {
    0%, 100% {
        text-shadow: 0 0 10px var(--neon-pink), 0 0 20px var(--neon-pink), 0 0 40px #ff00ff;
        color: var(--neon-pink);
    }
    50% {
        text-shadow: 0 0 5px var(--neon-cyan), 0 0 10px var(--neon-cyan);
        color: var(--neon-cyan);
    }
}

@keyframes flash-animation {
    from {
        box-shadow: 0 0 10px var(--neon-pink), 0 0 20px var(--neon-pink);
    }
    to {
        box-shadow: 0 0 20px var(--neon-cyan), 0 0 30px var(--neon-cyan);
        background-color: var(--neon-cyan);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

#surprise-container {
    margin-top: 20px;
    padding: 20px;
    border: 3px solid var(--neon-purple);
    border-radius: 10px;
    background: radial-gradient(circle, var(--dark-bg) 50%, transparent 100%);
    box-shadow: 0 0 15px var(--neon-purple), 0 0 30px var(--neon-purple);
    color: var(--neon-purple);
    text-align: center;
    opacity: 0; /* Initially hidden */
    max-width: 400px;
}

#surprise-container h4 {
    margin: 0 0 10px 0;
    font-family: 'Press Start 2P';
    font-size: 1.1rem;
    color: var(--neon-purple);
    text-shadow: 0 0 10px var(--neon-purple);
}

#surprise-container img {
    max-width: 150px;
    max-height: 150px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px var(--neon-purple));
}

#surprise-container p {
    margin: 0;
    font-size: 1rem;
}