@font-face {
    font-family: 'RockSalt';
    src: url('fonts/RockSalt-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'RockSalt', sans-serif;
    background: #4dbbf4;
    color: #000;
    text-align: center;
}
label,input,button,select{
    font-family: 'RockSalt', sans-serif;
    font-size: clamp(16px, 6vw, 36px);
}
input,select{
    padding:0 10px;
}

#controls { margin-bottom: 16px; }

#phrase {
    font-size: 1.2rem;
    text-align: center;
}

#phrase span {
    opacity: 0.5;
    transition: opacity 0.08s linear;
}

#phrase span.active {
    opacity: 1;
    font-weight: 600;
    background:none;
    color:white;
}

#gridContainer {
    width: 90%;
    max-width: 90%;
    max-height:10vh;
}

#grid {
    width: 100%;
    display: grid;
    margin-top: 16px;
}
.cell {
    box-sizing: border-box;
    aspect-ratio: 1 / 1;    /* optional: keep square cells */
    width: 100%;
    border: 2px solid #409dcd;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fdcf0a;
    border-radius: 13px;
    transition: background 0.1s ease;
    max-height:20vh;

}
.thin-borders .cell{
    border-width: 0.2px;
    border-radius:3px;
}

.hit {background: #9a302b;}
.active { background:#ffffff}
.active.hit { background: #ff0000 !important; }
.label {margin-right: 4px; }


select, input  {
    color: #fff;
    cursor: pointer;
    background: #4dbbf4;
    border:none;
    border-radius:0.2em;
}

select:hover {
    background-color: transparent;
    color: white;
}

/* style the play button */
.btn span {
    background: #FFF;
    display: block;
    padding: 5px 15px;
    border-radius: 5px;
    border: 2px solid #000;
}
.btn:hover {
    box-shadow: 0 2px 0 #000, 0 2px 0 2px #9a302b;
}
.btn:active {
    top: 4px;
    padding-bottom: 0;
    box-shadow: 0 1px 0 #000;
}
.btn {
    position: relative;
    float: left;
    margin-right: 10px;
    text-transform: uppercase;
    color: #000;
    text-decoration: none;
    padding-bottom: 3px;
    border-radius: 5px;
    box-shadow: 0 2px 0 #000;
    transition: padding 0.1s, box-shadow 0.1s, top 0.1s;
    background-image: url('data:image/gif;base64,R0lGODlhBAAEA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kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAAQABAAAAgYEEpdoeQUAOw==');
}

/* style selects */
select option {
    color: gray;
    width: 310px;
    padding: 10px 15px;
    height: 20px;
    cursor: pointer;
}

select option:hover {
    padding-left: 25px;
    width: 270px;
    color: #EC6F66;
}

/* -----------------------------
   Loading Screen
----------------------------- */

#loading-screen {
    position: fixed;
    inset: 0;
    background: #4dbbf4; /* simpsons blue */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    z-index: 9999;
    isolation: isolate;
}

/* Bottom SVG */
#svg-bottom {
    position: absolute;
    bottom: -100%;
    left: 50%;
    transform: translate(-50%);
    width: 100%;
    animation: slideUp 1.1s ease-out forwards;
    z-index: 2; /* IN FRONT */
}

/* Side SVG */
#svg-side {
    position: absolute;
    left: -100%;
    top: 30%;
    width: 60%;
    max-width: 500px;
    animation: slideInLeft 1s ease-out forwards;
    animation-delay: 0.4s;
    z-index: 1; /* BEHIND */
}

/* Hide app initially */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes slideUp {
    to {
        bottom: 0;
    }
}

@keyframes slideInLeft {
    to {
        left: 33%;
    }
}

/* Iris transition */
#clip-layer {
    position: absolute;
    inset: 0;
    background: #4dbbf4;
    clip-path: circle(150vmax at 50% 50%);
    animation: none;
}

#loading-screen.closing #clip-layer {
    animation: irisClip 0.9s ease-in forwards;
}

@keyframes irisClip {
    to {
        clip-path: circle(0px at 50% 50%);
    }
}

#iris-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300vmax;
    height: 300vmax;
    border-radius: 50%;
    border: 50px solid white;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}

#loading-screen.closing #iris-ring {
    animation: irisRing 0.9s ease-in forwards;
}

@keyframes irisRing {
    to {
        width: 0;
        height: 0;
        border-width: 0;
    }
}

/* Eyes anim */
.eyes, .brows {
    transform-origin: center;
    transform-box: fill-box;
    transition: transform 0.12s ease-out;
}
#sam {
    position:fixed;
    left:0;
    bottom: 0;
    width: 100vw;
    height: auto;
    pointer-events: none;
    transition: width 0.7s ease;
}
@media (min-width: 500px) {
    #svg-bottom {
        max-width:350px;
    }
}
#xmas {
    /* match it to sam */
    transition: bottom 0.7s ease, width 0.7s ease;
}
/* about box */
/* Closed state: question mark */
#about-toggle {
    position: fixed;
    left: 12px;
    bottom: 12px;

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 16px;
    font-weight: bold;

    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;

    cursor: pointer;
    z-index: 200;
}

/* Open state: info box */
#about-box {
    position: fixed;
    left: 12px;
    bottom: 48px;

    padding: 10px 12px;
    max-width: 220px;

    font-size: 12px;
    line-height: 1.4;

    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 8px;

    display: none;
    z-index: 200;
}
#metronome-toggle, #toggle-xmas {
    position: fixed;
    right: 12px;
    bottom: 12px;

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 16px;
    font-weight: bold;

    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;

    cursor: pointer;
    z-index: 200;
}
#metronome-toggle.active, #toggle-xmas.active{
    background: rgba(255, 255, 255, 1);
}
#metronome-toggle svg, #toggle-xmas svg{
    fill: rgba(255,255,255,0.6);
    height:20px;
}
#metronome-toggle.active svg,
#toggle-xmas.active svg{
    fill: black;
}
#toggle-xmas{
    display:none;
    right:43px;
}
