.thousand-board{--thousand-card-width:var(--card-width);display:grid;grid-template-rows:36px 78px minmax(0,1fr) auto auto;grid-template-columns:1fr 1fr;padding:0 12px 8px;gap:6px;min-height:0;overflow:hidden}
.thousand-info{grid-column:1/-1;display:flex;justify-content:center;align-items:center;gap:14px;font-size:13px;text-align:center}
.thousand-seat{min-width:0;text-align:center;z-index:3}
.thousand-seat--left{grid-column:1;grid-row:2}.thousand-seat--right{grid-column:2;grid-row:2}
.thousand-seat-label{display:flex;align-items:center;justify-content:center;gap:10px;min-height:23px;font-size:14px;line-height:1.2}
.thousand-seat.is-active .thousand-seat-label strong{color:#fff4a2}
.thousand-seat-label span{font-size:13px;color:rgba(255,255,255,.85)}
.thousand-hand{width:100%;display:flex;justify-content:center;align-items:flex-start;min-width:0;position:relative;gap:0}
.thousand-seat:not(.thousand-seat--south) .thousand-hand{height:48px;margin-top:5px}
.thousand-seat:not(.thousand-seat--south) .durak-card{width:calc(32px * var(--durak-scale));height:calc(44px * var(--durak-scale));min-width:0;flex:none;margin-left:calc(-20px * var(--durak-scale))}
.thousand-seat:not(.thousand-seat--south) .durak-card:first-child{margin-left:0}
.thousand-seat--south{grid-column:1/-1;grid-row:5;padding-top:3px}
.thousand-seat--south .thousand-seat-label{margin-bottom:7px}
.thousand-seat--south .durak-card{flex:none;min-width:0;margin:0;transition:box-shadow .15s,translate .15s}
.thousand-seat--south .durak-card.is-selected{box-shadow:0 0 0 3px #ffe784;translate:0 -6px}
.thousand-seat--south .durak-card.is-playable{cursor:pointer}
.thousand-seat--south .durak-card.is-selected{overflow:visible}
.thousand-recipient{position:absolute;top:-20px;left:0;width:20px;padding:2px 1px;border-radius:3px;background:#ffe784;color:#193522;font:700 10px/14px Arial;pointer-events:none}
.thousand-seat--south:has(.thousand-recipient) .thousand-seat-label{margin-bottom:23px}
.thousand-message{grid-column:1/-1;grid-row:3;align-self:end;position:relative!important;inset:auto!important;transform:none!important;z-index:6;margin:0;font-size:14px;line-height:1.35;padding:5px 0;text-align:center;pointer-events:none}
.thousand-message{white-space:normal;overflow-wrap:break-word}
.thousand-table{grid-column:1/-1;grid-row:3;position:relative;display:flex;align-items:center;justify-content:center;gap:12px;min-height:0;padding-bottom:32px;overflow:visible}
.thousand-table .durak-card{flex:none;pointer-events:none}
.thousand-trick-card{position:absolute;top:38%;left:50%;transform:translate(-50%,-50%)}
.thousand-trick-card--0{top:65%}.thousand-trick-card--1{left:34%;transform:translate(-50%,-50%) rotate(-6deg)}.thousand-trick-card--2{left:66%;transform:translate(-50%,-50%) rotate(6deg)}
.thousand-actions{grid-column:1/-1;grid-row:4;display:flex;position:relative!important;inset:auto!important;transform:none!important;justify-content:center;align-items:center;gap:8px;min-height:44px;flex-wrap:wrap;padding:0 0 4px}
.thousand-actions form{display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap}
.thousand-actions input[type=number]{width:82px;padding:9px;font:700 17px Arial;border:1px solid #c7dbcb;border-radius:4px;color:#193522;background:#fff;height:40px}
.thousand-actions button{padding:10px 16px;border:0;border-radius:4px;background:#13491d;color:#fff;font:700 15px Arial;min-height:40px;cursor:pointer}
.thousand-actions button:disabled{opacity:.45;cursor:default}.thousand-actions button:focus-visible{outline:3px solid #71d1ff;outline-offset:2px}
.thousand-actions label{font-size:13px}.thousand-actions input[type=checkbox]{accent-color:#ffe784}
.thousand-result{align-self:center;text-align:center;max-height:100%;overflow:auto;padding:4px 10px;font-size:14px}
.thousand-result strong{font-size:24px;color:#fff3a4}.thousand-result p{margin:6px 0}.thousand-result table{border-collapse:collapse;margin:8px auto;font-size:14px}.thousand-result th,.thousand-result td{padding:3px 9px}
.thousand-popover{position:relative;z-index:25;font-size:13px;flex:none}
.thousand-popover summary{cursor:pointer;padding:12px 6px}
.thousand-popover>div{position:absolute;top:100%;left:0;width:min(350px,88vw);max-height:min(350px,65vh);overflow:auto;background:#13491d;border:1px solid #75a580;border-radius:6px;padding:12px;color:#fff;box-shadow:0 8px 25px #0005}
.thousand-popover table{width:100%;border-collapse:collapse}.thousand-popover td,.thousand-popover th{padding:5px;text-align:left;border-bottom:1px solid #fff2}.thousand-popover p{margin:6px 0}
.thousand-is-ended .thousand-table{padding-bottom:0}.thousand-is-ended .thousand-message{display:none}
.thousand-is-ended .thousand-seat--south:has(.thousand-hand[hidden]){display:none}
.thousand-embedded .durak-app{height:calc(100dvh - 22px)}
@media(max-width:600px){
 .thousand-board{padding:0 8px 6px;grid-template-rows:45px 72px minmax(0,1fr) auto auto;gap:4px}
 .thousand-info{font-size:12px;gap:6px;flex-wrap:wrap;align-content:center}
 .thousand-seat-label{font-size:13px;gap:6px}.thousand-seat-label span{font-size:12px}
 .thousand-message{font-size:13px}.thousand-table{gap:7px}
 .thousand-trick-card--1{left:25%}.thousand-trick-card--2{left:75%}
 .thousand-actions button{font-size:14px;padding:9px 12px;min-height:38px}.thousand-actions{min-height:42px}
 .thousand-result strong{font-size:20px}.thousand-result{font-size:13px}
 .thousand-popover>div{position:fixed;left:8px;top:110px;width:calc(100vw - 16px)}
}
@media(max-height:500px) and (min-width:501px){
 .thousand-board{grid-template-columns:1fr 1fr;grid-template-rows:24px minmax(0,1fr) auto;gap:3px;padding-bottom:4px}
 .thousand-info{grid-column:1;grid-row:1;font-size:11px;gap:5px;white-space:nowrap}
 .thousand-seat--left,.thousand-seat--right{position:absolute;top:0;right:25%;width:25%;font-size:11px}
 .thousand-seat--right{right:0}.thousand-seat:not(.thousand-seat--south) .thousand-hand{height:24px;margin:0}
 .thousand-seat:not(.thousand-seat--south) .durak-card{width:16px;height:22px;margin-left:-11px}
 .thousand-seat-label{min-height:19px;font-size:11px;gap:4px}.thousand-seat-label span{font-size:10px}
 .thousand-table{grid-column:1;grid-row:2/4;padding-bottom:22px}
 .thousand-message{grid-column:1;grid-row:3;font-size:12px}
 .thousand-actions{grid-column:2;grid-row:2;align-self:end;gap:4px;padding:0;min-height:30px}
 .thousand-actions form{gap:4px}.thousand-actions button{min-height:30px;padding:6px 8px;font-size:12px}
 .thousand-actions input[type=number]{height:30px;padding:4px;font-size:14px;width:60px}
 .thousand-seat--south{grid-column:2;grid-row:3;padding-top:2px}.thousand-seat--south .thousand-seat-label{margin-bottom:4px}
 .thousand-result strong{font-size:18px}.thousand-result,.thousand-result table{font-size:12px}
}
.thousand-actions button{min-width:0;height:auto}
@media(max-width:600px){
 .thousand-app .durak-toolbar{gap:5px;padding-inline:8px}
 .thousand-app .durak-toolbar__spacer{min-width:0}
 .thousand-popover summary{font-size:12px;padding-inline:3px}
 .thousand-app .durak-zoom{gap:4px;font-size:12px}
 .thousand-app .durak-zoom__label{display:none}
}
@media(max-width:600px){.thousand-app .durak-tool{margin-right:0}.thousand-app .durak-toolbar{gap:3px}}
/* Full card targets replace the narrow overlapping fan on phones. */
@media(max-width:600px), (max-height:500px) and (min-width:501px) and (max-width:1000px){
 .thousand-seat--south .thousand-hand{flex-wrap:wrap;gap:6px;align-items:flex-start}
 .thousand-seat--south .durak-card{width:clamp(44px,var(--card-width),calc((100% - 24px)/5));height:auto;aspect-ratio:73/98;margin:0!important}
 .thousand-seat--south .durak-card.is-playable:hover,.thousand-seat--south .durak-card.is-playable:focus-visible{transform:none}
 .thousand-seat--south .durak-card:focus-visible{outline:3px solid #71d1ff;outline-offset:1px}
 .thousand-seat--south .thousand-hand:has(.thousand-recipient){row-gap:28px}
}
@media(max-height:500px) and (min-width:501px) and (max-width:1000px){
 .thousand-board{grid-template-rows:24px minmax(0,1fr) auto auto}
 .thousand-seat--left,.thousand-seat--right{position:static;grid-row:1;grid-column:2;width:50%;display:flex;align-items:center;justify-content:center;gap:5px;justify-self:start}
 .thousand-seat--right{justify-self:end}
 .thousand-seat:not(.thousand-seat--south) .thousand-hand{width:auto;height:22px}
 .thousand-seat:not(.thousand-seat--south) .thousand-seat-label span{display:none}
 .thousand-seat--south{grid-column:1/-1;grid-row:4}
 .thousand-message{grid-column:1/-1;grid-row:3}
 .thousand-table{grid-row:2;padding-bottom:0}
 .thousand-table .durak-card{width:calc(34px * var(--durak-scale));height:calc(46px * var(--durak-scale))}
 .thousand-trick-card,.thousand-trick-card--0{top:50%}
 .thousand-seat--south .thousand-hand{flex-wrap:nowrap;gap:4px}
 .thousand-seat--south .durak-card{width:clamp(44px,var(--card-width),calc((100% - (var(--thousand-hand-count) - 1)*4px)/var(--thousand-hand-count)))}
}
.thousand-is-ended .thousand-seat{display:none}

/* The physical talon stays on the table while flipping, then flies to its owner. */
.thousand-talon-revealing .thousand-table{overflow:visible}
.thousand-table .durak-card.is-flipping{z-index:4}
.thousand-app .durak-card.is-flipping{overflow:visible;background:transparent;border-color:transparent;transform-style:preserve-3d;transform:perspective(700px) rotateY(-180deg)}
.thousand-flip-face,.thousand-flip-back{position:absolute;inset:-1px;display:block;backface-visibility:hidden;pointer-events:none}
.thousand-flip-face{border:1px solid #151515;border-radius:calc(3px * var(--durak-scale));background:#fff}
.thousand-flip-back{transform:rotateY(180deg);background:url('/i/themes/default/back.png') center/100% 100% no-repeat}
