:root {
    --board-width: 600px;
    --background-color: #121212;
    --board-bg: #333;
    --cell-bg: #444;
    --text-color: #ffffff;
    --score-bg: #222;
    --accent-color: #4a90e2;
    --off-bit-bg: #555;
    --on-bit-bg: #50e3c2;
    --on-bit-text: #000;
    --selector-color: #f5a623;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 20px;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: var(--board-width);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

h1 {
    font-size: 3rem;
    font-weight: bold;
    color: #eee;
}

.scores-container {
    display: flex;
    gap: 10px;
}

.score-box {
    background-color: var(--score-bg);
    padding: 10px 20px;
    border-radius: 8px;
    text-align: center;
    min-width: 80px;
}

.score-box h2 {
    margin: 0;
    font-size: 0.9rem;
    color: #ccc;
}

.score-box p {
    margin: 5px 0 0;
    font-size: 1.5rem;
    font-weight: bold;
}

main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#target-display h2, #current-value-display h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: normal;
}

#target-number, #current-value {
    font-weight: bold;
    color: var(--accent-color);
    padding: 0 5px;
}

#place-values {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    width: 100%;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    width: 100%;
    height: 65px;
    position: relative;
}

.place-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #aaa;
    text-align: center;
}

.bit-tile {
    background-color: var(--off-bit-bg);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    font-weight: bold;
    transition: background-color 150ms ease, color 150ms ease;
}

.bit-tile.on {
    background-color: var(--on-bit-bg);
    color: var(--on-bit-text);
}

#selector {
    position: absolute;
    bottom: -12px; /* Position it below the tiles */
    width: calc(100% / 8);
    height: 5px;
    background-color: var(--selector-color);
    border-radius: 2px;
    transition: left 150ms ease-in-out;
}

#selector.no-transition {
    transition: none;
}


#instructions {
    margin-top: 20px;
    max-width: var(--board-width);
    background-color: var(--score-bg);
    padding: 20px;
    border-radius: 8px;
}

#instructions h2 {
    margin-top: 0;
}

@keyframes flash {
  50% {
    transform: scale(0.9);
    opacity: 0.7;
    background-color: var(--accent-color);
  }
}

.bit-tile.resetting {
  animation: flash 400ms ease-in-out;
}
