:root {
    --controlsHeight: 260px;
    --stagePaddingPercent: 5;
    --cardWidth: 672;
    --cardHeight: 936;
    touch-action: manipulation;
}

/* Optional: If gaps persist in specific orientations, add media queries as fallback */
@media (orientation: portrait) {
  body {
    min-height: calc(100dvh + env(safe-area-inset-top) + env(safe-area-inset-bottom));
  }
}

@media (orientation: landscape) {
  body {
    min-width: calc(100dvw + env(safe-area-inset-left) + env(safe-area-inset-right));
  }
}

div#background {
    background-image: url('https://cards.scryfall.io/art_crop/front/8/f/8fa46d54-563d-4b5c-9c69-5ab37dd529b3.jpg?1686963714');
    width: 150vmax;
    height: 150vmax;
    filter: blur(2rem) brightness(0.6) contrast(3);
    background-size: cover;
    left: -25vmax;
    top: -25vmax;
    position: absolute;
    z-index: -1;
    animation: rotateBackground 200s linear infinite;
    transform-origin: center;
    overflow: hidden;
    will-change: transform;
}

@keyframes rotateBackground {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

div#game {
    display: flex;
    flex-direction: column;
    height: 100dvh; 
    width: 100%;
    overflow: hidden;
    position: relative;
}

#canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 0; }

div#controls {
    height: var(--controlsHeight);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 3fr;
    align-items: center;
    gap: 2rem;
    padding: 0 2rem;
    background-image: linear-gradient(to bottom, rgba(0,0,0,0) -20%, rgba(0,0,0,1) 50%);
    z-index: 1;
}

.card {
    position: absolute;
    display: block;
    aspect-ratio: var('--cardWidth') / var('--cardHeight');
    z-index: 0;
    will-change: transform;
}

#playerInfo {
    position: absolute;
    color: #FFF;
    opacity: 0.8;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

#playerInfo #playerName {
    font-size: clamp(1.5rem, 5vw, 4rem);
    font-weight: bold;
    line-height: 1;
}

#playerInfo #playerTime {
    font-size: clamp(3rem, 15vw, 15rem); 
    font-weight: bold;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.expired {
    color: crimson !important;
}

button {
    height: 80%;
    background-color: transparent;
    border-radius: 2rem; 
    line-height: 1;
    border: 2px solid #444;
    cursor: pointer;
}

button#btnKill {
    grid-column: 1;
    position: relative;
    overflow: hidden; 
    display: grid;
    place-items: center;
}

    button#btnKill #btnKillImg {
        position: absolute;
        width:  195px;
        height: 195px;
        object-fit: contain;
        pointer-events: none;
        z-index: 2;
    }

    button#btnKill #btnKillImgJaw {
        position: absolute;
        width:  195px;
        height: 195px;
        object-fit: contain;
        pointer-events: none;
        z-index: 1;
    }

button#btnPass {
    grid-column: 2;
    width: auto;
    color: #DDD;
    font-size: clamp(1vw, calc(50vw / (var(--len, 10) * 0.5)), 5em);
    font-weight: bold;    
}

#pauseOverlay {
    --contentOpacity: 0.7;
    position: absolute;
    inset: 0;
    z-index: 1000;
    transform: translateZ(0);
    background-color: rgb(0 0 0 0);
    display: flex;
    justify-content: center;
    align-items: center;
}

#pauseOverlay span#pauseDuration {
    font-size: 12rem;
    opacity: 0;
    color: #FFF;
    font-weight: bold;
}