* {
    user-select: none;
}

html, body, #game-container, #game {
    height: 100%;
    margin: 0;
    background-color: black;
    font-family: sans-serif;
}

.grid {
    display: grid;
    grid-template-columns: repeat(40, 1fr);
    aspect-ratio: 1;
    width: 100vmin;
    height: 100vmin;
}

.grid-cell {
    aspect-ratio: 1;
    outline: .5px solid rgba(255, 255, 255, .5);
}

#game {
    display: flex;
    align-items: center;
    justify-content: center;
    outline: 1px solid rgba(255, 255, 255, .5);
}

.grid-cell-state-1:hover {
    background-color: rgba(255, 255, 255, .25);
}

.grid-cell-state-1:active, .grid-cell-state-1:focus {
    background-color: rgba(255, 255, 255, .5);
}

.grid-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5vmin;
}

.grid-cell-state-2 {
    background-color: rgba(255, 0, 0, .25);
}

.grid-cell-state-3 {
    background-color: rgba(0, 255, 0, .25);
}

.grid-cell-state-4 {
    background-color: rgba(255, 0, 0, .1);
    color: rgba(255, 255, 255, .5);
}

.grid-cell-state-5 {
    background-color: rgba(0, 255, 0, .1);
    color: rgba(255, 255, 255, .5);
}

.grid-cell-state-0 {
    outline: .5px solid rgba(255, 255, 255, .2);
}

.grid-cell-last {
    outline: 1px solid rgba(255, 255, 0, 1);
}

#notification, #menu {
    width: 100%;
    background-color: #333;
    color: white;
    padding: 20px 50px;
    box-shadow: 0 0 50px 10px black;
}

#notification-container, #menu-container {
    pointer-events: none;
    opacity: 0;
    transition: 200ms opacity;
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, .5);
    z-index: 2;
}

#notification-container.show {
    opacity: 1;
    pointer-events: initial;
}

#score-container {
    display: grid;
    grid-template-columns: 1fr .5fr 1fr;
    grid-gap: 20px;
    width: max-content;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.score-section-title {
    font-size: 48px;
    margin-bottom: 10px;
}

.score-section-score {
    font-size: 20px;
}

.score-section-title-x, .score-indicator-title-x, .start-title-x {
    color: #ffb3b3;
}

.score-section-title-o, .score-indicator-title-o, .start-title-o {
    color: #b3ffb3;
}

.score-section-score-emphasis, .score-indicator-emphasis {
    font-weight: bold;
    color: #ffff80;
}

.score-section-add, #start-notice {
    margin-top: 10px;
    opacity: .75;
    font-size: 12px;
}

#indicator {
    position: fixed;
    top: 10px;
    left: 10px;
    background: #222;
    color: white;
    border-radius: 5px;
    z-index: 1;
}

#turn-indicator, #demo-indicator {
    font-weight: bold;
    padding: 10px 20px;
    background: #333;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    border-bottom: 1px solid #111;
    text-align: center;
}

.score-indicator {
    padding: 5px 20px;
    display: grid;
    grid-template-columns: max-content 1fr;
    grid-gap: 10px;
}

.score-indicator-score {
    text-align: right;
}

.score-indicator-section, .actions-section {
    padding: 5px 0;
}

.score-indicator-title {
    font-weight: bold;
}

.score-indicator-ready {
    background-color: #2d2d2d;
}

#start {
    text-align: center;
}

#start-title {
    font-size: 48px;
    margin-bottom: 10px;
}


.action {
    padding: 5px 20px;
    cursor: pointer;
}

.action:hover {
    background-color: #2d2d2d;
}

.actions-section {
    border-top: 1px solid #111;
    background-color: #171717;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

#menu-container:not(.hide) {
    pointer-events: initial;
    opacity: 1;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
}

#menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-gap: 10px;
    margin-top: 20px;
}

.menu-grid-item {
    cursor: pointer;
    padding: 10px;
    border: 1px solid #222;
    border-radius: 10px;
    text-align: center;
}

.menu-grid-item:hover {
    background-color: #2c2c2c;
}

.menu-grid-item:active, .menu-grid-item:focus {
    background-color: #272727;
}