/* Nemam di parkirat (/nemam-di-parkirat): a jammed parking lot seen from above. A stage as tall as the screen: the place's picture
   behind, the top bar, Bubi and the meters, the lot framed in yellow-black hazard stripes on its ground, the round buttons at the
   bottom. Every vehicle is a button on whole cells with an arrow on its roof (owner, 4 Dec 2026: "that simple game, where u
   untangle all the cars, that have pointing arrows where they will move"). The site squares every button's and image's corners
   (news.css): the round pieces here are .rounded-circle or carry three classes. The lot takes no scroll or zoom gestures while a
   finger is on a car. */
.pk {
    --pk-ink: #16171c;
    --pk-orange: #ff8a1e;
    --pk-orange-dark: #d9600c;
    --pk-yellow: #ffc93c;
    --pk-blue: #1565c0;
    --pk-asphalt: #33363d;
    --pk-cream: #fffaf0;
    --pk-red: #e63b2e;
    --pk-muted: #5d6170;
    --pk-rim: 9px;
    color: var(--pk-ink);
}

.pk [hidden] {
    display: none !important;
}

html:has(body.parking-page),
body.parking-page {
    overflow-x: hidden;
    scrollbar-width: none;
}

html:has(body.parking-page)::-webkit-scrollbar,
body.parking-page::-webkit-scrollbar {
    display: none;
}

/* A phone: the site's header scrolls away above the game, so the stage can have the whole screen. */
@media (max-width: 767.98px) {
    .parking-page .app-header {
        position: relative;
    }
}

/* ---------- the stage ---------- */

.pk-stage {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    height: var(--pk-height, 100svh);
    min-height: 520px;
    margin: 0 auto;
    padding: 0 10px 10px;
    background: linear-gradient(165deg, var(--pk-from, #1fb6c9), var(--pk-to, #f3e6c8));
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.pk-stage > :not(.pk-bg):not(.pk-shade):not(.pk-done):not(.pk-milestone):not(.pk-travel):not(.pk-map):not(.pk-picking) {
    width: min(100%, calc(560px * var(--pk-ui, 1)));
}

/* The place's picture breathes: a slow soft zoom in and out on its own graphics layer (as every game's background). */
.pk-bg {
    position: absolute;
    inset: 0;
    z-index: -3;
    background:
        var(--pk-picture, none) center / cover no-repeat,
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.28), transparent 46%),
        linear-gradient(165deg, var(--pk-from, #1fb6c9), var(--pk-to, #f3e6c8));
    transform: translateZ(0) scale(1.02);
    transform-origin: 50% 50%;
    backface-visibility: hidden;
    animation: pk-breathe 18s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes pk-breathe {
    from { transform: translateZ(0) scale(1.02); }
    to { transform: translateZ(0) scale(1.1); }
}

.pk-shade {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(180deg, rgba(10, 14, 24, 0.5) 0%, rgba(10, 14, 24, 0) 22%),
        linear-gradient(0deg, rgba(10, 14, 24, 0.42) 0%, rgba(10, 14, 24, 0) 24%);
    pointer-events: none;
}

/* ---------- the bar: the name, where we are, the dukati, the switches ---------- */

.pk-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
}

.pk-where {
    min-width: 0;
    color: #fff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.pk-title {
    margin: 0;
    line-height: 1;
}

.pk-title .games-home {
    color: inherit;
    text-decoration: none;
}

/* The name: the owner's logo (the parking sign's P and the words on the blue plate). */
.pk-logo {
    display: block;
    width: calc(118px * var(--pk-ui, 1));
    height: auto;
    filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35));
}

.pk-level {
    margin: 6px 0 0;
    font: 900 1.15rem/1.05 var(--news-font-head, inherit);
}

.pk-zone,
.pk-challenge {
    margin: 2px 0 0;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.92;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pk-challenge {
    color: var(--pk-yellow);
    text-transform: none;
    letter-spacing: 0;
}

.pk-tools {
    position: relative;
    display: grid;
    justify-items: end;
    gap: 6px;
    flex-shrink: 0;
}

.pk.pk .pk-coins {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
    padding: 3px 11px 3px 6px;
    color: #fff;
    background: rgba(22, 23, 28, 0.82);
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px !important;
    font-weight: 900;
}

.pk-switches {
    display: flex;
    gap: 5px;
}

.pk-switch,
.pk-today {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
}

.pk-switch img,
.pk-today img {
    width: 100%;
    height: 100%;
}

/* Today's lot: a small calendar under the switches, its dot until this browser cleared it (gone once cleared). */
.pk-today {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 40px;
    height: 40px;
}

.pk-today.is-done {
    display: none;
}

.pk.pk .pk-today-dot {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    background: var(--pk-red);
    border: 2px solid #fff;
    border-radius: 50% !important;
}

/* ---------- Bubi and the meters ---------- */

.pk-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.pk-host {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.pk-bubi {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.35));
    transition: transform 0.2s ease;
    cursor: pointer;
}

.pk-bubi.is-bob {
    animation: pk-bob 0.5s ease;
}

@keyframes pk-bob {
    40% { transform: translateY(-6px) rotate(-4deg); }
}

/* His line: a speech bubble that comes in, stays a few seconds and fades (a tap puts it away). */
.pk.pk .pk-line {
    position: relative;
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 6px 10px;
    color: var(--pk-ink);
    background: #fff;
    border: 2px solid var(--pk-ink);
    border-radius: 14px !important;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.22;
    cursor: pointer;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Three lines at most, cut inside the bubble's padding (a cut on the bubble itself showed a sliver of the fourth line in its
   padding). parking.js shrinks a long line first, so a line is cut only where even the smallest size cannot hold it. */
.pk-line > span {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pk-line::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 2px solid var(--pk-ink);
    border-bottom: 2px solid var(--pk-ink);
    transform: translateY(-50%) rotate(45deg);
}

.pk-line.is-in {
    animation: pk-line-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.pk-line.is-away {
    opacity: 0;
    transform: translateY(-4px);
}

@keyframes pk-line-in {
    from { opacity: 0; transform: scale(0.86); }
}

.pk-meters {
    display: grid;
    gap: 5px;
    flex-shrink: 0;
}

.pk.pk :is(.pk-crashes, .pk-left) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    min-width: 104px;
    padding: 3px 9px;
    color: #fff;
    background: linear-gradient(180deg, #2b2e35, #1c1e23);
    border: 2px solid #0e0f12;
    border-radius: 11px !important;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.pk-crashes span:last-child,
.pk-left span:last-child {
    display: grid;
    justify-items: end;
    line-height: 1;
}

.pk-crashes small,
.pk-left small {
    color: var(--pk-yellow);
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pk-crashes b,
.pk-left b {
    font: 900 1.12rem/1 var(--news-font-head, inherit);
}

.pk-crashes.is-hit {
    animation: pk-shake 0.4s ease;
}

.pk-stars {
    display: flex;
    gap: 1px;
}

.pk-stars i {
    width: 15px;
    height: 15px;
    background: #6f7380;
    clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 78%, 20% 100%, 30% 60%, 0 38%, 38% 35%);
    transition: background 0.3s ease;
}

.pk-stars i.is-on {
    background: var(--pk-yellow);
}

.pk-stars i.is-lost {
    animation: pk-star-lost 0.6s ease;
}

@keyframes pk-star-lost {
    30% { transform: scale(1.6) rotate(20deg); background: #fff; }
    100% { transform: scale(1); }
}

/* The road under the meters: how much of the lot is cleared, a car driving along it. */
.pk.pk .pk-road {
    position: relative;
    height: 9px;
    margin-top: 7px;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0 10px, transparent 10px 20px) center / 100% 2px no-repeat, #2a2c32;
    border: 2px solid #0e0f12;
    border-radius: 999px !important;
    overflow: hidden;
}

.pk-road-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: linear-gradient(90deg, var(--pk-orange), var(--pk-yellow));
    transition: width 0.5s cubic-bezier(0.3, 1.2, 0.5, 1);
}

/* ---------- the lot ---------- */

.pk-lot-wrap {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 0;
    margin-top: 6px;
}

/* The lot's frame: yellow-black hazard stripes round its ground, a drop under it. --pk-cell, --pk-cols and --pk-rows come from
   parking.js. */
.pk.pk .pk-lot {
    position: relative;
    width: calc(var(--pk-cols, 6) * var(--pk-cell, 40px) + 2 * var(--pk-rim));
    height: calc(var(--pk-rows, 8) * var(--pk-cell, 40px) + 2 * var(--pk-rim));
    background: repeating-linear-gradient(-45deg, var(--pk-yellow) 0 9px, #1c1d22 9px 18px);
    border: 2px solid #0e0f12;
    border-radius: 16px !important;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.32), 0 14px 30px rgba(0, 0, 0, 0.3);
    touch-action: manipulation;
}

.pk.pk .pk-floor {
    position: absolute;
    inset: calc(var(--pk-rim) - 2px);
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.34) 0 1.3px, transparent 1.6px) 0 0 / var(--pk-cell, 40px) var(--pk-cell, 40px),
        var(--pk-floor, none) 0 0 / calc(var(--pk-cell, 40px) * 3) repeat,
        var(--pk-asphalt);
    border-radius: 9px !important;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25), inset 0 6px 14px rgba(0, 0, 0, 0.25);
}

.pk-cars {
    position: absolute;
    inset: calc(var(--pk-rim) - 2px);
}

/* A vehicle: a button over its cells (its own box: one cell wide and as long as it is, or across), its picture turned the way
   its arrow points. The drop is on the button, which never turns, so it always falls down the screen. */
.pk.pk .pk-car {
    position: absolute;
    left: calc(var(--c) * var(--pk-cell, 40px));
    top: calc(var(--r) * var(--pk-cell, 40px));
    width: calc(var(--w) * var(--pk-cell, 40px));
    height: calc(var(--h) * var(--pk-cell, 40px));
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    filter: drop-shadow(0 calc(var(--pk-cell, 40px) * 0.07) calc(var(--pk-cell, 40px) * 0.04) rgba(0, 0, 0, 0.45));
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
}

.pk-car:focus-visible {
    outline: 3px solid var(--pk-yellow);
    outline-offset: 1px;
}

.pk-car.is-moving {
    z-index: 6;
}

.pk-car-body {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--pk-cell, 40px);
    height: calc(var(--len) * var(--pk-cell, 40px));
    transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
    pointer-events: none;
}

.pk-car-body > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* The arrow on the roof (the middle of the vehicle), turned with it: a raised sticker, white over a soft grey, a dark rim and its
   edge under it, a little shadow on the roof; over the car's shine. Now and then it leans the way it points (parking.js). */
.pk-arrow {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: calc(var(--pk-cell, 40px) * 0.46);
    height: calc(var(--pk-cell, 40px) * 0.46);
    transform: translate(-50%, -50%);
    background: url("/img/igrice/parking/ui/strelica.svg") center / contain no-repeat;
    filter: drop-shadow(0 calc(var(--pk-cell, 40px) * 0.025) calc(var(--pk-cell, 40px) * 0.02) rgba(0, 0, 0, 0.3));
}

/* A shine crossing a vehicle now and then, light sliding over its paint (owner, 4 Dec 2026: "like we got polish in kolo, when
   white overlay goes over now and then, and on idle"): a soft white band cut to the car's own picture (--sprite), from its
   tail to its nose. */
.pk-car-body::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    -webkit-mask: var(--sprite) center / contain no-repeat;
    mask: var(--sprite) center / contain no-repeat;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.82) 50%, rgba(255, 255, 255, 0) 62%) 0 140% / 100% 260% no-repeat;
    opacity: 0;
    pointer-events: none;
}

.pk-car-body.is-glint::after {
    animation: pk-shine 0.9s ease-out;
}

@keyframes pk-shine {
    0% { background-position: 0 140%; opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { background-position: 0 -40%; opacity: 0; }
}

.pk-car[style*="--len:1"] .pk-arrow {
    width: calc(var(--pk-cell, 40px) * 0.34);
    height: calc(var(--pk-cell, 40px) * 0.34);
}

/* A driver on a coffee break (the cup and how many must leave first) and the ambulance (the moves it has left): a tag on the
   vehicle's corner, never turned. */
.pk.pk .pk-tag {
    position: absolute;
    top: calc(var(--pk-cell, 40px) * -0.12);
    right: calc(var(--pk-cell, 40px) * -0.12);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-width: calc(var(--pk-cell, 40px) * 0.62);
    height: calc(var(--pk-cell, 40px) * 0.5);
    padding: 0 4px 0 2px;
    color: var(--pk-ink);
    background: #fff;
    border: 2px solid var(--pk-ink);
    border-radius: 999px !important;
    font: 900 calc(var(--pk-cell, 40px) * 0.3)/1 var(--news-font-head, inherit);
    pointer-events: none;
    z-index: 3;
}

.pk-tag img {
    width: calc(var(--pk-cell, 40px) * 0.34);
    height: calc(var(--pk-cell, 40px) * 0.34);
}

.pk.pk .pk-tag.is-ambulance {
    color: #fff;
    background: var(--pk-red);
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--pk-ink);
    animation: pk-siren 1s ease-in-out infinite;
}

.pk-tag.is-low {
    animation: pk-siren 0.45s ease-in-out infinite;
}

@keyframes pk-siren {
    50% { background: #2f7bff; }
}

.pk-car.is-waiting .pk-car-body {
    filter: saturate(0.6) brightness(0.92);
}

/* Bubi's whistle: the vehicle that can go glows and bounces. */
.pk-car.is-hint {
    animation: pk-hint 0.9s ease-in-out infinite;
    z-index: 5;
}

@keyframes pk-hint {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 201, 60, 0)) drop-shadow(0 3px 2px rgba(0, 0, 0, 0.45)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 9px rgba(255, 201, 60, 1)) drop-shadow(0 0 3px #fff); transform: scale(1.06); }
}

/* The tow truck picks a vehicle: they all wiggle a hair. */
.pk-stage.is-picking .pk-car {
    animation: pk-pick 0.6s ease-in-out infinite;
}

@keyframes pk-pick {
    25% { transform: rotate(-2deg); }
    75% { transform: rotate(2deg); }
}


/* Things standing in the lot: pictures over their cells. */
.pk-thing {
    position: absolute;
    left: calc(var(--c) * var(--pk-cell, 40px));
    top: calc(var(--r) * var(--pk-cell, 40px));
    width: calc(var(--w) * var(--pk-cell, 40px));
    height: calc(var(--h) * var(--pk-cell, 40px));
    padding: calc(var(--pk-cell, 40px) * 0.05);
    filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.4));
    pointer-events: none;
    z-index: 1;
}

.pk-thing img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* A thing that moves (a palm in the breeze, the fountain, the café's umbrella): its strip of frames, one after another, each
   thing at a moment of its own (--phase). */
.pk-thing.is-moving {
    background: var(--strip) 0 0 / 100% calc(var(--frames) * 100%) no-repeat;
    background-origin: content-box;
    background-clip: content-box;
    animation: pk-frames var(--seconds) steps(var(--frames), jump-none) var(--phase, 0s) infinite;
}

@keyframes pk-frames {
    from { background-position: 0 0; }
    to { background-position: 0 100%; }
}

/* ---------- effects: smoke, a bump, the drivers' shouts ---------- */

.pk-fx {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 8;
    overflow: visible;
}

/* The tyre smoke's layer: over the ground and the things, under the cars, so it comes out from under a car. */
.pk-fx.is-under {
    z-index: 1;
}

/* Smoke (the owner's set): one second of frames, played once, then gone. */
.pk-puff {
    position: absolute;
    width: calc(var(--pk-cell, 40px) * var(--size, 0.9));
    height: calc(var(--pk-cell, 40px) * var(--size, 0.9));
    margin: calc(var(--pk-cell, 40px) * var(--size, 0.9) * -0.5) 0 0 calc(var(--pk-cell, 40px) * var(--size, 0.9) * -0.5);
    background: var(--strip) 0 0 / 100% 2400% no-repeat;
    transform: rotate(var(--turn, 0deg)) scaleY(var(--flip, 1));
    animation: pk-frames 1s steps(24, jump-none) forwards;
}

/* The bump: the burst and a comic BOINK! over it (owner: "BOINK when u click wrongly"), popping and gone in 0.75 s. The word
   is as wide as the burst's yellow (92 % of it), its spikes round it. */
.pk-bump {
    position: absolute;
    display: grid;
    place-items: center;
    width: calc(var(--pk-cell, 40px) * 1.6);
    height: calc(var(--pk-cell, 40px) * 1.6);
    margin: calc(var(--pk-cell, 40px) * -0.8) 0 0 calc(var(--pk-cell, 40px) * -0.8);
    background: url("/img/igrice/parking/ui/bum.svg") center / contain no-repeat;
    animation: pk-bump 0.75s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
    z-index: 10;
}

.pk-bump b {
    font: 900 calc(var(--pk-cell, 40px) * 0.3) / 1 var(--news-font-head, sans-serif);
    color: #fff;
    letter-spacing: 0.02em;
    white-space: nowrap;
    -webkit-text-stroke: calc(var(--pk-cell, 40px) * 0.055) #1d2026;
    paint-order: stroke fill;
    text-shadow: 0 calc(var(--pk-cell, 40px) * 0.05) 0 #d6302a;
    transform: rotate(var(--tilt, -6deg));
}

@keyframes pk-bump {
    0% { transform: scale(0.2) rotate(-25deg); opacity: 1; }
    30% { transform: scale(1.16) rotate(6deg); opacity: 1; }
    45% { transform: scale(0.95) rotate(-2deg); }
    60% { transform: scale(1.03) rotate(0); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 0; }
}

.pk.pk .pk-say {
    position: absolute;
    padding: 3px 9px;
    color: var(--pk-ink);
    background: #fff;
    border: 2px solid var(--pk-ink);
    border-radius: 12px !important;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
    font: 900 0.8rem/1.15 var(--news-font-head, inherit);
    white-space: nowrap;
    transform: translate(-50%, -100%);
    animation: pk-say 1.6s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
    z-index: 9;
}

.pk-say::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-right: 2px solid var(--pk-ink);
    border-bottom: 2px solid var(--pk-ink);
    transform: translateX(-50%) rotate(45deg);
}

.pk-say.is-coffee {
    background: #fff4dc;
}

@keyframes pk-say {
    0% { opacity: 0; transform: translate(-50%, -80%) scale(0.6); }
    14% { opacity: 1; transform: translate(-50%, -100%) scale(1.06); }
    22% { transform: translate(-50%, -100%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -110%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -125%) scale(0.96); }
}

.pk-car.is-shaken {
    animation: pk-shake 0.38s ease;
}

@keyframes pk-shake {
    20% { transform: translateX(-3px) rotate(-2deg); }
    45% { transform: translateX(3px) rotate(2deg); }
    70% { transform: translateX(-2px) rotate(-1deg); }
}

.pk-lot.is-bumped {
    animation: pk-jolt 0.3s ease;
}

@keyframes pk-jolt {
    35% { transform: translate(1.5px, -1px); }
    70% { transform: translate(-1px, 1px); }
}

/* The tow truck's hook comes down, the car goes up. */
.pk-hook {
    position: absolute;
    width: 4px;
    margin-left: -2px;
    background: linear-gradient(90deg, #4a4d55, #8a8f99, #4a4d55);
    transform-origin: top center;
    z-index: 9;
}

.pk-hook::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -14px;
    width: 18px;
    height: 16px;
    margin-left: -9px;
    border: 4px solid #4a4d55;
    border-top: 0;
    border-radius: 0 0 12px 12px;
}

/* ---------- the round buttons ---------- */

.pk-play {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(10px, 4vw, 22px);
    padding-top: 8px;
}

.pk-ico {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: calc(54px * var(--pk-ui, 1));
    height: calc(54px * var(--pk-ui, 1));
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.pk-ico:active {
    transform: scale(0.92);
}

.pk-ico img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35));
}

.pk-ico:disabled {
    opacity: 0.5;
    cursor: default;
}

.pk.pk .pk-ico em {
    position: absolute;
    right: -6px;
    bottom: -4px;
    min-width: 22px;
    padding: 2px 6px;
    color: var(--pk-ink);
    background: var(--pk-yellow);
    border: 2px solid var(--pk-ink);
    border-radius: 999px !important;
    font: 900 0.72rem/1 var(--news-font-head, inherit);
    font-style: normal;
}

.pk.pk .pk-ico em.is-free {
    color: #fff;
    background: #2f9e44;
}

.pk.pk .pk-ico em.is-label {
    right: 50%;
    bottom: -9px;
    transform: translateX(50%);
    color: #fff;
    background: var(--pk-ink);
    border-color: #fff;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* A round button's shine (as Kolo's): a soft white band across its circle, now and then and when the whistle could help. */
.pk.pk .pk-ico::after,
.pk.pk .pk-switch::after {
    content: "";
    position: absolute;
    inset: 3%;
    border-radius: 50% !important;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 62%) 140% 0 / 260% 100% no-repeat;
    opacity: 0;
    pointer-events: none;
}

.pk.pk .pk-ico.is-glint::after,
.pk.pk .pk-switch.is-glint::after {
    animation: pk-glint 0.95s ease-out;
}

@keyframes pk-glint {
    0% { background-position: 140% 0; opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { background-position: -40% 0; opacity: 0; }
}

/* The tow truck picks: a strip at the foot of the stage. */
.pk.pk .pk-picking {
    position: absolute;
    left: 50%;
    bottom: calc(86px * var(--pk-ui, 1));
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 14px;
    color: #fff;
    background: rgba(22, 23, 28, 0.92);
    border: 2px solid var(--pk-yellow);
    border-radius: 999px !important;
    font-weight: 800;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 12;
}

/* ---------- buttons on the cards ---------- */

.pk.pk .pk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.5rem 1.15rem;
    color: var(--pk-ink);
    background: #fff;
    border: 2.5px solid var(--pk-ink);
    border-radius: 999px !important;
    box-shadow: 0 4px 0 var(--pk-ink);
    font: 900 0.98rem/1 var(--news-font-head, inherit);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.pk.pk .pk-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--pk-ink);
}

.pk.pk .pk-btn.is-primary {
    color: #fff;
    background: linear-gradient(180deg, #ffa24a, var(--pk-orange-dark));
}

.pk.pk .pk-picking .pk-btn {
    min-height: 34px;
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    box-shadow: 0 2px 0 var(--pk-ink);
}

/* ---------- overlays: a lot cleared, Bubi's gift, a new zone, the map ---------- */

.pk-done,
.pk-milestone,
.pk-travel,
.pk-map {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(10, 14, 24, 0.5);
    overflow-y: auto;
}

.pk.pk :is(.pk-done-sheet, .pk-milestone-sheet, .pk-travel-sheet, .pk-map-sheet) {
    position: relative;
    width: min(100%, 390px);
    padding: 18px 16px 16px;
    text-align: center;
    background: var(--pk-cream);
    border: 3px solid var(--pk-ink);
    border-radius: 22px !important;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.35);
    animation: pk-pop 0.45s cubic-bezier(0.2, 1.5, 0.4, 1);
}

@keyframes pk-pop {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
}

.pk.pk .pk-done-ribbon {
    display: inline-block;
    margin: -34px auto 4px;
    padding: 6px 22px;
    color: #fff;
    background: linear-gradient(180deg, #ffa24a, var(--pk-orange-dark));
    border: 3px solid var(--pk-ink);
    border-radius: 12px !important;
    box-shadow: 0 4px 0 var(--pk-ink);
    font: 900 1.35rem/1 var(--news-font-head, inherit);
    transform: rotate(-2deg);
}

.pk-done-title {
    margin: 4px 0 6px;
    font: 900 1.25rem/1.15 var(--news-font-head, inherit);
}

.pk-done-stars {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 4px 0;
}

.pk-done-stars i {
    width: 42px;
    height: 42px;
    background: #c9cbd1;
    clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 78%, 20% 100%, 30% 60%, 0 38%, 38% 35%);
}

.pk-done-stars i:nth-child(2) {
    transform: translateY(-8px) scale(1.12);
}

.pk-done-stars i.is-on {
    background: linear-gradient(180deg, #ffe27a, #f2a91f);
    animation: pk-star 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.pk-done-stars i.is-on:nth-child(2) {
    animation-name: pk-star-mid;
}

@keyframes pk-star {
    from { transform: scale(0) rotate(-90deg); }
}

@keyframes pk-star-mid {
    from { transform: translateY(-8px) scale(0) rotate(-90deg); }
    to { transform: translateY(-8px) scale(1.12); }
}

.pk-done-bubi {
    width: 110px;
    height: 110px;
    object-fit: contain;
}

.pk-done-figures {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 8px 0;
}

.pk.pk .pk-done-figures > div {
    padding: 6px 2px;
    background: #fff;
    border: 2px solid var(--pk-ink);
    border-radius: 12px !important;
}

.pk-done-figures dt {
    color: var(--pk-muted);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pk-done-figures dd {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 2px 0 0;
    font: 900 1.25rem/1 var(--news-font-head, inherit);
}

.pk-done-words {
    margin: 6px 0;
    font-weight: 800;
}

.pk-done-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.pk-versus {
    margin: 8px 0;
    text-align: left;
}

.pk-versus-result {
    margin: 0 0 4px;
    font-weight: 900;
    text-align: center;
}

.pk-versus-result.is-won {
    color: #2f9e44;
}

.pk-versus-result.is-lost {
    color: var(--pk-red);
}

.pk-versus-both {
    margin: 0 0 6px;
    font-size: 0.85rem;
    text-align: center;
}

.pk-versus-board {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.86rem;
}

.pk-versus-board li {
    display: flex;
    gap: 6px;
}

.pk-versus-board li.is-me {
    font-weight: 900;
}

.pk-versus-board em {
    margin-left: auto;
    font-style: normal;
}

.pk-challenge-name {
    display: grid;
    gap: 4px;
    margin: 8px 0;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 800;
}

.pk.pk .pk-challenge-name input {
    padding: 8px 10px;
    border: 2px solid var(--pk-ink);
    border-radius: 10px !important;
}

.pk-kicker {
    margin: 0;
    color: var(--pk-orange-dark);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pk-milestone {
    background: radial-gradient(circle at 50% 40%, rgba(255, 201, 60, 0.4), rgba(10, 14, 24, 0.75) 60%);
}

.pk-rays {
    position: absolute;
    inset: -40%;
    background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.12) 0 10deg, transparent 10deg 20deg);
    animation: pk-rays 18s linear infinite;
    pointer-events: none;
}

@keyframes pk-rays {
    to { transform: rotate(360deg); }
}

.pk-milestone-number {
    margin: 0;
    color: var(--pk-orange);
    font: 900 4.2rem/1 var(--news-font-head, inherit);
    -webkit-text-stroke: 2px var(--pk-ink);
}

.pk-milestone-title {
    margin: 0 0 6px;
    font-weight: 900;
}

.pk-gifts {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 12px;
}

.pk.pk .pk-gifts span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: #fff;
    border: 2px solid var(--pk-ink);
    border-radius: 999px !important;
    font-weight: 900;
}

/* A new zone: the map of Croatia, the route from the old place to the new one, a car driving it. */
.pk-travel-name {
    margin: 2px 0 8px;
    font: 900 1.5rem/1.1 var(--news-font-head, inherit);
}

.pk-travel-map {
    position: relative;
    width: min(100%, 300px);
    margin: 0 auto;
    aspect-ratio: 480 / 473;
}

.pk-travel-map > img:first-child {
    width: 100%;
    height: 100%;
    filter: brightness(0.75) sepia(0.2);
}

.pk-travel-route {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.pk-travel-route path {
    fill: none;
    stroke: var(--pk-orange);
    stroke-width: 9;
    stroke-linecap: round;
    stroke-dasharray: 14 18;
    vector-effect: non-scaling-stroke;
}

.pk.pk :is(.pk-travel-from, .pk-travel-to) {
    position: absolute;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    background: #fff;
    border: 3px solid var(--pk-ink);
    border-radius: 50% !important;
}

.pk.pk .pk-travel-to {
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    background: var(--pk-orange);
    animation: pk-siren 0.9s ease-in-out infinite;
}

/* Bubi on his moped rides the route. */
.pk-travel-car {
    position: absolute;
    width: 64px;
    height: 64px;
    margin: -52px 0 0 -32px;
    filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.5));
}

.pk-travel-gift {
    margin: 10px 0 12px;
    font-weight: 800;
}

/* The map of the player's way. */
.pk-map {
    place-items: start center;
}

.pk.pk .pk-map-sheet {
    width: min(100%, 440px);
    max-height: calc(100% - 8px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    text-align: left;
    animation: none;
}

.pk-map-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.pk-map-title {
    margin: 0;
    font: 900 1.4rem/1 var(--news-font-head, inherit);
}

.pk-map-where {
    margin: 4px 0 0;
    color: var(--pk-muted);
    font-weight: 800;
}

.pk-map-close {
    width: 40px;
    height: 40px;
    padding: 0;
    color: #fff;
    background: var(--pk-ink);
    border: 0;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.pk-map-hint {
    margin: 6px 0 8px;
    font-size: 0.85rem;
}

.pk-map-zones {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
    overscroll-behavior: contain;
}

.pk.pk .pk-map-zone {
    padding: 8px;
    background: #fff;
    border: 2px solid var(--pk-ink);
    border-radius: 14px !important;
}

.pk-map-zone.is-locked {
    opacity: 0.55;
}

.pk-map-zone h3 {
    margin: 0 0 6px;
    font: 900 1rem/1.1 var(--news-font-head, inherit);
}

.pk-map-zone h3 small {
    color: var(--pk-muted);
    font-weight: 800;
}

.pk-map-levels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 6px;
}

.pk.pk .pk-map-level {
    position: relative;
    display: grid;
    place-items: center;
    height: 40px;
    padding: 0;
    color: var(--pk-ink);
    background: #f4efe2;
    border: 2px solid var(--pk-ink);
    border-radius: 50% !important;
    font: 900 0.85rem/1 var(--news-font-head, inherit);
    cursor: pointer;
}

.pk.pk .pk-map-level.is-now {
    color: #fff;
    background: var(--pk-orange);
    box-shadow: 0 0 0 3px var(--pk-yellow);
}

.pk.pk .pk-map-level.is-locked {
    color: #8b8f99;
    background: #e3e4e8;
    cursor: default;
}

.pk-map-level small {
    position: absolute;
    bottom: -7px;
    color: #f2a91f;
    font-size: 0.6rem;
    letter-spacing: -1px;
    text-shadow: 0 0 2px #fff;
}

/* Confetti at a lot's end. */
.pk-confetti {
    position: absolute;
    inset: 0;
    z-index: 19;
    pointer-events: none;
    overflow: hidden;
}

.pk-confetti i {
    position: absolute;
    top: -16px;
    left: var(--x);
    width: var(--w);
    height: var(--h);
    background: var(--c);
    border-radius: var(--r);
    animation: pk-fall var(--t) cubic-bezier(0.25, 0.4, 0.5, 1) var(--d) forwards;
}

@keyframes pk-fall {
    to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); }
}

/* ---------- under the game ---------- */

.pk-below {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1rem 16px 3rem;
}

.pk-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.pk-modes a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0.4rem 0.75rem;
    color: var(--pk-ink);
    background: #fff;
    border: 2px solid var(--pk-ink);
    font-size: 0.92rem;
    font-weight: 800;
    text-decoration: none;
}

.pk-modes a.is-active {
    color: #fff;
    background: var(--pk-blue);
    border-color: var(--pk-blue);
}

.pk-part {
    margin-top: 2rem;
}

.pk-part h2 {
    font-family: var(--news-font-head);
    font-weight: 900;
}

.pk-steps {
    display: grid;
    gap: 0.5rem;
    padding-left: 1.2rem;
}

.pk-top-list {
    display: grid;
    gap: 0.35rem;
    padding: 0;
    list-style: none;
}

.pk-top-list li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.pk-top-list em {
    margin-left: auto;
    font-style: normal;
    font-weight: 900;
}

.pk-top-list small {
    color: var(--pk-muted);
}

.pk-faq details {
    padding: 0.6rem 0;
    border-bottom: 1px solid #ddd;
}

.pk-faq summary {
    padding: 0.7rem 0;
    font-weight: 800;
    cursor: pointer;
}

/* ---------- the case round the stage: nothing on a phone; a portrait case on a computer ---------- */

.pk-backdrop {
    display: none;
}

.pk-case:fullscreen {
    display: grid;
    place-items: center;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--pk-ink);
}

.pk-case:fullscreen .pk-stage {
    width: min(100%, var(--pk-width, 100%));
    margin: 0;
}

/* A phone: a strip of nothing under the buttons, so a tap there is never the phone's own gesture bar. */
@media (max-width: 767.98px) {
    .pk-stage {
        padding-bottom: calc(26px + env(safe-area-inset-bottom, 0px));
    }
}

@media (min-width: 768px) {
    .pk-case {
        position: relative;
        isolation: isolate;
        overflow: hidden;
        max-width: 1180px;
        margin: 0 auto;
        padding: 6px 0 16px;
        background: var(--pk-ink);
    }

    .pk-backdrop {
        display: block;
        position: absolute;
        inset: -48px;
        z-index: -1;
        background: var(--pk-picture, none) center / cover no-repeat, linear-gradient(165deg, var(--pk-from, #1fb6c9), var(--pk-to, #f3e6c8));
        filter: blur(28px) brightness(0.5) saturate(1.1);
    }

    .pk-stage {
        width: min(100%, var(--pk-width, 600px));
        border: 3px solid var(--pk-ink);
        box-shadow: 0 8px 0 rgba(8, 12, 24, 0.6);
    }

    .pk-case:fullscreen .pk-stage {
        box-shadow: none;
    }

    .pk-bubi {
        width: 70px;
        height: 70px;
    }

    .pk-line {
        font-size: 0.9rem;
    }
}

/* A small phone: the bar and the meters a notch smaller, so the lot has the room. */
@media (max-height: 700px) {
    .pk-level {
        font-size: 1rem;
    }

    .pk-bubi {
        width: 50px;
        height: 50px;
    }

    .pk.pk .pk-line {
        font-size: 0.76rem;
    }

    .pk-line > span {
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 360px) {
    .pk-logo-words {
        font-size: 0.98rem;
    }

    .pk.pk :is(.pk-crashes, .pk-left) {
        min-width: 92px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pk-thing.is-moving,
    .pk-bg,
    .pk-rays,
    .pk-car.is-hint,
    .pk-stage.is-picking .pk-car,
    .pk-tag.is-ambulance {
        animation: none;
    }
}
