:root {
    --theme: #dabb71;
    --bg: #344918b0;
    font-family: "Rubik Gemstones";			
}
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;			
}
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);
    filter: saturate(0.85);
}
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;		
}

#board {
    display: flex;
    flex-grow: 1;
    align-self: stretch;			
}
#belly-bar-cont {
    display: inline-flex;
    width: 4em;
    height: 0.5em;
    overflow: hidden;
    align-self: center;
    transform: translateY(1px);
    position: relative;
    border-radius: 2px;
}
#belly-bar {
    display: inline-flex;
    height: 100%;
    width: 100%;
    border-radius: 2px;
    background: var(--theme);
    transition: transform 0.1s;
    transform-origin: left;			
}
#belly-bar + span {
    display: inline-flex;
    height: 100%;
    width: 2px;
    border-radius: 2px;
    background: var(--theme);
    position: absolute;
}
.worm-hole {
    position: absolute;
    color: var(--theme);
    background-size: contain;
    padding: 0.25em;
    height: 32px;
    width: 32px;
    display: inline-flex;
}
.worm-hole::before {
    content: "";
    background-size: contain;
    position: absolute;
    animation: wiggle 10s ease-in-out;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;							
}
.worm-hole.is-green::before {
    animation: green 10s ease-in-out;
}
.worm-hole.is-purple::before {
    animation: purple 10s ease-in-out;
}
.worm-hole.is-dud::before {
    animation: dud 10s ease-in-out;
}
.worm-hole.is-hit::before {
    animation: blink 0.05s ease-in-out alternate forwards;
    animation-iteration-count: 7 !important;
    background-image: url("/games/wormeater/sprites/base-c.png");						
}
.worm-hole.is-hit::after {
    content: "+1";
    color: var(--theme);
    background-color: var(--bg);
    display: inline-flex;
    animation: points 3s forwards ease-out 1;
    border-radius: 4px;
    position: absolute;
}
.worm-hole.is-purple.is-hit::after {
    content: "+2";
}
.worm-hole.is-green.is-hit::after {
    content: "+3";
}
@keyframes blink {
    from {
        opacity: 1;
    }	to {
   opacity: 0;				
    }			
}
@keyframes points {
    from {

    }
    50% {
        transform: translateX(-3px) translateY(-15px) scale(.9);
        opacity: 1;				
    }
    100% {
        transform: translateX(-10px) translateY(-20px) scale(.7);
        opacity: 0;				
    }			
}
@keyframes wiggle {
    0% {  
        background-image: url('/games/wormeater/sprites/base-a.png');
    }
    2.5% {  
        background-image: url('/games/wormeater/sprites/base-b.png');
    }
    5% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    25% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    30% {  
        background-image: url('/games/wormeater/sprites/eye.png');
    }
    37.5% {  
        background-image: url('/games/wormeater/sprites/eye.png');
    }
    40% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    47.5% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    50% {  
        background-image: url('/games/wormeater/sprites/tail-a.png');
    }
    52.5% {  
        background-image: url('/games/wormeater/sprites/tail-b.png');
    }
    55% {  
        background-image: url('/games/wormeater/sprites/wiggle-a.png');
    }
    57.5% {  
        background-image: url('/games/wormeater/sprites/wiggle-b.png');
    }
    60% {  
        background-image: url('/games/wormeater/sprites/wiggle-a.png');
    }
    62.5% {  
        background-image: url('/games/wormeater/sprites/wiggle-b.png');
    }
    65% {  
        background-image: url('/games/wormeater/sprites/wiggle-a.png');
    }
    67.5% {  
        background-image: url('/games/wormeater/sprites/tail-b.png');
    }
    70% {  
        background-image: url('/games/wormeater/sprites/tail-a.png');
    }
    72.5% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    75% {  
        background-image: url('/games/wormeater/sprites/base-b.png');
    }
    77.5% {  
        background-image: url('/games/wormeater/sprites/base-a.png');
    }
    95% {  
        background-image: url('/games/wormeater/sprites/base-a.png');
        opacity: 1;
    }
    100% {  
        opacity: 0;
    }
}
@keyframes green {
    0% {  
        background-image: url('/games/wormeater/sprites/base-a.png');
    }
    2.5% {  
        background-image: url('/games/wormeater/sprites/base-b.png');
    }
    5% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    25% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    30% {  
        background-image: url('/games/wormeater/sprites/eye.png');
    }
    37.5% {  
        background-image: url('/games/wormeater/sprites/eye.png');
    }
    40% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    47.5% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    50% {  
        background-image: url('/games/wormeater/sprites/tail-a-green.png');
    }
    52.5% {  
        background-image: url('/games/wormeater/sprites/tail-b-green.png');
    }
    55% {  
        background-image: url('/games/wormeater/sprites/wiggle-a-green.png');
    }
    57.5% {  
        background-image: url('/games/wormeater/sprites/wiggle-b-green.png');
    }
    60% {  
        background-image: url('/games/wormeater/sprites/wiggle-a-green.png');
    }
    62.5% {  
        background-image: url('/games/wormeater/sprites/wiggle-b-green.png');
    }
    65% {  
        background-image: url('/games/wormeater/sprites/wiggle-a-green.png');
    }
    67.5% {  
        background-image: url('/games/wormeater/sprites/tail-b-green.png');
    }
    70% {  
        background-image: url('/games/wormeater/sprites/tail-a-green.png');
    }
    72.5% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    75% {  
        background-image: url('/games/wormeater/sprites/base-b.png');
    }
    77.5% {  
        background-image: url('/games/wormeater/sprites/base-a.png');
    }
    95% {  
        background-image: url('/games/wormeater/sprites/base-a.png');
        opacity: 1;
    }
    100% {  
        opacity: 0;
    }
}
@keyframes purple {
    0% {  
        background-image: url('/games/wormeater/sprites/base-a.png');
    }
    2.5% {  
        background-image: url('/games/wormeater/sprites/base-b.png');
    }
    5% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    25% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    30% {  
        background-image: url('/games/wormeater/sprites/eye.png');
    }
    37.5% {  
        background-image: url('/games/wormeater/sprites/eye.png');
    }
    40% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    47.5% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    50% {  
        background-image: url('/games/wormeater/sprites/tail-a-purple.png');
    }
    52.5% {  
        background-image: url('/games/wormeater/sprites/tail-b-purple.png');
    }
    55% {  
        background-image: url('/games/wormeater/sprites/wiggle-a-purple.png');
    }
    57.5% {  
        background-image: url('/games/wormeater/sprites/wiggle-b-purple.png');
    }
    60% {  
        background-image: url('/games/wormeater/sprites/wiggle-a-purple.png');
    }
    62.5% {  
        background-image: url('/games/wormeater/sprites/wiggle-b-purple.png');
    }
    65% {  
        background-image: url('/games/wormeater/sprites/wiggle-a-purple.png');
    }
    67.5% {  
        background-image: url('/games/wormeater/sprites/tail-b-purple.png');
    }
    70% {  
        background-image: url('/games/wormeater/sprites/tail-a-purple.png');
    }
    72.5% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    75% {  
        background-image: url('/games/wormeater/sprites/base-b.png');
    }
    77.5% {  
        background-image: url('/games/wormeater/sprites/base-a.png');
    }
    95% {  
        background-image: url('/games/wormeater/sprites/base-a.png');
        opacity: 1;
    }
    100% {  
        opacity: 0;
    }
}
@keyframes dud {
    0% {  
        background-image: url('/games/wormeater/sprites/base-a.png');
    }
    2.5% {  
        background-image: url('/games/wormeater/sprites/base-b.png');
    }
    5% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    25% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    30% {  
        background-image: url('/games/wormeater/sprites/eye.png');
    }
    37.5% {  
        background-image: url('/games/wormeater/sprites/eye.png');
    }
    40% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    47.5% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    50% {  
        background-image: url('/games/wormeater/sprites/tail-a.png');
    }
    52.5% {  
        background-image: url('/games/wormeater/sprites/base-c.png');
    }
    55% {  
        background-image: url('/games/wormeater/sprites/base-b.png');
    }
    57.5% {  
        background-image: url('/games/wormeater/sprites/base-a.png');
    }
    95% {  
        background-image: url('/games/wormeater/sprites/base-a.png');
        opacity: 1;
    }
    100% {  
        opacity: 0;
    }
}
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: 159px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--theme);
    display: flex;
    flex-direction: column;
    align-items: center;
    grid-gap: 1.25em;
}
.dialog .worm-hole {
    position: relative;
}
.dialog .worm-hole::before {
    animation-iteration-count: infinite;
}
.wiggle-demo::before {
    animation: wiggle-demo 0.25s alternate infinite ease-in-out;
}
.purple-demo::before {
    animation: purple-demo 0.25s alternate infinite ease-in-out;
}
.green-demo::before {
    animation: green-demo 0.25s alternate infinite ease-in-out;
}
.eye-demo::before {
    animation: eye-demo 3s infinite ease-in-out;
}
.dud-demo::before {
    animation: dud-demo 3s infinite ease-in-out;
}
.dialog a:link,
.dialog a:visited
.dialog a:hover
.dialog a:active {
    color: var(--theme);
}

p .worm-hole {
    transform: translateY(10px);
}
@keyframes wiggle-demo {
    from {
        background-image: url('/games/wormeater/sprites/wiggle-a.png');
    }
    to {
        background-image: url('/games/wormeater/sprites/wiggle-b.png');
    }
}
@keyframes purple-demo {
    from {
        background-image: url('/games/wormeater/sprites/wiggle-a-purple.png');
    }
    to {
        background-image: url('/games/wormeater/sprites/wiggle-b-purple.png');
    }
}
@keyframes green-demo {
    from {
        background-image: url('/games/wormeater/sprites/wiggle-a-green.png');
    }
    to {
        background-image: url('/games/wormeater/sprites/wiggle-b-green.png');
    }
}
@keyframes eye-demo {
    0% {
        background-image: url(/games/wormeater/sprites/base-c.png);
    }
    12.5% {
        background-image: url(/games/wormeater/sprites/eye.png);
    }
    50% {
        background-image: url(/games/wormeater/sprites/eye.png);
    }
    67.5% {
        background-image: url(/games/wormeater/sprites/base-c.png);
    }
    100% {
        background-image: url(/games/wormeater/sprites/base-c.png);
    }
}
@keyframes dud-demo {
    0% {
        background-image: url(/games/wormeater/sprites/base-c.png);
    }
    12.5% {
        background-image: url(/games/wormeater/sprites/tail-a.png);
    }
    50% {
        background-image: url(/games/wormeater/sprites/base-c.png);
    }
    100% {
        background-image: url(/games/wormeater/sprites/base-c.png);
    }
}
@media only screen and (max-width:700px) {
    h1 {
        background:	var(--bg);
        margin: 0;		
    }
    #play-area {
        max-height: unset;				
    }
}