:root{--bg:#192328;--panel:#f3ead7;--paper:#fffaf0;--ink:#242a2c;--muted:#6d716e;--line:#d5c8ae;--gold:#c79b35;--gold-soft:#f4e6b9;--human:#a64f32;--bot:#2c596d;--danger:#8e3d34;--shadow:0 18px 55px rgba(0,0,0,.18);font-family:Georgia,"Times New Roman",serif;color:var(--ink);background:var(--bg)}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(circle at 20% 0,#344147 0,transparent 34rem),linear-gradient(155deg,#1a2429,#10191d);color:var(--ink)}button,input{font:inherit}button{touch-action:manipulation}.screen{min-height:100vh;padding:24px}.screen--center,.start-screen,.finish-screen{display:grid;place-items:center}.start-card,.dialog-card,.finish-card{width:min(760px,100%);background:var(--paper);border:1px solid #dacbab;border-radius:24px;padding:clamp(24px,5vw,54px);box-shadow:var(--shadow);position:relative;overflow:hidden}.start-card:before,.dialog-card:before,.finish-card:before{content:"";position:absolute;inset:0 0 auto;height:7px;background:linear-gradient(90deg,var(--human),var(--gold),var(--bot))}.eyebrow{text-transform:uppercase;letter-spacing:.12em;font:700 12px/1.4 Arial,sans-serif;color:#80715d}.game-title,.dialog-title,.finish-title{font-size:clamp(34px,7vw,64px);line-height:1;margin:.18em 0 .28em}.dialog-title,.finish-title{font-size:clamp(30px,5vw,48px)}.lead{font-size:clamp(17px,2.4vw,21px);line-height:1.55;max-width:620px}.muted{color:var(--muted);font-family:Arial,sans-serif;font-size:13px}.mode-picker{border:0;padding:0;margin:32px 0 20px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.mode-picker__legend{font:700 13px Arial,sans-serif;margin-bottom:10px}.mode-option{border:1px solid var(--line);border-radius:14px;padding:14px;display:flex;gap:10px;align-items:center;cursor:pointer;background:#fff}.mode-option.is-active{border-color:var(--gold);box-shadow:0 0 0 2px rgba(199,155,53,.18)}.mode-option__copy{display:grid;gap:2px}.mode-option__copy small{font:12px Arial,sans-serif;color:var(--muted)}.btn{border:0;border-radius:11px;padding:12px 18px;cursor:pointer;font:700 14px Arial,sans-serif;transition:transform .15s ease,opacity .15s ease,box-shadow .15s ease}.btn:hover:not(:disabled){transform:translateY(-1px)}.btn:disabled{opacity:.42;cursor:not-allowed}.btn--primary{background:#26383f;color:white;box-shadow:0 5px 14px rgba(20,32,37,.2)}.btn--secondary{background:#e8ddc8;color:#382f27}.btn--danger{background:var(--danger);color:#fff}.btn--wide{width:100%;padding:15px}.start-note{font:12px/1.5 Arial,sans-serif;color:var(--muted);margin:14px 0 0}.dialog-actions{display:flex;gap:10px;margin-top:24px}.dialog-score,.finish-score{font-size:clamp(38px,8vw,72px);margin:12px 0}.global-alert{background:#ffe7df;color:#742e27;padding:10px 14px;border-radius:10px;margin:0 auto 14px;width:min(760px,100%);font:14px Arial,sans-serif}.game-shell{width:min(1500px,100%);margin:0 auto;padding:16px clamp(10px,2vw,28px) 28px;min-height:100vh;color:#eee}.game-topbar{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:16px;padding:4px 2px 14px}.game-heading{display:grid}.game-heading__round{font-size:20px}.game-meta{text-align:right;font:13px Arial,sans-serif;color:#c9c5b9}.scoreboard{display:flex;align-items:center;gap:14px;background:rgba(0,0,0,.18);padding:8px 14px;border:1px solid rgba(255,255,255,.12);border-radius:15px}.scoreboard__side{display:flex;align-items:baseline;gap:8px}.scoreboard__name{font:12px Arial,sans-serif}.scoreboard__score{font-size:27px}.scoreboard__side--human .scoreboard__score{color:#edb092}.scoreboard__side--bot .scoreboard__score{color:#a9d7e7}.player-zone,.table-zone,.mini-map-panel{background:rgba(250,244,229,.98);color:var(--ink);border:1px solid rgba(214,196,158,.7);border-radius:18px;box-shadow:0 10px 30px rgba(0,0,0,.14)}.player-zone{padding:12px 16px}.player-zone__label,.zone-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:9px}.player-zone--bot{min-height:112px}.bot-hand{display:flex;justify-content:center;min-height:70px}.bot-hand .playing-card{width:46px;height:66px;margin-left:-20px}.bot-hand .playing-card:first-child{margin-left:0}.game-main{display:grid;grid-template-columns:minmax(0,1fr) minmax(210px,300px);gap:12px;margin:12px 0}.table-zone{padding:14px;min-height:330px}.card-grid{display:flex;flex-wrap:wrap;gap:9px;align-items:center;justify-content:center}.card-grid--table{min-height:255px}.card-grid--hand{min-height:180px}.playing-card{width:112px;height:162px;border-radius:12px;border:2px solid #d3c4a7;background:linear-gradient(150deg,#fffef9,#f0e5ce);box-shadow:0 5px 12px rgba(50,38,24,.16);padding:7px;position:relative;display:flex;flex-direction:column;color:var(--ink);transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;overflow:hidden}.playing-card:not(div):hover{transform:translateY(-4px)}.playing-card.is-selected{transform:translateY(-9px);border-color:#2b687a;box-shadow:0 11px 20px rgba(34,82,97,.28)}.playing-card.is-gold{background:linear-gradient(150deg,#fffdf5,#f5e6b2);border-color:#c49a3a}.card-topline{height:24px}.card-badge{font:700 9px Arial,sans-serif;text-transform:uppercase;letter-spacing:.03em;border-radius:10px;padding:3px 6px;display:inline-block}.card-badge--gold{background:#d6ae50;color:#3b2c12}.card-badge--nugget{background:#4b4035;color:#fff;margin-top:auto;align-self:center}.card-center{flex:1;display:grid;place-items:center;align-content:center}.card-value{font-size:64px;line-height:.82}.card-unit{font:12px Arial,sans-serif;margin-top:5px}.card-tool-image{width:70px;height:70px}.card-tool-label{font-size:15px;text-align:center;margin-top:6px}.playing-card--back{padding:0;border-color:#b99a68;background:#28323a}.playing-card--back img{width:100%;height:100%;display:block}.empty-table{font:italic 15px Georgia,serif;color:var(--muted)}.action-bar{display:grid;grid-template-columns:minmax(180px,1fr) auto auto;gap:9px;align-items:center;margin-top:12px}.selection-note{font:14px/1.4 Arial,sans-serif;min-height:20px}.inline-message{margin-top:8px;background:#fff1e7;color:#7b382f;border-radius:9px;padding:8px 10px;font:13px Arial,sans-serif}.mini-map-panel{padding:7px;display:flex;align-items:center}.claims-map-wrap{width:100%}.claims-map{display:block;width:100%;height:auto;max-height:360px}.map-bg{fill:#eadfbe;stroke:#ad9167;stroke-width:8}.map-stream{fill:none;stroke:#79a8ad;stroke-width:72;stroke-linecap:round;opacity:.92}.map-boundary{fill:none;stroke:#aa9270;stroke-width:3;stroke-dasharray:15 14;opacity:.65}.claim-flag__pole{stroke:#46372d;stroke-width:6;stroke-linecap:round}.claim-flag--human .claim-flag__cloth{fill:var(--human);stroke:#6d3324;stroke-width:3}.claim-flag--bot .claim-flag__cloth{fill:var(--bot);stroke:#193d4d;stroke-width:3}.claim-flag.is-new{transform-box:fill-box;transform-origin:center;animation:flag-pop .18s ease-out}.map-title{font:bold 37px Georgia,serif;fill:#483b2c}.map-score{font:bold 27px Arial,sans-serif}.map-score--human{fill:#7f3828}.map-score--bot{fill:#214f62}.map-overflow{font:bold 22px Arial,sans-serif;fill:#554734}.event-layer{position:fixed;inset:72px 16px auto;display:flex;flex-direction:column;align-items:center;pointer-events:none;z-index:30}.event-toast{background:rgba(13,21,25,.9);color:white;border:1px solid rgba(255,255,255,.18);padding:8px 14px;border-radius:20px;font:13px Arial,sans-serif;box-shadow:0 5px 25px rgba(0,0,0,.25)}.card-ghost{margin-top:10px;animation:card-flight .22s ease both}.round-overlay{position:fixed;inset:0;background:rgba(12,18,21,.7);display:grid;place-items:center;padding:18px;z-index:100;backdrop-filter:blur(5px)}.round-summary{width:min(520px,100%);background:var(--paper);border-radius:18px;padding:26px;box-shadow:var(--shadow)}.round-summary__title{font-size:34px;margin:4px 0 18px}.round-summary__grid{display:grid;gap:1px;background:#d8c9ac;border-radius:12px;overflow:hidden}.round-summary__row{display:grid;grid-template-columns:1fr auto;gap:20px;background:#fffaf0;padding:10px 12px;font:14px Arial,sans-serif}.round-summary__nuggets{display:flex;gap:16px;flex-wrap:wrap;margin:14px 0;font:12px Arial,sans-serif;color:#5e5140}.finish-card .claims-map{max-height:56vh;margin:18px auto}.loading-text{color:white;font:15px Arial,sans-serif}.brand-mark{width:66px;height:66px;border:2px solid #d5b275;color:#d5b275;border-radius:50%;display:grid;place-items:center;font-weight:bold;font-size:25px;margin:auto}.retry-button{grid-column:2/4}@keyframes flag-pop{0%{opacity:0;transform:scale(.1) translateY(15px)}70%{transform:scale(1.15)}100%{opacity:1;transform:scale(1)}}@keyframes card-flight{0%{opacity:0;transform:translateY(40px) rotate(-3deg)}100%{opacity:1;transform:translateY(0) rotate(0)}}
@media(max-width:820px){.screen{padding:12px}.game-topbar{grid-template-columns:1fr auto}.game-meta{display:none}.game-heading .eyebrow{display:none}.scoreboard{justify-self:end}.game-main{grid-template-columns:1fr}.mini-map-panel{order:-1;max-height:150px;overflow:hidden}.claims-map{max-height:150px}.table-zone{min-height:270px}.playing-card{width:86px;height:126px}.card-value{font-size:48px}.card-tool-image{width:50px;height:50px}.card-grid{gap:6px}.card-grid--hand{min-height:135px}.action-bar{grid-template-columns:1fr 1fr}.selection-note{grid-column:1/-1}.player-zone{padding:10px}.bot-hand .playing-card{width:38px;height:56px}.game-shell{padding:8px}.mode-picker{grid-template-columns:1fr}.dialog-actions{flex-direction:column}}
@media(max-height:720px) and (min-width:821px){.game-shell{padding-top:7px}.player-zone--bot{min-height:80px;padding-block:7px}.bot-hand{min-height:50px}.bot-hand .playing-card{width:34px;height:50px}.game-main{margin:7px 0}.table-zone{min-height:240px}.card-grid--table{min-height:190px}.playing-card{width:82px;height:119px}.card-value{font-size:44px}.card-tool-image{width:48px;height:48px}.card-grid--hand{min-height:125px}.claims-map{max-height:250px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
.finish-card{width:min(920px,100%)}.finish-names{display:flex;justify-content:space-between;gap:24px;font:700 15px Arial,sans-serif;margin-top:18px}.finish-name--human{color:#7f3828}.finish-name--bot{color:#214f62}.finish-score{text-align:center}.finish-meta{text-align:center}.finish-name-box{border-top:1px solid var(--line);padding-top:16px;margin-top:12px}.finish-name-label{display:block;font:700 13px Arial,sans-serif;margin-bottom:7px}.player-name-input{width:min(360px,100%);border:1px solid var(--line);border-radius:10px;background:#fff;padding:11px 12px;font:15px Arial,sans-serif;color:var(--ink)}.finish-name-actions,.finish-actions,.saved-name-row,.share-fallback{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.finish-name-actions{margin-top:8px}.finish-actions{margin-top:16px}.saved-name-row{justify-content:space-between}.btn--ghost,.btn--link{background:transparent;color:#394b53}.btn--link{padding:7px 4px;text-decoration:underline}.share-fallback{margin-top:12px;padding:12px;border-radius:12px;background:#f0e6d2}.share-fallback p{width:100%;margin:0}.share-copy-status{width:100%}
@media(max-width:520px){.finish-card{padding:20px 14px}.finish-names{font-size:12px}.finish-actions>.btn,.share-fallback>.btn{flex:1 1 100%}.finish-card .claims-map{max-height:44vh;margin:10px auto}.finish-score{margin:4px 0}.finish-title{font-size:30px}}
@media(min-width:900px) and (max-height:760px){.game-shell{padding-top:6px}.player-zone--bot{min-height:72px;padding-block:6px}.bot-hand{min-height:44px}.bot-hand .playing-card{width:32px;height:47px}.game-main{margin:6px 0}.table-zone{min-height:224px}.card-grid--table{min-height:175px}.playing-card{width:78px;height:114px}.card-value{font-size:42px}.card-tool-image{width:45px;height:45px}.card-grid--hand{min-height:118px}.claims-map{max-height:220px}.action-bar{margin-top:7px}.player-zone{padding-block:8px}}
@media(max-width:820px){.game-shell{padding-bottom:112px}.action-bar{position:fixed;left:8px;right:8px;bottom:8px;z-index:60;margin:0;padding:8px;background:rgba(255,250,240,.98);border:1px solid var(--line);border-radius:14px;box-shadow:0 10px 32px rgba(0,0,0,.28)}.inline-message{position:fixed;left:8px;right:8px;bottom:104px;z-index:59;margin:0;box-shadow:0 8px 22px rgba(0,0,0,.22)}}
@media(min-width:900px) and (max-height:760px){.game-shell{padding-bottom:74px}.action-bar{position:fixed;left:16px;right:16px;bottom:8px;z-index:60;margin:0;padding:8px 12px;background:rgba(255,250,240,.98);color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:0 10px 32px rgba(0,0,0,.28)}.inline-message{position:fixed;left:16px;right:16px;bottom:68px;z-index:59;margin:0}}
@media(min-width:900px) and (max-height:800px){.game-shell{padding-bottom:74px}.action-bar{position:fixed;left:16px;right:16px;bottom:8px;z-index:60;margin:0;padding:8px 12px;background:rgba(255,250,240,.98);color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:0 10px 32px rgba(0,0,0,.28)}.inline-message{position:fixed;left:16px;right:16px;bottom:68px;z-index:59;margin:0}}

/* Полировка после первой живой партии */
body{
  background:
    radial-gradient(circle at 12% -10%,rgba(191,139,63,.18),transparent 34rem),
    radial-gradient(circle at 88% 0,rgba(44,89,109,.22),transparent 38rem),
    linear-gradient(155deg,#1b2427,#101719 72%);
}
.game-topbar{
  border-bottom:1px solid rgba(220,188,126,.18);
}
.player-zone,.table-zone,.mini-map-panel{
  background:
    radial-gradient(circle at 15% 0,rgba(255,255,255,.58),transparent 18rem),
    linear-gradient(155deg,#fffaf0,#eee0c4);
  border-color:rgba(181,145,88,.62);
  box-shadow:0 12px 34px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.8);
}
.player-zone--bot{border-left:4px solid rgba(44,89,109,.72)}
.player-zone--human{border-left:4px solid rgba(166,79,50,.72)}
.table-zone{box-shadow:0 12px 34px rgba(0,0,0,.18),inset 0 0 0 1px rgba(123,96,58,.08)}
.scoreboard{box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 8px 26px rgba(0,0,0,.12)}
.playing-card{
  background:
    radial-gradient(circle at 20% 12%,rgba(255,255,255,.9),transparent 52%),
    linear-gradient(150deg,#fffef9,#eee0c4);
  border-color:#c9b58f;
  box-shadow:0 6px 15px rgba(50,38,24,.2),inset 0 0 0 1px rgba(255,255,255,.5);
}
.playing-card.is-gold{
  background:
    radial-gradient(circle at 18% 10%,rgba(255,255,255,.78),transparent 48%),
    linear-gradient(150deg,#fff9e8,#eed797);
  box-shadow:0 7px 17px rgba(103,73,19,.24),inset 0 0 0 1px rgba(255,255,255,.5);
}
.card-center{min-width:0;min-height:0;width:100%}
.card-tool-image{width:68%;height:auto;max-width:70px;max-height:62%;object-fit:contain;display:block}
.card-tool-label{max-width:100%;font:700 13px/1.08 Arial,sans-serif;text-align:center;margin-top:5px;overflow-wrap:anywhere}
.playing-card--tool-pan .card-tool-label{font-size:12px;letter-spacing:.01em}

.zone-heading--table{align-items:flex-start}
.table-meta{display:flex;align-items:flex-end;gap:5px;flex-direction:column}
.last-taker-status{
  display:inline-flex;align-items:center;gap:6px;
  padding:5px 9px;border-radius:999px;
  font:700 11px/1.1 Arial,sans-serif;
  border:1px solid #c9b998;background:rgba(255,255,255,.55);color:#5d5449;
  white-space:nowrap;
}
.last-taker-status:before{content:"";width:7px;height:7px;border-radius:50%;background:#9a927f;box-shadow:0 0 0 2px rgba(154,146,127,.14)}
.last-taker-status--human{color:#7f3828;border-color:rgba(166,79,50,.36);background:rgba(166,79,50,.08)}
.last-taker-status--human:before{background:var(--human)}
.last-taker-status--bot{color:#214f62;border-color:rgba(44,89,109,.36);background:rgba(44,89,109,.08)}
.last-taker-status--bot:before{background:var(--bot)}

.event-layer{
  position:fixed;inset:50% auto auto 50%;transform:translate(-50%,-50%);
  width:min(620px,calc(100vw - 24px));display:flex;flex-direction:column;align-items:center;
  pointer-events:none;z-index:80;
}
.event-action-panel{
  min-width:min(360px,100%);max-width:100%;
  display:flex;flex-direction:column;align-items:center;gap:10px;
  padding:13px 16px 15px;border-radius:18px;
  background:rgba(22,29,31,.96);color:#fff;
  border:1px solid rgba(221,190,129,.42);
  box-shadow:0 20px 70px rgba(0,0,0,.48),inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter:blur(7px);
}
.event-action-panel--bot{border-color:rgba(117,180,205,.56)}
.event-action-panel--human{border-color:rgba(223,145,112,.56)}
.event-action-panel .event-toast{background:transparent;border:0;box-shadow:none;padding:0;font:700 15px Arial,sans-serif}
.event-card-item{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:60px}
.event-mini-card{width:72px!important;height:104px!important;padding:5px!important;margin:0!important;box-shadow:0 7px 20px rgba(0,0,0,.28)!important}
.event-mini-card .card-value{font-size:38px}
.event-mini-card .card-tool-label{font-size:10px}
.event-mini-card .card-badge{font-size:6px;padding:2px 3px}
.event-mini-card .card-topline{height:14px}
.event-card-label{font:700 10px Arial,sans-serif;color:#eee5d5;text-align:center}
.event-take-detail{display:flex;align-items:center;justify-content:center;gap:11px;max-width:100%}
.event-take-arrow{font:700 28px Georgia,serif;color:#d5b275}
.event-taken-cards{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}
.event-remainder-note{font:700 14px/1.35 Arial,sans-serif;text-align:center;color:#f3e2bd}
.card-ghost{margin-top:0}

.round-overlay{background:rgba(10,15,16,.82);backdrop-filter:blur(7px)}
.round-summary{width:min(620px,100%);padding:28px;border:1px solid #d0ba8e;background:linear-gradient(160deg,#fffaf0,#f0e1c4)}
.round-summary__title{margin-bottom:8px}
.round-summary__last{margin:0 0 16px;padding:8px 10px;border-radius:10px;background:rgba(61,68,65,.08);font:700 13px Arial,sans-serif;color:#554a3e}
.round-summary__grid{gap:1px;background:#cbb792}
.round-summary__row{grid-template-columns:minmax(0,1fr) auto;padding:11px 13px;background:rgba(255,250,240,.92)}
.round-summary__criterion{font:14px/1.35 Arial,sans-serif}
.round-summary__points{min-width:72px;text-align:right;color:#27434f;font:700 15px Arial,sans-serif}
.round-summary__remainder{margin:13px 0 0;padding:9px 11px;border-left:4px solid var(--gold);background:rgba(199,155,53,.1);font:13px/1.4 Arial,sans-serif}
.round-summary__totals{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0}
.round-summary__total{display:grid;gap:4px;padding:11px 12px;border-radius:12px;background:#e8dcc4;font:12px Arial,sans-serif}
.round-summary__total strong{font:700 26px Georgia,serif}
.round-summary__total--all{background:#26383f;color:#fff}
.round-summary__continue{margin-top:4px}

.finish-actions{display:grid;grid-template-columns:1fr 1fr auto;align-items:stretch}
.finish-actions>.btn{min-height:44px}
.finish-share-status{display:block;min-height:18px;margin-top:8px}

@media(max-width:820px){
  .table-meta{align-items:flex-end;max-width:62%}
  .last-taker-status{white-space:normal;text-align:right;font-size:10px}
  .event-layer{width:calc(100vw - 16px)}
  .event-action-panel{min-width:0;padding:11px 10px}
  .event-mini-card{width:62px!important;height:90px!important}
  .event-take-detail{gap:6px}
  .event-taken-cards{gap:4px}
  .round-summary{padding:20px 14px}
  .round-summary__totals{grid-template-columns:1fr}
  .finish-actions{grid-template-columns:1fr}
}

@media(min-width:900px) and (max-height:820px){
  .game-shell{padding-top:6px;padding-bottom:74px}
  .game-topbar{padding-bottom:8px}
  .player-zone--bot{min-height:72px;padding-block:6px}
  .bot-hand{min-height:44px}
  .bot-hand .playing-card{width:32px;height:47px}
  .game-main{margin:6px 0;gap:8px}
  .table-zone{min-height:224px;padding-block:9px}
  .card-grid--table{min-height:175px}
  .playing-card{width:78px;height:114px;padding:5px}
  .card-topline{height:16px}
  .card-badge{font-size:7px;padding:2px 4px}
  .card-value{font-size:42px}
  .card-unit{font-size:9px;margin-top:3px}
  .card-tool-image{max-width:48px;max-height:46%}
  .card-tool-label{font-size:10px;margin-top:3px}
  .card-grid--hand{min-height:118px}
  .claims-map{max-height:220px}
  .player-zone--human{padding-block:8px}
  .action-bar{margin:0;padding:8px 12px}
}

/* r1.2: стол, модальные окна и подготовка будущих настроек игры */
.start-links{display:flex;justify-content:center;gap:10px;margin-top:10px}
.btn--ghost{background:transparent;color:inherit;border:1px solid rgba(93,79,58,.28)}

.modal-overlay{position:fixed;inset:0;z-index:140;display:grid;place-items:center;padding:18px;background:rgba(9,14,16,.8);backdrop-filter:blur(7px)}
.modal-card{width:min(760px,100%);max-height:calc(100vh - 36px);overflow:auto;background:linear-gradient(160deg,#fffaf0,#efe0c3);color:var(--ink);border:1px solid #cdb485;border-radius:20px;box-shadow:0 24px 80px rgba(0,0,0,.5)}
.modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 20px 12px;border-bottom:1px solid rgba(140,112,73,.2)}
.modal-title{margin:0;font-size:clamp(25px,4vw,36px)}
.modal-close{width:44px;height:44px;border:0;border-radius:50%;background:rgba(71,58,43,.08);color:#493d31;font:32px/1 Arial,sans-serif;cursor:pointer}
.modal-body{padding:18px 20px 22px}
.rules-lead{font:16px/1.55 Arial,sans-serif;margin-top:0}.rules-list{margin:12px 0 0;padding-left:22px;font:15px/1.55 Arial,sans-serif}.rules-list li+li{margin-top:8px}

.table-zone{position:relative;overflow:visible}
.table-deck-slot{position:absolute;left:14px;top:60px;width:66px;height:98px;z-index:8;pointer-events:none}
.deck-pile{position:relative;width:64px;height:96px}
.deck-pile__cards{position:absolute;inset:0}
.deck-pile__card{position:absolute!important;left:4px;top:4px;width:56px!important;height:82px!important;margin:0!important;transform:translate(calc(var(--deck-layer) * 2px),calc(var(--deck-layer) * -2px));box-shadow:0 5px 10px rgba(0,0,0,.25)!important}
.deck-pile__count{position:absolute;right:-2px;bottom:-2px;min-width:28px;height:28px;padding:0 6px;border-radius:14px;display:grid;place-items:center;background:#26383f;color:#fff;border:2px solid #f0dfbd;font:700 11px Arial,sans-serif;box-shadow:0 4px 12px rgba(0,0,0,.22)}
.card-grid--table{padding-left:76px;padding-right:8px}

.mini-map-button{position:relative;width:100%;padding:0;border:0;background:transparent;color:inherit;cursor:zoom-in;border-radius:12px;overflow:hidden}
.mini-map-button:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.mini-map-zoom{position:absolute;right:7px;bottom:7px;padding:4px 7px;border-radius:999px;background:rgba(29,38,41,.88);color:#fff;font:700 10px Arial,sans-serif;letter-spacing:.02em}
.map-modal .modal-card{width:min(980px,100%)}.map-modal__map .claims-map{width:100%;max-height:75vh}

.last-taker-status{cursor:pointer}.last-taker-status:disabled{cursor:default;opacity:.68}.last-take-detail{display:grid;gap:14px}.last-take-owner{font:700 16px Arial,sans-serif;margin:0}.last-take-cards{display:flex;align-items:center;justify-content:center;gap:18px;flex-wrap:wrap}.last-take-card-group{display:grid;justify-items:center;gap:7px}.last-take-card-group>.playing-card{width:90px;height:132px}.last-take-card-group .card-value{font-size:50px}.last-take-card-group .card-tool-image{max-width:58px}.last-take-caption,.last-take-card-name{font:700 11px Arial,sans-serif;color:#6b5e4e}.last-take-captured{display:flex;gap:7px;flex-wrap:wrap;justify-content:center}.last-take-captured .playing-card{width:78px;height:114px}.last-take-captured .card-value{font-size:42px}.last-take-arrow{font:700 30px Georgia,serif;color:#9b7330}

.played-card-stage{position:absolute;left:50%;top:48px;z-index:24;display:grid;justify-items:center;gap:5px;transform:translateX(-50%);pointer-events:none;transition:transform .32s ease,opacity .32s ease}
.played-card-stage__label{padding:4px 8px;border-radius:999px;background:rgba(23,31,34,.9);color:#fff;font:700 10px Arial,sans-serif}.played-card-stage__card{width:94px!important;height:136px!important;box-shadow:0 15px 35px rgba(0,0,0,.32)!important}.played-card-stage--bot{animation:bot-card-reveal .32s ease-out both}.played-card-stage--human{animation:human-card-reveal .25s ease-out both}.played-card-stage--to-table{transform:translate(-50%,80px) scale(.92);opacity:.1}.playing-card.is-taken-by-bot{animation:take-to-bot .48s ease-in both}.playing-card.is-taken-by-human{animation:take-to-human .38s ease-in both}.card-arrived-on-table{animation:arrive-table .3s ease-out both}
@keyframes bot-card-reveal{from{opacity:0;transform:translate(-50%,-76px) rotate(3deg) scale(.75)}to{opacity:1;transform:translate(-50%,0) rotate(0) scale(1)}}
@keyframes human-card-reveal{from{opacity:0;transform:translate(-50%,92px) rotate(-2deg) scale(.8)}to{opacity:1;transform:translate(-50%,0) rotate(0) scale(1)}}
@keyframes take-to-bot{to{opacity:0;transform:translateY(-105px) scale(.55)}}@keyframes take-to-human{to{opacity:0;transform:translateY(105px) scale(.55)}}@keyframes arrive-table{from{opacity:.2;transform:translateY(-35px) scale(.82)}to{opacity:1;transform:none}}

.action-bar{grid-template-columns:1fr;justify-items:stretch}.selection-note{text-align:center}.action-buttons{display:flex;justify-content:center;align-items:center;gap:9px;flex-wrap:wrap}.retry-button{grid-column:auto!important;justify-self:center}

.round-summary__grid{grid-template-columns:1fr}.round-summary__row{grid-template-columns:minmax(130px,1.35fr) minmax(90px,.8fr) minmax(90px,.8fr);gap:8px;align-items:center}.round-summary__row--head{background:#26383f;color:#fff}.round-summary__head{text-align:center;font:700 12px/1.2 Arial,sans-serif}.round-summary__head--human{color:#ffd0ba}.round-summary__head--bot{color:#c4e6f2}.round-summary__player-cell{display:grid;grid-template-columns:1fr auto;align-items:baseline;gap:5px;padding:2px 6px;text-align:center;font-family:Arial,sans-serif}.round-summary__value{font-size:15px}.round-summary__awarded{font:700 11px Arial,sans-serif;color:#846b45}.round-summary__player-cell--human{border-left:3px solid rgba(166,79,50,.45)}.round-summary__player-cell--bot{border-left:3px solid rgba(44,89,109,.45)}

.share-modal__lead{font:14px/1.5 Arial,sans-serif;color:#62594d;margin-top:0}.share-modal__actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.share-modal__status{display:block;min-height:18px;margin-top:10px}.finish-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.finish-actions>.btn{min-width:150px}

@media(max-width:820px){
  .table-deck-slot{left:7px;top:58px;width:48px;height:73px}.deck-pile{width:48px;height:72px}.deck-pile__card{width:42px!important;height:62px!important}.deck-pile__count{min-width:24px;height:24px;font-size:10px}.card-grid--table{padding-left:54px;padding-right:0}
  .played-card-stage{top:50px}.played-card-stage__card{width:72px!important;height:105px!important}.played-card-stage__label{font-size:9px}
  .modal-overlay{padding:8px}.modal-card{max-height:calc(100vh - 16px)}.modal-head,.modal-body{padding-left:13px;padding-right:13px}
  .last-take-cards{gap:9px}.last-take-card-group>.playing-card{width:76px;height:111px}.last-take-captured .playing-card{width:65px;height:95px}
  .round-summary__row{grid-template-columns:minmax(100px,1.2fr) minmax(74px,.8fr) minmax(74px,.8fr);padding:9px 7px}.round-summary__criterion{font-size:12px}.round-summary__player-cell{padding-inline:3px}.round-summary__value{font-size:13px}
  .share-modal__actions{grid-template-columns:1fr}.finish-actions{display:grid;grid-template-columns:1fr}
}


/* r1.3: разнесённые ходы, устойчивый счёт и видимый финальный CTA */
.round-summary__total{align-content:start}
.round-summary__total-title{font:700 12px/1.2 Arial,sans-serif;opacity:.82}
.round-summary__score-lines{display:grid;gap:6px;margin-top:5px}
.round-summary__score-line{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:baseline;padding-top:5px;border-top:1px solid rgba(97,77,53,.16)}
.round-summary__score-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 13px/1.2 Arial,sans-serif}
.round-summary__score-value{font:700 24px/1 Georgia,serif}
.round-summary__score-line--human{color:#7f3828}
.round-summary__score-line--bot{color:#214f62}
.round-summary__total--all .round-summary__score-line{border-color:rgba(255,255,255,.16)}
.round-summary__total--all .round-summary__score-line--human{color:#ffd0ba}
.round-summary__total--all .round-summary__score-line--bot{color:#c4e6f2}
.finish-actions--primary{margin:10px 0 4px}
.finish-actions--primary .share-open-button{min-width:220px}
@media(max-width:820px){
  .played-card-stage__card{width:72px!important;height:105px!important}
  .round-summary__score-name{font-size:12px}.round-summary__score-value{font-size:21px}
}

/* r1.4: читаемый выбор Смока перед взяткой */
.playing-card.is-bot-selected{transform:translateY(-13px);border-color:#2c596d;box-shadow:0 13px 22px rgba(44,89,109,.32);z-index:6}

/* Карточный визуал r1.5: «Клондайк — Колыма» */
.playing-card{
  border-color:#294f41;
  background:#efe6d3;
  box-shadow:0 7px 17px rgba(31,25,15,.22),inset 0 0 0 1px rgba(196,157,67,.36);
  padding:6px;
  isolation:isolate;
}
.playing-card:before{
  content:"";
  position:absolute;
  inset:3px;
  border:1px solid rgba(36,74,59,.45);
  border-radius:9px;
  z-index:3;
  pointer-events:none;
}
.playing-card.is-gold{
  border-color:#b68216;
  background:#f2e0aa;
  box-shadow:0 8px 22px rgba(124,84,8,.30),inset 0 0 0 2px rgba(229,181,55,.48);
}
.playing-card.is-gold:before{border-color:rgba(128,83,4,.68)}
.playing-card.is-selected,
.playing-card.is-gold.is-selected{
  border-color:#2b687a;
  outline:3px solid #2b687a;
  outline-offset:1px;
  box-shadow:0 12px 24px rgba(34,82,97,.34),inset 0 0 0 1px rgba(255,255,255,.45);
}
.card-art{
  position:absolute;
  z-index:0;
  left:6px;
  right:6px;
  top:33px;
  bottom:22px;
  width:calc(100% - 12px);
  height:calc(100% - 55px);
  object-fit:cover;
  border-radius:7px;
  opacity:.76;
  filter:saturate(.72) contrast(.96) sepia(.08);
}
.playing-card.is-gold .card-art{
  opacity:.93;
  filter:saturate(1.04) contrast(1.01) sepia(.02) brightness(1.03);
}
.playing-card .card-topline,
.playing-card .card-center,
.playing-card>.card-badge--nugget{position:relative;z-index:4}
.card-topline{height:25px;text-align:center}
.card-badge--gold{
  background:linear-gradient(#e7bd51,#bd8618);
  color:#2d2415;
  border:1px solid rgba(96,61,5,.36);
  box-shadow:0 1px 3px rgba(68,43,3,.2);
}
.card-center{display:flex;flex-direction:column;justify-content:flex-end;align-items:center;position:relative;z-index:4;min-height:0}
.card-center--number{align-items:flex-start;justify-content:flex-start;padding:4px 3px 0;text-shadow:0 1px 0 rgba(255,250,235,.95),0 0 5px rgba(255,250,235,.8)}
.card-value{font-size:58px;color:#112c2b;line-height:.8;letter-spacing:-.04em}
.card-unit{font:700 10px/1.08 Georgia,"Times New Roman",serif;color:#2f2a20;margin-top:7px;max-width:80px}
.card-center--tool{justify-content:flex-end;padding-bottom:2px}
.card-tool-label{
  background:rgba(244,235,215,.86);
  color:#1f2e29;
  border:1px solid rgba(51,76,62,.25);
  border-radius:999px;
  padding:3px 7px;
  font:700 11px/1.05 Georgia,"Times New Roman",serif;
  max-width:94%;
  text-shadow:0 1px 0 rgba(255,255,255,.7);
}
.playing-card--tool-pan .card-tool-label{font-size:10px}
.card-badge--nugget{
  background:linear-gradient(180deg,#503d1c,#2d281f);
  color:#f6d36b;
  border:1px solid #c4972d;
  font-size:7px;
  padding:2px 5px;
  margin-bottom:1px;
}
.playing-card--back{
  background:#173d34;
  border-color:#bc943c;
  padding:0;
  box-shadow:0 5px 14px rgba(0,0,0,.3);
}
.playing-card--back:before{border-color:rgba(220,175,65,.58)}
.playing-card--back img{width:100%;height:100%;object-fit:cover;border-radius:9px}

@media(max-width:820px){
  .card-art{top:27px;bottom:17px;height:calc(100% - 44px)}
  .card-value{font-size:44px}
  .card-unit{font-size:8px;margin-top:4px;max-width:64px}
  .card-topline{height:19px}
  .card-tool-label{font-size:9px;padding:2px 5px}
  .playing-card--tool-pan .card-tool-label{font-size:8px}
}
@media(min-width:900px) and (max-height:760px){
  .card-art{top:25px;bottom:16px;height:calc(100% - 41px)}
  .card-value{font-size:40px}
  .card-unit{font-size:7px;max-width:58px}
  .card-topline{height:17px}
  .card-badge--gold{font-size:6px;padding:2px 3px}
  .card-tool-label{font-size:8px;padding:2px 4px}
}

/* Читаемость номинала поверх иллюстрации */
.card-center--number{
  align-self:flex-start;
  width:auto;
  min-width:58px;
  background:rgba(247,239,220,.82);
  border:1px solid rgba(51,75,61,.24);
  border-radius:9px;
  padding:5px 6px 6px;
  margin-top:1px;
  backdrop-filter:blur(1.5px);
}
.playing-card.is-gold .card-center--number{
  background:rgba(255,239,180,.78);
  border-color:rgba(157,108,10,.34);
}
.card-unit{display:block;max-width:76px}
@media(max-width:820px){
  .card-center--number{min-width:48px;padding:4px 5px 5px;border-radius:7px}
  .card-unit{max-width:60px}
}
@media(min-width:900px) and (max-height:760px){
  .card-center--number{min-width:44px;padding:3px 4px 4px}
  .card-unit{max-width:54px}
}
.playing-card--back{position:relative}
.card-back-brand{
  position:absolute;
  z-index:4;
  left:9%;right:9%;bottom:12%;
  color:#d7ae52;
  text-align:center;
  font:700 10px/1.12 Georgia,"Times New Roman",serif;
  letter-spacing:.02em;
  text-shadow:0 1px 2px rgba(0,0,0,.55);
}
.bot-hand .card-back-brand,.deck-pile .card-back-brand{font-size:5px;bottom:10%}

/* r1.7 — full-face колода: все карты 1–10, инструменты и золотые версии */
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.playing-card--r16{
  padding:0;
  border:0;
  background:#efe4cf;
  overflow:hidden;
  box-shadow:0 8px 20px rgba(38,27,13,.24);
}
.playing-card--r16:before,
.playing-card--r16:after{display:none}
.playing-card--r16.is-gold{
  background:#ebcb74;
  box-shadow:0 9px 24px rgba(139,88,7,.34);
}
.playing-card--r16.is-selected,
.playing-card--r16.is-gold.is-selected{
  outline:0;
  box-shadow:0 0 18px 5px rgba(247,210,129,.78),0 0 34px 10px rgba(237,176,63,.36),0 17px 28px rgba(29,23,13,.38);
}
.playing-card--r16.is-bot-selected{box-shadow:0 0 18px 5px rgba(247,210,129,.78),0 0 34px 10px rgba(237,176,63,.36),0 17px 28px rgba(29,23,13,.38)}
.playing-card--r16:focus-visible,
.playing-card--r16.is-selected:focus-visible,
.playing-card--r16.is-gold.is-selected:focus-visible{
  outline:0;
  box-shadow:0 0 18px 5px rgba(247,210,129,.78),0 0 34px 10px rgba(237,176,63,.36),0 17px 28px rgba(29,23,13,.38);
}
.card-face-r16{
  position:absolute;
  inset:0;
  z-index:1;
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:10px;
}
.playing-card--r16-back{padding:0;border:0;background:#143d34}
.playing-card--r16-back:before,.playing-card--r16-back:after{display:none}
.playing-card--r16-back img{width:100%;height:100%;object-fit:cover;border-radius:10px}

/* r1.6: регулярная игровая сетка под полноразмерные карты */
@media(min-width:821px){
  .card-grid--table{
    display:grid;
    grid-template-columns:repeat(auto-fit,128px);
    justify-content:center;
    align-items:center;
    gap:12px;
    min-height:255px;
  }
  .card-grid--table .playing-card{width:128px;height:185px}
  .card-grid--hand{
    display:grid;
    grid-template-columns:repeat(4,112px);
    justify-content:center;
    align-items:center;
    gap:10px;
    width:min(100%,520px);
    min-height:180px;
    margin-inline:auto;
  }
  .card-grid--hand .playing-card{width:112px;height:162px}
}
@media(min-width:900px) and (max-height:800px){
  .card-grid--table{grid-template-columns:repeat(auto-fit,104px);gap:9px}
  .card-grid--table .playing-card{width:104px;height:150px}
  .card-grid--hand{grid-template-columns:repeat(4,92px);gap:8px;min-height:142px}
  .card-grid--hand .playing-card{width:92px;height:133px}
}
@media(max-width:820px){
  .card-grid--hand{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    justify-content:center;
    gap:5px;
    width:min(100%,390px);
    min-height:0;
    margin-inline:auto;
  }
  .card-grid--hand .playing-card{
    width:100%;
    height:auto;
    min-width:0;
    aspect-ratio:112/162;
  }
  .card-grid--table{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    justify-content:center;
    align-items:center;
    gap:6px;
    min-height:0;
    padding-left:54px;
    padding-right:0;
  }
  .card-grid--table .playing-card{
    width:100%;
    height:auto;
    min-width:0;
    aspect-ratio:112/162;
  }
  .action-bar{padding:6px 8px;gap:5px}
  .selection-note{font-size:12px;line-height:1.25;min-height:0}
  .action-buttons .btn{padding:10px 14px}
  .player-zone--human{padding-bottom:8px}
}

/* r1.6: панель действий участвует в потоке и не перекрывает руку */
@media(max-width:820px), (min-width:900px) and (max-height:800px){
  .game-shell{padding-bottom:18px}
  .action-bar{
    position:sticky;
    left:auto;
    right:auto;
    bottom:8px;
    z-index:60;
    margin-top:8px;
  }
  .inline-message{
    position:static;
    margin-top:6px;
  }
}

/* r1.6: на телефоне действия идут сразу после руки, без наложения */
@media(max-width:820px){
  .game-shell{padding-bottom:18px}
  .action-bar{
    position:static;
    left:auto;
    right:auto;
    bottom:auto;
    margin-top:8px;
  }
}
@media(min-width:900px) and (max-height:800px){
  .game-shell{padding-bottom:74px}
  .action-bar{
    position:fixed;
    left:16px;
    right:16px;
    bottom:8px;
    margin:0;
  }
}

/* r1.6: низкий десктоп — стол крупный, рука и действия компактнее без наложения */
@media(min-width:900px) and (max-height:800px){
  .game-shell{padding-bottom:8px}
  .player-zone--human{padding-top:6px;padding-bottom:6px}
  .card-grid--hand{grid-template-columns:repeat(4,82px);gap:8px;min-height:124px}
  .card-grid--hand .playing-card{width:82px;height:119px}
  .action-bar{
    position:static;
    left:auto;
    right:auto;
    bottom:auto;
    margin-top:5px;
    padding:5px 10px;
    gap:4px;
  }
  .selection-note{font-size:12px;line-height:1.2;min-height:0}
  .action-buttons .btn{padding:8px 14px}
}

/* r1.6 layout v2: десктопный масштаб и мобильное игровое меню */
.game-menu-button{
  display:none;
  width:44px;
  height:44px;
  padding:0;
  border:1px solid rgba(255,255,255,.16);
  border-radius:12px;
  background:rgba(0,0,0,.18);
  color:#fff;
  font:700 24px/1 Arial,sans-serif;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.game-menu-actions{display:grid;gap:10px}
.game-menu-actions .btn{width:100%;text-align:left;padding:14px 16px}

@media(min-width:821px){
  .card-grid--table{
    flex:1;
    align-content:center;
    min-height:0;
  }
  .table-zone{display:flex;flex-direction:column;min-height:350px}
  .card-grid--table.table-layout--sparse{
    display:grid;
    grid-template-columns:repeat(auto-fit,150px);
    justify-content:center;
    gap:14px;
  }
  .card-grid--table.table-layout--sparse .playing-card{width:150px;height:217px}
  .card-grid--table.table-layout--dense{
    display:grid;
    grid-template-columns:repeat(auto-fit,118px);
    justify-content:center;
    column-gap:0;
    row-gap:12px;
  }
  .card-grid--table.table-layout--dense .playing-card{width:150px;height:217px;z-index:1}
  .card-grid--table.table-layout--dense .playing-card:hover,
  .card-grid--table.table-layout--dense .playing-card.is-selected{z-index:8}
  .card-grid--table.table-layout--crowded{
    display:grid;
    grid-template-columns:repeat(auto-fit,104px);
    justify-content:center;
    column-gap:0;
    row-gap:10px;
  }
  .card-grid--table.table-layout--crowded .playing-card{width:142px;height:205px;z-index:1}
  .card-grid--table.table-layout--crowded .playing-card:hover,
  .card-grid--table.table-layout--crowded .playing-card.is-selected{z-index:8}
}

@media(min-width:900px) and (max-height:800px){
  .table-zone{min-height:282px}
  .card-grid--table.table-layout--sparse{grid-template-columns:repeat(auto-fit,120px);gap:10px}
  .card-grid--table.table-layout--sparse .playing-card{width:120px;height:174px}
  .card-grid--table.table-layout--dense{grid-template-columns:repeat(auto-fit,98px);row-gap:8px}
  .card-grid--table.table-layout--dense .playing-card{width:120px;height:174px}
  .card-grid--table.table-layout--crowded{grid-template-columns:repeat(auto-fit,86px);row-gap:8px}
  .card-grid--table.table-layout--crowded .playing-card{width:116px;height:168px}
}

@media(max-width:820px){
  .game-topbar{grid-template-columns:auto 1fr auto;gap:8px;align-items:center}
  .game-heading{min-width:0}
  .scoreboard{justify-self:center;min-width:0;padding:7px 10px;gap:9px}
  .scoreboard__name{font-size:11px}
  .scoreboard__score{font-size:24px}
  .game-menu-button{display:inline-flex;justify-self:end}
  .mini-map-panel{display:none!important}
  .game-main{grid-template-columns:1fr}
  .table-zone{
    display:flex;
    flex-direction:column;
    transition:min-height .16s ease;
  }
  .table-zone--single{min-height:218px}
  .table-zone--multi{min-height:330px}
  .table-zone--crowded{min-height:330px}
  .card-grid--table{
    flex:1;
    align-content:center;
    justify-content:center;
    min-height:0;
    padding-left:54px;
    padding-right:2px;
  }
  .card-grid--table.table-layout--sparse{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:6px;
  }
  .card-grid--table.table-layout--sparse .playing-card{
    width:100%;height:auto;min-width:0;aspect-ratio:112/162;
  }
  .card-grid--table.table-layout--dense{
    display:grid;
    grid-template-columns:repeat(5,46px);
    column-gap:0;
    row-gap:9px;
  }
  .card-grid--table.table-layout--dense .playing-card{
    width:78px;height:113px;z-index:1;
  }
  .card-grid--table.table-layout--crowded{
    display:grid;
    grid-template-columns:repeat(6,38px);
    column-gap:0;
    row-gap:8px;
  }
  .card-grid--table.table-layout--crowded .playing-card{
    width:72px;height:104px;z-index:1;
  }
  .card-grid--table.table-layout--dense .playing-card.is-selected,
  .card-grid--table.table-layout--crowded .playing-card.is-selected{z-index:8}
  .card-grid--table.table-layout--dense .playing-card:focus-visible,
  .card-grid--table.table-layout--crowded .playing-card:focus-visible{z-index:9}
}

/* r1.6 layout v2.1: низкий десктоп держит большой стол в один ряд через controlled overlap */
@media(min-width:900px) and (max-height:800px){
  .table-zone{min-height:246px}
  .card-grid--table.table-layout--dense{grid-template-columns:repeat(auto-fit,84px);row-gap:8px}
  .card-grid--table.table-layout--crowded{grid-template-columns:repeat(auto-fit,72px);row-gap:8px}
}

/* r1.17: геометрия колоды и игровой стол на десктопе */
.card-grid--table .playing-card,
.card-grid--hand .playing-card,
.last-take-card-group>.playing-card,
.last-take-captured .playing-card,
.played-card-stage__card{
  height:auto!important;
  aspect-ratio:190/310;
}
.bot-hand .playing-card,
.deck-pile__card{
  height:auto!important;
  aspect-ratio:186/310;
}
.bot-hand{align-items:center}
.card-face-r16,
.playing-card--r16-back img{object-fit:contain}

@media(min-width:821px){
  .game-shell{padding-top:10px;padding-bottom:12px}
  .game-topbar{padding-bottom:8px}
  .player-zone--bot{min-height:92px;padding-block:6px}
  .player-zone--bot .player-zone__label{margin-bottom:4px}
  .bot-hand{min-height:70px}
  .bot-hand .playing-card{width:42px}
  .game-main{margin:8px 0}
  .table-zone{min-height:322px;padding-block:10px}
  .card-grid--table.table-layout--sparse{grid-template-columns:repeat(auto-fit,166px);gap:14px}
  .card-grid--table.table-layout--sparse .playing-card{width:166px}
  .card-grid--table.table-layout--dense{grid-template-columns:repeat(auto-fit,86px)}
  .card-grid--table.table-layout--dense .playing-card{width:160px}
  .card-grid--table.table-layout--crowded{grid-template-columns:repeat(auto-fit,90px)}
  .card-grid--table.table-layout--crowded .playing-card{width:148px}
  .card-grid--hand{grid-template-columns:repeat(4,138px);gap:12px;width:min(100%,600px);min-height:226px}
  .card-grid--hand .playing-card{width:138px}
  .player-zone--human{padding-block:10px}
  .player-zone--human .player-zone__label{margin-bottom:5px}
  .action-bar{margin-top:6px}
}

@media(min-width:821px) and (max-width:1450px){
  .card-grid--table.table-layout--dense{grid-template-columns:repeat(auto-fit,76px)}
  .card-grid--table.table-layout--dense .playing-card{width:134px}
}

@media(min-width:900px) and (max-height:800px){
  .game-shell{padding-top:5px;padding-bottom:6px}
  .game-topbar{padding-bottom:5px}
  .player-zone--bot{min-height:78px;padding-block:5px}
  .bot-hand{min-height:61px}
  .bot-hand .playing-card{width:36px}
  .game-main{margin:6px 0}
  .table-zone{min-height:255px;padding-block:8px}
  .card-grid--table.table-layout--sparse{grid-template-columns:repeat(auto-fit,126px);gap:10px}
  .card-grid--table.table-layout--sparse .playing-card{width:126px}
  .card-grid--table.table-layout--dense{grid-template-columns:repeat(auto-fit,74px)}
  .card-grid--table.table-layout--dense .playing-card{width:126px}
  .card-grid--table.table-layout--crowded{grid-template-columns:repeat(auto-fit,72px)}
  .card-grid--table.table-layout--crowded .playing-card{width:116px}
  .card-grid--hand{grid-template-columns:repeat(4,120px);gap:10px;width:min(100%,520px);min-height:198px}
  .card-grid--hand .playing-card{width:120px}
  .player-zone--human{padding-block:7px}
  .player-zone--human .player-zone__label{margin-bottom:4px}
  .action-bar{
    margin-top:4px;
    padding:0;
    background:transparent;
    border:0;
    box-shadow:none;
  }
}

@media(min-width:900px) and (max-height:740px){
  .bot-hand .playing-card{width:34px}
  .table-zone{min-height:237px}
  .card-grid--table.table-layout--sparse{grid-template-columns:repeat(auto-fit,116px)}
  .card-grid--table.table-layout--sparse .playing-card{width:116px}
  .card-grid--table.table-layout--dense{grid-template-columns:repeat(auto-fit,70px)}
  .card-grid--table.table-layout--dense .playing-card{width:116px}
  .card-grid--hand{grid-template-columns:repeat(4,108px);gap:9px;width:min(100%,470px);min-height:178px}
  .card-grid--hand .playing-card{width:108px}
}

@media(max-width:820px){
  .game-shell{padding-bottom:12px}
  .card-grid--table.table-layout--dense .playing-card,
  .card-grid--table.table-layout--crowded .playing-card{height:auto!important}
  .bot-hand .playing-card{width:38px}
  .deck-pile__card{height:auto!important}
}

/* r1.19 — оформление игрового поля по целевому макету; карта прииска не меняется */
.game-shell{position:relative;isolation:isolate}
.game-shell::before{
  content:"";
  position:absolute;
  z-index:-1;
  top:0;
  left:50%;
  width:100vw;
  height:165px;
  transform:translateX(-50%);
  pointer-events:none;
  background:
    linear-gradient(180deg,rgba(11,24,23,.24),rgba(10,22,21,.48) 57%,#111c1a 100%),
    url('../img/game-header-r1.19.webp') center 46%/cover no-repeat;
}
.game-topbar{
  min-height:110px;
  padding:10px 3px 8px;
  border-bottom:1px solid rgba(210,184,125,.36);
  position:relative;
  z-index:1;
}
.game-heading{gap:2px;align-content:center;max-width:440px}
.game-heading__brand{display:grid;gap:1px}
.game-heading__brand::before{
  content:"";
  display:block;
  width:235px;
  height:25px;
  margin-bottom:1px;
  background:url('../img/mountain-mark-r1.19.svg') left bottom/contain no-repeat;
  filter:drop-shadow(0 2px 4px rgba(2,12,11,.7));
}
.game-heading__name{
  color:#eed6a0;
  font-size:clamp(25px,2.35vw,35px);
  line-height:.97;
  font-weight:700;
  letter-spacing:.012em;
  text-shadow:0 2px 8px rgba(2,12,11,.92),0 0 18px rgba(215,167,85,.16);
}
.game-heading__motto{
  color:#dfbf7e;
  font:700 9px/1.25 Georgia,"Times New Roman",serif;
  letter-spacing:.18em;
  text-transform:uppercase;
  text-shadow:0 2px 5px rgba(2,12,11,.9);
}
.game-heading__round{color:#fff2d7;font-size:16px;line-height:1.2;text-shadow:0 2px 5px rgba(2,12,11,.85)}
.game-shell .scoreboard{
  background:rgba(8,22,22,.86);
  border:1px solid rgba(205,178,119,.38);
  color:#fff4dc;
  box-shadow:0 8px 20px rgba(0,0,0,.32),inset 0 1px 0 rgba(255,255,255,.08);
}
.game-meta{display:grid;justify-items:end;gap:4px;color:#f0e2c2}
.game-meta__quote{
  max-width:270px;
  color:#efd19a;
  font:italic 15px/1.23 Georgia,"Times New Roman",serif;
  text-align:right;
  text-shadow:0 2px 5px rgba(2,12,11,.95);
}
.game-meta__target{font:13px Arial,sans-serif;text-shadow:0 2px 5px rgba(2,12,11,.95)}
.player-zone,.table-zone{
  background:
    radial-gradient(circle at 18% 0,rgba(255,255,255,.68),transparent 44%),
    linear-gradient(142deg,#fffdf5,#f0e2c7);
  border:1px solid rgba(28,61,52,.9);
  box-shadow:0 0 0 4px rgba(27,59,51,.74),0 13px 28px rgba(0,0,0,.22),inset 0 1px 0 rgba(255,255,255,.84);
}
.player-zone--bot{border-left:4px solid rgba(44,89,109,.72)}
.player-zone--human{border-left:4px solid rgba(166,79,50,.72)}
.game-shell .player-zone__label>strong,
.game-shell .zone-heading>strong{font-size:20px}
.game-shell .player-zone__label .muted{color:#756e60}
.game-shell .btn--primary{
  background:linear-gradient(180deg,#314a40,#19342e);
  color:#fff4dc;
  box-shadow:0 6px 16px rgba(21,45,37,.25);
}
.game-shell .btn--secondary{background:#e7dbc3;color:#594d3a}
.game-shell .action-buttons .btn{border-radius:8px}

@media(min-width:821px) and (max-height:800px){
  .game-topbar{min-height:77px;padding-block:5px 4px}
  .game-heading__brand::before{display:none}
  .game-heading__name{font-size:25px}
  .game-heading__round{font-size:14px}
  .game-meta__quote{display:none}
}
@media(min-width:821px) and (max-height:740px){
  .game-topbar{min-height:66px}
  .game-heading__motto{display:none}
  .game-heading__name{font-size:22px}
}
@media(max-width:820px){
  .game-topbar{min-height:76px;padding-block:7px 5px}
  .game-heading__brand::before{display:none}
  .game-heading__name{font-size:clamp(16px,2.8vw,23px)}
  .game-heading__motto,.game-meta__quote{display:none}
  .game-heading__round{font-size:15px}
  .game-meta{display:none}
  .player-zone,.table-zone{box-shadow:0 0 0 2px rgba(27,59,51,.68),0 9px 22px rgba(0,0,0,.2)}
  .game-shell .player-zone__label>strong,
  .game-shell .zone-heading>strong{font-size:17px}
}
@media(max-width:520px){
  .game-heading__name{max-width:132px;font-size:16px;line-height:1.05}
  .game-heading__round{font-size:14px}
}

/* Карта прииска r1.20: флажки собираются на шестнадцати местах. */
.claims-map .map-bg{stroke:none}
.claims-map .map-frame{fill:none;stroke:#997f5f;stroke-width:8}
.claims-map .map-art{pointer-events:none}
.claims-map .map-title,.claims-map .map-score,.claims-map .map-overflow{
  paint-order:stroke;stroke:#f5eddd;stroke-width:10;stroke-linejoin:round
}
.claims-map .claim-cluster__flag .claim-flag__pole{stroke:#40332c;stroke-width:6;stroke-linecap:round}
.claims-map .claim-cluster--human .claim-flag__cloth{fill:#b95a32;stroke:#733b27;stroke-width:3}
.claims-map .claim-cluster--bot .claim-flag__cloth{fill:#326781;stroke:#203f54;stroke-width:3}
.claims-map .claim-cluster--human .claim-cluster__plate{fill:#ffefd0;stroke:#995332;stroke-width:4}
.claims-map .claim-cluster--bot .claim-cluster__plate{fill:#e2f0ef;stroke:#2c5f75;stroke-width:4}
.claims-map .claim-cluster__count{font:bold 43px Arial,sans-serif;fill:#263038;dominant-baseline:auto}
.claims-map .claim-cluster,.claims-map .claim-flag{filter:drop-shadow(0 2px 3px rgba(27,29,28,.48))}
.claims-map .claim-flag.is-new,.claims-map .claim-cluster.is-new{animation:claim-appear .26s ease-out both}
@keyframes claim-appear{from{opacity:.15}to{opacity:1}}

/* Флаги r1.21: полотнище, скрещённый инструмент и деревянная табличка. */
.claims-map .claim-flag__pole{stroke:#593d28;stroke-width:7;stroke-linecap:round}
.claims-map .claim-flag__finial{fill:#d9b26a;stroke:#533924;stroke-width:3}
.claims-map .claim-flag--human .claim-flag__cloth,
.claims-map .claim-cluster--human .claim-flag__cloth{fill:#a55033;stroke:#d5ab62;stroke-width:3}
.claims-map .claim-flag--bot .claim-flag__cloth,
.claims-map .claim-cluster--bot .claim-flag__cloth{fill:#315d72;stroke:#d5ab62;stroke-width:3}
.claims-map .claim-flag__tools,.claims-map .claim-flag__tool-head{
  fill:none;stroke:#f3d389;stroke-width:4;stroke-linecap:round;stroke-linejoin:round
}
.claims-map .claim-flag__plaque,
.claims-map .claim-cluster--human .claim-cluster__plate,
.claims-map .claim-cluster--bot .claim-cluster__plate{fill:#e7cf9d;stroke:#654932;stroke-width:4}
.claims-map .claim-flag__plaque-number,
.claims-map .claim-cluster__count{font:bold 35px Georgia,serif;fill:#30271e}
.claims-map .claim-cluster__count{font-size:43px}
.claims-map .map-legend__back{fill:#f4e8ca;fill-opacity:.82;stroke:#b6986e;stroke-opacity:.75;stroke-width:3}

/* r1.22: главная страница и рейтинг старателей */
.start-screen{display:block;width:min(1280px,100%);margin:0 auto;min-height:100vh;padding:clamp(14px,3vw,38px)}
.start-hero{display:grid;grid-template-columns:minmax(450px,1.05fr) minmax(340px,.95fr);gap:clamp(16px,3vw,38px);align-items:center;min-height:min(710px,90vh)}
.start-screen .start-card{width:100%;padding:clamp(24px,3.4vw,50px);z-index:1}
.start-screen .game-title{font-size:clamp(38px,5vw,72px)}
.start-screen .lead{max-width:560px;margin-bottom:10px}
.start-promise{font:15px/1.55 Arial,sans-serif;color:#645640;margin:0 0 22px}
.start-art{position:relative;align-self:stretch;min-height:450px;display:grid;place-items:center;isolation:isolate}
.start-art:before{content:"";position:absolute;inset:11% 0 16%;border-radius:50%;background:radial-gradient(ellipse,rgba(189,149,72,.36),transparent 70%);filter:blur(25px);z-index:-1}
.start-art__map{width:100%;max-height:530px;object-fit:contain;filter:drop-shadow(0 20px 28px rgba(0,0,0,.35));border-radius:18px}
.start-art__card{position:absolute;width:clamp(92px,12vw,155px);height:auto;aspect-ratio:190/310;object-fit:contain;border-radius:8px;filter:drop-shadow(0 9px 14px rgba(0,0,0,.42))}
.start-art__card--0{left:3%;bottom:4%;transform:rotate(-12deg)}
.start-art__card--1{left:23%;bottom:1%;transform:rotate(5deg)}
.start-art__card--2{right:2%;bottom:6%;transform:rotate(13deg)}
.start-how,.rating-teaser{margin:16px 0 0;padding:clamp(18px,2vw,30px);border-radius:20px;background:rgba(252,242,218,.95);color:var(--ink)}
.start-how h2,.rating-teaser h2{font-size:clamp(23px,3vw,35px);margin:0 0 18px}
.start-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.start-step{padding:12px 15px;border-left:3px solid #bd994e;background:rgba(255,255,255,.6)}
.start-step h3{font-size:17px;margin:0 0 8px}.start-step p{font:14px/1.5 Arial,sans-serif;margin:0}
.rating-teaser{text-align:center;margin-bottom:22px}
.rating-teaser__intro{font:15px/1.5 Arial,sans-serif;color:#665b49;margin:-7px 0 18px}
.rating-teaser__categories{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;text-align:left}
.rating-teaser__category{display:flex;flex-direction:column;min-width:0;padding:17px 18px;border:1px solid rgba(173,135,66,.34);border-radius:14px;background:rgba(255,255,255,.48)}
.rating-teaser__category h3{font-size:clamp(19px,2vw,23px);margin:0 0 10px}
.rating-teaser__content{min-width:0;overflow-x:auto;flex:1;margin-bottom:15px}
.rating-teaser__open{align-self:flex-start}
.rating-modal .modal-card{width:min(820px,100%)}
.rating-intro,.rating-footnote{font:14px/1.55 Arial,sans-serif;color:#665b49}
.rating-tabs{display:flex;gap:8px;margin:12px 0 17px}
.rating-tab{background:#f3e4c5;color:#3b3327}.rating-tab.is-active{background:#32464b;color:white}
.rating-content{max-width:100%;overflow-x:auto}.rating-empty,.rating-error{font:16px/1.5 Arial,sans-serif}
.rating-me{font:700 14px/1.5 Arial,sans-serif;padding:10px 13px;background:#eaddbf;border-radius:10px}
.rating-table{width:100%;border-collapse:collapse;text-align:left;font:14px/1.4 Arial,sans-serif}
.rating-table th,.rating-table td{padding:9px 8px;border-bottom:1px solid rgba(117,93,56,.22)}
.rating-table th{font-size:12px;color:#63543e}.rating-table td:nth-child(3){font-weight:700}
.finish-rating-status{text-align:center;font:14px/1.45 Arial,sans-serif;margin:12px 0}.finish-rating-status p{margin:8px 0}
.finish-name-error{font:13px/1.4 Arial,sans-serif;color:#9d3929;min-height:17px;margin:8px 0 0}
@media(max-width:900px){.start-hero{grid-template-columns:1fr;min-height:auto}.start-art{min-height:290px;max-width:620px;width:100%;margin:auto}.start-art__map{max-height:365px}.start-art__card{width:105px}.start-steps{grid-template-columns:1fr}}
@media(max-width:800px){.rating-teaser__categories{grid-template-columns:1fr}}
@media(max-width:520px){.start-screen{padding:10px}.start-screen .start-card{padding:22px 16px}.start-screen .game-title{font-size:39px}.start-art{min-height:245px}.start-art__map{max-height:275px}.start-art__card{width:72px}.start-art__card--0{left:6%}.start-art__card--1{left:27%}.start-art__card--2{right:6%}.rating-table{min-width:480px}.rating-tabs .btn{flex:1}.start-how,.rating-teaser{padding:17px}}
@media(min-width:901px) and (max-height:760px){.start-hero{min-height:auto}.start-screen .start-card{padding:24px 34px}.start-screen .game-title{font-size:47px}.start-screen .lead{font-size:17px}.start-art{min-height:430px}.start-art__map{max-height:400px}.start-art__card{width:105px}}

/* r1.23: узнаваемая верхняя полоса главной страницы */
.start-masthead{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  min-height:82px;padding:12px clamp(16px,2vw,28px);
  border:1px solid rgba(215,185,120,.48);border-radius:16px;
  background:linear-gradient(90deg,rgba(13,30,30,.91),rgba(18,35,34,.74) 56%,rgba(12,28,28,.86)),
    url('../img/game-header-r1.19.webp') center 44%/cover no-repeat;
  box-shadow:0 12px 30px rgba(0,0,0,.27);
}
.start-masthead__brand{display:flex;align-items:center;gap:12px;min-width:0}
.start-masthead__mark{display:block;width:150px;height:20px;object-fit:contain;flex:none}
.start-masthead__name{font:700 clamp(18px,2vw,25px)/1.15 Georgia,"Times New Roman",serif;color:#f2dbac;text-shadow:0 2px 8px #0d1b1d;white-space:nowrap}
.start-masthead__nav{display:flex;justify-content:flex-end;gap:4px;align-items:center;flex-wrap:wrap}
.start-masthead__link{border:0;border-radius:9px;background:rgba(10,27,27,.65);color:#fff0d2;min-height:44px;padding:9px 14px;cursor:pointer;font:700 13px/1.2 Arial,sans-serif}
.start-masthead__link:hover{background:rgba(33,66,57,.85)}
.start-masthead__link:focus-visible{outline:2px solid #e4c07f;outline-offset:3px}
.start-screen .start-hero{min-height:min(640px,calc(100vh - 152px))}
.start-screen>h1,.start-screen>p{color:#f1e0b9}
@media(min-width:901px) and (max-height:760px){.start-masthead{min-height:62px;padding-block:6px}.start-masthead__mark{width:100px;height:16px}.start-masthead__name{font-size:20px}.start-screen .start-hero{min-height:auto}}
@media(max-width:900px){.start-masthead{flex-wrap:wrap;justify-content:center;min-height:0;padding:10px 14px}.start-masthead__brand{justify-content:center}.start-masthead__mark{width:105px;height:16px}.start-masthead__nav{width:100%;justify-content:center}.start-masthead__link{flex:1;white-space:nowrap}.start-screen .start-hero{min-height:auto}}
@media(max-width:520px){.start-masthead__mark{display:none}.start-masthead__name{font-size:18px}.start-masthead__nav{gap:2px}.start-masthead__link{padding:8px 5px;font-size:12px}}

/* r1.24: отступ после шапки и две завершающие панели главной */
.start-screen .start-hero{margin-top:20px}
.start-connect{display:grid;grid-template-columns:1fr 1fr;gap:22px;margin:18px 0 8px}
.start-connect__panel{min-width:0;min-height:214px;padding:clamp(18px,2vw,26px);background:rgba(255,250,241,.97);border:1px solid #e1d5c0;border-radius:22px}
.start-connect__panel .eyebrow{color:#18735f}
.start-connect__panel h2{font-size:clamp(25px,2.7vw,32px);margin:4px 0 9px;color:#142c31}
.start-connect__panel p{font:14px/1.5 Arial,sans-serif;color:#6a706f;margin:0 0 17px}
.start-connect__actions{display:flex;gap:10px;flex-wrap:wrap}
.start-connect__panel .btn--primary{background:#20775e;color:white}
.start-connect__panel .btn--secondary{background:white;border:1px solid #dfd0b7;color:#182b2e}
.start-connect__panel .btn{min-height:46px}
.start-news__note{display:block;margin-top:8px;font:12px/1.4 Arial,sans-serif;color:#706f67}
.start-share__status{display:block;min-height:20px;margin-top:7px;font:13px Arial,sans-serif;color:#20775e}
@media(max-width:760px){.start-connect{grid-template-columns:1fr;gap:14px}.start-connect__panel{min-height:0}}
@media(max-width:520px){.start-screen .start-hero{margin-top:16px}.start-connect__panel{padding:19px 16px}}

/* r1.26: правила с примером взятки и закреплённой кнопкой возврата */
.rules-modal .modal-card{width:min(860px,100%);display:flex;flex-direction:column;overflow:hidden}
.rules-modal .modal-body{min-height:0;overflow-y:auto;padding:18px 20px}
.rules-columns{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:stretch}
.rules-section{min-width:0;padding:15px 17px;border:1px solid rgba(126,100,58,.22);border-radius:14px;background:rgba(255,251,242,.72)}
.rules-section__title{margin:0 0 10px;color:#26383f;font:700 22px/1.2 Georgia,"Times New Roman",serif}
.rules-section p{margin:0 0 10px;font:14px/1.48 Arial,sans-serif}
.rules-section p:last-child{margin-bottom:0}
.rules-section .rules-note{font:13px/1.45 Arial,sans-serif;color:#665c4d}
.rules-example{display:grid;justify-items:start;gap:8px;margin:11px 0;padding:10px 12px;border-radius:11px;background:#e8dcc4}
.rules-example__caption{font:700 13px/1.3 Arial,sans-serif;color:#4e4435}
.rules-example__cards{display:flex;align-items:center;gap:7px}
.rules-example .playing-card{width:46px;height:75px;flex:none;pointer-events:none}
.rules-example__operator{font:700 20px/1 Georgia,serif;color:#795b2b}
.rules-points{display:grid;gap:1px;margin-bottom:11px;border:1px solid #dfd0b5;border-radius:10px;overflow:hidden;background:#dfd0b5}
.rules-points__row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 11px;background:#fffaf0;font:14px/1.3 Arial,sans-serif}
.rules-points__row strong{flex:none;color:#17624f;white-space:nowrap;font:700 14px Arial,sans-serif}
.rules-section--finish{margin-top:14px;border-color:rgba(176,133,49,.48);background:rgba(221,198,151,.24)}
.rules-section--finish p{margin:0}
.rules-modal .modal-footer{flex:none;display:flex;justify-content:flex-end;padding:12px 20px;border-top:1px solid rgba(140,112,73,.2);background:#f5ead5}
.rules-close{min-width:190px;min-height:44px}
@media(max-width:700px){
  .rules-columns{grid-template-columns:1fr}
  .rules-modal .modal-body{padding:12px}
  .rules-section{padding:13px}
  .rules-modal .modal-footer{padding:10px 12px}
  .rules-close{width:100%}
}

/* r1.29: тихие счётчики, временная подсказка и отступ под действиями. */
.game-shell .capture-stats{font:12px/1.4 Arial,sans-serif;text-align:right;color:#756e60}
.game-notice{
  position:fixed;z-index:85;top:clamp(78px,13vh,140px);left:50%;
  width:max-content;max-width:calc(100vw - 24px);transform:translateX(-50%);
  padding:10px 16px;border:1px solid rgba(234,206,151,.6);border-radius:12px;
  background:rgba(29,43,45,.96);color:#fff4db;text-align:center;
  font:700 14px/1.4 Arial,sans-serif;box-shadow:0 12px 32px rgba(0,0,0,.35);
  pointer-events:none;animation:game-notice-fade 3.6s both;
}
@keyframes game-notice-fade{0%,72%{opacity:1}100%{opacity:0}}
@media(min-width:821px) and (max-height:800px){.game-shell{padding-bottom:clamp(36px,7vh,64px)}}
@media(max-width:820px){.game-shell{padding-bottom:32px}}

/* r1.30: имя игрока открывает редактирование без изменения сетки поля. */
.player-name-edit{
  padding:0;border:0;background:none;color:inherit;text-align:left;cursor:pointer;
  text-decoration:underline dotted;text-decoration-color:rgba(127,99,58,.6);text-underline-offset:4px;
}
.player-name-edit:hover:not(:disabled){text-decoration-style:solid}
.player-name-edit:focus-visible{outline:2px solid var(--gold);outline-offset:4px;border-radius:2px}
.player-name-edit:disabled{cursor:default;text-decoration:none}
.game-shell .player-zone__label>.player-name-edit--zone{font:700 20px/1.2 Georgia,"Times New Roman",serif}
.game-shell .scoreboard__name.player-name-edit--score{font:12px/1.2 Arial,sans-serif;text-decoration-color:rgba(255,230,179,.65)}
.name-modal .modal-card{width:min(470px,100%)}
.name-modal__label{display:block;margin-bottom:8px;font:700 14px/1.4 Arial,sans-serif}
.name-modal__hint{margin:10px 0 0;font:13px/1.5 Arial,sans-serif;color:#665b49}
.name-modal .modal-footer{display:flex;justify-content:flex-end;gap:9px;padding:0 20px 18px}
@media(max-width:820px){.game-shell .player-zone__label>.player-name-edit--zone{font-size:17px}}
@media(max-width:520px){.name-modal .modal-footer{padding:0 13px 13px}.name-modal .modal-footer .btn{flex:1}}

/* r1.31: возврат к партии на главной и единая ширина её секций. */
.screen.start-screen{display:block;width:min(1280px,100%);margin-inline:auto}
.start-screen>.start-masthead,.start-screen>.start-hero,.start-screen>.start-how,.start-screen>.rating-teaser,.start-screen>.start-connect{width:100%}
.start-card--recovery .game-title{font-size:clamp(34px,4vw,54px)}
.start-recovery__score{font-size:clamp(38px,5vw,58px);margin:24px 0 6px}
.start-recovery__meta{font:14px/1.5 Arial,sans-serif;color:#665b49;margin:0}
.start-recovery__actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:26px}
.start-recovery__actions .btn{min-height:46px}
@media(max-width:520px){.start-recovery__actions .btn{flex:1}}

/* r1.32: итог партии помещается рядом с картой прииска на десктопе. */
.screen.finish-screen{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px;padding:14px clamp(14px,2vw,28px)}
.finish-masthead,.finish-card{width:min(1200px,100%)}
.finish-masthead{min-height:62px;flex:none}
.finish-masthead__label{color:#f2dbac;font:700 14px/1.3 Arial,sans-serif}
.finish-card{padding:clamp(20px,2.4vw,34px)}
.finish-layout{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);align-items:center;gap:clamp(16px,2.4vw,32px)}
.finish-summary,.finish-map{min-width:0}
.finish-summary .finish-title{font-size:clamp(34px,3.6vw,52px);line-height:1.05;margin:5px 0 14px;text-wrap:balance}
.finish-summary .finish-names{margin-top:12px}
.finish-summary .finish-score{text-align:left;font-size:clamp(50px,5vw,72px);line-height:1.05;margin:7px 0 16px}
.finish-summary .finish-actions{justify-content:flex-start;margin:10px 0 6px}
.finish-summary .finish-actions--primary .share-open-button{min-width:190px}
.finish-summary .finish-meta,.finish-summary .finish-rating-status{text-align:left}
.finish-summary .finish-meta{margin:12px 0 0}
.finish-summary .finish-rating-status{margin:12px 0}
.finish-summary .finish-rating-status p{margin:0 0 8px}
.finish-summary .finish-rating-status .btn{margin:2px 8px 0 0}
.finish-summary .finish-name-box{padding-top:12px;margin-top:12px}
.finish-map{display:grid;place-items:center}
.finish-map .claims-map{display:block;width:min(100%,520px,calc(100vh - 180px));height:auto;max-height:none;margin:0 auto}
@media(min-width:901px) and (max-height:800px){
  .finish-card{padding:clamp(18px,2vw,28px)}
  .finish-summary .finish-title{font-size:clamp(30px,3.2vw,45px)}
  .finish-summary .finish-score{font-size:58px;margin-bottom:12px}
  .finish-summary .finish-rating-status{margin:9px 0}
}
@media(max-width:900px){
  .screen.finish-screen{justify-content:flex-start}
  .finish-masthead,.finish-card{width:min(760px,100%)}
  .finish-layout{grid-template-columns:1fr}
  .finish-map .claims-map{width:min(100%,480px);max-height:44vh}
}
@media(max-width:520px){.finish-masthead__label{display:none}.finish-summary .finish-score{text-align:center}.finish-summary .finish-meta,.finish-summary .finish-rating-status{text-align:center}}

/* r1.33: внутренний скролл попапов, фиксированная кнопка расчёта кона. */
.modal-overlay,.round-overlay{overscroll-behavior:contain}
.modal-card{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.round-summary{display:flex;flex-direction:column;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);overflow:hidden}
.round-summary__content{min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.round-summary__continue{flex:none;min-height:48px;margin-top:12px}

/* Ссылки в приложение Telegram выглядят и размещаются как соседние кнопки. */
a.btn[href^="tg://"]{display:inline-flex;align-items:center;justify-content:center;text-align:center;text-decoration:none}

/* r1.35: мобильный стол, имена и рука соперника при прокрутке. */
@media(max-width:820px){
  .game-topbar{grid-template-columns:minmax(0,1fr) minmax(0,1.45fr) 44px}
  .game-shell .scoreboard{width:100%;max-width:100%;min-width:0;justify-self:stretch;gap:5px;padding:6px 7px}
  .scoreboard__side{flex:1 1 0;min-width:0;align-items:center;gap:4px}
  .scoreboard__side--bot{justify-content:flex-end}
  .scoreboard__name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .scoreboard__score,.scoreboard__divider{flex:none;line-height:1}
  .player-zone__label{min-width:0;align-items:flex-start;gap:8px}
  .player-zone__label>strong,.player-zone__label>.player-name-edit--zone{flex:1 1 42%;min-width:0;overflow-wrap:anywhere}
  .player-zone__label .capture-stats{flex:1 1 58%;min-width:0}
}
@media(max-width:520px){
  .player-zone--bot{position:sticky;top:0;z-index:20;min-height:0;padding:8px 10px}
  .player-zone--bot .player-zone__label{margin-bottom:4px}
  .bot-hand{min-height:48px}
  .bot-hand .playing-card{width:34px}
  .table-zone--single-row{min-height:218px}
  .card-grid--table.table-layout--sparse:not(.table-layout--mobile-row){display:flex;flex-wrap:wrap;gap:6px}
  .card-grid--table.table-layout--sparse:not(.table-layout--mobile-row) .playing-card{flex:0 0 min(90px,calc((100% - 12px)/3));width:min(90px,calc((100% - 12px)/3))}
  .card-grid--table.table-layout--mobile-row{display:grid;grid-template-columns:repeat(5,46px);column-gap:0;row-gap:0;justify-content:center}
  .card-grid--table.table-layout--mobile-row.table-layout--four{grid-template-columns:repeat(4,46px)}
  .card-grid--table.table-layout--mobile-row .playing-card{width:78px;z-index:1}
  .card-grid--table.table-layout--mobile-row .playing-card.is-selected{z-index:8}
  .card-grid--table.table-layout--mobile-row .playing-card:focus-visible{z-index:9}
}
@media(max-width:350px){
  .card-grid--table.table-layout--mobile-row{grid-template-columns:repeat(5,minmax(0,1fr));padding-right:18px}
  .card-grid--table.table-layout--mobile-row.table-layout--four{grid-template-columns:repeat(4,minmax(0,1fr))}
  .card-grid--table.table-layout--mobile-row .playing-card{width:calc(100% + 18px)}
}

/* r1.36: действия остаются доступны внизу экрана при прокрутке партии. */
@media(max-width:520px){
  .game-shell{padding-bottom:calc(152px + env(safe-area-inset-bottom,0px))}
  .game-shell .action-bar{
    position:fixed;z-index:60;
    left:calc(8px + env(safe-area-inset-left,0px));
    right:calc(8px + env(safe-area-inset-right,0px));
    bottom:calc(8px + env(safe-area-inset-bottom,0px));
    margin:0;padding:8px;gap:6px;
    max-height:min(150px,32dvh);overflow-y:auto;
    color:var(--ink);background:rgba(255,250,240,.98);
    border:1px solid var(--line);border-radius:14px;
    box-shadow:0 10px 32px rgba(0,0,0,.28);
  }
  .game-shell .selection-note{min-height:0;font:12px/1.3 Arial,sans-serif}
  .game-shell .action-buttons{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.5fr);gap:8px}
  .game-shell .action-buttons .btn{min-width:0;min-height:44px;padding:10px 5px;font:700 13px/1.2 Arial,sans-serif;white-space:nowrap}
}

/* r1.40: единая геометрия нового экспорта 440×589 и руки из четырёх/пяти карт. */
.game-shell{--hand-columns:4;--hand-overlap-total:36px}
.game-shell[data-deck-size="65"]{--hand-columns:5;--hand-overlap-total:48px}
.playing-card.playing-card--classic,
.card-grid .playing-card.playing-card--classic,
.bot-hand .playing-card.playing-card--classic,
.played-card-stage__card.playing-card--classic,
.last-take-card-group>.playing-card.playing-card--classic,
.last-take-captured .playing-card.playing-card--classic{
  height:auto!important;aspect-ratio:440/589!important;
  padding:0;border:0;border-radius:0;background:transparent!important;
  box-shadow:none!important;overflow:visible;
}
.playing-card--classic .card-face-r16,
.playing-card--classic.playing-card--r16-back img{
  display:block;width:100%;height:100%;object-fit:contain;border-radius:0;
  filter:drop-shadow(0 4px 5px rgba(0,0,0,.28));
}
.playing-card--classic.is-selected .card-face-r16,
.playing-card--classic.is-bot-selected .card-face-r16,
.playing-card--classic:focus-visible .card-face-r16{
  filter:drop-shadow(0 0 4px #ffdc95) drop-shadow(0 0 8px rgba(247,190,72,.85)) drop-shadow(0 8px 8px rgba(0,0,0,.3));
}
.start-art__card{aspect-ratio:440/589;border-radius:0}
.deck-pile__cards{height:auto;aspect-ratio:440/589}
.deck-picker .mode-option__copy small{font-size:11px}
.start-card .mode-picker{margin-block:12px}
.selection-note{overflow-wrap:anywhere}
.card-grid--table{min-height:0}
@media(min-width:821px){
  .game-shell{--table-card-width:166px}
  .card-grid--table.table-layout--mobile-row{
    grid-template-columns:repeat(5,minmax(0,var(--table-card-width)));gap:8px;justify-items:center;
  }
  .card-grid--table.table-layout--mobile-row.table-layout--four{grid-template-columns:repeat(4,minmax(0,var(--table-card-width)))}
  .card-grid--table.table-layout--mobile-row .playing-card{width:min(100%,var(--table-card-width))}
  .card-grid--hand{
    display:grid;grid-template-columns:repeat(var(--hand-columns),minmax(0,1fr));
    width:min(100%,600px);gap:10px;min-height:0;
  }
  .game-shell[data-deck-size="65"] .card-grid--hand{width:min(100%,720px)}
  .card-grid--hand .playing-card{width:100%;min-width:0}
}
@media(min-width:821px) and (max-height:800px){
  .game-shell{--table-card-width:126px}
  .card-grid--hand{width:min(100%,500px)}
  .game-shell[data-deck-size="65"] .card-grid--hand{width:min(100%,610px)}
  .player-zone--human{padding-block:8px}
}
@media(min-width:821px) and (max-height:740px){
  .game-shell{--table-card-width:116px}
}
@media(min-width:821px) and (max-height:650px){
  .game-shell{--table-card-width:105px;padding-bottom:24px}
  .game-topbar{min-height:58px}
  .player-zone--bot{min-height:66px;padding-block:4px}
  .bot-hand{min-height:40px}
  .bot-hand .playing-card{width:30px}
  .table-zone{min-height:190px}
  .mini-map-panel .claims-map{max-height:174px}
  .card-grid--hand{width:min(100%,400px)}
  .game-shell[data-deck-size="65"] .card-grid--hand{width:min(100%,490px)}
}
@media(max-width:820px){
  .card-grid--hand{
    display:flex;justify-content:center;align-items:center;gap:0;
    width:min(100%,470px);min-height:0;
  }
  .card-grid--hand .playing-card{
    flex:0 0 auto;width:calc((100% + var(--hand-overlap-total)) / var(--hand-columns));
    max-width:112px;min-width:0;margin-left:-12px;
  }
  .card-grid--hand .playing-card:first-child{margin-left:0}
  .card-grid--hand .playing-card.is-selected{z-index:10}
}

/* r1.41: стабильная прокрутка и ширина ряда с учётом выступа последней карты. */
.game-shell{overflow-anchor:none}
.card-grid--hand:empty::before{content:"";display:block;width:100%;aspect-ratio:440/589;visibility:hidden}
.rating-tabs--deck{margin-bottom:8px}
.rating-tabs--score{margin-top:0}
.rating-tabs .is-active{background:var(--gold-soft);box-shadow:inset 0 0 0 1px var(--gold)}
.rating-category-title{font:700 16px/1.3 Georgia,serif;margin:8px 0 12px}
@media(min-width:821px){
  .game-shell{--table-dense-width:160px;--table-dense-step:86px;--table-crowded-width:148px;--table-crowded-step:90px}
  .card-grid--table.table-layout--dense{--row-width:var(--table-dense-width);--row-step:var(--table-dense-step)}
  .card-grid--table.table-layout--crowded{--row-width:var(--table-crowded-width);--row-step:var(--table-crowded-step)}
  .card-grid--table.table-layout--dense,.card-grid--table.table-layout--crowded{
    --row-overhang:calc(var(--row-width) - var(--row-step));
    flex:none;align-self:center;max-width:100%;
    width:calc(76px + 10 * var(--row-step) + var(--row-overhang) + 8px);
    grid-template-columns:repeat(auto-fit,var(--row-step));
    padding-right:calc(8px + var(--row-overhang));column-gap:0;row-gap:10px;
  }
  .card-grid--table.table-layout--dense .playing-card,
  .card-grid--table.table-layout--crowded .playing-card{width:var(--row-width)}
}
@media(min-width:821px) and (max-width:1450px){
  .game-shell{--table-dense-width:134px;--table-dense-step:76px}
}
@media(min-width:821px) and (max-height:800px){
  .game-shell{--table-dense-width:126px;--table-dense-step:74px;--table-crowded-width:116px;--table-crowded-step:72px}
}
@media(min-width:821px) and (max-height:650px){
  .game-shell{--table-dense-width:105px;--table-dense-step:62px;--table-crowded-width:105px;--table-crowded-step:62px}
}
@media(max-width:820px){
  .card-grid--hand:empty::before{flex:0 0 auto;width:calc((100% + var(--hand-overlap-total)) / var(--hand-columns));max-width:112px}
}

/* r1.42: крупное действие, единые переключатели и вертикальный нахлёст стола. */
.game-shell .action-buttons .take-button{min-width:160px}
.rating-tabs .btn{color:#3b3327;background:#f3e4c5;border:1px solid transparent;box-shadow:none;min-height:42px}
.rating-tabs .btn.is-active{color:#3b3327;background:#f4e6b9;border-color:#b19447;box-shadow:none}
.rating-tabs .btn:focus-visible{outline:2px solid #725b2c;outline-offset:2px}
.share-modal__actions [hidden]{display:none!important}
.card-grid--table.table-layout--dense,.card-grid--table.table-layout--crowded{
  --row-height:calc(var(--row-width) * 589 / 440);
  --row-overlap:calc(var(--row-height) * .24);
  grid-auto-rows:calc(var(--row-height) - var(--row-overlap));
  row-gap:0;padding-bottom:var(--row-overlap);align-items:start;isolation:isolate;
}
.card-grid--table.table-layout--dense .playing-card,
.card-grid--table.table-layout--crowded .playing-card{z-index:calc(var(--table-row,1) * 10)}
.card-grid--table.table-layout--dense .playing-card.is-selected,
.card-grid--table.table-layout--crowded .playing-card.is-selected,
.card-grid--table.table-layout--dense .playing-card:focus-visible,
.card-grid--table.table-layout--crowded .playing-card:focus-visible,
.card-grid--table.table-layout--dense .playing-card:hover,
.card-grid--table.table-layout--crowded .playing-card:hover{z-index:calc(var(--table-row,1) * 10 + 8)}
@media(max-width:820px){
  .card-grid--table.table-layout--dense{--row-width:78px}
  .card-grid--table.table-layout--crowded{--row-width:72px}
  .table-zone--multi,.table-zone--crowded{min-height:218px}
}
@media(max-width:520px){
  .game-shell .action-buttons{grid-template-columns:minmax(0,1fr) max-content}
  .game-shell .action-buttons .btn{padding-inline:10px}
  .game-shell .action-buttons .drop-button{padding-inline:5px}
  .game-shell .action-buttons .take-button{min-width:0}
}
@media(max-width:350px){
  .game-shell .action-buttons .drop-button{font-size:12px}
}
