/* v20260801-trump2: classic tucked trump under deck, no discard count */

/* —— table width: compact & centered on desktop —— */
body.page-kormkota.page-durak .kk-durak-table {
    display: grid;
    gap: 1rem;
    width: 100%;
    max-width: 980px;
    margin-inline: auto;
}

body.page-kormkota.page-durak .kk-durak-waiting-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

body.page-kormkota.page-durak .kk-durak-sit-form,
body.page-kormkota.page-durak .kk-durak-restart-form {
    display: grid;
    justify-items: center;
    margin: 0.35rem 0 0.85rem;
}

body.page-kormkota.page-durak .kk-durak-sit-btn,
body.page-kormkota.page-durak .kk-durak-restart-btn {
    min-width: min(22rem, 92vw) !important;
    min-height: 3.35rem !important;
    padding: 0.85rem 1.4rem !important;
    font-size: 1.15rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    border-radius: 16px !important;
    box-shadow: 0 0 0 1px rgba(125, 255, 104, 0.35), 0 0 28px rgba(90, 220, 120, 0.28) !important;
}

body.page-kormkota.page-durak .kk-durak-restart,
body.page-kormkota.page-durak .kk-durak-restart-form {
    margin-top: 0.75rem;
}

body.page-kormkota.page-durak .kk-durak-seat.is-sit {
    opacity: 1;
    border-color: rgba(125, 255, 104, 0.55);
    box-shadow: 0 0 0 1px rgba(125, 255, 104, 0.2), 0 0 18px rgba(90, 220, 120, 0.18);
}

body.page-kormkota.page-durak .kk-seat-empty {
    display: grid;
    place-items: center;
    gap: 0.35rem;
    min-height: 4.2rem;
    color: #8fa0b8;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
}

body.page-kormkota.page-durak .kk-seat-sit-btn {
    min-height: 2.1rem;
    padding: 0.35rem 0.85rem;
    border: 1px solid rgba(125, 255, 104, 0.55);
    border-radius: 999px;
    background: rgba(40, 120, 70, 0.85);
    color: #e8ffe8;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
}

body.page-kormkota.page-durak .kk-seat-sit-btn:hover {
    filter: brightness(1.08);
}

body.page-kormkota.page-durak .kk-trump-empty,
body.page-kormkota.page-durak .kk-card-placeholder {
    display: grid !important;
    place-items: center !important;
    width: clamp(4.2rem, 5vw, 5.2rem) !important;
    height: clamp(5.8rem, 7vw, 7.2rem) !important;
    border: 1.5px dashed rgba(200, 255, 220, 0.35) !important;
    border-radius: 10px !important;
    background: rgba(0, 0, 0, 0.28) !important;
    color: #9bb0c4 !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    box-shadow: none !important;
}

/* ensure empty trump never looks like a blank white card */
body.page-kormkota.page-durak .kk-durak-trump > .kk-card:empty,
body.page-kormkota.page-durak button.kk-card--trump:empty {
    display: none !important;
}

body.page-kormkota.page-durak .kk-durak-board {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(26rem, 1fr) auto auto !important;
    gap: 0.9rem;
    width: 100%;
    max-width: 940px;
    margin-inline: auto;
    min-height: min(720px, calc(100svh - 12rem));
    padding: clamp(0.75rem, 1.6vw, 1.2rem) !important;
    border-radius: 28px !important;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(ellipse at 50% 42%, rgba(40, 120, 78, 0.35), transparent 42%),
        linear-gradient(160deg, #0a2f28 0%, #061820 48%, #041018 100%) !important;
}

body.page-kormkota.page-durak .kk-durak-board::before,
body.page-kormkota.page-durak .kk-durak-board::after {
    display: none !important;
}

body.page-kormkota.page-durak .kk-durak-arena {
    position: relative;
    z-index: 1;
    min-height: min(30rem, 52vh);
    width: 100%;
    max-width: 920px;
    margin-inline: auto;
}

body.page-kormkota.page-durak .kk-durak-oval {
    position: absolute;
    inset: 12% 18% 18% 18%;
    border-radius: 50%;
    border: 2px solid rgba(200, 255, 220, 0.22);
    background:
        radial-gradient(ellipse at 50% 40%, rgba(70, 160, 100, 0.35), rgba(8, 55, 42, 0.85) 55%, rgba(3, 22, 20, 0.95) 100%);
    box-shadow:
        inset 0 0 80px rgba(0, 0, 0, 0.45),
        0 20px 60px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

body.page-kormkota.page-durak .kk-durak-seat {
    position: absolute;
    z-index: 3;
    width: min(10.5rem, 20vw);
    min-height: 5rem;
    padding: 0.45rem 0.5rem 0.4rem;
    border: 1px solid rgba(200, 255, 220, 0.2);
    border-radius: 16px;
    background: rgba(2, 14, 20, 0.82);
    backdrop-filter: blur(8px);
    display: grid;
    gap: 0.25rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

body.page-kormkota.page-durak .kk-durak-seat.is-empty {
    opacity: 0.55;
    border-style: dashed;
}

body.page-kormkota.page-durak .kk-durak-seat.is-me {
    border-color: rgba(125, 255, 104, 0.55);
    background: rgba(10, 48, 40, 0.92);
}

body.page-kormkota.page-durak .kk-durak-seat.is-attacker {
    border-color: rgba(255, 214, 90, 0.75);
    box-shadow: 0 0 0 1px rgba(255, 214, 90, 0.25), 0 0 24px rgba(255, 214, 90, 0.16);
}

body.page-kormkota.page-durak .kk-durak-seat.is-defender {
    border-color: rgba(90, 220, 255, 0.75);
    box-shadow: 0 0 0 1px rgba(90, 220, 255, 0.25), 0 0 24px rgba(90, 220, 255, 0.16);
}

body.page-kormkota.page-durak .kk-durak-seat.is-loser {
    border-color: rgba(255, 110, 110, 0.7);
}

body.page-kormkota.page-durak .kk-durak-seat--pos0 { left: 50%; bottom: 1%; transform: translateX(-50%); }
body.page-kormkota.page-durak .kk-durak-seat--pos1 { left: 2%; bottom: 22%; }
body.page-kormkota.page-durak .kk-durak-seat--pos2 { left: 2%; top: 14%; }
body.page-kormkota.page-durak .kk-durak-seat--pos3 { left: 50%; top: 1%; transform: translateX(-50%); }
body.page-kormkota.page-durak .kk-durak-seat--pos4 { right: 2%; top: 14%; }
body.page-kormkota.page-durak .kk-durak-seat--pos5 { right: 2%; bottom: 22%; }

body.page-kormkota.page-durak .kk-seat-head {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 0.4rem;
    align-items: center;
}

body.page-kormkota.page-durak .kk-seat-meta {
    min-width: 0;
    display: grid;
    gap: 0.05rem;
}

body.page-kormkota.page-durak .kk-seat-meta strong,
body.page-kormkota.page-durak .kk-seat-meta em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.page-kormkota.page-durak .kk-seat-meta strong {
    color: #f2fbff !important;
    font-size: 0.82rem;
    font-weight: 800;
}

body.page-kormkota.page-durak .kk-seat-meta em {
    color: #9dff5a !important;
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 700;
}

body.page-kormkota.page-durak .kk-seat-backs {
    display: flex;
    justify-content: center;
    min-height: 1.6rem;
    padding-left: 0.6rem;
}

body.page-kormkota.page-durak .kk-seat-backs .kk-card-back--mini {
    width: 1.15rem !important;
    height: 1.55rem !important;
    margin-left: -0.55rem;
    border-radius: 4px !important;
    font-size: 0;
}

body.page-kormkota.page-durak .kk-seat-count {
    text-align: center;
    color: #aebbd2;
    font-size: 0.72rem;
    font-weight: 800;
}

body.page-kormkota.page-durak .kk-seat-empty {
    display: grid;
    place-items: center;
    min-height: 4.2rem;
    color: #8fa0b8;
    font-size: 0.78rem;
    font-weight: 700;
}

body.page-kormkota.page-durak .kk-durak-felt {
    position: absolute;
    z-index: 2;
    inset: 28% 20% 30% 20%;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.55rem;
    margin: 0 !important;
    width: auto !important;
    min-height: 0 !important;
    border: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
}

body.page-kormkota.page-durak .kk-durak-center {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    padding: 0.35rem !important;
    min-height: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

/* Classic Durak stock: face-up trump tucked under face-down deck */
body.page-kormkota.page-durak .kk-durak-stock {
    position: relative !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    min-height: 0 !important;
    padding: 0.35rem 0.25rem !important;
    border: 0 !important;
    background: transparent !important;
}

body.page-kormkota.page-durak .kk-durak-pile {
    position: relative !important;
    flex: 0 0 auto !important;
    width: clamp(4.8rem, 5.6vw, 5.8rem) !important;
    height: clamp(6.7rem, 7.8vw, 8.1rem) !important;
    min-height: 0 !important;
    /* room for trump peeking to the right */
    margin: 0 clamp(2.6rem, 3vw, 3.2rem) 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    overflow: visible !important;
}

body.page-kormkota.page-durak .kk-durak-deck-meta {
    display: grid !important;
    gap: 0.05rem !important;
    line-height: 1.1 !important;
    min-height: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

body.page-kormkota.page-durak .kk-durak-deck-meta strong {
    color: #f4fbff !important;
    font-size: 1.35rem !important;
    font-weight: 900 !important;
}

body.page-kormkota.page-durak .kk-durak-deck-meta span {
    color: #9bb0c4 !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: lowercase !important;
}

body.page-kormkota.page-durak .kk-durak-trump {
    position: absolute !important;
    z-index: 1 !important;
    left: 0 !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    display: grid !important;
    place-items: center !important;
    gap: 0 !important;
    pointer-events: none !important;
    overflow: visible !important;
}

body.page-kormkota.page-durak .kk-durak-trump .kk-card--trump,
body.page-kormkota.page-durak .kk-durak-trump button.kk-card--trump,
body.page-kormkota.page-durak .kk-durak-trump .kk-trump-empty {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35) !important;
    /* sideways under deck; peek to the right */
    transform: translate(-50%, -50%) rotate(90deg) translateY(-44%) !important;
    transform-origin: center center !important;
}

body.page-kormkota.page-durak .kk-durak-pile > .kk-card-back {
    position: absolute !important;
    z-index: 2 !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    box-shadow:
        2px 2px 0 rgba(0, 0, 0, 0.18),
        4px 4px 0 rgba(5, 34, 54, 0.55),
        0 10px 22px rgba(0, 0, 0, 0.35) !important;
}

body.page-kormkota.page-durak .kk-durak-stock:not(.has-trump) .kk-durak-trump .kk-trump-empty {
    font-size: 0.58rem !important;
    opacity: 0.7 !important;
}

/* When deck is gone, trump sits upright as the last card */
body.page-kormkota.page-durak .kk-durak-stock.is-empty-deck .kk-durak-pile {
    margin-right: 0 !important;
}

body.page-kormkota.page-durak .kk-durak-stock.is-empty-deck .kk-durak-trump .kk-card--trump,
body.page-kormkota.page-durak .kk-durak-stock.is-empty-deck .kk-durak-trump button.kk-card--trump {
    transform: translate(-50%, -50%) !important;
}

body.page-kormkota.page-durak .kk-durak-stock.is-empty-deck .kk-durak-pile > .kk-card-back {
    opacity: 0 !important;
    pointer-events: none !important;
}

body.page-kormkota.page-durak .kk-durak-discard {
    display: none !important;
}

body.page-kormkota.page-durak .kk-durak-playfield {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 8rem !important;
    padding: 0.55rem !important;
    border-radius: 18px;
    border: 1px solid rgba(200, 255, 220, 0.12);
    background: rgba(0, 0, 0, 0.2) !important;
}

body.page-kormkota.page-durak .kk-durak-pair {
    display: grid !important;
    grid-template-columns: auto auto !important;
    gap: 0.25rem;
    padding: 0.3rem;
    border-radius: 12px;
    background: rgba(2, 14, 22, 0.35);
}

body.page-kormkota.page-durak .kk-durak-pair > span {
    display: none;
}

body.page-kormkota.page-durak .kk-durak-actions {
    z-index: 2;
    width: min(48rem, 94%);
    justify-self: center;
    border-radius: 16px;
    padding: 0.75rem 1rem;
}

body.page-kormkota.page-durak .kk-durak-hand {
    z-index: 2;
    width: min(52rem, 96%);
    justify-self: center;
    margin: 0 !important;
    border-radius: 18px !important;
}

body.page-kormkota.page-durak .kk-durak-cards .kk-card {
    margin-left: -0.85rem;
    transition: transform 0.18s ease;
}

body.page-kormkota.page-durak .kk-durak-cards .kk-card:first-child {
    margin-left: 0;
}

body.page-kormkota.page-durak .kk-durak-cards .kk-card:not(:disabled):hover {
    transform: translateY(-0.85rem) scale(1.05);
    z-index: 5;
}

body.page-kormkota .kk-room-actions {
    display: grid;
    gap: 0.55rem;
    align-content: start;
}

/* —— classic playing-card faces (beats global strong/small !important) —— */
body.page-kormkota .kk-card,
body.page-kormkota button.kk-card {
    position: relative !important;
    display: grid !important;
    grid-template-rows: auto 1fr auto !important;
    align-items: stretch !important;
    justify-items: stretch !important;
    width: clamp(4.8rem, 5.6vw, 5.8rem) !important;
    height: clamp(6.7rem, 7.8vw, 8.1rem) !important;
    padding: 0.32rem 0.34rem !important;
    border: 1px solid #c9d4e0 !important;
    border-radius: 10px !important;
    background: #fff !important;
    background-image: none !important;
    color: #111 !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28) !important;
    font-family: "Exo 2", "Segoe UI", sans-serif !important;
    line-height: 1 !important;
    overflow: hidden !important;
    cursor: pointer;
}

body.page-kormkota .kk-card .kk-card-corner,
body.page-kormkota button.kk-card .kk-card-corner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.02rem !important;
    justify-self: start !important;
    line-height: 1 !important;
}

body.page-kormkota .kk-card .kk-card-corner--br,
body.page-kormkota button.kk-card .kk-card-corner--br {
    justify-self: end !important;
    transform: rotate(180deg);
}

body.page-kormkota .kk-card .kk-card-rank,
body.page-kormkota .kk-card strong,
body.page-kormkota .kk-card strong.kk-card-rank,
body.page-kormkota button.kk-card .kk-card-rank,
body.page-kormkota button.kk-card strong {
    display: block !important;
    color: #111 !important;
    font-size: 1.28rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.02em !important;
    line-height: 1 !important;
    text-shadow: none !important;
    -webkit-text-fill-color: #111 !important;
}

body.page-kormkota .kk-card .kk-card-suit,
body.page-kormkota .kk-card em.kk-card-suit,
body.page-kormkota button.kk-card .kk-card-suit {
    display: block !important;
    color: #111 !important;
    font-size: 0.9rem !important;
    font-style: normal !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    -webkit-text-fill-color: #111 !important;
}

body.page-kormkota .kk-card .kk-card-pip,
body.page-kormkota .kk-card > span.kk-card-pip,
body.page-kormkota button.kk-card .kk-card-pip {
    display: grid !important;
    place-items: center !important;
    align-self: center !important;
    justify-self: center !important;
    color: #111 !important;
    font-size: 2.45rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    -webkit-text-fill-color: #111 !important;
}

/* legacy markup fallback (old strong/span/small) */
body.page-kormkota .kk-card > span:not(.kk-card-corner):not(.kk-card-pip),
body.page-kormkota button.kk-card > span:not(.kk-card-corner):not(.kk-card-pip) {
    display: grid !important;
    place-items: center !important;
    color: #111 !important;
    font-size: 1.9rem !important;
    -webkit-text-fill-color: #111 !important;
}

body.page-kormkota .kk-card > small,
body.page-kormkota button.kk-card > small {
    display: none !important;
}

body.page-kormkota .kk-card--red,
body.page-kormkota .kk-card--red .kk-card-rank,
body.page-kormkota .kk-card--red .kk-card-suit,
body.page-kormkota .kk-card--red .kk-card-pip,
body.page-kormkota .kk-card--red strong,
body.page-kormkota .kk-card--red span,
body.page-kormkota .kk-card--red em,
body.page-kormkota button.kk-card--red,
body.page-kormkota button.kk-card--red .kk-card-rank,
body.page-kormkota button.kk-card--red .kk-card-suit,
body.page-kormkota button.kk-card--red .kk-card-pip,
body.page-kormkota button.kk-card--red strong,
body.page-kormkota button.kk-card--red span,
body.page-kormkota button.kk-card--red em {
    color: #c41e3a !important;
    -webkit-text-fill-color: #c41e3a !important;
}

body.page-kormkota .kk-card--red {
    color: #c41e3a !important;
}

body.page-kormkota .kk-card--black,
body.page-kormkota .kk-card--black .kk-card-rank,
body.page-kormkota .kk-card--black .kk-card-suit,
body.page-kormkota .kk-card--black .kk-card-pip,
body.page-kormkota .kk-card--black strong,
body.page-kormkota .kk-card--black span,
body.page-kormkota .kk-card--black em,
body.page-kormkota button.kk-card--black,
body.page-kormkota button.kk-card--black .kk-card-rank,
body.page-kormkota button.kk-card--black .kk-card-suit,
body.page-kormkota button.kk-card--black .kk-card-pip,
body.page-kormkota button.kk-card--black strong,
body.page-kormkota button.kk-card--black span,
body.page-kormkota button.kk-card--black em {
    color: #121212 !important;
    -webkit-text-fill-color: #121212 !important;
}

body.page-kormkota .kk-card:not(:disabled):hover {
    transform: translateY(-6px);
}

body.page-kormkota .kk-card:disabled {
    cursor: default;
    opacity: 1;
}

body.page-kormkota .kk-card-back {
    display: grid !important;
    place-items: center !important;
    width: clamp(4.8rem, 5.6vw, 5.8rem) !important;
    height: clamp(6.7rem, 7.8vw, 8.1rem) !important;
    border-radius: 10px !important;
    border: 1px solid rgba(67, 230, 255, 0.35) !important;
    background:
        linear-gradient(45deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.08) 75%, transparent 75%),
        linear-gradient(135deg, #052236, #0a4360 54%, #7dff68) !important;
    background-size: 12px 12px, auto !important;
    color: #d8fff6 !important;
    font-weight: 900 !important;
}

body.page-kormkota .kk-card-slot,
body.page-kormkota .kk-card-placeholder {
    display: grid !important;
    place-items: center !important;
    width: clamp(4.8rem, 5.6vw, 5.8rem) !important;
    height: clamp(6.7rem, 7.8vw, 8.1rem) !important;
    border-radius: 10px !important;
    border: 1px dashed rgba(211, 255, 225, 0.35) !important;
    background: rgba(0, 0, 0, 0.18) !important;
    color: #aebbd2 !important;
    font-weight: 900 !important;
}

@media (max-width: 900px) {
    body.page-kormkota.page-durak .kk-durak-table {
        max-width: none;
    }

    body.page-kormkota.page-durak .kk-durak-board {
        grid-template-rows: auto auto auto !important;
        min-height: auto;
        max-width: none;
    }

    body.page-kormkota.page-durak .kk-durak-arena {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        min-height: auto;
        max-width: none;
    }

    body.page-kormkota.page-durak .kk-durak-oval {
        display: none;
    }

    body.page-kormkota.page-durak .kk-durak-seat {
        position: relative;
        inset: auto;
        width: 100%;
        transform: none !important;
    }

    body.page-kormkota.page-durak .kk-durak-felt {
        position: relative;
        inset: auto;
        grid-column: 1 / -1;
    }

    body.page-kormkota.page-durak .kk-durak-center {
        display: flex !important;
        justify-content: center !important;
    }

    body.page-kormkota.page-durak .kk-durak-pile {
        width: 3.9rem;
        height: 5.5rem;
        margin-right: 2rem;
    }

    body.page-kormkota .kk-card,
    body.page-kormkota button.kk-card,
    body.page-kormkota .kk-card-back,
    body.page-kormkota .kk-card-slot,
    body.page-kormkota .kk-card-placeholder {
        width: 3.9rem !important;
        height: 5.5rem !important;
    }

    body.page-kormkota .kk-card .kk-card-pip {
        font-size: 1.7rem !important;
    }

    body.page-kormkota .kk-card .kk-card-rank,
    body.page-kormkota .kk-card strong {
        font-size: 0.92rem !important;
    }
}
