/* Cards over the canvas. Mid-century cut-paper: paper, ink, one red. */
:root {
    --ink: #221e1b;
    --paper: #ebe2d3;
    --red: #dd3222;
    --cream: #f4ecdf;
    --font: 'Jost', 'Futura', 'Century Gothic', 'Avenir Next', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    overscroll-behavior: none;
}

#stage, #playfield {
    position: fixed;
    inset: 0;
    touch-action: none;
}

#safe-probe {
    position: fixed;
    visibility: hidden;
    pointer-events: none;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* #app sits over the canvas but lets taps through except on cards. */
#app {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.scrim {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background: rgba(235, 226, 211, 0.9);
    pointer-events: auto;
    animation: fade .18s ease-out;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(340px, 100%);
    text-align: center;
    animation: drop .28s cubic-bezier(.2, 1.4, .4, 1);
}

.card-mole {
    width: 46%;
    max-width: 170px;
    filter: drop-shadow(0 3px 0 rgba(34, 30, 27, .12));
}

.logo {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: .95;
    font-weight: 800;
    letter-spacing: .02em;
}

.logo span {
    display: inline-block;
    padding: .04em .22em .1em;
    font-size: clamp(44px, 15vw, 64px);
    clip-path: polygon(1% 4%, 99% 0, 100% 95%, 0 100%);
}

.logo-a { background: var(--ink); color: var(--cream); transform: rotate(-3deg); }
.logo-b { background: var(--red); color: var(--cream); transform: rotate(2deg) translateX(14px); margin-top: -4px; }

.tag {
    margin: 4px 0 6px;
    font-weight: 600;
    font-size: 17px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tag.loading { opacity: .6; animation: blink 1s steps(2) infinite; }

.stamp {
    margin: 0 0 6px;
    padding: .05em .3em .12em;
    background: var(--ink);
    color: var(--cream);
    font-size: clamp(34px, 11vw, 52px);
    font-weight: 800;
    white-space: nowrap;
    transform: rotate(-3deg);
    clip-path: polygon(0 3%, 100% 0, 99% 100%, 1% 96%);
}

.score { margin: 0; font-size: 20px; font-weight: 600; }
.score .num { font-size: 44px; font-weight: 800; color: var(--red); vertical-align: -4px; }
.best { margin: 0; font-weight: 600; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }

.btn {
    min-width: 200px;
    padding: 14px 28px 16px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: 800 24px/1 var(--font);
    letter-spacing: .08em;
    cursor: pointer;
    box-shadow: inset 0 0 0 4px var(--ink);
    clip-path: polygon(1% 0, 100% 3%, 99% 100%, 0 97%);
    transition: transform .08s;
}

.btn.primary { background: var(--ink); color: var(--cream); box-shadow: none; }
.btn:active { transform: scale(.94) rotate(-1deg); }
.btn:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }

.bob { animation: bob 1.4s ease-in-out infinite; }
.shake { animation: shake .5s ease-out; }

@keyframes fade { from { opacity: 0; } }
@keyframes drop { from { transform: translateY(-24px) scale(.96); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-2deg); } }
@keyframes shake { 20% { transform: translateX(-8px) rotate(-4deg); } 40% { transform: translateX(7px) rotate(3deg); } 60% { transform: translateX(-4px); } }
@keyframes blink { 50% { opacity: .25; } }

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    padding: 12px 16px;
    background: var(--red);
    color: var(--cream);
    z-index: 10;
}
#blazor-error-ui a { color: var(--cream); margin-left: 12px; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

@media (prefers-reduced-motion: reduce) {
    .bob, .shake, .card, .scrim { animation: none; }
}
