/* Klupko (/klupko): Bubi's 4×4 grid of letters. Adios's blocky cards (thick black borders, flat colours) around the owner's
   knitted interface pieces (img/igrice/klupko/ui: the board's frame and linen, the tiles, the yarn clock, the medals, the
   ribbon, the notebook, the round buttons) and the game's purple (#6D3FD1). The thread is an SVG over the board; the board
   takes no scroll or zoom gestures (touch-action: none), so a swipe draws a word and never moves the page. */
.kl {
    --kl-ink: #16171c;
    --kl-purple: #6d3fd1;
    --kl-purple-soft: #b9a3f0;
    --kl-cream: #f6f1e7;
    --kl-green: #1f8f4e;
    --kl-red: #c0392b;
    --kl-amber: #e0a100;
    --kl-muted: #5d6170;
    max-width: 1180px;
    margin: 0 auto;
    padding: 1rem 16px 3rem;
    color: var(--kl-ink);
}

.kl [hidden] {
    display: none !important;
}

.kl-head {
    margin-bottom: 1rem;
}

.kl-kicker {
    margin: 0 0 0.3rem;
    color: var(--kl-muted);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.kl-kicker a {
    color: inherit;
}

.kl-kicker span[aria-hidden] {
    margin: 0 0.4rem;
}

.kl-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.6rem;
    font-family: var(--news-font-head);
    font-size: clamp(1.9rem, 6vw, 2.6rem);
    font-weight: 900;
    line-height: 1.05;
}

/* The owner's knitted logo, no box behind it; "bez kraja" as a small purple tag beside it. */
.kl-logo {
    display: block;
    width: auto;
    height: clamp(52px, 13vw, 76px);
    filter: drop-shadow(0 3px 3px rgba(22, 23, 28, 0.25));
}

.kl-title-mode {
    padding: 0.2rem 0.6rem;
    color: #fff;
    background: var(--kl-purple, #6d3fd1);
    border-radius: 999px;
    font-size: 0.42em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.kl-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.kl-modes a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0.2rem 0.7rem 0.2rem 0.25rem;
    color: var(--kl-ink);
    background: #fff;
    border: 2px solid var(--kl-ink);
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.kl-modes a img {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
}

.kl-modes a.is-active {
    color: #fff;
    background: var(--kl-purple);
    border-color: var(--kl-purple);
}

/* ---------- the stage: a zone's painting behind the game ---------- */

.kl-stage {
    position: relative;
    isolation: isolate;
    overflow-x: clip;
    margin: 0 -16px;
    padding: 12px 10px 18px;
    background: var(--kl-picture, none) center / cover no-repeat, linear-gradient(165deg, var(--kl-from, #b9a3f0), var(--kl-to, #f6f1e7));
    transition: background 0.6s ease;
}

/* A little darker at the edges, so the cards stand out, and the painting muted as Petica's (owner, 29 Nov 2026: "remember to
   have klupko muted background like petica"): a grey wash, and the painting behind it a third quieter (a backdrop filter,
   so the board and the tiles on top keep their colours). */
.kl-stage::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(10, 14, 24, 0.28), rgba(10, 14, 24, 0.08) 30%, rgba(10, 14, 24, 0.08) 70%, rgba(10, 14, 24, 0.3)),
        linear-gradient(rgba(52, 56, 64, 0.4), rgba(52, 56, 64, 0.4));
    -webkit-backdrop-filter: saturate(0.66);
    backdrop-filter: saturate(0.66);
    content: "";
    pointer-events: none;
}

/* A friend's challenge: who sent it and the score to beat, on top of the side card. */
.kl-challenge {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.6rem;
    padding: 0.4rem 0.6rem;
    color: #5a3a00;
    background: #fff4d6;
    border: 2px solid #e2b54a;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.3;
}

.kl-challenge img {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
}

.kl-goal-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.kl-sound-slot {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
}

/* Over the painting every part is a solid card: Bubi and the clock, the word, the hint under the board. */
.kl-stage .kl-side {
    padding: 0.6rem 0.7rem;
    background: #fff;
    border: 3px solid var(--kl-ink);
    box-shadow: 0 4px 0 var(--kl-ink);
}

.kl-stage .kl-word {
    width: fit-content;
    min-width: min(100%, 220px);
    max-width: 100%;
    margin: 0.4rem auto 0.55rem;
    padding: 0.1rem 1rem;
    background: rgba(255, 255, 255, 0.94);
    border: 3px solid var(--kl-ink);
    box-shadow: 0 4px 0 var(--kl-ink);
}

/* No word being drawn: the pill keeps its place, clear. */
.kl-stage .kl-word.is-blank {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.kl-stage .kl-review span {
    padding: 0.2rem 0.6rem;
    color: var(--kl-ink);
    background: rgba(255, 255, 255, 0.94);
    border: 2px solid var(--kl-ink);
}

.kl-stage .kl-keys {
    width: fit-content;
    margin: 0.7rem auto 0;
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.94);
    border: 2px solid var(--kl-ink);
}

@media (min-width: 768px) {
    .kl-stage {
        margin: 0;
        padding: 18px;
        border: 3px solid var(--kl-ink);
    }
}

/* ---------- the game ---------- */

.kl-game {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

.kl-play {
    min-width: 0;
}

.kl-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.kl-host {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.kl-host img {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
}

/* Bubi's line fills the room between him and the clock, whatever he says (owner, 29 Nov 2026: a short "Ima!" shrank it to a
   narrow box). */
.kl-line {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0.5rem 0.7rem;
    background: #fff;
    border: 2px solid var(--kl-ink);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
}

.kl-meters {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.5rem;
}

/* The owner's yarn clock: the time left is a purple strand along its cream ring (r 93 to 107 of 256), the minutes and seconds
   white on the yarn. */
.kl-timer {
    position: relative;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    background: url("/img/igrice/klupko/ui/klupko-sat.svg") center / 100% 100% no-repeat;
    filter: drop-shadow(0 3px 2px rgba(22, 23, 28, 0.25));
}

.kl-timer svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.kl-timer-yarn {
    fill: none;
    stroke: var(--kl-purple);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke 0.3s;
}

.kl-timer strong {
    position: relative;
    color: #fff;
    font-family: var(--news-font-head);
    font-size: 1rem;
    font-weight: 900;
    text-shadow: 0 1px 0 var(--kl-ink), 0 -1px 0 var(--kl-ink), 1px 0 0 var(--kl-ink), -1px 0 0 var(--kl-ink), 0 2px 4px rgba(0, 0, 0, 0.55);
}

.kl-timer.is-late .kl-timer-yarn {
    stroke: #e8604c;
}

.kl-timer.is-late {
    animation: kl-late 1s ease-in-out infinite;
}

.kl-score {
    display: grid;
    place-items: center;
    min-width: 58px;
    padding: 0.2rem 0.5rem;
    background: #fff;
    border: 2px solid var(--kl-ink);
    line-height: 1.05;
}

.kl-score strong {
    font-family: var(--news-font-head);
    font-size: 1.25rem;
    font-weight: 900;
}

.kl-score small {
    color: var(--kl-muted);
    font-size: 0.7rem;
    font-weight: 700;
}

.kl-sound {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    filter: drop-shadow(0 3px 2px rgba(22, 23, 28, 0.3));
    transition: transform 0.1s ease;
}

.kl-sound img {
    width: 100%;
    height: 100%;
}

.kl-sound:active {
    transform: scale(0.93);
}

/* Off: the speaker greyed and struck through. */
.kl-sound.is-off img {
    opacity: 0.8;
    filter: grayscale(0.9);
}

.kl-sound.is-off::after {
    position: absolute;
    top: 50%;
    left: 12%;
    width: 76%;
    height: 6px;
    margin-top: -3px;
    background: var(--kl-ink);
    border: 1.5px solid #fff;
    border-radius: 3px;
    content: "";
    transform: rotate(-45deg);
}

.kl-goal {
    margin: 1.05rem 0 0.4rem;
}

.kl-goal-bar {
    position: relative;
    height: 14px;
    margin-right: 16px;
    background: #efe9fb;
    border: 2px solid var(--kl-ink);
    border-radius: 999px;
}

/* The goal so far: a twisted purple strand. */
.kl-goal-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: repeating-linear-gradient(-60deg, #8a5fe8 0 5px, #6d3fd1 5px 10px);
    border-radius: 999px;
    transition: width 0.35s ease;
}

/* Bronze, silver and gold at the goal's steps: grey until reached, then in colour with a hop. */
.kl-goal-bar i {
    position: absolute;
    top: 50%;
    width: 34px;
    height: 34px;
    margin: -19px 0 0 -17px;
    background: center / contain no-repeat;
    filter: grayscale(1) opacity(0.5);
    transition: filter 0.3s ease, transform 0.3s ease;
}

/* At their steps a third apart until a grid places them (before Kreni they all sat at the start). */
.kl-goal-bar i[data-kl-mark="1"] {
    left: 33%;
    background-image: url("/img/igrice/klupko/ui/medalja-bronca.svg");
}

.kl-goal-bar i[data-kl-mark="2"] {
    left: 67%;
    background-image: url("/img/igrice/klupko/ui/medalja-srebro.svg");
}

.kl-goal-bar i[data-kl-mark="3"] {
    left: 100%;
    background-image: url("/img/igrice/klupko/ui/medalja-zlato.svg");
}

.kl-goal-bar i.is-reached {
    filter: drop-shadow(0 2px 1px rgba(22, 23, 28, 0.35));
    transform: scale(1.12);
}

.kl-goal p {
    margin: 0.6rem 0 0;
    color: var(--kl-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.kl-word {
    min-height: 2.2rem;
    margin: 0.3rem 0 0.5rem;
    font-family: var(--news-font-head);
    font-size: clamp(1.4rem, 6vw, 1.9rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    text-align: center;
}

.kl-word.is-ok {
    color: var(--kl-green);
}

.kl-word.is-bad {
    color: var(--kl-red);
    animation: kl-shake 0.35s;
}

.kl-word.is-again {
    color: var(--kl-amber);
}

/* Letters typed that no path on the board spells (yet). */
.kl-word.is-miss {
    color: var(--kl-muted);
    text-decoration: line-through 3px rgba(192, 57, 43, 0.6);
}

/* Typing is for a computer's keyboard: the hint shows only on a computer's width with a mouse. */
.kl-keys {
    display: none;
    margin: 0.7rem 0 0;
    color: var(--kl-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.kl-keys kbd {
    padding: 0.05rem 0.35rem;
    color: var(--kl-ink);
    background: #fff;
    border: 2px solid var(--kl-ink);
    box-shadow: 0 2px 0 var(--kl-ink);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 800;
}

@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
    .kl-keys {
        display: block;
    }
}

/* The owner's knitted board. The wrap is the frame's outer edge (940 of the picture's 1024: the shadow and the yarn ball at the
   bottom right spill past it); the grid sits on the linen, 8 % in, so cellAt's quarters of [data-kl-board] are the tiles.
   The grid's padding is half its gap, so each quarter is a tile with half a gap around it. Sizes inside are in cqw (the
   board's width), each after a fixed one for a browser without container units. */
.kl-board-wrap {
    position: relative;
    width: min(100%, 480px);
    aspect-ratio: 1;
    margin: 0 auto;
    container-type: inline-size;
}

.kl-board-wrap::before {
    position: absolute;
    inset: -4.04% -4.47% -4.89%;
    background: url("/img/igrice/klupko/ui/klupko-ploca.svg") center / 100% 100% no-repeat;
    content: "";
    pointer-events: none;
}

.kl-board {
    position: absolute;
    inset: 8.12% 8.01% 7.9%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 12px;
    gap: 3.4cqw;
    padding: 6px;
    padding: 1.7cqw;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.kl-tile {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    min-width: 0;
    padding: 0;
    color: var(--kl-ink);
    background: none;
    border: 0;
    font-family: var(--news-font-head);
    font-size: clamp(1.4rem, 8vw, 2.6rem);
    font-size: 8.4cqw;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.1s ease, color 0.12s ease;
    touch-action: none;
}

/* The tile's picture: the four faces share one canvas (the face from 24 to 232 of 256), set 11.54 % out on every side so the
   face is the button and the drawn path's glow spills into the gap. */
.kl-tile::before {
    position: absolute;
    inset: -11.54%;
    z-index: -1;
    background: url("/img/igrice/klupko/ui/plocica.svg") center / 100% 100% no-repeat;
    content: "";
    pointer-events: none;
}

.kl-tile span {
    position: relative;
    top: 0.04em;
}

.kl-tile.is-double span {
    font-size: 0.78em;
    letter-spacing: -0.02em;
}

/* In the path: the purple tile, a hair bigger. */
.kl-tile.is-on {
    color: #fff;
    text-shadow: 0 2px 2px rgba(31, 12, 70, 0.45);
    transform: scale(1.04);
}

.kl-tile.is-on::before {
    background-image: url("/img/igrice/klupko/ui/plocica-aktivna.svg");
}

/* A word found: green, with a pop. */
.kl-tile.is-ok {
    color: #fff;
    text-shadow: 0 2px 2px rgba(6, 50, 26, 0.45);
    animation: kl-ok 0.5s ease;
}

.kl-tile.is-ok::before {
    background-image: url("/img/igrice/klupko/ui/plocica-dobro.svg");
}

/* Not a word: coral, with a shake. */
.kl-tile.is-bad {
    color: #fff;
    text-shadow: 0 2px 2px rgba(90, 20, 10, 0.4);
    animation: kl-bad 0.45s ease;
}

.kl-tile.is-bad::before {
    background-image: url("/img/igrice/klupko/ui/plocica-krivo.svg");
}

/* Too short: a shake on the plain tile. Found before: a gold glow. */
.kl-tile.is-short {
    animation: kl-bad 0.45s ease;
}

.kl-tile.is-again {
    animation: kl-again 0.5s ease;
}

.kl-thread {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.kl-thread polyline {
    fill: none;
    stroke: var(--kl-purple-soft);
    stroke-width: 9;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.8;
    filter: drop-shadow(0 1px 0 rgba(22, 23, 28, 0.45));
}

.kl-thread circle {
    fill: var(--kl-purple);
    stroke: #fff;
    stroke-width: 3;
    transition: r 0.12s ease;
}

/* Before Kreni: Bubi on the linen, the knitted frame around him. */
.kl-start {
    position: absolute;
    inset: 8.12% 8.01% 7.9%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem;
    text-align: center;
    background: rgba(251, 247, 238, 0.95);
    border-radius: 10px;
    border-radius: 2.4cqw;
}

.kl-start img {
    width: 110px;
    width: min(120px, 30cqw);
    height: 110px;
    height: min(120px, 30cqw);
}

.kl-start p {
    max-width: 22rem;
    margin: 0;
    font-weight: 700;
}

.kl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.2rem;
    color: var(--kl-ink);
    background: #fff;
    border: 3px solid var(--kl-ink);
    box-shadow: 0 4px 0 var(--kl-ink);
    font-family: var(--news-font-head);
    font-size: 1rem;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.kl-btn:hover {
    color: var(--kl-ink);
    transform: translateY(1px);
    box-shadow: 0 3px 0 var(--kl-ink);
}

.kl-btn.is-primary {
    color: #fff;
    background: var(--kl-purple);
}

.kl-btn img {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    margin: -0.4rem 0 -0.4rem -0.55rem;
}

.kl-btn.is-primary:hover {
    color: #fff;
}

.kl-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.kl-start .kl-btn {
    min-width: 160px;
    font-size: 1.15rem;
}

/* ---------- the words, by length ---------- */

/* The words on the owner's notebook page, in nine slices: the corners (the yarn ball's too) keep their size and the rest
   stretches with the list (repeated, the paper's gradient showed seams). The paper's drawn edge is 14 px in on the left (the
   stitched margin at 27), 17 on the right, 12 at the top and 16 at the bottom: the words stay a good way inside it. */
.kl-words {
    padding: 1.15rem 1.8rem 1.6rem 2.7rem;
    background: none;
    border: 1px solid transparent;
    border-image: url("/img/igrice/klupko/ui/biljeznica.svg") 17.97% 28.65% 10.94% 17.71% fill / 46px 55px 28px 34px / 0 stretch;
}

/* Clear of the yarn ball in the page's top corner. */
.kl-words-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
    padding-right: 30px;
}

.kl-words h2 {
    margin: 0;
    font-family: var(--news-font-head);
    font-size: 1.1rem;
    font-weight: 900;
}

.kl-words-count {
    margin-left: auto;
    color: var(--kl-purple);
    font-family: var(--news-font-head);
    font-size: 1.05rem;
    font-weight: 900;
}

.kl-words-close {
    display: none;
    width: 42px;
    height: 42px;
    background: #fff;
    border: 2px solid var(--kl-ink);
    cursor: pointer;
}

.kl-words-hint {
    margin: -0.35rem 0 0.7rem;
    color: var(--kl-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.kl-empty {
    text-align: center;
}

.kl-empty img {
    width: 150px;
    height: auto;
}

.kl-empty p {
    margin: 0.4rem 0 0;
    color: var(--kl-muted);
    font-size: 0.9rem;
}

.kl-found {
    display: grid;
    align-content: start;
    gap: 0.8rem;
}

/* A length: its name, what a word of it is worth, and the everyday words found of all it holds. */
.kl-group h3 {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.kl-group h3 small {
    color: var(--kl-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

/* The count a little higher than the shared baseline (owner, 29 Nov 2026: "0/3 it needs to be a bit higher"): its digits are
   bigger than the title's capitals and sat low beside them. */
.kl-group h3 em {
    position: relative;
    top: -0.14em;
    display: inline-block;
    margin-left: auto;
    font-family: var(--news-font-head);
    font-size: 0.88rem;
    font-style: normal;
    letter-spacing: 0;
}

.kl-group.is-complete h3 em {
    color: var(--kl-green);
}

.kl-group.is-complete h3 em::after {
    content: " \2713";
}

.kl-group.is-bonus h3 {
    color: #8a6400;
}

/* The rare words' star: the owner's gold star wherever a bonus word is counted. */
.kl-group.is-bonus h3 span::before,
.kl-sheet-toggle em::before,
.kl-chip.is-rare::before,
.kl-plus.is-rare::before {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    margin-right: 0.25em;
    vertical-align: -0.2em;
    background: url("/img/igrice/klupko/ui/zvjezdica.svg") center / contain no-repeat;
    content: "";
}

.kl-chip.is-rare::before {
    margin-right: 0;
}

.kl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kl-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 1.9rem;
    padding: 0.15rem 0.45rem;
    color: var(--kl-ink);
    background: #f4f1fb;
    border: 2px solid #cdbff3;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.kl-chip.is-new {
    border-color: var(--kl-green);
    animation: kl-chip-in 0.6s ease-out;
}

/* A word still hidden: a slot for each of its letters. */
.kl-chip.is-blank {
    gap: 3px;
    background: #fff;
    border: 2px dashed #e0dbec;
}

.kl-chip.is-blank i {
    display: block;
    width: 0.6rem;
    height: 2px;
    margin-top: 0.8rem;
    background: #b5adc9;
}

/* At the end: the everyday words not found, in their blanks' place. */
.kl-chip.is-missed {
    color: var(--kl-muted);
    background: #f3f3f5;
    border: 2px dashed #c4c4cc;
}

.kl-chip.is-rare {
    background: #fdf6e1;
    border-color: #ebd18b;
}

.kl-chip b {
    color: #8a6400;
    font-size: 0.76rem;
}

/* At the end every word is a button that draws its path on the board. */
button.kl-chip {
    min-height: 42px;
    cursor: pointer;
}

button.kl-chip:hover {
    border-color: var(--kl-purple);
}

.kl-chip.is-shown {
    color: #fff;
    background: var(--kl-purple);
    border-color: var(--kl-purple);
}

.kl-chip.is-shown b {
    color: #fff;
}

.kl-sheet-toggle {
    display: none;
}

.kl-sheet-toggle strong {
    display: inline-block;
}

.kl-sheet-toggle em {
    margin-left: 0.45rem;
    color: #8a6400;
    font-size: 0.85rem;
    font-style: normal;
}

/* ---------- a word found: it has to feel good ---------- */
/* Owner, 29 Nov 2026: "feedbacks when u untie the klupko, like box having subtle enlarging animation, like by 2%". The board
   swells by 2 % and settles (a long word a little more), the score and its length's count bump, and the points rise from the
   board in a tag. */

.kl-board-wrap.is-pop {
    animation: kl-board-pop 0.34s ease-out;
}

.kl-board-wrap.is-pop-big {
    animation: kl-board-pop-big 0.5s ease-out;
}

.kl-score.is-bump,
.kl-group.is-bump h3 em,
.kl-sheet-toggle.is-bump strong,
.kl-words-count.is-bump {
    animation: kl-bump 0.42s ease-out;
}

.kl-plus {
    position: absolute;
    top: -0.55rem;
    left: 50%;
    z-index: 4;
    padding: 0.05rem 0.55rem;
    color: #fff;
    background: var(--kl-green);
    border: 2px solid var(--kl-ink);
    box-shadow: 0 3px 0 var(--kl-ink);
    font-family: var(--news-font-head);
    font-size: 1.05rem;
    font-weight: 900;
    white-space: nowrap;
    pointer-events: none;
    animation: kl-plus 0.9s ease-out forwards;
}

.kl-plus.is-rare {
    color: var(--kl-ink);
    background: #f6c945;
}

.kl-plus.is-big {
    font-size: 1.3rem;
}

.kl-goal-bar i.is-just {
    animation: kl-mark 0.7s ease-out;
}

/* ---------- the end: in the board's place ---------- */

.kl-end {
    position: relative;
    width: min(100%, 540px);
    margin: 30px auto 0;
    padding: 2.3rem 1.1rem 1.1rem;
    text-align: center;
    background: #fff;
    border: 3px solid var(--kl-ink);
    box-shadow: 0 6px 0 var(--kl-ink);
    animation: kl-pop 0.35s ease;
}

/* The owner's stitched ribbon across the card's top, the title in its band (the picture's band spans 50 to 190 of its 256:
   the box shows just that, and the title sits a little high, where the band's middle is). */
.kl-ribbon {
    position: absolute;
    top: -30px;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(calc(100% + 28px), 440px);
    height: 58px;
    margin: 0;
    padding: 0 66px 18px;
    color: #fff;
    background: url("/img/igrice/klupko/ui/traka.svg") center 43% / 100% 183% no-repeat;
    font-family: var(--news-font-head);
    font-size: 1.12rem;
    font-weight: 900;
    line-height: 1.1;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
    transform: translateX(-50%);
    animation: kl-ribbon 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

.kl-strand {
    display: block;
    width: min(64%, 280px);
    height: auto;
    margin: -0.3rem auto 0.3rem;
}

.kl-end-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.4rem;
    text-align: left;
}

.kl-end-top > img {
    flex: 0 0 auto;
    width: 110px;
    height: 110px;
}

.kl-end-top .kl-medal {
    justify-content: flex-start;
}

/* A game from a challenge: who won, the two scores, the challenge's table. */
.kl-versus {
    margin: 0 0 0.8rem;
    padding: 0.6rem 0.8rem;
    background: #fff8e6;
    border: 2px solid #e2b54a;
}

.kl-versus-result {
    margin: 0;
    font-family: var(--news-font-head);
    font-size: 1.2rem;
    font-weight: 900;
}

.kl-versus-result.is-won {
    color: var(--kl-green);
}

.kl-versus-result.is-lost {
    color: #9a3412;
}

.kl-versus-score {
    margin: 0.15rem 0 0;
    font-family: var(--news-font-head);
    font-size: 1.35rem;
    font-weight: 900;
}

.kl-versus-board {
    display: grid;
    gap: 0.2rem;
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.kl-versus-board li {
    display: flex;
    gap: 0.45rem;
    font-size: 0.9rem;
}

.kl-versus-board li.is-me {
    color: var(--kl-purple);
    font-weight: 800;
}

.kl-versus-board em {
    margin-left: auto;
    font-style: normal;
    font-weight: 800;
}

/* A guest's name for the challenge (a signed-in player's nickname goes by itself). */
.kl-challenge-name {
    display: grid;
    gap: 0.2rem;
    width: min(100%, 260px);
    margin: 0 auto 0.6rem;
    font-size: 0.82rem;
    font-weight: 800;
    text-align: left;
}

.kl-challenge-name span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.kl-challenge-name input {
    padding: 0.5rem 0.6rem;
    border: 2px solid var(--kl-ink);
    font: inherit;
    font-size: 1rem;
}

.kl-medal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0.2rem 0;
    font-family: var(--news-font-head);
    font-size: 1.6rem;
    font-weight: 900;
}

.kl-medal img {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 4px 3px rgba(22, 23, 28, 0.3));
    animation: kl-medal-in 0.7s 0.2s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.kl-end[data-goal="0"] .kl-medal {
    color: var(--kl-muted);
    font-size: 1.3rem;
}

.kl-end-line {
    margin: 0 0 0.8rem;
    font-weight: 700;
}

.kl-end-figures {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0 0 0.8rem;
}

.kl-end-figures div {
    padding: 0.5rem;
    background: #f4f1fb;
    border: 2px solid var(--kl-ink);
}

.kl-end-figures dt {
    color: var(--kl-muted);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.kl-end-figures dd {
    margin: 0;
    font-family: var(--news-font-head);
    font-size: 1.35rem;
    font-weight: 900;
}

.kl-end-earned,
.kl-end-notice {
    margin: 0 0 0.8rem;
    font-weight: 700;
}

.kl-end-earned {
    color: var(--kl-purple);
}

.kl-end-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.kl-end-board {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem 1rem;
    margin: 0 0 0.6rem;
    font-weight: 700;
}

.kl-end .games-account {
    margin-top: 0.6rem;
    text-align: left;
}

.kl-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0;
    color: var(--kl-purple);
    background: none;
    border: 0;
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.kl-word-link {
    min-height: 42px;
    padding: 0.1rem 0.5rem;
    color: var(--kl-ink);
    background: #f4f1fb;
    border: 2px solid var(--kl-ink);
    font-family: inherit;
    font-weight: 900;
    letter-spacing: 0.05em;
    cursor: pointer;
}

/* The board after the end: back to the result, and a word's path drawn on it. */
.kl-review {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.9rem;
    margin: 0 0 0.3rem;
    color: var(--kl-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.kl.is-over.is-review .kl-review {
    display: flex;
}

.kl.is-over .kl-side,
.kl.is-over .kl-keys,
.kl.is-over:not(.is-review) .kl-word,
.kl.is-over:not(.is-review) .kl-board-wrap,
.kl.is-over.is-review .kl-end {
    display: none;
}

.kl-word.is-found {
    color: var(--kl-purple);
}

.kl-word.is-missed {
    color: var(--kl-muted);
}

/* ---------- below the game ---------- */

.kl-section {
    margin-top: 2rem;
}

.kl-section h2 {
    font-family: var(--news-font-head);
    font-weight: 900;
}

.kl-steps {
    display: grid;
    gap: 0.5rem;
    padding-left: 1.2rem;
}

.kl-top-list {
    display: grid;
    gap: 0.35rem;
    padding: 0;
    list-style: none;
}

.kl-top-list li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.kl-top-list em {
    margin-left: auto;
    font-style: normal;
    font-weight: 900;
}

.kl-top-list small {
    color: var(--kl-muted);
}

.kl-faq details {
    padding: 0.6rem 0;
    border-bottom: 1px solid #ddd;
}

.kl-faq summary {
    padding: 0.7rem 0;
    font-weight: 800;
    cursor: pointer;
}

/* ---------- a computer: the board beside the words ---------- */

@media (min-width: 900px) {
    /* Bubi, the clock and the goal go beside the board, above the words, so the board starts under the tabs and fits a
       laptop's screen (its side never taller than the screen leaves). */
    .kl-game {
        grid-template-columns: minmax(0, 1fr) 340px;
        grid-template-rows: auto minmax(0, 1fr);
        grid-template-areas: "play side" "play words";
        gap: 1rem 2rem;
    }

    .kl-side {
        grid-area: side;
        padding: 0.8rem;
        background: #fff;
        border: 3px solid var(--kl-ink);
    }

    .kl-play {
        grid-area: play;
    }

    .kl-top {
        flex-wrap: wrap;
    }

    .kl-host {
        flex: 1 1 100%;
    }

    .kl-host img {
        width: 80px;
        height: 80px;
    }

    .kl-goal {
        margin-bottom: 0;
    }

    .kl-word {
        margin-top: 0;
    }

    .kl-board-wrap {
        width: min(100%, 590px, max(360px, 100dvh - 320px));
    }

    /* The words fill the column beside the board down to its bottom and scroll inside it (the newest first): the board, the
       clock and every word found are on one screen. contain: size keeps a long list from making the page taller. */
    .kl-words {
        grid-area: words;
        display: flex;
        flex-direction: column;
        align-self: stretch;
        min-height: 240px;
        overflow: hidden;
        contain: size;
    }

    .kl-found {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-right: 2px;
    }

    /* Over: the result (or the board) beside every word of the grid; the clock and the goal have had their day. */
    .kl.is-over .kl-game {
        grid-template-rows: minmax(0, 1fr);
        grid-template-areas: "play words";
    }

    .kl.is-review .kl-board-wrap {
        width: min(100%, 590px, max(340px, 100dvh - 410px));
    }

    .kl-review span {
        display: none;
    }
}

/* ---------- a phone: the board fills the screen, the words slide up ---------- */

@media (max-width: 767.98px) {
    .klupko-page .app-header {
        position: relative;
    }
}

.kl-scrim {
    position: fixed;
    inset: 0;
    z-index: 1065;
    background: rgba(8, 12, 24, 0.45);
    animation: kl-fade 0.2s ease;
}

@media (min-width: 900px) {
    .kl-scrim {
        display: none !important;
    }
}

@media (max-width: 899.98px) {
    /* The paper's bottom edge and shadow (16 px of the picture) below the screen. */
    .kl-words {
        position: fixed;
        right: 0;
        bottom: -16px;
        left: 0;
        padding-bottom: calc(1.6rem + 16px);
        z-index: 1070;
        display: flex;
        flex-direction: column;
        max-height: 72dvh;
        overflow: hidden;
        filter: drop-shadow(0 -4px 12px rgba(22, 23, 28, 0.3));
        transform: translateY(105%);
        transition: transform 0.28s ease;
    }

    .kl-words.is-open {
        transform: translateY(0);
    }

    .kl-words-head {
        flex: 0 0 auto;
    }

    .kl-found {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-bottom: 0.4rem;
    }

    .kl-words-close {
        display: grid;
        place-items: center;
    }

    .kl-sheet-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: min(100%, 460px);
        margin: 0.75rem auto 0;
        padding: 0.6rem 0.9rem;
        color: var(--kl-ink);
        background: #fff;
        border: 3px solid var(--kl-ink);
        box-shadow: 0 4px 0 var(--kl-ink);
        font-weight: 800;
        cursor: pointer;
    }

    .kl-sheet-toggle strong {
        color: var(--kl-purple);
    }
}

/* A narrow phone: Bubi, his line, the clock, the score and the sound share one row above the board. */
@media (max-width: 520px) {
    .kl-top {
        gap: 0.5rem;
    }

    .kl-host {
        gap: 0.4rem;
    }

    .kl-host img {
        width: 52px;
        height: 52px;
    }

    /* Bubi's line keeps its size whatever he says (as the text grew and shrank, the board moved under the finger): three
       lines, four on the narrowest phones; his longest lines fit, a short one sits in the middle. */
    .kl-line {
        display: flex;
        align-items: center;
        align-items: safe center;
        height: calc(3 * 1.25em + 0.7rem);
        overflow: hidden;
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
        line-height: 1.25;
    }

    .kl-meters {
        gap: 0.35rem;
    }

    .kl-timer {
        width: 58px;
        height: 58px;
    }

    .kl-timer strong {
        font-size: 0.92rem;
    }

    .kl-score {
        min-width: 50px;
        padding: 0.15rem 0.35rem;
    }

    .kl-sound {
        width: 42px;
        height: 42px;
    }

    .kl-end {
        padding: 2.1rem 0.8rem 0.9rem;
    }

    .kl-end-top {
        gap: 0.7rem;
        margin-bottom: 0.6rem;
    }

    .kl-end-top > img {
        width: 86px;
        height: 86px;
    }

    .kl-medal {
        justify-content: flex-start;
        font-size: 1.3rem;
    }

    .kl-medal img {
        width: 48px;
        height: 48px;
    }

    .kl-ribbon {
        font-size: 1rem;
        padding: 0 60px 18px;
    }

    .kl-end-line {
        margin: 0;
        font-size: 0.9rem;
    }

    .kl-end-figures dd {
        font-size: 1.2rem;
    }
}

@keyframes kl-ok {
    40% { transform: scale(1.08); }
}

@keyframes kl-bad {
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

@keyframes kl-again {
    40% { transform: scale(1.05); filter: drop-shadow(0 0 7px rgba(242, 181, 58, 0.95)); }
}

@keyframes kl-shake {
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes kl-pulse {
    50% { opacity: 0.45; }
}

@keyframes kl-late {
    50% { transform: scale(1.08); filter: drop-shadow(0 0 7px rgba(232, 96, 76, 0.95)); }
}

@keyframes kl-fade {
    from { opacity: 0; }
}

@keyframes kl-chip-in {
    0% { background: #d6f2e1; transform: scale(0.7); opacity: 0; }
    55% { background: #d6f2e1; transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

@keyframes kl-board-pop {
    45% { transform: scale(1.02); }
}

@keyframes kl-board-pop-big {
    35% { transform: scale(1.035); }
    70% { transform: scale(0.995); }
}

@keyframes kl-bump {
    40% { transform: scale(1.14); }
}

@keyframes kl-plus {
    0% { opacity: 0; transform: translate(-50%, 8px) scale(0.85); }
    18% { opacity: 1; transform: translate(-50%, 0) scale(1.06); }
    60% { opacity: 1; transform: translate(-50%, -14px) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -30px) scale(1); }
}

@keyframes kl-mark {
    40% { transform: scale(1.7) rotate(-12deg); }
    70% { transform: scale(1.05) rotate(6deg); }
}

@keyframes kl-medal-in {
    from { transform: scale(0.2) rotate(-25deg); opacity: 0; }
}

@keyframes kl-ribbon {
    from { transform: translateX(-50%) scale(0.4) rotate(-6deg); opacity: 0; }
}

@keyframes kl-in {
    from { opacity: 0; transform: translateY(-4px); }
}

@keyframes kl-pop {
    from { opacity: 0; transform: scale(0.94); }
}

@media (prefers-reduced-motion: reduce) {
    .kl *,
    .kl *::before,
    .kl *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 380px) {
    .kl-line {
        height: calc(4 * 1.25em + 0.7rem);
    }
}
