/* Games for several people: room, players, Connect Four. */
.team-invite { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; padding: 1rem; margin-bottom: 1rem;
    border: 1px solid var(--bs-border-color); border-radius: .75rem; background: var(--bs-tertiary-bg); }
.team-invite[hidden] { display: none; }
.team-invite-qr { width: 8.5rem; flex: none; background: #fff; padding: .35rem; border-radius: .5rem; }
.team-invite-qr svg { display: block; width: 100%; height: auto; }
.team-code { font-size: 2.4rem; font-weight: 800; letter-spacing: .25em; line-height: 1.1; font-variant-numeric: tabular-nums; }

.team-seats { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.team-seats li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .45rem .7rem;
    border: 1px solid var(--bs-border-color); border-radius: .5rem; background: var(--bs-body-bg); }
.team-seat-name { font-weight: 600; margin-right: auto; }

.team-players { list-style: none; padding: 0; margin: 0 0 .75rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.team-players li { display: flex; gap: .6rem; align-items: baseline; padding: .35rem .75rem; border-radius: .5rem;
    border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); }
.team-players li.turn { background: var(--bs-success-bg-subtle); border-color: var(--bs-success); }
.team-players li.me .team-player-name { text-decoration: underline; }
.team-player-name { font-weight: 600; }
.team-player-score { font-weight: 800; font-variant-numeric: tabular-nums; }

.team-status { padding: .5rem .8rem; border-radius: .5rem; background: var(--bs-tertiary-bg); margin-bottom: .75rem; }
.team-status.mine { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.team-over { text-align: center; padding: 1rem; margin-bottom: 1rem; border-radius: .75rem; background: var(--bs-warning-bg-subtle); }
@keyframes c4-drop { from { transform: translateY(-120%); } to { transform: none; } }
@keyframes c4-pulse { 50% { filter: brightness(1.25); } }
@media (max-width: 575.98px) { .team-code { font-size: 2rem; } }

/* Sudoku race */
.team-status.bad { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }

/* Quick quiz */
.qz-prompt { text-align: center; font-size: 2.2rem; font-weight: 800; padding: 1rem; margin-bottom: .75rem; border-radius: .75rem; background: var(--bs-tertiary-bg); }
.qz-prompt.spell { letter-spacing: .08em; }
.qz-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .6rem; max-width: 34rem; margin: 0 auto; }
.qz-choice { padding: .9rem .5rem; font-size: 1.5rem; font-weight: 700; border-radius: .6rem; border: 2px solid var(--bs-border-color); background: var(--bs-body-bg); cursor: pointer; }
.qz-choice:disabled { cursor: default; }
.qz-choice:not(:disabled):hover { border-color: var(--bs-primary); background: var(--bs-primary-bg-subtle); }
.qz-choice.picked { border-color: var(--bs-primary); background: var(--bs-primary-bg-subtle); }
.qz-choice.right { border-color: var(--bs-success); background: var(--bs-success-bg-subtle); }
.qz-choice.wrong { border-color: var(--bs-danger); background: var(--bs-danger-bg-subtle); }
.qz-who { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.qz-chip { padding: .15rem .6rem; border-radius: 1rem; border: 1px solid var(--bs-border-color); font-size: .9rem; }
.qz-chip.done { background: var(--bs-success-bg-subtle); border-color: var(--bs-success); }
@keyframes sh-nope { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Draughts and chess boards */
.dk-wrap { max-width: 30rem; margin: 0 auto; }
.dk-board { display: grid; grid-template-columns: repeat(8, 1fr); border: 4px solid #5b3a1e; border-radius: .4rem; overflow: hidden; }
.dk-sq { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; position: relative; padding: 0; border: 0; }
.dk-sq.light { background: #f0d9b5; }
.dk-sq.dark { background: #b58863; }
.dk-sq.last { box-shadow: inset 0 0 0 100px rgba(255, 235, 59, .35); }
.dk-sq.sel { box-shadow: inset 0 0 0 4px #1971c2; }
.dk-sq.target::after { content: ''; width: 28%; aspect-ratio: 1; border-radius: 50%; background: rgba(47, 158, 68, .75); position: absolute; }
button.dk-sq { cursor: pointer; }
.dk-sq.check { box-shadow: inset 0 0 0 100px rgba(224, 49, 49, .5); }
.dk-sq.capture::after { content: ''; position: absolute; inset: 4%; border-radius: 50%; border: 4px solid rgba(47, 158, 68, .8); }
@keyframes ld-pulse { from { opacity: 1; } to { opacity: .55; } }

/* Chat of the room: a bubble in the corner that lights up, and a small window opened from it */
.team-chat-toggle { position: fixed; z-index: 1040; right: calc(1rem + env(safe-area-inset-right, 0px)); bottom: calc(1rem + env(safe-area-inset-bottom, 0px) + var(--chat-lift, 0px));
    width: 3.5rem; height: 3.5rem; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center;
    background: var(--bs-primary); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); cursor: pointer; touch-action: manipulation; }
.team-chat-toggle[hidden] { display: none; }
.team-chat-toggle:focus-visible { outline: 3px solid var(--bs-warning); outline-offset: 2px; }
.team-chat-toggle.open { background: var(--bs-secondary); }
.team-chat-toggle.lit { background: #f59f00; color: #222; animation: team-chat-glow 1.1s ease-in-out infinite alternate; }
@keyframes team-chat-glow {
    from { box-shadow: 0 4px 12px rgba(0, 0, 0, .3), 0 0 0 0 rgba(245, 159, 0, .7); }
    to { box-shadow: 0 4px 12px rgba(0, 0, 0, .3), 0 0 0 .7rem rgba(245, 159, 0, 0); }
}
@media (prefers-reduced-motion: reduce) { .team-chat-toggle.lit { animation: none; box-shadow: 0 0 0 .3rem rgba(245, 159, 0, .5); } }
.team-chat-badge { position: absolute; top: -.2rem; right: -.2rem; min-width: 1.4rem; height: 1.4rem; padding: 0 .3rem; border-radius: .7rem;
    background: #dc3545; color: #fff; font-size: .8rem; font-weight: 700; line-height: 1.4rem; text-align: center; }
.team-chat-badge[hidden] { display: none; }
.team-chat { position: fixed; z-index: 1041; right: calc(1rem + env(safe-area-inset-right, 0px));
    bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px) + var(--chat-lift, 0px));
    width: min(22rem, calc(100vw - 2rem)); max-height: min(26rem, calc(var(--chat-room, 100vh) - 6.5rem));
    display: flex; flex-direction: column; padding: .75rem; border-radius: .9rem;
    background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); box-shadow: 0 8px 28px rgba(0, 0, 0, .3); }
.team-chat[hidden] { display: none; }
.team-chat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.team-chat-log { list-style: none; padding: 0; margin: 0 0 .5rem; flex: 1 1 auto; min-height: 3rem; overflow-y: auto; overscroll-behavior: contain;
    font-size: .95rem; overflow-wrap: anywhere; }
.team-chat-log li { padding: .1rem 0; }
.team-chat-log li.me strong { color: var(--app-primary-text, var(--bs-primary)); }
.team-chat-form { display: flex; gap: .5rem; flex: none; }
.team-chat-form .form-control { min-width: 0; font-size: 1rem; }
/* Voice chat: a microphone next to the bubble and a window like the one of the chat */
.team-react-toggle { right: calc(5.25rem + env(safe-area-inset-right, 0px)); background: #f59f00; font-size: 1.7rem; line-height: 1; }
.team-voice-toggle { right: calc(9.5rem + env(safe-area-inset-right, 0px)); background: var(--bs-secondary); }
/* Who is talking: the microphone next to the name lights up */
.team-voice-mark { display: inline-block; padding: 0 .2rem; border-radius: .6rem; transition: box-shadow .15s, background-color .15s; }
.team-voice-mark.speaking { background: #b9f2c4; box-shadow: 0 0 0 .15rem #2fb344, 0 0 .5rem .2rem rgba(47, 179, 68, .55); }
/* Quick reactions: a row of pictures and the pictures that float up */
.team-react-bar { position: fixed; z-index: 1041; right: calc(1rem + env(safe-area-inset-right, 0px));
    bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px) + var(--chat-lift, 0px)); display: flex; gap: .25rem; padding: .4rem;
    border-radius: 2rem; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); box-shadow: 0 8px 28px rgba(0, 0, 0, .3); }
.team-react-bar[hidden] { display: none; }
.team-react-bar button { width: 2.9rem; height: 2.9rem; border: 0; border-radius: 50%; background: transparent; font-size: 1.7rem; line-height: 1; cursor: pointer; touch-action: manipulation; }
.team-react-bar button:hover, .team-react-bar button:focus-visible { background: var(--bs-secondary-bg); outline: none; }
.team-react-bar button:active { transform: scale(1.25); }
.team-reactions { position: fixed; z-index: 1039; left: 0; right: 0; bottom: calc(5rem + var(--chat-lift, 0px)); height: 0; pointer-events: none; }
.team-reaction { position: absolute; bottom: 0; display: flex; flex-direction: column; align-items: center; animation: team-reaction-up 2.5s ease-out forwards; }
.team-reaction-icon { font-size: 2.8rem; line-height: 1.1; }
.team-reaction-name { font-size: .8rem; font-weight: 700; padding: 0 .4rem; border-radius: .6rem; background: var(--bs-body-bg); color: var(--bs-body-color); border: 1px solid var(--bs-border-color); max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes team-reaction-up {
    0% { transform: translateY(0) scale(.4); opacity: 0; }
    15% { transform: translateY(-2rem) scale(1.15); opacity: 1; }
    75% { opacity: 1; }
    100% { transform: translateY(-16rem) scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .team-reaction { animation: team-reaction-fade 2.5s linear forwards; bottom: 3rem; }
    @keyframes team-reaction-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
}
.team-voice-toggle.on { background: #198754; }
.team-voice-toggle.muted { background: #dc3545; }
.team-voice-slash { position: absolute; display: none; fill: none; }
.team-voice-toggle.muted .team-voice-slash { display: block; }
.team-voice-body { overflow-y: auto; overscroll-behavior: contain; }
.team-voice-list { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: .35rem; }
.team-voice-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.team-voice-name { font-weight: 600; overflow-wrap: anywhere; margin-right: auto; }
.team-voice-status.failed { color: var(--bs-danger) !important; }
/* Room for the bubble, so it never covers the last row of a board or the buttons under it. */
/* Room under the round buttons in the corner, so the last row of a board can be scrolled above them. */
#teamRoom { padding-bottom: 6.5rem; }
@media (max-width: 575.98px) {
    .team-chat { left: .5rem; right: .5rem; width: auto; bottom: calc(4.9rem + env(safe-area-inset-bottom, 0px) + var(--chat-lift, 0px)); }
    .team-chat-toggle { width: 3.25rem; height: 3.25rem; right: calc(.75rem + env(safe-area-inset-right, 0px)); bottom: calc(.75rem + env(safe-area-inset-bottom, 0px) + var(--chat-lift, 0px)); }
    .team-react-toggle { right: calc(4.6rem + env(safe-area-inset-right, 0px)); }
    .team-voice-toggle { right: calc(8.45rem + env(safe-area-inset-right, 0px)); }
    .team-react-bar { right: .5rem; bottom: calc(4.9rem + env(safe-area-inset-bottom, 0px) + var(--chat-lift, 0px)); }
    .team-react-bar button { width: 2.6rem; height: 2.6rem; font-size: 1.5rem; }
}
@media (max-width: 575.98px) {
    .dice-table th, .dice-table td { padding: .25rem .35rem; font-size: .85rem; }
}

/* Domino and Makao: tiles, cards, counters */
.dm-counts { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1rem; margin-bottom: .5rem; font-size: .95rem; }
.dm-count.turn { font-weight: 700; text-decoration: underline; }
.mk-deck { width: 3.4rem; height: 4.8rem; border-radius: .45rem; border: 2px solid #2c4f9e; display: flex; align-items: center; justify-content: center; color: #fff;
    background: repeating-linear-gradient(45deg, #3b66c4, #3b66c4 7px, #4a75d4 7px, #4a75d4 14px); }
.mk-card { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 3.4rem; height: 4.8rem; border-radius: .45rem;
    background: #fff; color: #111; border: 2px solid #333; line-height: 1.1; box-shadow: 0 2px 3px rgba(0, 0, 0, .35); font-size: 1.15rem; }
.mk-card i { font-style: normal; font-size: 1.4rem; }
.mk-card.red, .mk-suit.red { color: #c92a2a; }
.mk-card.playable { border-color: #198754; }
.mk-card.dim { opacity: .55; }
.mk-card.top { box-shadow: 0 0 0 3px #ffd54a; }
.mk-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.mk-pick { border: 0; padding: 0; background: none; }
button.mk-pick { cursor: pointer; }
button.mk-pick:hover .mk-card { transform: translateY(-4px); }
.mk-pick.chosen .mk-card { outline: 3px solid var(--bs-warning); }
button.mk-pick.lifted .mk-card { transform: translateY(-18px); box-shadow: 0 .6rem 1rem rgba(0, 0, 0, .3); outline: 3px solid var(--bs-primary); }
.team-confirm { display: flex; justify-content: center; align-items: center; gap: .5rem; margin-top: .6rem; padding-left: 0; }
.team-confirm .form-check-input { float: none; margin: 0; }
.team-confirm-hint { margin-top: .2rem; }

/* Watching, the table of the room, the game picker */
.team-watching { margin-bottom: .6rem; padding: .45rem .8rem; border-radius: .5rem; background: var(--bs-warning-bg-subtle, #fff3cd); color: var(--bs-warning-text-emphasis, #664d03); font-weight: 600; }
.team-watchers { margin: -.2rem 0 .5rem; }
.team-table { max-width: 30rem; margin: 1rem auto 0; padding: .8rem 1rem; border: 1px solid var(--bs-border-color); border-radius: .6rem; background: var(--bs-body-bg); }
.team-game-pick { max-width: 22rem; }
.sp-o0 { background: #ffd6d6; } .sp-o1 { background: #cfe2ff; } .sp-o2 { background: #d3f3d6; } .sp-o3 { background: #ffe9b0; }
.sp-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-top: .5rem; }

/* The settings of a game in the lobby */
.team-options { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: end; }
.team-option { display: flex; flex-direction: column; gap: .15rem; min-width: 9rem; }
span.team-option { flex-direction: row; gap: .3rem; min-width: 0; }

/* The room on a projector: nothing but the table, larger, with the code to join */
.team-screen-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.2rem; margin-bottom: .8rem; padding: .6rem 1rem; border-radius: .6rem;
    background: var(--bs-primary-bg-subtle, #cfe2ff); color: var(--bs-primary-text-emphasis, #052c65); font-size: 1.2rem; }
.team-screen-head .team-code { font-size: 2.2rem; letter-spacing: .25em; }
.team-screen-bar { display: flex; justify-content: flex-end; margin-bottom: .4rem; }
html.team-screen { font-size: 125%; }
html.team-screen header, html.team-screen footer, html.team-screen .feedback-widget, html.team-screen .cookie-notice,
html.team-screen .page-title .small, html.team-screen #teamInvite .small, html.team-screen #teamInvite [data-copy] { display: none !important; }
html.team-screen .container-xl { max-width: none; }

/* Two teams */
.team-t0 { box-shadow: inset 4px 0 0 #dc3545; }
.team-t1 { box-shadow: inset 4px 0 0 #0d6efd; }
.team-badge { display: inline-block; padding: .05rem .5rem; border-radius: 1rem; font-size: .8rem; font-weight: 700; color: #fff; }
.team-badge.t0 { background: #c92a2a; }
.team-badge.t1 { background: #1c5fd6; }
.team-totals { display: flex; justify-content: center; align-items: center; gap: .6rem; margin: .2rem 0 .6rem; font-weight: 800; font-size: 1.2rem; }
.wj-empty { width: 3.4rem; height: 4.8rem; border: 2px dashed rgba(255, 255, 255, .45); border-radius: .45rem; }
.qz-prompt.own { font-size: 1.4rem; font-weight: 700; text-align: left; }

/* Tysiąc */
.ty-trick { display: flex; justify-content: center; gap: 1rem; padding: .8rem; margin: .5rem auto; max-width: 28rem; background: #1d6b3a; border-radius: .6rem; color: #fff; }
.ty-last { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem; margin: 0 auto .5rem; }
.ty-last-card { display: inline-block; text-align: center; }
.ty-last-card .mk-card { transform: scale(.85); }
.ty-slot { display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 4.5rem; }
.ty-slot.win .mk-card { box-shadow: 0 0 0 3px #ffd54a; }
.mk-card.trump { background: #fff8d6; }
/* The countdown of a lifted card: a bar under it fills up, then the card goes to the table. */
button.mk-pick.lifted.timed { position: relative; }
button.mk-pick.lifted.timed::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -6px; height: 4px; border-radius: 2px; background: var(--bs-primary); transform-origin: left; animation: team-confirm var(--confirm-delay, 1.5s) linear var(--confirm-gone, 0ms) forwards; }
@keyframes team-confirm { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { button.mk-pick.lifted.timed::after { animation: none; transform: scaleX(1); opacity: .6; } }

/* Dragging a card onto the table (card games). */
button.mk-pick[data-card-confirm] { touch-action: none; }
.team-drag-ghost { position: fixed; left: 0; top: 0; z-index: 2000; pointer-events: none; opacity: .92; box-shadow: 0 .8rem 1.4rem rgba(0, 0, 0, .35); }
.team-dragging, .team-dragging * { cursor: grabbing !important; user-select: none; }
.team-dragging .mk-hand { outline: 2px dashed var(--bs-secondary-color); outline-offset: 4px; border-radius: .5rem; }
.team-dragging.team-drop-ready .mk-hand { outline-color: var(--bs-success); }

/* A card an opponent has just given (Tysiąc), marked for a few seconds. */
.mk-card.received { position: relative; outline: 3px solid #f5b301; outline-offset: 2px; box-shadow: 0 0 .9rem .15rem rgba(245, 179, 1, .75); transform: translateY(-8px); }
.mk-card.received::after { content: "✦"; position: absolute; top: -.55rem; right: -.35rem; color: #f5b301; font-size: 1.1rem; line-height: 1; }

/* A die is a real cube turned in 3D: the face to show is picked by turning the cube (.vN), a roll tumbles it down onto that face. */
.die { --s: 4.2rem; width: var(--s); height: var(--s); padding: 0; border: 0; background: none; cursor: pointer; position: relative;
    perspective: 650px; transition: transform .15s ease; }
.die:disabled { cursor: default; opacity: 1; }
.die:not(:disabled):hover { transform: translateY(-3px); }
.die::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -.7rem; height: .7rem; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0, 0, 0, .38), transparent); transition: transform .15s ease; }
.die .tilt { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-18deg) rotateY(-24deg); }
.die .cube { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--fx)) rotateY(var(--fy)) rotateZ(0deg); }
.cube.v1 { --fx: 0deg; --fy: 0deg; }
.cube.v2 { --fx: 0deg; --fy: -90deg; }
.cube.v3 { --fx: -90deg; --fy: 0deg; }
.cube.v4 { --fx: 90deg; --fy: 0deg; }
.cube.v5 { --fx: 0deg; --fy: 90deg; }
.cube.v6 { --fx: 0deg; --fy: 180deg; }
.cube.v0 { --fx: 0deg; --fy: 0deg; }
.die .face { position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 13%; box-sizing: border-box;
    background: linear-gradient(145deg, #ffffff, #dfe3ea); border: 1px solid rgba(0, 0, 0, .22); border-radius: 16%; }
.die .face b { display: block; margin: 10%; border-radius: 50%; }
.die .face b.p { background: radial-gradient(circle at 35% 30%, #4a4f57, #0f1114); box-shadow: inset 0 -1px 2px rgba(255, 255, 255, .25); }
.die .f1 b.p { background: radial-gradient(circle at 35% 30%, #e0584a, #a82a1e); margin: 2%; }
.die .f1 { transform: translateZ(calc(var(--s) / 2)); }
.die .f6 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.die .f2 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.die .f5 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.die .f3 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.die .f4 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.die.blank .f1 { display: flex; align-items: center; justify-content: center; color: #9aa3ad; font-size: calc(var(--s) * .55); font-weight: 800; }
.die.blank .f1 b { display: none; }
.die.blank .f1::after { content: "?"; }
.die.held { transform: translateY(-9px); }
.die.held::after { transform: scale(.7); }
.die.held .face { background: linear-gradient(145deg, #f2f7ff, #c9dcff); box-shadow: inset 0 0 0 3px var(--bs-primary); }
.die.rolling .tilt { animation: die-hop .95s cubic-bezier(.3, .6, .4, 1) both; animation-delay: var(--d, 0ms); }
.die.rolling .cube { animation: die-tumble .95s cubic-bezier(.2, .7, .3, 1) both; animation-delay: var(--d, 0ms); }
.die.rolling::after { animation: die-shadow .95s ease-out both; animation-delay: var(--d, 0ms); }
@keyframes die-tumble {
    from { transform: rotateX(calc(var(--fx) + var(--sx, 720deg))) rotateY(calc(var(--fy) + var(--sy, 1080deg))) rotateZ(var(--sz, 200deg)); }
    to { transform: rotateX(var(--fx)) rotateY(var(--fy)) rotateZ(0deg); }
}
@keyframes die-hop {
    0% { transform: translateY(-2.6rem) translateZ(3rem) rotateX(-18deg) rotateY(-24deg); }
    38% { transform: translateY(0) translateZ(0) rotateX(-18deg) rotateY(-24deg); }
    58% { transform: translateY(-.9rem) rotateX(-18deg) rotateY(-24deg); }
    78% { transform: translateY(0) rotateX(-18deg) rotateY(-24deg); }
    88% { transform: translateY(-.25rem) rotateX(-18deg) rotateY(-24deg); }
    100% { transform: translateY(0) rotateX(-18deg) rotateY(-24deg); }
}
@keyframes die-shadow {
    0%, 30% { transform: scale(.5); opacity: .35; }
    40% { transform: scale(1); opacity: 1; }
    58% { transform: scale(.7); }
    78%, 100% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .die.rolling .tilt, .die.rolling .cube, .die.rolling::after { animation: none; }
}
@media (max-width: 575.98px) { .die { --s: 3.3rem; } }

/* Cards: one that has just appeared is dealt in (hand), thrown onto the table (table, trick) or turned over (war); team.js adds the class. */
.mk-card.deal { animation: mk-deal .5s cubic-bezier(.2, .8, .3, 1) both; }
.mk-card.play { animation: mk-play .55s cubic-bezier(.2, .8, .3, 1) both; }
.mk-card.flip { animation: mk-flip .6s ease-out both; }
@keyframes mk-deal { from { transform: translate(0, -3rem) rotate(-8deg) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes mk-play { from { transform: perspective(500px) translateY(4rem) rotateX(55deg) rotateZ(-14deg) scale(1.15); opacity: 0; } 60% { opacity: 1; } to { transform: none; } }
@keyframes mk-flip { from { transform: perspective(500px) rotateY(180deg); } to { transform: perspective(500px) rotateY(0); } }
@media (prefers-reduced-motion: reduce) { .mk-card.deal, .mk-card.play, .mk-card.flip { animation: none; } }

/* The card table: the deck on the felt, the fans of cards of the opponents, and the cards flying from the deck to the players */
.card-table { background: radial-gradient(ellipse at center, #2e8b57 0%, #1d6b3a 75%); border-radius: 1.2rem; padding: .7rem .6rem .9rem; margin: .5rem 0 .8rem; box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .18); display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.ct-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.6rem; }
.ct-seat { text-align: center; color: #fff; }
.ct-name { font-weight: 700; font-size: .9rem; }
.ct-seat.turn .ct-name { color: #ffd54a; }
.ct-hand { display: flex; justify-content: center; min-height: 2.5rem; padding-left: 1rem; }
.ct-back { width: 1.7rem; height: 2.4rem; margin-left: -1rem; border-radius: .3rem; font-size: 0; }
.ct-deck { position: relative; display: inline-block; width: 3.4rem; height: 4.8rem; }
.ct-deck .mk-deck { position: absolute; left: 0; top: 0; }
.pk-table { position: relative; }
.pk-table .ct-deck { position: absolute; left: .8rem; top: .6rem; width: 2.6rem; height: 3.7rem; }
.pk-table .ct-deck .mk-deck { width: 2.6rem; height: 3.7rem; }
.dealt { animation: card-dealt .55s cubic-bezier(.2, .8, .3, 1) both; position: relative; z-index: 6; }
@keyframes card-dealt {
    from { transform: translate(var(--fx, 0), var(--fy, 0)) rotate(-28deg) scale(.55); opacity: 0; }
    12% { opacity: 1; }
    to { transform: none; opacity: 1; }
}
.thrown { animation: card-thrown .5s cubic-bezier(.25, .8, .35, 1) both; position: relative; z-index: 7; }
@keyframes card-thrown {
    from { transform: translate(var(--fx, 0), var(--fy, 0)) rotate(-12deg) scale(.9); }
    to { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .dealt, .thrown { animation: none; } }

.card-table .mk-table, .card-table .ty-trick, .card-table .ty-musik { background: none; border-radius: 0; margin: 0; padding: 0; max-width: none; box-shadow: none; }
.card-table .ty-musik { color: #fff; }
.card-table .ty-trick { border-top: 1px dashed rgba(255, 255, 255, .25); padding-top: .7rem; width: 100%; }
.card-table .ct-seats { padding-bottom: .2rem; }

.ct-deck { box-shadow: none; }
.ct-deck .mk-deck { box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.ct-deck .mk-deck b { font-size: .8rem; }
.ct-deck.empty { display: none; }
.mk-deck.empty { visibility: hidden; }
.ct-deck.leaving { animation: deck-away .45s ease-in both; }
@keyframes deck-away { to { opacity: 0; transform: scale(.85); } }
.card-table.turn-glow { animation: table-glow 1.8s ease-in-out infinite; }
.pk-table.turn-glow { animation: table-glow-out 1.8s ease-in-out infinite; }
@keyframes table-glow {
    0%, 100% { box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .18), 0 0 0 3px rgba(255, 213, 74, .35), 0 0 8px 2px rgba(255, 213, 74, .25); }
    50% { box-shadow: inset 0 0 0 4px rgba(255, 213, 74, .55), 0 0 0 4px rgba(255, 213, 74, .8), 0 0 18px 6px rgba(255, 213, 74, .55); }
}
@keyframes table-glow-out {
    0%, 100% { box-shadow: 0 0 0 3px rgba(255, 213, 74, .35), 0 0 8px 2px rgba(255, 213, 74, .25); }
    50% { box-shadow: 0 0 0 4px rgba(255, 213, 74, .8), 0 0 18px 6px rgba(255, 213, 74, .55); }
}
@media (prefers-reduced-motion: reduce) { .turn-glow, .ct-deck.leaving { animation: none; } }

/* The table stays still: it is as tall as it gets with the trick on it from the first moment, and the cards of the hand never scroll the page. */
.card-table.ct-trick { min-height: 15rem; justify-content: flex-start; }
.mk-hand, .mk-hand .mk-pick { touch-action: none; }
