/*
 * Der Kniffel-Tisch im Spielmodus (kniffel-tisch.js).
 * Buehne: 742 x 542, wie beim Einarmigen Koch.
 */

.kt-tisch {
    position: absolute;
    inset: 0;
    overflow: hidden;
    font-family: Muli, Verdana, sans-serif;
    color: #fff;
    user-select: none;
    -webkit-user-select: none;
}

.kt-buehne {
    position: absolute;
    inset: 0;
    background: #0a2517 url("/img/kniffel/filz.jpg") center / cover no-repeat;
}

/* ---- Meldungen links oben ------------------------------------------------ */

.kt-status {
    position: absolute;
    left: 30px;
    top: 24px;
    width: 380px;
    font-size: 14px;
    line-height: 1.4;
    color: #e6f2dc;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .85);
}

.kt-status b {
    color: #ffe08a;
}

.kt-wurfknopf,
.kt-knopf {
    display: inline-block;
    padding: 10px 22px;
    border: 1px solid rgba(255, 236, 170, .9);
    border-radius: 999px;
    background: linear-gradient(180deg, #ffe89a 0%, #e8b93a 52%, #b98618 100%);
    box-shadow: 0 5px 14px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .7);
    color: #2c1e04;
    font: 800 14px/1 Muli, Verdana, sans-serif;
    letter-spacing: .04em;
    cursor: pointer;
    transition: transform .12s, filter .12s;
}

.kt-wurfknopf:hover,
.kt-knopf:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.kt-wurfknopf:active,
.kt-knopf:active {
    transform: translateY(1px);
}

.kt-wurfknopf {
    position: absolute;
    left: 30px;
    top: 78px;
    z-index: 4;
}

.kt-wurfknopf[hidden],
.kt-verlassen[hidden] {
    display: none;
}

.kt-knopf-hell {
    border-color: rgba(255, 255, 255, .35);
    background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05));
    box-shadow: none;
    color: #eaf5e2;
}

.kt-knopf-rot {
    border-color: rgba(255, 150, 150, .8);
    background: linear-gradient(180deg, #ff9b9b, #d13c3c 60%, #9a1f1f);
    color: #fff;
}

.kt-klein {
    padding: 7px 14px;
    font-size: 12px;
}

.kt-verlassen {
    position: absolute;
    left: 30px;
    top: 138px;
    z-index: 4;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    background: rgba(0, 0, 0, .3);
    color: #cfe3c4;
    font: 700 11px/1 Muli, Verdana, sans-serif;
    cursor: pointer;
}

.kt-verlassen:hover {
    border-color: #ff9b9b;
    color: #ffd0d0;
}

/* ---- Die Ablage ---------------------------------------------------------- */

.kt-ablage {
    position: absolute;
    left: 22px;
    top: 398px;
    width: 410px;
    height: 120px;
    box-sizing: border-box;
    border: 26px solid transparent;
    border-image: url("/img/kniffel/ablage.webp") 44 fill / 26px stretch;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .55));
    pointer-events: none;
}

.kt-ablagetext {
    position: absolute;
    left: 22px;
    top: 495px;
    width: 410px;
    text-align: center;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .5em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .3);
    pointer-events: none;
}

.kt-canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 452px;
    height: 542px;
    touch-action: none;
}

/* ---- Das Blatt ------------------------------------------------------------ */

.kt-blatt {
    position: absolute;
    left: 456px;
    top: 14px;
    width: 274px;
    height: 514px;
    transform: rotate(2.3deg);
    transform-origin: 50% 50%;
    filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .6));
    cursor: url("/img/kniffel/stift-zeiger.png") 1 55, default;
}

.kt-blatt.kt-schreibt,
.kt-blatt.kt-schreibt * {
    cursor: none !important;
}

.kt-papier {
    position: absolute;
    inset: 0;
    background: url("/img/kniffel/papier.jpg") center / 100% 100% no-repeat;
    border-radius: 1px;
}

.kt-inhalt {
    position: absolute;
    left: 15px;
    right: 15px;
    top: 26px;
    bottom: 10px;
    color: #3a3024;
}

.kt-titel {
    height: 26px;
    text-align: center;
    font: 700 16px/26px Georgia, "Times New Roman", serif;
    letter-spacing: .38em;
    text-transform: uppercase;
    color: #4a3b26;
}

.kt-zeile {
    position: relative;
    display: flex;
    align-items: stretch;
    height: 26px;
    border-bottom: 1px solid rgba(58, 96, 150, .38);
}

.kt-kopf {
    height: 24px;
    border-bottom: 2px solid rgba(58, 96, 150, .55);
    font: 700 12px/24px Georgia, serif;
    color: #4a3b26;
}

.kt-kopf .kt-z {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kt-name {
    flex: 0 0 112px;
    padding-left: 4px;
    font: 13px/26px Georgia, "Times New Roman", serif;
    color: #3a3024;
    white-space: nowrap;
}

.kt-z {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    line-height: 26px;
    border-left: 1px solid rgba(58, 96, 150, .38);
}

.kt-summe {
    background: rgba(110, 90, 40, .08);
}

.kt-summe .kt-name {
    font-style: italic;
    font-size: 12px;
}

.kt-summe .kt-z {
    font: 700 13px/26px "Courier New", Courier, monospace;
    color: #4a3b26;
}

.kt-zeile:last-of-type,
.kt-summe[data-summe="gesamt"] {
    border-bottom: 2px solid rgba(58, 96, 150, .55);
}

/* In Bleistift: was der Wurf im freien Feld braechte. */
.kt-z.kt-frei {
    font: italic 16px/26px "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
    color: rgba(64, 64, 78, .45);
    background: rgba(120, 190, 120, .1);
}

/* Vorgemerkt (am Finger): ein zweiter Tipp traegt ein. */
.kt-z.kt-gewaehlt {
    background: rgba(255, 186, 30, .78);
    box-shadow: inset 0 0 0 2px #c77a00, 0 0 10px rgba(255, 190, 40, .8);
    color: #2a1800;
    font-style: normal;
    font-weight: 800;
    animation: kt-gewaehlt 1s ease-in-out infinite;
}

@keyframes kt-gewaehlt {
    0%, 100% { background-color: rgba(255, 186, 30, .78); }
    50% { background-color: rgba(255, 214, 90, .95); }
}

.kt-feld .kt-z[data-wer="meins"].kt-frei:hover {
    background: rgba(255, 224, 120, .5);
    color: rgba(30, 30, 44, .9);
}

.kt-tinte {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.kt-stiftbild {
    filter: drop-shadow(2px 4px 2px rgba(0, 0, 0, .4));
}

/* ---- Karten: Lobby, Warten, Ergebnis -------------------------------------- */

.kt-karte {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, .25), rgba(0, 0, 0, .62));
}

.kt-karte[hidden] {
    display: none;
}

.kt-karte-innen {
    width: 380px;
    padding: 24px 28px 26px;
    text-align: center;
    border: 1px solid rgba(233, 200, 107, .65);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(10, 34, 22, .95), rgba(3, 15, 9, .97));
    box-shadow: 0 24px 64px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .1);
}

.kt-karte-innen h3 {
    margin: 0 0 6px;
    color: #ffd86e;
    font: 800 26px/1.1 Muli, Verdana, sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.kt-karte-innen h4 {
    margin: 18px 0 6px;
    color: #9fc79a;
    font: 800 11px/1 Muli, Verdana, sans-serif;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.kt-karte-innen p {
    margin: 0 0 14px;
    color: #cfe3c4;
    font-size: 13px;
}

.kt-unter {
    color: #a9c4a0;
}

.kt-liste {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.kt-liste li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    font-size: 13px;
    color: #e6f2dc;
}

.kt-liste small {
    color: #8fb08a;
}

.kt-liste b {
    color: #ffe08a;
}

.kt-liste .kt-leer {
    justify-content: center;
    color: #8fb08a;
    font-style: italic;
}

.kt-gegen {
    color: #8fb08a;
    font-size: 11px;
}

.kt-wartend {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 6px 0 20px;
}

.kt-wartend i {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #f5efdc;
    box-shadow: 0 3px 6px rgba(0, 0, 0, .5);
    animation: kt-huepf 1s ease-in-out infinite;
}

.kt-wartend i:nth-child(2) {
    animation-delay: .15s;
}

.kt-wartend i:nth-child(3) {
    animation-delay: .3s;
}

@keyframes kt-huepf {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    40% { transform: translateY(-11px) rotate(90deg); }
}

.kt-endstand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 10px 0 20px;
}

.kt-endstand span {
    display: flex;
    flex-direction: column;
}

.kt-endstand small {
    color: #a9c4a0;
    font-size: 12px;
}

.kt-endstand b {
    color: #fff;
    font-size: 44px;
    line-height: 1.1;
}

.kt-endstand em {
    color: #ffd86e;
    font-size: 34px;
    font-style: normal;
}

/* ---- Kniffel-Schriftzug ---------------------------------------------------- */

.kt-banner {
    position: absolute;
    left: 0;
    width: 452px;
    top: 150px;
    z-index: 15;
    text-align: center;
    font: 900 62px/1 Muli, Verdana, sans-serif;
    letter-spacing: .04em;
    color: #ffd45a;
    text-shadow: 0 3px 0 #a36b00, 0 8px 24px rgba(0, 0, 0, .7), 0 0 34px rgba(255, 200, 60, .8);
    pointer-events: none;
}

.kt-banner[hidden] {
    display: none;
}

.kt-banner-an {
    animation: kt-banner 2.5s ease-out both;
}

@keyframes kt-banner {
    0% { opacity: 0; transform: scale(.3) rotate(-6deg); }
    14% { opacity: 1; transform: scale(1.18) rotate(2deg); }
    24% { transform: scale(1) rotate(0); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.08); }
}

/* ---- Blaetter: Regeln und Bestenliste -------------------------------------- */

.kt-panel {
    position: absolute;
    inset: 10px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(233, 200, 107, .55);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(8, 30, 19, .985), rgba(3, 14, 9, .985));
    box-shadow: 0 16px 50px rgba(0, 0, 0, .7);
}

.kt-panel[hidden] {
    display: none;
}

.kt-panelkopf {
    display: flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.kt-panelkopf h3 {
    margin: 0;
    color: #ffd86e;
    font-size: 15px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.kt-zu {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.kt-zu:hover {
    background: rgba(255, 255, 255, .12);
}

.kt-panelkoerper {
    flex: 1;
    overflow: auto;
    padding: 14px 20px 20px;
    font-size: 13px;
    line-height: 1.5;
    color: #dcebd3;
}

.kt-panelkoerper h4 {
    margin: 16px 0 6px;
    color: #ffd86e;
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.kt-schritte {
    margin: 0;
    padding-left: 20px;
}

.kt-schritte li {
    margin-bottom: 6px;
}

.kt-regeltabelle {
    width: 100%;
    border-collapse: collapse;
}

.kt-regeltabelle td {
    padding: 5px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    vertical-align: top;
}

.kt-regeltabelle td:first-child {
    width: 34%;
    color: #ffe08a;
    font-weight: 700;
}

.kt-gross {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffe89a, #e8b93a 55%, #b98618);
    color: #2c1e04;
    font: 800 14px/1 Muli, Verdana, sans-serif;
    cursor: pointer;
}

.kt-bestenliste table {
    width: 100%;
    margin-bottom: 4px;
    color: #e6f2dc;
    border-collapse: collapse;
}

.kt-bestenliste th {
    padding: 6px 4px;
    color: #9fc79a;
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, .2);
}

.kt-bestenliste td {
    padding: 5px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.kt-bestenliste h6 {
    margin: 16px 0 4px;
    color: #ffd86e;
    font-size: 13px;
}

.kt-bestenliste .text-right {
    text-align: right;
}

.kt-bestenliste .text-muted {
    color: #8fb08a;
}

/* ---- Rueckfrage und Hinweis ------------------------------------------------ */

.kt-frage {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .6);
}

.kt-frage[hidden] {
    display: none;
}

.kt-frage-kasten {
    width: 360px;
    padding: 22px 26px;
    text-align: center;
    border: 1px solid rgba(255, 150, 150, .6);
    border-radius: 18px;
    background: linear-gradient(180deg, #2a1414, #150808);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .75);
}

.kt-frage-kasten h4 {
    margin: 0 0 8px;
    color: #ffb1b1;
    font-size: 18px;
}

.kt-frage-kasten p {
    margin: 0 0 16px;
    color: #f0d6d6;
    font-size: 13px;
}

.kt-meldung {
    position: absolute;
    top: 10px;
    left: 50%;
    z-index: 45;
    max-width: 90%;
    padding: 8px 18px;
    transform: translateX(-50%);
    border: 1px solid rgba(233, 200, 107, .7);
    border-radius: 18px;
    background: rgba(6, 22, 14, .96);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .55);
    color: #ffe9a8;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.kt-meldung[hidden] {
    display: none;
}

.kt-meldung-fehler {
    border-color: rgba(255, 130, 130, .8);
    color: #ffc2cb;
}

/* ==== Handy und Tablet: der Tisch im Vollbild ================================== */

body.kt-voll-offen {
    overflow: hidden !important;
}

.kt-voll {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background: #061a10;
    color: #fff;
    font-family: Muli, Verdana, sans-serif;
}

.kt-voll-kopf {
    flex: 0 0 46px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    background: rgba(3, 8, 22, .92);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.kt-voll-titel {
    flex: 1;
    min-width: 0;
    color: #e9c86b;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.1;
}

.kt-voll-titel small {
    display: block;
    color: #a9c4a0;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: none;
}

.kt-voll-tipp[hidden] {
    display: none;
}

.kt-voll-werkzeuge {
    display: flex;
    gap: 6px;
}

.kt-voll-flaeche {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #061a10 url("/img/kniffel/filz.jpg") center / cover no-repeat;
}

.kt-rahmen-aussen {
    position: relative;
    flex: none;
}

.kt-rahmen {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
}

/* Der Knopf, der zum laufenden Tisch zurueckfuehrt. */
.kt-schwebe {
    position: fixed;
    right: 12px;
    bottom: calc(var(--mob-reiter, 0px) + 14px);
    z-index: 100040;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px 9px 10px;
    border: 1px solid rgba(255, 236, 170, .9);
    border-radius: 999px;
    background: linear-gradient(180deg, #ffe89a 0%, #e8b93a 52%, #b98618 100%);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .7);
    color: #2c1e04;
    font: 800 13px/1 Muli, Verdana, sans-serif;
    cursor: pointer;
    animation: kt-schwebe 2.2s ease-in-out infinite;
}

.kt-schwebe[hidden] {
    display: none;
}

.kt-schwebe img {
    width: 26px;
    height: 26px;
}

@keyframes kt-schwebe {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ==== Die schmale Anordnung (Handy hochkant): 390 x 680 ========================== */

.kt-schmal .kt-status {
    left: 10px;
    top: 6px;
    width: 262px;
    font-size: 11.5px;
    line-height: 1.3;
}

.kt-schmal .kt-wurfknopf {
    left: 10px;
    top: 40px;
    padding: 7px 14px;
    font-size: 12px;
}

.kt-schmal .kt-verlassen,
.kt-schmal .kt-ablagetext {
    display: none;
}

.kt-schmal .kt-ablage {
    left: 12px;
    top: 178px;
    width: 366px;
    height: 80px;
    border-width: 16px;
    border-image-width: 16px;
}

.kt-schmal .kt-canvas {
    width: 390px;
    height: 262px;
}

.kt-schmal .kt-blatt {
    left: 12px;
    top: 266px;
    width: 366px;
    height: 408px;
    transform: rotate(-.5deg);
}

.kt-schmal .kt-inhalt {
    left: 11px;
    right: 11px;
    top: 14px;
    bottom: 8px;
}

.kt-schmal .kt-titel {
    display: none;
}

.kt-schmal .kt-zeile {
    height: 23px;
}

.kt-schmal .kt-kopf {
    height: 22px;
    font-size: 12px;
    line-height: 22px;
}

.kt-schmal .kt-name {
    flex: 0 0 122px;
    font-size: 12px;
    line-height: 23px;
}

.kt-schmal .kt-z {
    line-height: 23px;
}

.kt-schmal .kt-z.kt-frei {
    font-size: 14px;
    line-height: 23px;
}

.kt-schmal .kt-summe .kt-name {
    font-size: 11px;
}

.kt-schmal .kt-summe .kt-z {
    font-size: 12px;
    line-height: 23px;
}

.kt-schmal .kt-banner {
    width: 390px;
    top: 80px;
    font-size: 40px;
}

.kt-schmal .kt-karte-innen {
    width: 320px;
    padding: 18px 20px 20px;
}

.kt-schmal .kt-karte-innen h3 {
    font-size: 21px;
}

.kt-schmal .kt-endstand b {
    font-size: 36px;
}

/* Im Vollbild liegt der Filz schon dahinter. */
.kt-schmal .kt-buehne {
    background: none;
}
