@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #333333;
    font-family: Arial, sans-serif;
    padding: 20px; /* Add some padding to prevent touching screen edges */
}

.game-container {
    width: 1400px;
    height: 600px;
    background-color: #f0f0f0;
    border: 2px solid #333;
    position: relative;
    overflow: visible; /* Changed from hidden to visible to allow popup to show */
    z-index: 1;
    margin-top: 20px; /* Reduced to match popup position */
    margin-left: 0; /* Reset left margin */
}

#scoreBar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background-color: #8B008B;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;  /* Add some spacing between characters */
}

.high-score {
    color: #FFD700;  /* Gold color for high score */
    text-shadow: 2px 2px 0 #000;  /* Add text shadow for better visibility */
}

canvas {
    display: block;
    background-color: #000000; /* Changed from sky blue to black */
    z-index: 0;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);  /* Reduced from 0.7 to 0.5 */
    color: white;
    text-align: center;
    z-index: 1;
}

.hidden {
    display: none;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.pixel-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 4em;
    color: #FFD700;
    text-shadow: 4px 4px 0 #000;
    letter-spacing: 4px;
    margin-bottom: 10px;
    text-transform: uppercase;
    line-height: 1.2;
    margin-top: -200px;
}

#winScreen .pixel-title {
    margin-top: 50px;
}

#gameOverScreen .pixel-title {
    font-size: 3em;
    color: #FF6B6B;
    margin-bottom: 10px;
    line-height: 1.4;
    text-align: center;
    transform: translateY(50px);
}

#gameOverScreen .pixel-title br {
    display: block;  /* Ensure the line break is visible */
    content: "";  /* Add content to the line break */
    margin-bottom: 10px;  /* Add some space between the lines */
}

#gameOverScreen .subtitle {
    font-size: 1.5em;
    color: #FFFFFF;
    margin-bottom: 20px;
    margin-top: 50px;
    text-shadow: 2px 2px 0 #000;
}

#gameOverScreen .subtitle.flashing {
    animation: flash 1.5s infinite;
}

#gameOverScreen .subtitle:not(.flashing) {
    animation: none;
}

#gameOverScreen .start-instruction:not(.hidden) + .subtitle {
    animation: none;
}

p {
    font-size: 1em;
    margin: 10px 0;
}

.wager-form {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 10px;
    margin: 10px auto;
    width: 80%;
    max-width: 400px;
    text-align: center;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.pixel-select {
    font-family: 'Press Start 2P', cursive;
    padding: 5px;
    margin: 5px 0;
    background: #000;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 5px;
    width: 100%;
}

.pixel-button {
    font-family: 'Press Start 2P', cursive;
    padding: 5px 10px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px 0;
    width: 100%;
}

.pixel-button:hover {
    background: #45a049;
}

.wager-form label {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8em;
    color: white;
    margin-bottom: 10px;
    display: block;
    font-weight: normal;
}

.payout-info {
    margin-top: 8px;
    font-size: 0.7em;
    color: #888;
    font-family: 'Press Start 2P', monospace;
    font-weight: normal;
}

.payout-info p {
    font-family: 'Press Start 2P', monospace;
    margin: 5px 0;
    font-weight: normal;
}

.wager {
    margin-left: 20px;
    color: #4CAF50;
}

.wallet {
    margin-left: 20px;
    color: #FFD700;  /* Gold color for wallet balance */
    text-shadow: 1px 1px 0 #000;
}

.results-container {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 300px;
    text-align: right;
    color: white;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7em;
}

.results-container p {
    margin: 10px 0;
    font-size: 0.9em;
    text-align: right;
}

.results-container .total-payout {
    font-size: 1.5em;  /* Reduced from 2em to 1.5em */
    color: #FFD700;  /* Gold color for emphasis */
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 15px;
    border-bottom: 2px solid #FFD700;  /* Add a separator line */
    padding-bottom: 10px;
    font-family: 'Press Start 2P', monospace;
    letter-spacing: 2px;
}

/* Add new style for total-payout outside results container */
.total-payout {
    font-size: 1.2em;
    color: #FFD700;
    text-shadow: 2px 2px 0 #000;
    margin: 10px 0;
    font-family: 'Press Start 2P', monospace;
    letter-spacing: 2px;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.5s forwards;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.results-container .breakdown {
    font-size: 0.8em;
    color: #FFFFFF;
    margin: 5px 0;
    text-align: right;
}

#gameOverScreen .wager-form {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

#gameOverScreen .start-instruction {
    margin-top: 20px;
    font-size: 1.2em;
    color: #4CAF50;
}

/* Popup Window Styles */
.popup-window {
    position: absolute;
    top: -350px;
    left: 0;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 10px;
    z-index: 1000;
    width: 500px;
    min-width: 300px;
    min-height: 200px;
    resize: both;
    overflow: auto;
    cursor: move;
    border-radius: 0;
}

/* Specific positioning for payout popup */
#payoutPopup {
    left: 900px;
    width: 500px;
    min-width: 300px;
    min-height: 200px;
}

#payoutPopup .wager-form p {
    color: white;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8em;
    margin: 10px 0;
}

#payoutPopup .popup-title {
    color: white;
    font-family: 'Press Start 2P', monospace;
    text-shadow: 2px 2px 0 #000;
    font-size: 1.2em;
    margin: 0;
    text-align: left;
}

.popup-header {
    padding: 5px;
    cursor: move;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-title {
    font-family: 'Press Start 2P', monospace;
    color: #FFD700;
    text-shadow: 2px 2px 0 #000;
    font-size: 1.2em;
    margin: 0;
    text-align: left;
}

.popup-close {
    background: none;
    border: none;
    color: #FFD700;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 5px;
}

.popup-content {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.popup-window .wager-form {
    background: rgba(0, 0, 0, 0.6);
    padding: 10px;
    border-radius: 10px;
    width: 100%;
    max-width: 100%;
}

.popup-window .pixel-select {
    font-family: 'Press Start 2P', cursive;
    padding: 5px;
    margin: 5px 0;
    background: #000;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 5px;
    font-size: 0.8em;
    width: 100%;
}

.popup-window .pixel-button {
    font-family: 'Press Start 2P', cursive;
    padding: 5px 10px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px 0;
    font-size: 0.8em;
    width: 100%;
}

.popup-window .payout-info {
    background: rgba(0, 0, 0, 0.4);
    padding: 8px;
    border-radius: 5px;
    width: 100%;
    text-align: center;
    font-size: 0.8em;
}

.popup-window .wager-form label {
    font-size: 0.8em;
}

@keyframes flash {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.start-instruction {
    margin-top: 20px;
    font-size: 1.2em;
    color: #4CAF50;
    animation: flash 1.5s infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-shadow: 2px 2px 0 #000;
    font-family: 'Press Start 2P', monospace;
    font-weight: normal;
}

.start-instruction + .start-instruction {
    margin-top: 60px; /* Increased from 40px to 60px for more space between lines */
}

#gameOverScreen .subtitle {
    font-size: 1.5em;
    color: #FFFFFF;
    margin-bottom: 20px;
    margin-top: 50px;
    text-shadow: 2px 2px 0 #000;
}

.subtitle {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.2em;
    color: #FFFFFF;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 30px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: -30px;
}

.payout-amount {
    color: #FFD700;
    text-shadow: 2px 2px 0 #000;
    margin-left: 10px;
}

#startScreen .pixel-title {
    transform: translateY(50px);
}

#startScreen .subtitle {
    margin-top: 50px;
}

.sound-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 15px;
    z-index: 100;
    opacity: 0.7;
}

.sound-toggle-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sound-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
}

.sound-toggle {
    background: none;
    border: none;
    width: 12px;
    height: 12px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-indicator {
    width: 8px;
    height: 8px;
    display: block;
    border-radius: 50%;
    background: #0f0;
    transition: all 0.2s ease;
}

.sound-toggle.muted .toggle-indicator {
    background: none;
    position: relative;
    width: 8px;
    height: 8px;
}

.sound-toggle.muted .toggle-indicator::before,
.sound-toggle.muted .toggle-indicator::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 2px;
    background: #f00;
    top: 3px;
    left: -1px;
}

.sound-toggle.muted .toggle-indicator::before {
    transform: rotate(45deg);
}

.sound-toggle.muted .toggle-indicator::after {
    transform: rotate(-45deg);
}

.higher-wager-info {
    margin: 20px 0;
    font-size: 18px;
    line-height: 1.5;
}

#dismissPopup {
    margin-top: 20px;
}

.higher-wager-box {
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid #4CAF50;
    border-radius: 5px;
    padding: 8px;
    width: 300px;
    margin: 0 auto;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
    position: relative;
    top: 50px;
}

.higher-wager-content {
    text-align: center;
}

.higher-wager-info {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    line-height: 1.2; /* Reduced from 1.5 */
    color: #4CAF50;
    margin-bottom: 5px; /* Reduced from 10px */
    text-shadow: 1px 1px 0 #000;
}

.higher-wager-info .wager-header {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: #4CAF50;
    margin-bottom: 5px; /* Reduced from 10px */
    text-shadow: 1px 1px 0 #000;
    line-height: 1.2; /* Reduced from 1.5 */
}

.higher-wager-info .wager-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0;
    padding: 0 20px;
}

.higher-wager-info .payout-amount {
    color: #FFD700;
    text-shadow: 1px 1px 0 #000;
    white-space: nowrap;
}

.higher-wager-info .wager-detail {
    color: #4CAF50;
    font-size: 8px;
    text-shadow: 1px 1px 0 #000;
    white-space: nowrap;
}

.pixel-button.small {
    font-size: 10px;
    padding: 2px 8px; /* Reduced from 3px */
    margin-top: 3px; /* Reduced from 5px */
} 