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

body {
    background-color: #000;
    color: #fff;
    font-family: 'Silkscreen', cursive;
    font-size: 12px;
    overflow: hidden;
    width: 100%;
    height: 100%;
    position: fixed;
}

#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #000;
}

#grid-container {
    position: relative;
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    gap: 0;
    background-color: #000;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cell {
    background-color: #000;
    transition: background-color 0.1s ease;
}

.cell.filled {
    background-color: #fff;
    border: 1px solid #000;
}

.cell.risked {
    background-color: #888;
    border: 1px solid #000;
}

.cell.temp {
    background-color: #444;
    border: 1px solid #000;
}

.cell.flash {
    animation: flashAnimation 0.2s ease;
}

@keyframes flashAnimation {
    0%, 100% { background-color: var(--original-color); }
    50% { background-color: var(--flash-color); }
}

.game-ball {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1000;
    transition: all 0.016s linear;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#instruction-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#instruction-overlay.hidden {
    display: none;
}

#instruction-text {
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

.main-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 12px;
}

@media (max-width: 768px) {
    .main-text {
        top: 33%;
    }
}

.controls-text {
    text-align: center;
    margin-top: 20px;
    padding: 0 20px;
    width: 100%;
    min-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.control-lines p {
    margin: 5px 0;
    white-space: nowrap;
}

.logo {
    position: absolute;
    top: 40px;
    left: 40px;
    font-size: 12px;
    margin: 0;
    padding: 0;
}

.difficulty-controls {
    position: absolute;
    bottom: 40px;
    left: 40px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.start-button {
    position: absolute;
    bottom: 40px;
    right: 40px;
    margin: 0;
    padding: 8px 16px;
}

.game-button {
    background: #fff;
    color: #000;
    border: 1px solid #fff;
    padding: 8px 16px;
    font-family: 'Silkscreen', cursive;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.game-button:hover, .game-button.selected {
    background: #000;
    color: #fff;
}

.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

#mute-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    z-index: 100;
    transition: opacity 0.2s ease;
    transform: scale(0.8);
    margin: 0;
}

#mute-button:hover {
    opacity: 0.7;
}

#mute-button.muted path:last-child {
    display: none;
}

.hidden {
    display: none !important;
}

.beta-tag {
    font-size: 8px;
    color: #666;
    vertical-align: super;
    margin-left: 2px;
}

#game-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    font-size: 24px;
}

#game-message.visible {
    display: flex;
}

#automation-panel {
    position: fixed;
    top: 20px;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #333;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1001;
    padding: 10px;
    font-family: 'Silkscreen', cursive;
    width: 320px;
}

#automation-panel .tab {
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #333;
    border-left: none;
    padding: 10px;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

#automation-panel.visible {
    transform: translateX(0);
}

.info-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 20px;
    height: 20px;
    background: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: #fff;
    z-index: 1002;
}

#automation-info {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1003;
}

#automation-info.hidden {
    display: none;
}

.info-content {
    background: #000;
    border: 1px solid #333;
    padding: 20px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.5;
}

.info-content h3 {
    margin-bottom: 15px;
    font-size: 14px;
}

.info-content p {
    margin-bottom: 10px;
}

.info-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.info-content li {
    margin: 5px 0;
}

.close-info {
    margin-top: 15px;
}

.panel-content {
    position: relative;
}

#automation-toggle {
    width: 100%;
    margin-top: 10px;
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 8px;
    cursor: pointer;
    font-family: 'Silkscreen', cursive;
    font-size: 12px;
}

#automation-toggle.active {
    background: #444;
}

.automation-row {
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #333;
    transition: background-color 0.3s ease;
}

.automation-row.triggered {
    animation: triggerFlash 0.4s ease;
}

@keyframes triggerFlash {
    0%, 100% { background-color: transparent; }
    50% { background-color: #333; }
}

.input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.input-group select {
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 4px;
    font-family: 'Silkscreen', cursive;
    font-size: 10px;
    width: 45px;
}

.streak-label, .continue-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    white-space: nowrap;
}

.streak-label input[type="checkbox"],
.continue-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    width: 12px;
    height: 12px;
    vertical-align: middle;
}

.input-group input[type="number"] {
    width: 50px;
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 4px;
    font-family: 'Silkscreen', cursive;
    font-size: 10px;
}

.input-group input[type="number"]:disabled,
.input-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.continue-label {
    margin-top: 0;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.results-graph {
    margin-top: 15px;
    border-top: 1px solid #333;
    padding-top: 15px;
    height: 60px;
    width: 100%;
}

#graph-canvas {
    width: 100%;
    height: 100%;
    background: #000;
}

.starting-bet-group {
  margin-top: 10px;
}