:root {
    --theme: #f0f8ff;
    --bg: #012542bf;
    font-family: "Cherry Bomb One";
}
body {
    display: flex;
    align-items: center;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
    background: var(--bg);
}
#play {
    position: absolute;
    opacity: 1;
    transition: 0.1s;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    grid-gap: 2em;
    align-items: center;
    justify-content: center;
    z-index: 9999;			
}
body.is-playing #play {
    opacity: 0;
    display: none;
}
#play button, .dialog button {
    color: var(--theme);
    background: var(--bg);
    font-size: 32px;
    padding: 0.5em 1.5em;
    border-radius: 16px;
    font-family: unset;
    align-items: center;
    display: flex;
    grid-gap: 0.375em;
    border: 2px solid var(--theme);
    cursor: pointer;
}
#background {
    position: absolute;
    max-width: 1000px;
    z-index: -1;
    mask: linear-gradient(90deg, transparent, black 5%, black 95%, transparent);
    transform: translate(0, -25%);
}
main {
    display: flex;
    align-items: center;
    flex-direction: column;
    align-self: stretch;
    flex-grow: 1;
}
main > header {
    align-self: stretch;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 0;
}
#play-area {
    flex-grow: 1;
    width: 100%;
    max-width: 700px;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    position: relative;
}
#play-area header {
    display: flex;
    justify-content: center;
    padding: 0.375em 0;
    align-self: stretch;
}
#play-area header > span {
    background: var(--bg);
    color: var(--theme);
    display: flex;
    align-items: baseline;
    grid-gap: 0.125em;
    padding: 0.25em;
    width: 120px;
    justify-content: center;
}#timer-bar-cont {
    display: inline-flex;
    width: 4em;
    height: 0.5em;
    overflow: hidden;
    align-self: center;
    transform: translateY(1px);
    position: relative;
    border-radius: 2px;
}
#timer-bar {
    display: inline-flex;
    height: 100%;
    width: 100%;
    border-radius: 2px;
    background: var(--theme);
    transition: transform 0.1s;
    transform-origin: left;			
}
#timer-bar + span {
    display: inline-flex;
    height: 100%;
    width: 2px;
    border-radius: 2px;
    background: var(--theme);
    position: absolute;
}
#board {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25em;
    margin: 25% 0;
    align-self: stretch;
    flex-wrap: wrap;
    border: none;
    padding: 0;
}
.is-playing .tuna-button {
    opacity: 1;
}
.tuna-button {
    content: "";
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30%;
    opacity: 0;
    transition: opacity 0.2s;
    position: relative;
    background: none;
    border: none;
}

.tuna-button::after {
    content: "";
    background-image: url(/games/tunea/sprites/tuna-a.png);
    background-size: cover;
    background-position: right;
    display: inline-flex;
    height: 100px;
    width: 100px;
    clip-path: ellipse(50% 45%);
    backdrop-filter: blur(2px);
    transition: background-image 0.2s;
}
.tuna-button.light::after {
    animation: light 1s backwards 1 ease-in-out;
    background-image: url(/games/tunea/sprites/tuna-b.png);
}
@keyframes light {
    0% {
        filter: none;
    }
    10% {
        filter: drop-shadow(0 4px 12px var(--theme)) drop-shadow(0 -4px 12px var(--theme));
    }
    90% {
        filter: drop-shadow(0 4px 12px var(--theme)) drop-shadow(0 -4px 12px var(--theme));
   }
    100% {
        filter: none;
    }
}
h1 {
    color: var(--theme);
    background: linear-gradient(90deg, transparent, var(--bg) 25%, var(--bg) 75%, transparent);
    flex-grow: 1;
    text-align: center;
    padding: 0.25em;
    margin: 0 0.125em;
    max-width: 700px;
    font-weight: 400;
    font-size: 50px;
}
audio {
    position: fixed;
    top: -999999px;
    left: -999999px;
    height: 1px;
    width: 1px;
}
.dialog {
    background: var(--bg);
    backdrop-filter: blur(5px);
    color: var(--theme);
    font-family: monospace;
    font-size: 24px;
    font-weight: 600;
    padding: 2em 3em;
    padding-bottom: 5em;
    text-align: center;
    flex-direction: column;
    align-items: center;
    position: absolute;
    display: none;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    transition: opacity 0.2s;
    z-index: 99999;
    @starting-style {
        opacity: 0;
    }
}
.show-instructions .dialog {
    display: flex;
    opacity: 1;			
}
.dialog section {
    display: flex;
    flex-direction: column;
    align-items: center;
    grid-gap: 3em;
}
.dialog ul {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    grid-gap: 3em;
}
.dialog li {
    padding: 2.5em;
    width: 174px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--theme);
    display: flex;
    flex-direction: column;
    align-items: center;
    grid-gap: 1.25em;
}
.dialog a:link,
.dialog a:visited
.dialog a:hover
.dialog a:active {
    color: var(--theme);
}
.tuna-demo {
    display: flex;
}
.tuna-demo .tuna-button {
    flex-grow: 1;
    opacity: 1;
}
p .tuna-button {
    height: 100px;
    width: 100px;
    opacity: 1;
}

.dead-demo .tuna-button::after {
    animation: dead 3s 1s backwards infinite;
}

@keyframes dead {
    0% {
        background-image: url(/games/tunea/sprites/tuna-b.png);
    }
    16% {
        background-image: url(/games/tunea/sprites/tuna-c.png);
    }
    32% {
        background-image: url(/games/tunea/sprites/tuna-c.png);
    }
    33% {
        background-image: url(/games/tunea/sprites/tuna-b.png);
    }
    100% {
        background-image: url(/games/tunea/sprites/tuna-b.png);
    }
}

.is-game-over .tuna-button {
    opacity: 1;
}

.is-game-over #board .tuna-button::after {
    background-image: url(/games/tunea/sprites/tuna-c.png);
}
.is-game-over #board .tuna-button:nth-child(2)::after,
.is-game-over #board .tuna-button:nth-child(4)::after,
.is-game-over #board .tuna-button:nth-child(5)::after {
    transition-delay: 0.1s;
}
.is-game-over #board .tuna-button:nth-child(3)::after,
.is-game-over #board .tuna-button:nth-child(6)::after,
.is-game-over #board .tuna-button:nth-child(7)::after,
.is-game-over #board .tuna-button:nth-child(8)::after,
.is-game-over #board .tuna-button:nth-child(9)::after {
    transition-delay: 0.2s;
}

@media only screen and (max-width: 700px) {
    h1 {
        background: var(--bg);
        margin: 0;
    }
    #play-area {
        max-height: unset;
    }
}
