@import url('https://fonts.googleapis.com/css2?family=Russo+One&family=Source+Sans+3:wght@400;600;700;800&display=swap');
:root{--gold:#ffcb45;--purple:#28142f;--paper:#ffe5aa;--line:#f5ca6b62}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;color:#fff7eb;font-family:'Source Sans 3',Arial,sans-serif;background:radial-gradient(ellipse at 50% 30%,#69364d 0,#2b162f 38%,#100a17 100%)}body:before{content:'';position:fixed;inset:0;pointer-events:none;opacity:.16;background-image:radial-gradient(#ffd981 1px,transparent 1px);background-size:31px 31px}.hidden{display:none!important}button,input{font:inherit}button{border:0;cursor:pointer}button:disabled{opacity:.4;cursor:not-allowed}.screen{position:relative;z-index:1;width:min(1780px,100%);margin:auto;padding:18px}.join-screen,.lobby-screen{min-height:100vh;display:grid;place-items:center}.join-card,.lobby-card{width:min(560px,100%);padding:38px;border:1px solid #ffdc8c77;border-radius:25px;text-align:center;background:linear-gradient(145deg,#49254f,#1b1023);box-shadow:0 25px 70px #050308b0}.eyebrow{color:#ffd05c;font-size:12px;font-weight:800;letter-spacing:.17em}h1,h2{margin:0;font-family:'Russo One',Impact,sans-serif}h1{font-size:clamp(42px,8vw,74px);line-height:.9;color:#ffcf4c;text-shadow:4px 4px #972d37}h1 span{display:block;margin-top:13px;color:#f36f42;font-size:.38em;letter-spacing:.3em}.join-copy,.hint{color:#d8c4d8;font-size:17px}.avatar-picker{margin:19px 0;color:#ffe08c;font-size:13px;font-weight:800}.avatar-picker>span{display:block;margin-bottom:8px}.avatar-carousel{display:flex;align-items:center;justify-content:center;gap:20px}.avatar-current{display:grid;place-items:center;width:104px;height:104px;border:2px solid #ffcf52;border-radius:28px;font-size:66px;line-height:1;background:radial-gradient(circle at 35% 25%,#704263,#2b1736 70%);box-shadow:0 0 0 5px #ffce4c17,0 8px 22px #08020d88;transition:transform .22s ease,opacity .16s ease,filter .2s}.avatar-current.swap{transform:scale(.72) rotate(-8deg);opacity:.12;filter:blur(2px)}.avatar-arrow{width:48px;height:62px;border:1px solid #f5ca6b75;border-radius:16px;color:#ffe4a5;font-size:42px;line-height:.7;background:#301a39;transition:transform .15s,background .15s}.avatar-arrow:hover{transform:scale(1.08);background:#613a54}.avatar-name{min-height:20px;margin-top:9px;color:#dfc6d9;font-size:12px;letter-spacing:.06em}.join-card label{display:block;margin:14px 0;color:#ffd879;font-size:13px;font-weight:800;text-align:left}input{display:block;width:100%;margin-top:5px;padding:13px;border:1px solid #a56b9e;border-radius:9px;color:white;background:#1b1022;outline:0}.button-primary{padding:13px 20px;border-radius:9px;color:#321325;font-weight:800;background:linear-gradient(#ffd35d,#f18f29);box-shadow:0 3px #a24324}.join-card .button-primary{width:100%;margin-top:8px}.lobby-card h2{margin:10px;color:#ffda68;font-size:36px}.property-choice{margin:22px 0;padding:14px;border:1px solid var(--line);border-radius:13px;background:#150d1bbb}.choice-title{margin-bottom:10px;color:#ffe6b2;font-weight:800}.property-options{display:grid;grid-template-columns:1fr 1fr;gap:9px}.property-option{min-height:105px;padding:11px;border:1px solid #ffffff2c;border-radius:10px;color:#e8dce7;text-align:left;background:#38203e}.property-option.selected{border-color:var(--gold);background:#5a3543;box-shadow:0 0 13px #ffc83d44}.property-option b{display:block;margin-bottom:5px;color:#ffdc71}.property-option small{font-size:11px;line-height:1.1}.lobby-players{padding:0;list-style:none;text-align:left}.lobby-players li{padding:8px 12px;border-bottom:1px solid #ffffff12}.lobby-players .ready{color:#aee875}.game-screen{overflow:visible}.game-header{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;min-height:55px}.brand{font-family:'Russo One';font-size:27px}.brand span{color:var(--gold)}.brand small{color:#f16a49;font-size:10px}.turn-banner{padding:8px 16px;border:1px solid #ffd26e8c;border-radius:99px;color:#ffe7ae;font-size:13px;font-weight:800;background:#160c1abf}.room-pill{justify-self:end;color:#bfaec0;font-size:12px}.room-pill b{color:#ffda71}.board-shell{position:relative;display:grid;grid-template-columns:185px minmax(420px,1fr) 86px;gap:13px;min-height:calc(100vh - 275px);padding:13px;border:1px solid var(--line);border-radius:22px;background:radial-gradient(ellipse at center,#4c2d4c 0,#2a1834 52%,#1b1026 100%);box-shadow:inset 0 0 70px #06020a99,0 15px 40px #09030d77}.supply-rail{display:flex;flex-direction:column;gap:11px;padding-right:10px;border-right:1px solid #fbdc8433}.supply-stack{position:relative;width:98px;padding:0;border-radius:8px;color:#ffe5aa;text-align:left;background:#120b17}.supply-stack img{display:block;width:96px;height:135px;object-fit:cover;border:2px solid #c79b4c;border-radius:7px;box-shadow:5px 5px #0f0716}.supply-stack span{display:block;margin-top:5px;font-size:12px;font-weight:800}.supply-stack b{color:#ffcb43}.legend-stack img{filter:hue-rotate(310deg) saturate(1.25)}.token-stack{display:flex;align-items:center;gap:7px;color:#e6c8dd;font-size:12px}.token-stack img{width:55px;height:62px;object-fit:contain}.token-stack b{color:#ffcf4a}.log-toggle{margin-top:auto;padding:7px;border:1px solid #f5ca6b55;border-radius:7px;color:#f9d983;font-size:11px;background:#1a0d22}.event-feed{position:absolute;z-index:40;bottom:10px;left:180px;width:280px;padding:12px;border:1px solid #f6d06e88;border-radius:11px;background:#201129fa;box-shadow:0 10px 30px #000;transform:scale(.9);transform-origin:bottom left;opacity:0;pointer-events:none;transition:.15s}.event-feed.open{transform:none;opacity:1;pointer-events:auto}.panel-heading{color:#ffdb86;font-size:11px;font-weight:800;letter-spacing:.12em}#log-panel{height:200px;overflow:auto;margin-top:8px;color:#cbb9ce;font-size:12px;line-height:1.25}#log-panel div{padding:5px 0;border-bottom:1px solid #ffffff0d}.table-stage{position:relative;display:flex;min-width:0;justify-content:center;align-items:center;overflow:visible}.table-stage:before{content:'';position:absolute;width:min(64vw,770px);height:min(34vw,350px);border:1px solid #ffc54c5c;border-radius:50%;background:radial-gradient(ellipse,#ffb9470c,transparent 64%);box-shadow:0 0 60px #ffb34215}.players-orbit{position:absolute;z-index:3;inset:24px 4% auto;display:flex;justify-content:center;flex-wrap:wrap;gap:10px}.opp-card{position:relative;width:166px;min-height:98px;padding:10px;border:1px solid #ffffff24;border-radius:12px;background:linear-gradient(130deg,#3b2545,#24152d);box-shadow:0 5px 14px #08040d77}.opp-card.active-turn{border-color:var(--gold);box-shadow:0 0 18px #ffc14350}.turn-arrow{position:absolute;top:-27px;left:50%;transform:translateX(-50%);color:#ffcf45;font-size:19px;text-shadow:0 2px #321324}.opp-card .avatar{font-size:18px;margin-right:4px}.opp-card .name{min-height:33px;color:#ffe5a2;font-weight:800;line-height:1.04}.opp-card .stat{display:inline-block;margin:3px 6px 0 0;color:#d0bed2;font-size:11px}.played-cards{position:relative;z-index:25;display:flex;align-items:center;justify-content:center;gap:10px;min-height:240px;pointer-events:none}.played-cards .card{pointer-events:auto;flex-basis:155px;width:155px}.played-cards .card:hover{transform:translateY(-14px) scale(1.1)}.prize-pedestal{position:absolute;z-index:2;bottom:70px;display:grid;place-items:center;opacity:.9}.prize-pedestal img{width:135px;max-height:230px;object-fit:contain;filter:drop-shadow(0 8px 15px #000)}.prize-pedestal span{margin-top:-25px;color:#ffde78;font-size:10px;font-weight:800;letter-spacing:.1em}.stage-caption{position:absolute;bottom:15px;color:#bfaec2;font-size:11px;text-align:center}.market-rail{position:relative;z-index:8;display:flex;flex-direction:column;gap:9px;align-items:flex-end;padding-top:12px}.market-drawer{position:relative;width:72px;min-height:190px}.drawer-tab{position:absolute;z-index:3;inset:0 0 auto auto;width:62px;min-height:184px;padding:8px 5px;border:1px solid #ffce5d8c;border-radius:10px;color:#ffe9b7;background:linear-gradient(#5e384a,#2a1738);box-shadow:3px 4px #100817}.legend-drawer .drawer-tab{border-color:#ff6c897b;background:linear-gradient(#6a2944,#2b1430)}.drawer-tab span{display:block;writing-mode:vertical-rl;letter-spacing:.12em;font-size:11px;font-weight:800}.drawer-tab b{position:absolute;bottom:7px;left:25px;font-size:19px}.drawer-content{position:absolute;z-index:2;right:28px;top:0;width:min(700px,calc(100vw - 300px));padding:13px;overflow:visible;opacity:0;pointer-events:none;transform:translateX(30px);transition:.2s;background:#201129f7;border:1px solid #ffd05c7a;border-radius:13px;box-shadow:-10px 10px 30px #050207aa}.market-drawer:hover .drawer-content,.market-drawer:focus-within .drawer-content,.market-drawer.open .drawer-content{opacity:1;pointer-events:auto;transform:none}.drawer-heading{margin-bottom:8px;color:#ffe298;font-family:'Russo One';font-size:16px}.drawer-cards{display:flex;align-items:flex-start;gap:8px;min-height:180px;padding:22px 3px 12px;overflow:visible}.special-actions{margin-top:auto;display:grid;gap:7px}.small-action{width:78px;padding:7px 5px;border:1px solid #ffcc5660;border-radius:8px;color:#ffecbe;font-size:10px;font-weight:700;background:#160c1bd9}.small-action b{color:var(--gold)}.wild-action{padding:0;overflow:hidden}.wild-action img{display:block;width:76px;height:107px;object-fit:cover}.wild-action span{display:block;padding:4px}.card{position:relative;z-index:10;flex:0 0 108px;width:108px;overflow:visible;cursor:pointer;border-radius:8px;background:#412449;box-shadow:0 5px 12px #050208aa;transition:transform .18s,filter .18s}.card:hover{z-index:50;transform:translateY(-14px) scale(1.16);filter:drop-shadow(0 12px 16px #000)}.cart-img{display:block;width:100%;aspect-ratio:708/1000;object-fit:cover;border-radius:8px;border:1px solid #e5c78055}.card-info{min-height:150px;padding:8px;border-radius:8px;background:#44284e}.card.has-image .card-info{display:none}.cname{color:#ffe4a7;font-weight:800;font-size:12px}.ctext{margin:6px 0;color:#e1d4e2;font-size:10px;line-height:1.1}.cfooter{display:flex;justify-content:space-between;margin-top:auto}.cost{color:#86d9ff}.power{color:#b7eb87}.self-dock{position:relative;z-index:20;margin-top:13px;padding:13px 17px 12px;border:1px solid #f2c9686b;border-radius:21px;background:linear-gradient(160deg,#53324c,#26162f);box-shadow:0 -8px 25px #08030d77;overflow:visible}.self-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px}.self-name{color:#ffe9ad;font-family:'Russo One';font-size:19px}.self-meta{color:#d8c7da;font-size:13px}.self-meta b{color:#ffd04b}.end-turn span{font-size:18px}.hand-label{margin:9px 0 5px;color:#e2c9db;font-size:11px;font-weight:800;letter-spacing:.15em}.hand-row{display:flex;align-items:flex-end;gap:7px;min-height:170px;overflow:visible}.hand-row .card{flex-basis:113px;width:113px}.hand-row .card:hover{transform:translateY(-40px) scale(1.14)}.modal{position:fixed;z-index:100;inset:0;display:grid;place-items:center;padding:20px;background:#07030bbd}.modal-card{position:relative;width:min(560px,100%);padding:27px;border:1px solid #ffd267a3;border-radius:18px;background:linear-gradient(145deg,#4d2b51,#1d1026);box-shadow:0 20px 70px #000}.modal-card h2{margin-top:8px;color:#ffe1a1;font-size:25px}.modal-card p{color:#cdbace}.modal-close{position:absolute;right:11px;top:7px;color:#f6d5a5;font-size:28px;background:transparent}.target-list{display:grid;grid-template-columns:repeat(2,1fr);gap:9px}.target-button{padding:13px;border:1px solid #ffffff2e;border-radius:11px;color:#ffe8c0;text-align:left;background:#321a39}.target-button:hover{border-color:#ffcf4a;background:#603449}.target-button small{display:block;margin-top:4px;color:#d1bdd4}@media(max-width:850px){.game-header{grid-template-columns:1fr auto}.turn-banner{display:none}.board-shell{grid-template-columns:88px 1fr 68px;min-height:590px}.supply-rail{padding-right:3px}.supply-stack{width:64px}.supply-stack img{width:62px;height:88px}.supply-stack span{font-size:9px}.players-orbit{inset:10px 2%;gap:5px}.opp-card{width:135px;min-height:85px;padding:7px}.prize-pedestal img{width:94px}.drawer-content{width:calc(100vw - 180px)}.self-dock{padding:11px}.hand-row{overflow-x:auto}.property-options{grid-template-columns:1fr}}@media(max-width:520px){.screen{padding:10px}.join-card,.lobby-card{padding:27px 18px}.brand{font-size:20px}.board-shell{grid-template-columns:55px 1fr 53px;padding:7px;gap:4px;min-height:515px}.supply-stack{width:46px}.supply-stack img{width:44px;height:63px}.supply-stack span{font-size:7px}.token-stack img{width:38px;height:42px}.token-stack span{display:none}.opp-card{width:108px;font-size:11px}.opp-card .stat{font-size:9px}.drawer-tab{width:48px;min-height:140px}.drawer-tab b{left:19px}.market-drawer{width:50px;min-height:145px}.drawer-content{right:19px;width:calc(100vw - 125px)}.special-actions{display:none}.self-toolbar{align-items:flex-start;flex-direction:column}.end-turn{width:100%}.hand-row .card{flex-basis:95px;width:95px}.target-list{grid-template-columns:1fr}.room-pill{font-size:9px}}
/* Не выделяем элементы игрового стола случайным ЛКМ; текст в полях ввода остаётся редактируемым. */
body, button, .card, .opp-card, .supply-stack { user-select:none; -webkit-user-select:none; }
input { user-select:text; -webkit-user-select:text; }
/* Спокойная левая панель: стопки остаются счётчиками, а не вторым рядом крупных карт. */
.supply-stack img { width:54px; height:76px; border-width:1px; box-shadow:2px 2px #0f0716; }
.supply-stack { width:104px; display:flex; align-items:center; gap:7px; }
.supply-stack span { margin:0; }
.prize-mini { display:flex; align-items:center; gap:5px; margin-top:2px; color:#f7d781; font-size:11px; font-weight:800; }
.prize-mini img { width:49px; height:70px; object-fit:contain; filter:drop-shadow(0 4px 6px #000); }
.played-cards { min-height:190px; gap:8px; }
.played-cards .card { flex-basis:118px; width:118px; }
@media (max-width:1200px) { .played-cards .card { flex-basis:104px; width:104px; } }
/* Единая левая полка: счётчики не висят текстом поверх фона. */
.supply-rail { position:relative; }
.supply-stack, .token-stack, .prize-mini { width:120px; min-height:54px; padding:4px 6px; border:1px solid #ffffff12; border-radius:7px; background:linear-gradient(110deg,#180b20,#0d0714); box-shadow:4px 4px 0 #09040f; }
.supply-stack { display:flex; align-items:center; gap:7px; }
.supply-stack span, .token-stack span, .prize-mini span { margin:0; color:#ffe3a0; font-size:10px; font-weight:800; line-height:1.05; overflow-wrap:anywhere; }
.token-stack, .prize-mini { display:flex; align-items:center; gap:6px; }
.token-stack img { flex:0 0 auto; }.prize-mini img { flex:0 0 auto; }
.event-feed { left:0; bottom:42px; transform:translateY(8px) scale(.96); transform-origin:bottom left; }
.event-feed.open { transform:translateY(0) scale(1); }
.header-tools{justify-self:end;display:flex;align-items:center;gap:9px}.sound-toggle{width:29px;height:29px;border:1px solid #f5ca6b62;border-radius:50%;background:#1c0e23;color:#ffe3a0;font-size:14px}.room-pill{justify-self:auto}
/* Центральная выкладка — пять карт в ряд, затем новая строка. */
.played-cards { display:grid; grid-template-columns:repeat(5, minmax(0,118px)); grid-auto-rows:auto; justify-content:center; align-content:center; gap:10px; max-width:650px; }
/* Рынок — приоритетнее выкладки карт: раскрытая панель всегда сверху. */
.market-rail { z-index:90; width:112px; }
.market-drawer { width:108px; min-height:88px; }
.drawer-tab { width:108px; min-height:82px; display:flex; align-items:center; justify-content:space-between; padding:12px; border-radius:12px; }
.drawer-tab span { display:block; writing-mode:horizontal-tb; letter-spacing:.08em; font-size:11px; }
.drawer-tab b { position:static; font-size:23px; }
.drawer-content { z-index:110; right:50px; }
.board-shell { grid-template-columns:185px minmax(420px,1fr) 112px; }
/* Колоды слева: крупная цифра читается сразу, не смешиваясь с названием. */
.supply-stack { width:150px; min-height:84px; }
.supply-stack span { font-size:12px; line-height:1.05; }
.supply-stack span b { display:block; margin-top:5px; color:#ffd24a; font-size:21px; line-height:.8; }
.attack-actions{display:flex;flex-wrap:wrap;gap:7px;min-height:0;margin:4px 0 9px}.deferred-attack{padding:7px 10px;border:1px solid #ffcb4d8a;border-radius:8px;color:#ffe8ad;background:#3f1d31;font-size:12px;box-shadow:0 3px 8px #0006}.deferred-attack:hover:not(:disabled){background:#68344c}
/* Статистика должна читаться с первого взгляда, особенно доступная мощь. */
.opp-card .stat-power{padding:3px 6px;border-radius:6px;color:#27151c!important;font-size:13px!important;font-weight:900;background:#ffd14c}
.self-meta{display:flex;flex-wrap:wrap;gap:7px;margin-top:7px}.stat-chip{padding:5px 8px;border:1px solid #ffffff20;border-radius:7px;color:#eadcec;font-size:13px;font-weight:700;background:#21142b}.stat-chip.power{color:#23140d;font-size:16px;background:#ffd14c;box-shadow:0 2px 6px #0006}.stat-chip.health{color:#ffe3e5;background:#6d3145}
.host-settings{margin:18px 0;padding:13px;border:1px solid #ffcf6361;border-radius:12px;text-align:left;background:#1b0e23}.host-settings label{display:block;color:#f9dfa1;font-size:12px;font-weight:800}.host-settings select,.host-settings input{width:100%;margin:6px 0 9px;padding:8px;border:1px solid #c088bb;border-radius:7px;color:#fff;background:#291631}.host-settings .small-action{width:auto;padding:8px 12px}
.familiar-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:250px;overflow:auto;padding:2px}.familiar-option{min-height:82px;padding:9px;border:1px solid #ffffff2a;border-radius:9px;color:#e9dce9;text-align:left;background:#34203e}.familiar-option.selected{border-color:#ffd04e;background:#5a3546;box-shadow:0 0 11px #ffc83d44}.familiar-option b,.familiar-option span,.familiar-option small{display:block}.familiar-option b{color:#ffdd82;font-size:12px;line-height:1.05}.familiar-option span{margin:3px 0;color:#93d6ff;font-size:11px;font-weight:700}.familiar-option small{font-size:10px;line-height:1.08}.familiar-mini{margin-top:5px;color:#9edcff;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Колдуны всегда выше разыгранных карт: карты не могут перекрывать интерфейс игрока. */
.players-orbit{z-index:60}.opp-card{z-index:61}.played-cards{z-index:25}
.vyal-stack{display:flex;align-items:center;gap:6px;width:150px;min-height:76px;padding:4px 6px;border:1px solid #ffffff12;border-radius:7px;color:#d9f3b5;background:linear-gradient(110deg,#16301d,#0d1b12);box-shadow:4px 4px 0 #090f0a}.vyal-stack img{width:43px;height:61px;object-fit:cover;border-radius:4px}.vyal-stack span{color:#d8f3a7;font-size:10px;font-weight:800;line-height:1.05}.vyal-stack b{display:block;margin-top:4px;color:#caff49;font-size:20px}
.zone-label{margin:10px 0 4px;color:#e3c8dc;font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.permanent-row{display:flex;gap:6px;min-height:0;overflow-x:auto}.permanent-row .card{flex-basis:72px;width:72px}.permanent-row .card:hover{transform:translateY(-12px) scale(1.12)}.event-card{text-align:center;border-color:#ffcf4d;box-shadow:0 0 40px #ff9f314d,0 20px 70px #000}.event-card h2{margin:10px 0;color:#ffdd73;font-size:30px}.event-card p{min-height:58px;color:#fff0c7;font-size:16px;line-height:1.35}.event-card .button-primary{margin-top:8px}
.decision-card{width:min(820px,96vw)}.reveal-row{display:flex;justify-content:center;gap:10px;max-height:270px;margin:12px 0;overflow-x:auto;padding:8px}.reveal-row .card{flex:0 0 126px;width:126px;cursor:default}.reveal-row .card:hover{transform:none;filter:none}
.permanent-row .card.is-actionable:after{content:'АКТИВИРОВАТЬ';position:absolute;left:3px;right:3px;bottom:3px;padding:3px;border-radius:4px;color:#2a1605;font-size:8px;font-weight:900;text-align:center;background:#ffd24d}.permanent-row .card.is-actionable{outline:1px solid #ffd24d;cursor:pointer}
/* Рассадка вокруг стола: игрок 0 — владелец нижней руки, остальные по кругу. */
.table-stage{overflow:visible;background:radial-gradient(ellipse at 50% 48%,#59334d 0%,#37203f 55%,#21142c 100%)}
.table-stage:before{inset:4% 5%;width:auto;height:auto;border:0;border-radius:28px;background:repeating-linear-gradient(135deg,rgba(255,221,141,.025) 0 1px,transparent 1px 6px),repeating-linear-gradient(45deg,rgba(0,0,0,.08) 0 1px,transparent 1px 10px);box-shadow:inset 0 0 70px #100716aa}
.players-orbit{position:absolute;z-index:60;inset:0;display:block;pointer-events:none}.player-seat{position:absolute;z-index:61;pointer-events:auto;width:166px;transform:translate(-50%,-50%)}
/* Я — у нижней кромки, возле собственной руки. */
.seat-0{left:50%;top:auto;bottom:14px;transform:translateX(-50%)}
/* При 2 игроках противник напротив. */
.seat-1{left:50%;top:15%;}
/* При 3–5 игроках последующие места естественно расходятся вокруг стола. */
.seat-2{left:27%;top:24%}.seat-3{left:73%;top:24%}.seat-4{left:13%;top:53%}.seat-5{left:87%;top:53%}
.played-cards{margin-top:20px;align-self:center;z-index:25}
@media(max-width:850px){.player-seat{width:132px}.seat-0{bottom:8px}.seat-1{top:12%}.seat-2{left:24%;top:24%}.seat-3{left:76%;top:24%}.seat-4{left:10%;top:50%}.seat-5{left:90%;top:50%}}
/* Настоящий цвет сукна: нефритовый бархат вместо полупрозрачной фиолетовой подложки. */
.table-stage{background:radial-gradient(ellipse at 48% 44%,#315d52 0%,#173b35 48%,#0d2523 100%)}
.table-stage:before{background:repeating-linear-gradient(135deg,rgba(226,255,211,.045) 0 1px,transparent 1px 6px),repeating-linear-gradient(45deg,rgba(0,0,0,.12) 0 1px,transparent 1px 10px);box-shadow:inset 0 0 90px #061512cc}
.activity-toast{position:absolute;z-index:80;left:50%;top:12px;transform:translateX(-50%);max-width:420px;padding:9px 15px;border:1px solid #ffd66d;border-radius:999px;color:#fff0c0;background:#1b402fef;box-shadow:0 5px 18px #0008;font-size:13px;text-align:center}.activity-toast span{color:#ffd35a;font-weight:800}
.flying-card{position:fixed;z-index:500;display:grid;place-items:center;padding:6px;pointer-events:none;overflow:hidden;border:2px solid #ffd455;border-radius:8px;color:#1d1123;font-size:10px;font-weight:900;text-align:center;background:linear-gradient(135deg,#ffe78a,#ee9b36);box-shadow:0 12px 26px #0009;transition:left .78s cubic-bezier(.2,.8,.2,1),top .78s cubic-bezier(.2,.8,.2,1),width .78s ease,height .78s ease,opacity .78s ease,transform .78s ease;transform-origin:center}.flip-card{background:linear-gradient(135deg,#5b2c55,#20132a);color:#ffe2a1}.turn-overlay{position:fixed;z-index:400;left:50%;top:42%;transform:translate(-50%,-50%);padding:20px 28px;border:2px solid #ffd35a;border-radius:14px;color:#fff0ae;font-family:'Russo One',Impact,sans-serif;font-size:clamp(22px,4vw,44px);text-align:center;background:#1a3c31ed;box-shadow:0 0 45px #ffd03955;text-shadow:2px 2px #1b1820;animation:turnPop 1.3s ease both}@keyframes turnPop{0%{opacity:0;transform:translate(-50%,-40%) scale(.7)}18%{opacity:1;transform:translate(-50%,-50%) scale(1.04)}75%{opacity:1}100%{opacity:0;transform:translate(-50%,-60%) scale(.96)}}
/* FLIP overlay: это реальный клон карты, не текстовая заглушка. */
.flying-card.card{position:fixed;z-index:500;display:block;padding:0;pointer-events:none;overflow:hidden;border-radius:8px;background:#301d3b;box-shadow:0 18px 32px #000c;transform-style:preserve-3d;will-change:transform,opacity;transition:transform .88s cubic-bezier(.18,.78,.18,1),opacity .88s ease}.flying-card.card .cart-img{width:100%;height:100%;aspect-ratio:auto;object-fit:cover}.flying-card.card .card-info{display:none}.flying-card.card .cname{display:none}
/* Лошара должен быть заметен с первого взгляда. */
.loshara-player{border:2px solid #ff4d70!important;background:linear-gradient(135deg,#6a2038,#341128)!important;box-shadow:0 0 22px #ff315a8c!important}.loshara-player:before{content:'ЛОШАРА';position:absolute;right:7px;top:7px;padding:2px 5px;border-radius:4px;color:#fff;font-size:8px;font-weight:900;letter-spacing:.08em;background:#ef315b}.self-loshara{border-color:#ff4d70!important;background:linear-gradient(135deg,#68243d,#321127)!important;box-shadow:0 0 20px #ef31594d!important}.self-loshara .self-name{color:#ff9bad}.self-loshara .self-name:after{content:' ⚠';color:#ff4569}
/* Целевая карта проявляется только после прилёта overlay-клона, иначе это выглядит как телепорт. */
.motion-target-hidden{opacity:0!important;transition:opacity .12s ease}.motion-target-hidden.card{pointer-events:none}
/* Карты на столе больше не участвуют в высоте документа: страница не прыгает при ходе. */
.table-stage{min-height:590px;position:relative}.played-cards{position:absolute;z-index:25;left:50%;top:50%;width:min(650px,82%);min-height:0;margin:0;transform:translate(-50%,-50%);pointer-events:auto}.played-cards:empty{display:none}@media(max-width:850px){.table-stage{min-height:500px}.played-cards{width:76%;top:48%}}
.activity-toast{transition:opacity .32s ease,transform .32s ease}.activity-toast.hidden{display:block!important;opacity:0;transform:translate(-50%,-10px);pointer-events:none}
/* Планшет игрока: ресурсы и HP читаются отдельно, без мелкой каши. */
.opp-card{min-height:174px;padding:10px 11px}.player-head{display:flex;align-items:center;gap:7px}.player-head .avatar{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;font-size:20px;background:#4a2c52}.player-title{min-width:0;flex:1}.player-title .name{min-height:0;color:#fff0bc;font-size:14px;font-weight:900;line-height:1.08}.player-tags{min-height:12px;margin-top:2px;color:#ffd253;font-size:8px;font-weight:800}.player-health{display:flex;align-items:baseline;gap:4px;margin:8px 0 6px;padding:5px 7px;border-radius:7px;color:#ffe6e8;background:#6c3044}.player-health span{font-size:15px}.player-health b{font-size:21px;line-height:1}.player-health small{color:#ffd5da;font-size:10px;font-weight:800}.player-resources{display:grid;grid-template-columns:1fr 1fr;gap:5px}.resource{display:flex;flex-direction:column;padding:5px 6px;border-radius:6px;background:#24152f}.resource b{font-size:13px;line-height:1}.resource span{margin-top:3px;color:#d7c9d8;font-size:8px;font-weight:800;text-transform:uppercase}.power-resource{color:#2c1800;background:#ffd24a}.power-resource span{color:#6d4512}.chips-resource{color:#9ee6ff;background:#1d4250}.chips-resource span{color:#b9eafb}.player-piles{display:flex;justify-content:space-between;margin-top:7px;color:#d6c9da;font-size:10px;font-weight:800}.player-piles span{padding:2px 3px;border-radius:3px;background:#ffffff0c}.chips-bank{display:flex;align-items:center;gap:6px;width:150px;min-height:76px;padding:4px 6px;border:1px solid #ffffff12;border-radius:7px;color:#9ee6ff;background:linear-gradient(110deg,#123744,#0c2029);box-shadow:4px 4px 0 #070d12}.chips-bank img{width:48px;height:58px;object-fit:contain}.chips-bank span{font-size:10px;font-weight:800;line-height:1.05}.chips-bank b{display:block;margin-top:4px;color:#83ddff;font-size:20px}
/* Компактный планшет: всё важное на одном уровне, подробности только по hover/тапу. */
.opp-card{min-height:82px!important;padding:7px 8px!important;overflow:visible}.player-core{display:grid;grid-template-columns:31px minmax(0,1fr) 34px;align-items:center;gap:6px}.player-core>.avatar{display:grid;place-items:center;width:31px;height:31px;border-radius:8px;font-size:20px;background:#4a2c52}.player-center{min-width:0}.player-center .name{overflow:hidden;color:#fff0bc;font-size:12px;font-weight:900;line-height:1.05;text-overflow:ellipsis;white-space:nowrap}.core-stats{display:flex;gap:3px;margin-top:5px;white-space:nowrap}.core-stats b{padding:3px 4px;border-radius:4px;font-size:9px;background:#251630}.core-hp{color:#ffe2e6;background:#7a344a!important}.core-power{color:#311a00;background:#ffd24a!important}.core-chips{color:#a8eaff;background:#1d4a59!important}.core-zhdk{color:#ddd3de}.familiar-thumb{display:grid;place-items:center;width:34px;height:48px;overflow:hidden;border:1px solid #9bd9ed;border-radius:5px;color:#9bd9ed;background:#183140}.familiar-thumb img{width:100%;height:100%;object-fit:cover}.player-details{position:absolute;z-index:75;left:0;right:0;top:calc(100% + 4px);display:none;padding:8px;border:1px solid #ffd45d;border-radius:7px;color:#eaddea;font-size:10px;line-height:1.35;background:#24142df5;box-shadow:0 8px 18px #0009}.opp-card:hover .player-details,.opp-card:focus-within .player-details{display:block}.player-details .property-mini{display:block;width:100%;margin-top:5px;padding:4px;color:#ffe5a0;font-size:9px;text-align:left;background:#3a2144}.buy-familiar-btn{display:flex!important;align-items:center;gap:4px}.buy-fam-thumb{width:28px;height:38px;object-fit:cover;border-radius:4px}.buy-familiar-btn span{font-size:9px;line-height:1.05}
.card-zoom{position:absolute;z-index:5;right:4px;top:4px;display:grid;place-items:center;width:22px;height:22px;padding:0;border:1px solid #ffe079;border-radius:50%;color:#2c1730;font-size:17px;font-weight:900;line-height:1;background:#ffe079;box-shadow:0 2px 6px #0009;opacity:0;transition:opacity .16s}.card:hover .card-zoom,.card:focus-within .card-zoom{opacity:1}.card-inspector{display:grid;grid-template-columns:minmax(180px,300px) minmax(220px,1fr);gap:20px;width:min(760px,94vw);text-align:left}.inspect-visual{display:grid;place-items:center;min-height:300px}.inspect-card{width:100%!important;max-width:280px!important;cursor:default!important}.inspect-card:hover{transform:none!important;filter:none!important}.inspect-card .card-zoom{display:none}.inspect-copy h2{margin:8px 0;color:#ffe5a1;font-size:26px}.inspect-copy p{color:#eee0ee;font-size:15px;line-height:1.4}.inspect-stats{display:flex;gap:7px;margin:10px 0}.inspect-stats b{padding:6px 8px;border-radius:6px;color:#2b1720;background:#ffe178;font-size:13px}.inspect-stats b:nth-child(2){background:#b8ef87}.inspect-stats b:nth-child(3){background:#93dcff}@media(max-width:600px){.card-inspector{grid-template-columns:1fr;gap:8px}.inspect-visual{min-height:180px}.inspect-card{max-width:180px!important}.card-zoom{opacity:1;width:20px;height:20px;font-size:15px}}
/* Финальная иерархия планшета: подробности не имеют права жить в основной карточке. */
.opp-card{min-height:78px!important}.player-core{grid-template-columns:34px minmax(0,1fr) 46px!important}.player-core>.avatar{width:34px!important;height:34px!important;margin-left:-1px}.player-center .name{font-size:13px!important}.core-stats b{font-size:10px!important}.familiar-thumb{width:46px!important;height:62px!important;cursor:pointer;transition:transform .16s,box-shadow .16s}.familiar-thumb:hover{transform:scale(1.16);box-shadow:0 5px 14px #000b}.player-details{display:none!important}.property-mini{border:1px solid #b68bd0!important;border-radius:5px!important;color:#f4ddff!important;background:#3c2349!important;font-size:9px!important}.player-details .property-mini{display:block!important}@media(hover:hover){.opp-card:hover .player-details{display:block!important}}@media(hover:none){.opp-card:active .player-details{display:block!important}}
/* Планшет строго из трёх зон: аватар / основная информация / фамильяр. */
.opp-card{width:250px!important;min-height:92px!important;padding:6px!important;overflow:visible}.player-core{display:grid!important;grid-template-columns:54px minmax(0,1fr) 62px!important;align-items:stretch;gap:7px}.avatar-box{display:grid;place-items:center;width:54px;min-height:72px;border:2px solid #1b0e20;border-radius:12px;font-size:32px;background:#17101b;box-shadow:inset 0 0 0 1px #ffffff18}.player-main{display:flex;min-width:0;flex-direction:column;justify-content:center;padding:4px 2px}.player-name{overflow:visible!important;color:#fff0bd;font-size:15px!important;font-weight:900;line-height:1.15;text-align:center;white-space:normal!important;word-break:break-word}.main-stats{display:flex;justify-content:center;gap:4px;margin-top:7px;white-space:nowrap}.main-stats span{padding:4px 5px;border-radius:5px;font-size:10px;font-weight:800;background:#2a1833}.main-hp{color:#ffe7eb;background:#73344a!important}.main-chips{color:#b8efff;background:#1c4a58!important}.main-zhdk{color:#f1e4f1;background:#34233d!important}.familiar-card{display:grid;place-items:center;width:62px;min-height:78px;padding:0;overflow:hidden;border:2px solid #9ed7e7;border-radius:8px;color:#9ed7e7;font-size:28px;background:#193341;cursor:pointer;box-shadow:0 4px 9px #0008}.familiar-card img{width:100%;height:100%;object-fit:cover}.seat-power{position:absolute;z-index:70;left:50%;top:-34px;transform:translateX(-50%);padding:6px 10px;border:2px solid #ffd24d;border-radius:8px;color:#2c1905;font-size:13px;font-weight:900;white-space:nowrap;background:#ffd24d;box-shadow:0 4px 10px #0008}.loshara-label{margin-top:4px;color:#ff9eae;font-size:8px;font-weight:900;text-align:center}.stage-caption{display:none!important}.opp-card .avatar,.opp-card .player-head,.opp-card .player-center,.opp-card .player-resources,.opp-card .player-health,.opp-card .player-piles{display:none!important}
@media(max-width:850px){.opp-card{width:210px!important}.player-core{grid-template-columns:45px minmax(0,1fr) 52px!important}.avatar-box{width:45px;min-height:64px;font-size:27px}.familiar-card{width:52px;min-height:64px}.player-name{font-size:12px!important}.main-stats{gap:2px}.main-stats span{padding:3px;font-size:8px}}
/* Три ФИЗИЧЕСКИ РАЗДЕЛЬНЫХ блока вокруг игрока: никакой общей рамки. */
.opp-card{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;overflow:visible!important;min-height:78px!important}.player-core{grid-template-columns:58px minmax(132px,1fr) 68px!important;gap:12px!important}.avatar-box{width:58px!important;min-height:78px!important;border:0!important;border-radius:15px!important;background:#08090b!important;box-shadow:0 5px 12px #000a!important}.familiar-card{width:68px!important;min-height:84px!important;border:0!important;border-radius:12px!important;background:#08090b!important;box-shadow:0 5px 12px #000a!important}.player-main{min-height:78px;padding:7px 10px!important;border:2px solid #1b0e20;border-radius:16px!important;background:linear-gradient(135deg,#753680,#42204c)!important;box-shadow:0 5px 12px #0009!important}.active-turn .player-main{border-color:#ffd24d!important;box-shadow:0 0 16px #ffd24d75,0 5px 12px #0009!important}.seat-power{top:-39px!important;border:0!important;border-radius:14px!important;color:#fff3e4!important;background:#08090b!important;box-shadow:0 5px 12px #000b!important}.loshara-player .player-main{border-color:#ff4d70!important;background:linear-gradient(135deg,#7c2945,#421126)!important}.loshara-player:before{display:none!important}.player-details{left:70px!important;right:80px!important}.player-name{font-size:14px!important}.main-stats{margin-top:8px!important;gap:6px!important}.main-stats span{background:transparent!important;padding:0!important;font-size:10px!important}.main-hp{color:#ffe6e9!important}.main-chips{color:#b9efff!important}.main-zhdk{color:#f5e6f5!important}
/* Никакой нижней hover-плашки у игрока: только три главные цифры. */
.player-details{display:none!important}.opp-card{width:274px!important}.player-core{grid-template-columns:56px minmax(150px,1fr) 68px!important;gap:11px!important}.player-main{min-height:84px;padding:7px 8px!important}.player-name{min-height:27px;display:flex;align-items:center;justify-content:center;overflow:visible!important;font-size:13px!important;line-height:1.05;text-align:center;white-space:normal!important;word-break:break-word}.main-stats{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px!important;margin-top:5px!important}.main-stats span{display:flex;min-width:0;flex-direction:column;align-items:center;justify-content:center;padding:4px 2px!important;border-radius:6px!important}.main-stats i{font-style:normal;font-size:13px;line-height:1}.main-stats b{font-size:13px;line-height:1.1}.main-stats small{margin-top:2px;font-size:7px;font-weight:900;letter-spacing:.04em}.main-hp{background:#78354a!important;color:#ffecef!important}.main-chips{background:#1c4b5a!important;color:#bdf2ff!important}.main-zhdk{background:#32233b!important;color:#f5eafa!important}.player-prize{position:absolute;z-index:75;right:-22px;bottom:-14px;width:44px;height:68px;object-fit:contain;filter:drop-shadow(0 4px 6px #000)}
@media(max-width:850px){.opp-card{width:232px!important}.player-core{grid-template-columns:48px minmax(128px,1fr) 56px!important;gap:7px!important}.avatar-box{width:48px!important;min-height:70px!important}.familiar-card{width:56px!important;min-height:72px!important}.main-stats b{font-size:11px}.main-stats small{font-size:6px}}
/* Ресурсы игрока: только чипсины и ЖДК, HP — отдельная читаемая шкала. */
.main-resources{display:flex;justify-content:center;gap:10px;margin-top:4px}.main-resources span{display:flex;align-items:center;gap:3px;color:#fff;font-size:12px;font-weight:900}.main-resources img{width:18px;height:18px;object-fit:contain}.hp-bar{position:relative;height:18px;margin-top:5px;overflow:hidden;border:1px solid #120914;border-radius:9px;color:#fff;text-align:center;background:#25132c}.hp-fill{position:absolute;z-index:0;left:0;top:0;bottom:0;border-radius:9px;background:linear-gradient(90deg,#be3552,#f26773)}.hp-bar span{position:relative;z-index:1;font-size:10px;font-weight:900;line-height:17px;text-shadow:1px 1px #35111b}.hand-zone{display:flex;align-items:flex-end;gap:12px}.self-piles{display:flex;gap:7px;flex:none}.self-pile{position:relative;width:64px;color:#f7e4b3;font-size:9px;font-weight:900;text-align:center}.self-pile img{display:block;width:58px;height:82px;object-fit:cover;border:1px solid #e2b955;border-radius:5px;box-shadow:3px 3px #160a1c}.self-pile b{position:absolute;right:0;top:-6px;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;color:#251305;background:#ffd34e;font-size:11px}.self-pile span{display:block;margin-top:3px}.hand-content{min-width:0;flex:1}.hand-content .hand-row{margin:0}.self-meta .stat-chip:not(.health):not(.power){display:none}

/* ================= v44: чипсы/ЖДК без рамок, HP по центру, выбор фамильяра ================= */

/* 1. Убираем «колхозные» плашки у чипсин и ЖДК — только иконка и число */
.main-resources{gap:14px!important}
.main-resources span,
.main-chips,
.main-zhdk{
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:none!important;
  box-shadow:none!important;
  color:#fff!important;
  font-size:13px!important;
  font-weight:900!important;
  text-shadow:0 1px 2px #0009!important;
}
.main-resources img{width:19px!important;height:19px!important;filter:drop-shadow(0 1px 2px #0009)}

/* 2. Надпись HP строго по центру полоски (flex вместо line-height) */
.hp-bar{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  height:20px!important;
  line-height:normal!important;
}
.hp-bar span{
  line-height:1!important;
  display:block!important;
  margin:0!important;
  padding:0!important;
  font-size:11px!important;
}

/* 3. Карточка фамильяра в лобби: фото слева, текст полностью, кнопка выбора */
.familiar-options{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  max-height:none!important;
  gap:12px!important;
}
.familiar-option{
  display:grid!important;
  grid-template-columns:88px minmax(0,1fr)!important;
  gap:10px!important;
  min-height:0!important;
  padding:10px!important;
  border:1px solid #ffffff26!important;
  border-radius:12px!important;
  background:#34203e!important;
  text-align:left!important;
  cursor:default;
}
.familiar-option.selected{
  border-color:#ffd04e!important;
  background:#4b2c40!important;
  box-shadow:0 0 12px #ffc83d40!important;
}
.fam-photo{
  position:relative;
  overflow:hidden;
  border-radius:9px;
  background:#12080f;
  cursor:zoom-in;
  aspect-ratio:5/7;
}
.fam-photo img{display:block;width:100%;height:100%;object-fit:cover}
.fam-zoom{
  position:absolute;right:4px;bottom:4px;
  width:24px;height:24px;
  display:grid;place-items:center;
  border:0;border-radius:50%;
  color:#2b1720;background:#ffd875e0;
  font-size:14px;font-weight:900;cursor:zoom-in;
}
.fam-body{display:flex;flex-direction:column;min-width:0}
.familiar-option b{color:#ffdd82;font-size:13px;line-height:1.15}
.familiar-option span{margin:3px 0;color:#93d6ff;font-size:11px;font-weight:700}
/* Текст больше не обрезается */
.familiar-option small{
  display:block;
  color:#e6d8e6;
  font-size:11px;
  line-height:1.35;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
}
.fam-actions{margin-top:auto;padding-top:8px}
.fam-pick{
  width:100%;
  padding:7px 10px;
  border:0;border-radius:8px;
  color:#2b1720;background:#ffd34e;
  font-size:12px;font-weight:900;cursor:pointer;
}
.familiar-option.selected .fam-pick{color:#fff;background:#7a3b58}
.fam-pick:hover{filter:brightness(1.08)}

/* 4. Модалка подтверждения фамильяра */
.confirm-fam-card{width:min(560px,94vw);text-align:left}
.confirm-fam-body{display:grid;grid-template-columns:150px minmax(0,1fr);gap:16px;margin:10px 0 4px}
.confirm-fam-photo{overflow:hidden;border-radius:11px;background:#12080f;cursor:zoom-in;aspect-ratio:5/7}
.confirm-fam-photo img{display:block;width:100%;height:100%;object-fit:cover}
.confirm-fam-copy h2{margin:0 0 4px;color:#ffe5a1;font-size:20px;line-height:1.15}
.confirm-fam-wizard{margin-bottom:8px;color:#93d6ff;font-size:12px;font-weight:800}
.confirm-fam-copy p{color:#eee0ee;font-size:13px;line-height:1.45}
.confirm-fam-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:14px}

@media (max-width:900px){
  .familiar-options{grid-template-columns:1fr!important}
  .confirm-fam-body{grid-template-columns:120px minmax(0,1fr)}
}

/* ================= v45: карточки фамильяров — только крупная картинка ================= */

/* Текст с карточек убран: всё описание напечатано на самой карте. */
.familiar-option{
  display:flex!important;
  flex-direction:column!important;
  grid-template-columns:none!important;
  gap:9px!important;
  padding:10px!important;
  background:#2c1a35!important;
}
.familiar-option .fam-body{display:none!important}

/* Картинка карты — крупная, целиком, без обрезки */
.fam-photo{
  width:100%;
  aspect-ratio:auto!important;
  background:transparent;
  border-radius:10px;
}
.fam-photo img{
  width:100%!important;
  height:auto!important;
  object-fit:contain!important;
  display:block;
  border-radius:10px;
}
.fam-zoom{
  right:7px!important;bottom:7px!important;
  width:30px!important;height:30px!important;
  font-size:17px!important;
  background:#ffd875f0!important;
  box-shadow:0 2px 8px #000a;
}
.fam-photo:hover .fam-zoom{background:#ffe49a!important}

/* Кнопка выбора — во всю ширину под картой */
.familiar-option .fam-pick{
  width:100%;
  margin-top:auto;
  padding:9px 10px!important;
  font-size:13px!important;
}

/* Модалка подтверждения: только карта крупно + название */
.confirm-fam-card{width:min(420px,94vw)!important;text-align:center!important}
.confirm-fam-body{
  display:block!important;
  grid-template-columns:none!important;
  margin:12px 0 6px!important;
}
.confirm-fam-photo{
  width:min(300px,72vw);
  margin:0 auto 12px;
  aspect-ratio:auto!important;
  background:transparent!important;
  cursor:default!important;
  border-radius:12px;
}
.confirm-fam-photo img{
  width:100%!important;height:auto!important;
  object-fit:contain!important;
  border-radius:12px;
  box-shadow:0 8px 24px #0008;
}
.confirm-fam-card h2{margin:0 0 4px!important;color:#ffe5a1;font-size:19px;line-height:1.2}
.confirm-fam-wizard{margin-bottom:0!important;color:#93d6ff;font-size:12px;font-weight:800}
.confirm-fam-actions{justify-content:center!important}

@media (max-width:900px){
  .familiar-options{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* ================= v46: карты покупки крупнее и без подписей ================= */

/* Правая колонка шире, чтобы вместить увеличенные карты */
.market-rail{width:132px}
.special-actions{display:grid;gap:10px;justify-items:end}

/* Обе кнопки — просто крупная карта со счётчиком-бейджем, без текста */
.small-action.wild-action,
.small-action.fam-action{
  position:relative;
  width:118px;
  padding:0!important;
  overflow:visible!important;
  border:0!important;
  border-radius:9px!important;
  background:transparent!important;
}
.small-action.wild-action img,
.small-action.fam-action img{
  display:block!important;
  width:118px;
  height:166px;
  object-fit:cover!important;
  border:2px solid #c79b4c!important;
  border-radius:9px!important;
  box-shadow:4px 5px #0f0716!important;
  transition:transform .16s ease;
}
.small-action.wild-action:hover img,
.small-action.fam-action:hover img{transform:translateY(-4px) scale(1.04)}
/* Подписи под картами больше не выводим */
.small-action.wild-action span,
.small-action.fam-action span{display:none!important}

/* Круглый счётчик поверх карты */
.action-badge{
  position:absolute;z-index:3;right:-7px;top:-7px;
  display:grid;place-items:center;
  min-width:28px;height:28px;padding:0 6px;
  border-radius:99px;
  color:#2b1705;background:#ffd34e;
  font-size:13px;font-weight:900;
  box-shadow:0 3px 9px #0009;
}
/* У кнопки фамильяра без картинки бейдж не должен висеть в пустоте */
.small-action.fam-action{min-height:166px}
.small-action.fam-action .buy-fam-thumb{
  width:118px;height:166px;
  border-radius:9px!important;
}

@media(max-width:850px){
  .market-rail{width:96px}
  .small-action.wild-action,.small-action.fam-action,
  .small-action.wild-action img,.small-action.fam-action img,
  .small-action.fam-action .buy-fam-thumb{width:86px}
  .small-action.wild-action img,.small-action.fam-action img,
  .small-action.fam-action .buy-fam-thumb{height:121px}
  .small-action.fam-action{min-height:121px}
}

/* ================= v47: правая колонка не должна выпирать ================= */

/* Колонка в сетке была 86px, а рельса — 132px: контент вылезал вправо
   и всё выглядело сдвинутым. Приводим сетку и рельсу к одной ширине. */
.board-shell{grid-template-columns:185px minmax(380px,1fr) 138px}
.market-rail{
  width:100%;
  align-items:center;
  padding-right:2px;
}
.special-actions{justify-items:center;width:100%}

/* Ящики барахолки/легенд центрируем в колонке */
.market-drawer{align-self:center}

/* Лупа предпросмотра на картах покупки */
.buy-zoom{
  position:absolute;z-index:4;left:-8px;top:-8px;
  display:grid;place-items:center;
  width:26px;height:26px;
  border:0;border-radius:50%;
  color:#2b1720;background:#ffd875f0;
  font-size:15px;font-weight:900;cursor:zoom-in;
  box-shadow:0 2px 8px #000a;
}
.buy-zoom:hover{background:#ffe49a}

@media(max-width:850px){
  .board-shell{grid-template-columns:88px 1fr 100px}
}
@media(max-width:520px){
  .board-shell{grid-template-columns:55px 1fr 58px}
}

/* ================= v48: кружки-бейджи на картах покупки убраны ================= */
/* Стоимость и так напечатана на самой карте — дублировать её незачем. */
.action-badge{display:none!important}

/* ================= v49: показ полученного жетона ЖДК ================= */
.event-art{display:grid;place-items:center;margin:12px 0 6px}
.event-art img{
  width:min(230px,62vw);height:auto;
  border-radius:11px;
  box-shadow:0 8px 24px #000a;
}
.event-owner{
  margin:2px 0 8px;
  color:#ffd34e;font-size:13px;font-weight:900;
  letter-spacing:.04em;
}
.event-card{text-align:center}
.event-card h2{margin:6px 0 2px}

/* ================= v50: купленный фамильяр уходит из колонки ================= */
/* .hidden уже глобально display:none!important — карточка исчезает,
   а Шальная магия поднимается на её место, т.к. .special-actions это grid. */
.special-actions .small-action.hidden{display:none!important}

/* ================= v51: экран итогов партии ================= */
.gameover-card{width:min(560px,94vw);text-align:center}
.gameover-card h2{margin:6px 0 14px;color:#ffe5a1}
.gameover-table{display:grid;gap:7px;margin-bottom:16px;text-align:left}
.score-row{
  display:grid;
  grid-template-columns:26px 28px minmax(0,1fr) auto auto;
  align-items:center;gap:9px;
  padding:9px 11px;
  border:1px solid #ffffff1f;border-radius:10px;
  background:#2c1a35;
}
.score-row.is-winner{border-color:#ffd04e;background:#4b2c40;box-shadow:0 0 12px #ffc83d33}
.score-place{color:#ffd34e;font-weight:900;text-align:center}
.score-ava{font-size:18px;text-align:center}
.score-name{overflow:hidden;color:#ffe9ad;font-size:13px;font-weight:800;text-overflow:ellipsis;white-space:nowrap}
.score-sub{color:#bfaec2;font-size:11px;white-space:nowrap}
.score-vp{color:#ffd34e;font-size:15px;font-weight:900;white-space:nowrap}

/* ================= v52: вход по ссылке, пауза, реконнект ================= */

/* Приглашение на экране входа и в лобби */
.room-invite{margin:14px 0 4px;color:#ffd879;font-size:13px;font-weight:800;text-align:left}
.invite-row{display:flex;gap:7px;margin-top:6px}
.invite-row input{
  flex:1;min-width:0;margin:0;
  padding:10px 12px;
  border:1px solid #a56b9e;border-radius:9px;
  color:#ffe9c0;background:#1b1022;
  font-size:12px;
}
.invite-row .small-action{width:auto;flex:none;white-space:nowrap}
.invite-hint{margin-top:6px;color:#c6b3c8;font-size:11px;font-weight:600}
.lobby-invite{margin:10px 0 4px}

/* Плашка «нет связи» */
.link-state{
  position:fixed;z-index:120;left:50%;top:12px;transform:translateX(-50%);
  padding:8px 16px;border-radius:99px;
  color:#2b1705;background:#ffd34e;
  font-size:12px;font-weight:900;
  box-shadow:0 6px 18px #0009;
}

/* Экран паузы */
.pause-overlay{
  position:fixed;z-index:115;inset:0;
  display:grid;place-items:center;
  padding:20px;
  background:#07030bd9;
  backdrop-filter:blur(3px);
}
.pause-card{
  width:min(420px,94vw);padding:30px 26px;
  border:1px solid #ffd267a3;border-radius:18px;
  text-align:center;
  background:linear-gradient(145deg,#4d2b51,#1d1026);
  box-shadow:0 20px 70px #000;
}
.pause-icon{font-size:44px;line-height:1}
.pause-card h2{margin:10px 0 6px;color:#ffe5a1;font-size:24px}
.pause-card p{margin:0 0 18px;color:#e2cfe2;font-size:14px}

/* ================= v54: список жетонов ЖДК ================= */
.main-zhdk.has-tokens{cursor:pointer}
.main-zhdk.has-tokens:hover{filter:brightness(1.35)}
.tokens-card{width:min(520px,94vw);text-align:left}
.tokens-card h2{margin:6px 0 14px;color:#ffe5a1;font-size:20px}
.tokens-list{display:grid;gap:9px;max-height:60vh;overflow:auto}
.token-row{
  padding:11px 13px;
  border:1px solid #ffffff1f;border-radius:10px;
  background:#2c1a35;
}
.token-row.is-permanent{border-color:#ffd04e;background:#3d2440}
.token-head{display:flex;justify-content:space-between;gap:10px;align-items:baseline}
.token-head b{color:#ffdd82;font-size:14px}
.token-head span{color:#ff8f9c;font-size:12px;font-weight:900;white-space:nowrap}
.token-flag{
  margin-top:4px;
  color:#ffd34e;font-size:10px;font-weight:900;letter-spacing:.06em;
}
.token-row p{margin:6px 0 0;color:#e6d8e6;font-size:12px;line-height:1.4}


/* ============ v57: счётчик фамильяров + плашка свойства ============
   Вёрстку планшета НЕ трогаем — она вернулась к рабочему виду.
   Карта фамильяра снова одна, как было. */

/* Значок «сколько всего фамильяров» в углу карты */
.familiar-card{position:relative}
.fam-count{
  position:absolute;right:-5px;top:-5px;
  display:grid;place-items:center;
  min-width:19px;height:19px;padding:0 4px;
  border-radius:99px;
  color:#2b1705;background:#ffd34e;
  font-size:11px;font-weight:900;line-height:1;
  box-shadow:0 2px 6px #000a;
}

/* Плашка свойства под планшетом */
.property-plate{
  display:block;width:100%;
  margin-top:4px;padding:3px 7px;
  border:1px solid #ffcf4c55!important;border-radius:6px;
  color:#ffe0a0;background:#2a1730d9;
  font-size:10px;font-weight:800;text-align:center;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  cursor:pointer;
}
.property-plate:hover{border-color:#ffd34e!important;background:#4a2a44;color:#fff3d0}

/* Строки в окне «Фамильяры» */
.fam-line{
  display:grid;grid-template-columns:52px minmax(0,1fr);
  gap:11px;align-items:center;width:100%;
  padding:9px 11px;
  border:1px solid #ffffff1f;border-radius:10px;
  background:#2c1a35;text-align:left;cursor:zoom-in;
}
.fam-line:hover{border-color:#ffd04e;background:#3d2440}
.fam-line img{width:52px;height:73px;object-fit:contain;border-radius:6px;background:#0c0710}
.fam-line b{display:block;color:#ffdd82;font-size:13px}
.fam-line small{display:block;margin-top:3px;color:#e6d8e6;font-size:11px;line-height:1.35}

/* ============ v58: извержение «БЕСПРЕДЕЛ!» ============ */

.besp-burst{
  position:fixed;z-index:130;inset:0;
  display:grid;place-items:center;
  pointer-events:none;overflow:hidden;
}

/* Вспышка из глубины — «жерло вулкана» снизу экрана */
.besp-glow{
  position:absolute;left:50%;bottom:-30vh;
  width:120vw;height:90vh;
  transform:translateX(-50%) scale(.3);
  border-radius:50%;
  background:radial-gradient(circle at 50% 70%,
    #fff3c4 0%, #ffb43a 18%, #ff5722 38%, #c1123a 58%, transparent 74%);
  opacity:0;
}
.besp-burst.run .besp-glow{animation:besp-erupt 1.5s cubic-bezier(.2,.9,.3,1) forwards}
@keyframes besp-erupt{
  0%  {opacity:0;  transform:translateX(-50%) scale(.25)}
  22% {opacity:.95;transform:translateX(-50%) scale(1.05)}
  55% {opacity:.55;transform:translateX(-50%) scale(1.25)}
  100%{opacity:0;  transform:translateX(-50%) scale(1.5)}
}

/* Летящие вверх искры */
.besp-embers{
  position:absolute;inset:0;opacity:0;
  background-image:
    radial-gradient(3px 3px at 12% 90%,#ffd166,transparent),
    radial-gradient(2px 2px at 27% 96%,#ff8a3d,transparent),
    radial-gradient(4px 4px at 44% 88%,#fff0b8,transparent),
    radial-gradient(2px 2px at 61% 94%,#ff6b35,transparent),
    radial-gradient(3px 3px at 78% 91%,#ffd166,transparent),
    radial-gradient(2px 2px at 90% 97%,#ffa62b,transparent);
}
.besp-burst.run .besp-embers{animation:besp-embers 1.9s ease-out forwards}
@keyframes besp-embers{
  0%  {opacity:0;  transform:translateY(10vh) scale(1)}
  25% {opacity:1}
  100%{opacity:0;  transform:translateY(-70vh) scale(1.6)}
}

/* Надпись поднимается снизу, буквы по очереди */
.besp-word{
  position:relative;z-index:2;
  display:flex;gap:.02em;
  font-family:'Russo One',Impact,sans-serif;
  font-size:clamp(38px,11vw,132px);
  line-height:1;letter-spacing:.02em;
  color:#ffdf5e;
  text-shadow:0 4px 0 #a01028, 0 8px 26px #000, 0 0 44px #ff6b35;
}
.besp-word span{
  display:inline-block;opacity:0;
  transform:translateY(90px) rotate(-14deg) scale(.6);
}
.besp-burst.run .besp-word span{animation:besp-letter .62s cubic-bezier(.18,1.5,.4,1) forwards}
@keyframes besp-letter{
  0%  {opacity:0;transform:translateY(90px) rotate(-14deg) scale(.6)}
  65% {opacity:1;transform:translateY(-10px) rotate(3deg)  scale(1.14)}
  100%{opacity:1;transform:translateY(0)     rotate(0)     scale(1)}
}
/* Мегабеспредел — холоднее и злее */
.besp-burst.is-mega .besp-glow{
  background:radial-gradient(circle at 50% 70%,
    #fff 0%, #b5f0ff 16%, #7a4dff 38%, #4a0f7a 60%, transparent 76%);
}
.besp-burst.is-mega .besp-word{
  color:#e9d5ff;
  text-shadow:0 4px 0 #4a0f7a, 0 8px 26px #000, 0 0 48px #9d6bff;
  font-size:clamp(28px,8vw,104px);
}

/* Тряска стола */
.board-shell.quake{animation:besp-quake .82s cubic-bezier(.36,.07,.19,.97) both}
@keyframes besp-quake{
  10%,90%{transform:translate3d(-3px,1px,0) rotate(-.18deg)}
  20%,80%{transform:translate3d(6px,-2px,0) rotate(.28deg)}
  30%,50%,70%{transform:translate3d(-9px,2px,0) rotate(-.36deg)}
  40%,60%{transform:translate3d(9px,-2px,0) rotate(.36deg)}
}

/* Окно Беспредела влетает, а не выскакивает мгновенно */
#event-modal:not(.hidden) .event-card{animation:besp-card .45s cubic-bezier(.2,1.3,.4,1) both}
@keyframes besp-card{
  0%  {opacity:0;transform:translateY(38px) scale(.9)}
  100%{opacity:1;transform:none}
}

@media (prefers-reduced-motion:reduce){
  .besp-burst.run .besp-glow,.besp-burst.run .besp-embers,
  .besp-burst.run .besp-word span,.board-shell.quake{animation-duration:.01ms!important}
}

/* ============ v60: извержение медленнее, окно выплывает мягко ============ */

/* Вспышка и искры живут дольше — есть что разглядывать */
.besp-burst.run .besp-glow{animation-duration:2.6s!important}
.besp-burst.run .besp-embers{animation-duration:3.2s!important}

/* Надпись: вылетает, ЗАВИСАЕТ на экране и только потом тает */
.besp-burst.run .besp-word span{
  animation:besp-letter-hold 3.4s cubic-bezier(.18,1.5,.4,1) forwards!important;
}
@keyframes besp-letter-hold{
  0%   {opacity:0;transform:translateY(90px) rotate(-14deg) scale(.6)}
  12%  {opacity:1;transform:translateY(-10px) rotate(3deg)  scale(1.14)}
  20%  {opacity:1;transform:translateY(0)     rotate(0)     scale(1)}
  72%  {opacity:1;transform:translateY(0)     rotate(0)     scale(1)}   /* пауза: читаем */
  100% {opacity:0;transform:translateY(-26px) rotate(0)     scale(1.06)}
}

/* Окно Беспредела больше не выскакивает — медленно проявляется снизу */
#event-modal:not(.hidden) .event-card{
  animation:besp-card-slow 1.05s cubic-bezier(.16,.9,.3,1) both!important;
}
@keyframes besp-card-slow{
  0%  {opacity:0;transform:translateY(54px) scale(.94);filter:blur(6px)}
  55% {opacity:.85}
  100%{opacity:1;transform:none;filter:blur(0)}
}
/* Затемнение позади окна тоже нарастает плавно */
#event-modal:not(.hidden){animation:besp-veil .7s ease both}
@keyframes besp-veil{from{background:#07030b00}to{background:#07030bbd}}

@media (prefers-reduced-motion:reduce){
  .besp-burst.run .besp-word span,
  #event-modal:not(.hidden) .event-card,
  #event-modal:not(.hidden){animation-duration:.01ms!important}
}

/* ============ v62: живой подсчёт очков + подтверждение активации ============ */

.score-row{transition:border-color .2s,background .2s,transform .2s}
.score-row.is-active{border-color:#ffd04e!important;background:#3d2440!important;transform:scale(1.02)}
.score-vp{transition:color .2s}
.score-vp.bump-good{animation:vp-good .55s ease}
.score-vp.bump-bad{animation:vp-bad .55s ease}
@keyframes vp-good{
  0%{transform:scale(1);color:#ffd34e}
  40%{transform:scale(1.45);color:#9dff87}
  100%{transform:scale(1);color:#ffd34e}
}
@keyframes vp-bad{
  0%{transform:scale(1);color:#ffd34e}
  40%{transform:scale(1.3);color:#ff7a8f}
  100%{transform:scale(1);color:#ffd34e}
}
.score-sub.flash{animation:sub-flash .6s ease}
@keyframes sub-flash{
  0%{opacity:0;transform:translateX(10px)}
  100%{opacity:1;transform:none}
}
.score-row.is-winner{
  border-color:#ffd04e!important;background:#4b2c40!important;
  box-shadow:0 0 18px #ffc83d55;
}
#gameover-winner.reveal{animation:win-reveal .8s cubic-bezier(.2,1.4,.4,1) both}
@keyframes win-reveal{
  0%{opacity:0;transform:scale(.7) translateY(14px)}
  60%{opacity:1;transform:scale(1.12)}
  100%{opacity:1;transform:none}
}

/* Текст постоянки в окне подтверждения */
.act-text{margin:8px 0 0;color:#e6d8e6;font-size:12px;line-height:1.45;text-align:left}

/* ============ v64: раскрываемая расшифровка очков ============ */
.score-row.is-expandable{cursor:pointer}
.score-row.is-expandable:hover{border-color:#ffd04e88}
.score-row.is-open{grid-template-columns:26px 28px minmax(0,1fr) auto auto}
.score-details{
  grid-column:1 / -1;
  margin-top:9px;padding-top:9px;
  border-top:1px solid #ffffff1f;
  display:grid;gap:4px;
}
.detail-line{
  display:flex;justify-content:space-between;gap:12px;
  color:#e6d8e6;font-size:11px;line-height:1.35;
}
.detail-line b{white-space:nowrap;font-variant-numeric:tabular-nums}
.detail-line.plus b{color:#9dff87}
.detail-line.minus b{color:#ff7a8f}
.detail-line.total{
  margin-top:4px;padding-top:6px;
  border-top:1px solid #ffffff1f;
  color:#ffdd82;font-size:12px;font-weight:900;
}
.detail-line.total b{color:#ffd34e}

/* ============ v65: счётчик оставшихся фамильяров ============ */
.fam-left{
  position:absolute;left:-6px;top:-6px;
  display:grid;place-items:center;
  min-width:20px;height:20px;padding:0 5px;
  border-radius:99px;
  color:#2b1705;background:#9dff87;
  font-size:11px;font-weight:900;
  box-shadow:0 2px 6px #000a;
}

/* ============ v70: щит защиты, постоянки соседа, выбор оплаты ============ */
.defend-fx{
  position:absolute;z-index:70;left:50%;top:-14px;
  transform:translateX(-50%);pointer-events:none;
}
.defend-fx .shield{
  display:block;font-size:46px;line-height:1;
  filter:drop-shadow(0 0 14px #7fd8ff) drop-shadow(0 3px 6px #000);
  animation:shield-pop 1.7s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes shield-pop{
  0%  {opacity:0;transform:scale(.3) translateY(18px)}
  22% {opacity:1;transform:scale(1.25) translateY(-6px)}
  40% {transform:scale(1) translateY(0)}
  75% {opacity:1}
  100%{opacity:0;transform:scale(1.1) translateY(-16px)}
}
.player-main{cursor:pointer}
.player-main:hover{filter:brightness(1.12)}
.pay-opt b{display:block;color:#ffdd82;font-size:14px}
.pay-opt small{color:#bfe9ff}

/* ============ v72: щит крупнее, длинные списки со скроллом, оплата ============ */

/* Щит был мелкий и незаметный — делаем крупный синий значок с сиянием */
.defend-fx{top:-38px!important}
.defend-fx .shield{
  font-size:88px!important;
  color:#7fd8ff;
  filter:drop-shadow(0 0 26px #35b8ff) drop-shadow(0 0 46px #1a7fd4) drop-shadow(0 4px 8px #000)!important;
}
@keyframes shield-pop{
  0%  {opacity:0;transform:scale(.25) translateY(26px) rotate(-12deg)}
  18% {opacity:1;transform:scale(1.5)  translateY(-10px) rotate(4deg)}
  34% {transform:scale(1.15) translateY(0) rotate(0)}
  70% {opacity:1;transform:scale(1.15)}
  100%{opacity:0;transform:scale(1.3) translateY(-24px)}
}
/* Плашка «кто чем защитился» — крупнее и заметнее */
.activity-toast{
  font-size:15px!important;
  border:1px solid #7fd8ff88!important;
  box-shadow:0 0 24px #35b8ff44!important;
}

/* Длинные списки выбора: скролл вместо бесконечной простыни */
#decision-options{
  max-height:46vh;
  overflow-y:auto;
  padding-right:4px;
}
#decision-options::-webkit-scrollbar{width:9px}
#decision-options::-webkit-scrollbar-track{background:#1b1022;border-radius:6px}
#decision-options::-webkit-scrollbar-thumb{
  background:linear-gradient(#ffd35d,#c98a2a);border-radius:6px;
}
#decision-options::-webkit-scrollbar-thumb:hover{background:#ffd875}
.tokens-list{max-height:56vh;overflow-y:auto}

/* Ползунок оплаты */
.pay-slider{display:grid;gap:12px;justify-items:center;padding:6px 2px}
.pay-readout{display:flex;align-items:center;gap:12px;font-size:22px;font-weight:900}
.pay-readout b{color:#ffd34e}
.pay-readout span{color:#bfaec2}
#pay-range{width:100%;accent-color:#ffd34e;cursor:pointer}
.pay-hint{color:#bfaec2;font-size:11px}

/* v73: кнопки итогового окна — хост уводит всех в лобби */
.gameover-actions{display:flex;justify-content:center;gap:10px;margin-top:14px;flex-wrap:wrap}
.gameover-actions .small-action{width:auto;padding:10px 18px;font-size:12px}
.gameover-actions .button-primary{padding:11px 22px;font-size:14px}
.gameover-note{
  margin-top:12px;padding:9px 14px;border:1px solid #ffd26e55;border-radius:10px;
  color:#ffe4ad;font-size:12px;text-align:center;background:#1b0f2399;
}

/* v74: список игроков в лобби с кнопкой «выгнать» у хоста */
.lobby-players li.lobby-player{
  display:flex;align-items:center;gap:10px;
  padding:9px 12px;border-bottom:1px solid #ffffff12;
}
.lobby-player .lp-who{flex:1;min-width:0;color:#ffe9b8;font-weight:700;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lobby-player.is-bot .lp-who{color:#bfe6ff}
.lobby-player .lp-state{flex:none;color:#c9b6cc;font-size:11px}
.lobby-player .lp-state.ready{color:#aee875}
.lp-kick{
  flex:none;display:grid;place-items:center;width:26px;height:26px;padding:0;
  border:1px solid #ff8d9f88;border-radius:50%;
  color:#ffb9c4;font-size:14px;font-weight:900;line-height:1;
  background:#431b28;cursor:pointer;transition:.15s;
}
.lp-kick:hover{border-color:#ff6d85;color:#fff;background:#8c2438;transform:scale(1.1)}
@media(max-width:520px){
  .lobby-player .lp-state{display:none}
}

/* --- Скрытая панель ведущего (debug). Открывается только хоткеем. --- */
#gm-modal .modal-card{width:min(760px,100%);max-height:88vh;overflow:auto;border-color:#7ce0a0a3;background:linear-gradient(150deg,#1d3330,#120f1d)}
#gm-modal h2{color:#8ff0b4}
.gm-badge{display:inline-block;padding:3px 9px;border-radius:99px;color:#0d2418;font-size:10px;font-weight:800;letter-spacing:.12em;background:#7ce0a0}
.gm-section{margin-top:14px;padding-top:11px;border-top:1px solid #ffffff1a}
.gm-section>b{display:block;margin-bottom:7px;color:#c9f6d8;font-size:11px;font-weight:800;letter-spacing:.14em}
.gm-row{display:flex;flex-wrap:wrap;gap:7px;align-items:center}
.gm-btn{padding:8px 12px;border:1px solid #7ce0a055;border-radius:9px;color:#d9ffe7;font-size:12px;font-weight:700;background:#23433a}
.gm-btn:hover{border-color:#8ff0b4;background:#2f5c4c}
.gm-btn.danger{border-color:#ff8a8a66;color:#ffdcdc;background:#4a2230}
.gm-btn.danger:hover{background:#68303f}
#gm-modal select,#gm-modal input{width:auto;min-width:96px;margin:0;padding:8px;border-color:#7ce0a055;background:#12251f;color:#e7fff1}
.gm-hint{margin:6px 0 0;color:#9cc2ae;font-size:11px}
.gm-toast{position:fixed;z-index:600;left:50%;bottom:22px;transform:translateX(-50%);padding:10px 18px;border:1px solid #7ce0a0;border-radius:10px;color:#0f2a1d;font-size:13px;font-weight:800;background:#8ff0b4;box-shadow:0 10px 26px #0009}

/* ===================================================================== *
 *  ЕДИНАЯ ШКАЛА СЛОЁВ
 *  Раньше все модалки висели на z-index:100 и перекрывали друг друга в
 *  произвольном порядке: лупа открывалась ПОД окном решения. Теперь
 *  порядок задан явно и в одном месте.
 * ===================================================================== */
.modal            { z-index:1000 }   /* обычные окна */
#decision-modal   { z-index:1100 }   /* выбор игрока — важнее обычных */
#event-modal      { z-index:1200 }   /* Беспредел */
#card-modal       { z-index:1600 }   /* лупа — ВСЕГДА поверх всего */
#gm-modal,
#gm-auth-modal    { z-index:1700 }   /* панель ведущего */
.flying-card      { z-index:900 }    /* анимация полёта — под окнами */
.turn-overlay     { z-index:880 }
.besp-burst       { z-index:1150 }
.gm-toast         { z-index:1800 }

/* --- #2: ящики барахолки и легенд закрываются нормально --- */
/* Пока ящик открыт кликом, hover его не держит: иначе он «залипал». */
.market-drawer.pinned .drawer-content{opacity:1;pointer-events:auto;transform:none}
.market-drawer.pinned .drawer-tab{border-color:#ffe89b;box-shadow:0 0 12px #ffce4c66}
.drawer-close{position:absolute;z-index:6;right:8px;top:8px;display:grid;place-items:center;
  width:30px;height:30px;padding:0;border:1px solid #ffd07a;border-radius:50%;
  color:#2b1730;font-size:22px;font-weight:900;line-height:1;background:#ffd77e;
  box-shadow:0 2px 8px #0009}
.drawer-close:hover{background:#fff0b8}
/* Подложка: клик мимо ящика закрывает его. */
.drawer-backdrop{position:fixed;z-index:105;inset:0;background:#05030880}

/* --- #11: кто над чем думает --- */
.waiting-banner{position:fixed;z-index:1250;left:50%;bottom:26px;transform:translateX(-50%);
  display:flex;align-items:center;gap:11px;max-width:min(560px,92vw);
  padding:13px 22px;border:1px solid #ffd66d;border-radius:14px;
  color:#fff2c8;background:#2a1636f2;box-shadow:0 12px 34px #000a}
.waiting-banner b{color:#ffd35a}
.waiting-banner .spin{width:17px;height:17px;border:3px solid #ffd35a55;
  border-top-color:#ffd35a;border-radius:50%;animation:waitSpin .8s linear infinite;flex:0 0 auto}
@keyframes waitSpin{to{transform:rotate(360deg)}}

/* --- #12: кого ещё ждём на Беспределе --- */
.event-waiting{margin-top:12px;padding:9px 12px;border:1px dashed #ffd06e88;
  border-radius:10px;color:#ffe0a4;font-size:13px;text-align:center}
.event-waiting b{color:#ffd35a}

/* --- #14: лог событий читаемый и поверх стола --- */
.event-feed{z-index:1050!important;width:min(420px,90vw);bottom:14px;left:14px}
.event-feed #log-panel{height:min(46vh,420px);font-size:14px;line-height:1.45}
.event-feed #log-panel div{padding:7px 2px}
/* Свежие строки заметнее — глаз цепляется за то, что произошло только что. */
.event-feed #log-panel div:last-child{color:#ffe9b0;font-weight:700}
.log-toggle{position:relative}
.log-badge{position:absolute;right:-5px;top:-6px;min-width:19px;height:19px;padding:0 5px;
  border-radius:99px;color:#2a1520;font-size:11px;font-weight:900;line-height:19px;
  background:#ffd35a;box-shadow:0 2px 6px #0008}
@media(max-width:850px){.event-feed{left:8px;right:8px;width:auto}}

/* #1: своё здоровье в окне выбора цели атаки */
.self-hp-line{margin:2px 0 8px;font-weight:700;color:#ffd166;font-size:15px}

/* #18: подсказка при возвращении в уже начатую партию */
.join-return-hint{margin:6px 0 10px;color:#9be29b;font-weight:600;text-align:center}


/* v77 — desktop: неблокирующая лента уничтожений и игровые диалоги.
   Сохраняем палитру стола. Лента выше обязательных окон, ниже лупы. */
.destroy-notices{position:fixed;z-index:1500;right:20px;top:20px;width:300px;
  overflow:hidden;border:1px solid #e5aa666e;border-radius:14px;
  color:#fff3e0;background:#24152ef5;box-shadow:0 12px 36px #08030c88;}
.destroy-header{display:flex;align-items:center;justify-content:space-between;
  gap:12px;padding:16px 16px 12px;border-bottom:1px solid #ffffff16;}
.destroy-header .eyebrow{font-size:10px;letter-spacing:.14em;color:#ffba78;}
.destroy-header h2{margin:5px 0 0;font:700 18px/1.25 'Source Sans 3',Arial,sans-serif;}
#destroy-count{margin-left:4px;color:#dfbfdf;font-size:14px;font-weight:400;}
#destroy-hide,.destroy-dismiss{flex:none;border-radius:8px;color:#ddc7df;background:transparent;font-size:24px;}
#destroy-hide{width:36px;height:36px;}
#destroy-hide:hover,.destroy-dismiss:hover{color:#fff;background:#ffffff12;}
.destroy-list{display:grid;gap:8px;padding:12px;max-height:calc(100vh - 180px);overflow:auto;scrollbar-color:#86516c #24152e;}
.destroy-notice{position:relative;display:grid;grid-template-columns:58px minmax(0,1fr);gap:12px;
  padding:12px 28px 12px 10px;border:1px solid #bf755744;border-radius:10px;
  background:linear-gradient(115deg,#54303b70,#35203b);animation:destroy-arrive .24s ease-out both;}
.destroy-thumb{display:grid;place-items:center;align-self:start;width:58px;height:82px;
  overflow:hidden;border:1px solid #c89559;border-radius:6px;background:#3c273c;color:#ffc475;cursor:zoom-in;}
.destroy-thumb img{width:100%;height:100%;object-fit:cover;}
.destroy-copy{min-width:0;overflow-wrap:anywhere;}
.destroy-who{margin-bottom:5px;font-size:12px;line-height:1.4;color:#ffc18d;}
.destroy-name{display:block;font-size:15px;line-height:1.3;color:#fff3e0;}
.destroy-reason{margin:7px 0 0;font-size:13px;line-height:1.45;color:#dccbdd;}
.destroy-dismiss{position:absolute;right:2px;top:4px;width:26px;height:30px;font-size:20px;}
.destroy-footnote{margin:0;padding:2px 16px 14px;color:#c9b1ce;font-size:12px;line-height:1.4;}
@keyframes destroy-arrive{from{opacity:0;transform:translateX(12px)}to{opacity:1;transform:none}}
/* Не допускаем пересечения ленты с вариантами обязательного выбора. */
@media(min-width:1000px){
  body.has-destroy-notices #decision-modal,body.has-destroy-notices #event-modal{padding-right:348px;}
}
#ui-dialog{z-index:1550;}
.ui-dialog-card{width:min(500px,100%);padding:30px;border-radius:14px;}
.ui-dialog-card h2{font-size:26px;line-height:1.2;padding-right:10px;}
#ui-dialog-text{margin:18px 0 24px;color:#e6d3e7;font-size:17px;line-height:1.55;white-space:pre-line;}
.ui-dialog-actions{display:flex;justify-content:flex-end;gap:12px;}
.ui-dialog-actions button{min-height:44px;padding:11px 18px;border-radius:9px;font-size:15px;font-weight:700;}
#ui-dialog-cancel{color:#f5e5f5;border:1px solid #c39eb870;background:#39243e;}
#ui-dialog-cancel:hover{background:#50324f;}
#ui-dialog-confirm.is-danger{color:#fff3ed;background:linear-gradient(#be4b45,#942f37);box-shadow:0 3px #602035;}
#ui-dialog button:focus-visible,.destroy-notices button:focus-visible{outline:2px solid #ffdb7b;outline-offset:3px;}
@media(prefers-reduced-motion:reduce){.destroy-notice{animation:none;}}

.destroy-thumb{padding:0;}
#decision-modal .modal-card{max-height:calc(100vh - 40px);overflow:auto;}

.destroy-header,.destroy-notices{background-color:#24152e;}
.destroy-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 12px 12px;}
.destroy-footer .destroy-footnote{margin:0;padding:0;font-size:12px;}
#destroy-clear{padding:7px 9px;border:1px solid #9a708866;border-radius:7px;color:#ead6ec;background:#39243e;font-size:12px;}
.destroy-history-button{padding:6px 10px;border:1px solid #e5aa666e;border-radius:8px;color:#ffd49f;background:#342037;font-size:12px;white-space:nowrap;}
.destroy-summary{position:fixed;z-index:1500;left:50%;top:84px;transform:translateX(-50%);
  width:max-content;max-width:min(460px,60vw);padding:12px 18px;border:1px solid #e5aa66;
  border-radius:10px;color:#ffe9d5;background:#382137;box-shadow:0 6px 20px #0006;
  font-size:15px;line-height:1.4;text-align:center;}
body.has-destroy-notices .destroy-summary{display:none;}
/* История открывается по запросу и не скрывает панель паузы/звука. */
.destroy-notices{top:84px;}
.destroy-list{max-height:calc(100vh - 250px);}
/* У старого decision-card ширина зависела от viewport, а не от свободной
   области модалки. Теперь боковая лента действительно резервирует место. */
#decision-modal .modal-card{width:min(820px,100%);}
#decision-modal .reveal-row{justify-content:flex-start;}
@media(min-width:1000px){body.has-destroy-notices #event-modal .modal-card{max-width:100%;}}


/* v78 — свободная зона выкладки, вместо неограниченной сетки под игроками. */
.played-zone{position:absolute;z-index:25;display:flex;flex-direction:column;padding:10px;
  border:1px solid #d3bc7940;border-radius:12px;background:#102c2788;overflow:hidden;}
.played-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;
  min-height:32px;margin-bottom:8px;color:#d8e7d0;font-size:12px;}
.played-heading b{color:#ffe39d;}
#played-expand,.played-fallback{padding:6px 10px;border:1px solid #dbc77b55;border-radius:7px;
  color:#ffe4aa;background:#203932;font-size:12px;}
.played-zone .played-cards{position:static;display:grid;flex:1;min-height:0;max-width:none;
  width:100%;margin:0;transform:none;gap:8px;justify-content:center;align-content:start;
  overflow-y:auto;overflow-x:hidden;scrollbar-color:#7b9273 #153029;scrollbar-width:thin;padding:2px;}
.played-zone .played-cards .card{width:var(--played-width,104px);flex-basis:auto;}
.played-zone .played-cards .card:hover{transform:none;filter:brightness(1.08);}
.played-zone .played-cards .card-info{height:calc(var(--played-width,104px) * 1000 / 708);min-height:0;overflow:hidden;}
.played-zone.is-scrollable{border-color:#e1c37488;}
.played-zone.is-scrollable .played-heading:after{content:'↕';color:#ffe39d;}
.played-fallback{position:absolute;z-index:70;left:50%;top:50%;transform:translate(-50%,-50%);}
.played-gallery{width:min(1060px,94vw);max-height:90vh;overflow:auto;}
.played-gallery h2{padding-right:24px;}
.played-all-cards{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:14px;padding:18px 0 4px;}
.played-all-cards .card{width:126px;flex:0 0 126px;}
.played-all-cards .card:hover{transform:none;}
#played-modal{z-index:1300;}
#card-modal{z-index:1900;} /* Лупа доступна также поверх панели ведущего. */
.reconnect-button{position:fixed;z-index:1400;top:52px;left:50%;transform:translateX(-50%);
  padding:9px 14px;border:1px solid #ffd36d;border-radius:8px;color:#ffe7b3;background:#38213c;}
.gm-card-preview{display:grid;grid-template-columns:90px minmax(0,1fr);gap:16px;
  margin-top:12px;padding:14px;border:1px solid #7ce0a047;border-radius:10px;background:#162b29;}
#gm-preview-art{align-self:start;width:90px;min-height:126px;padding:0;border:1px solid #7ce0a066;
  border-radius:7px;overflow:hidden;color:#b5d5c8;background:#101d1e;cursor:zoom-in;}
#gm-preview-art img{display:block;width:100%;height:auto;}
.gm-preview-type{color:#9fc6b6;font-size:12px;}
#gm-preview-title{margin:7px 0;color:#ecf6de;font-size:18px;line-height:1.3;}
#gm-preview-text{margin:7px 0 0;color:#d3e5d9;font-size:15px;line-height:1.5;white-space:pre-line;}
#gm-modal .gm-row{min-width:0;}
#gm-card{flex:1;min-width:160px!important;max-width:100%;}
#gm-card-search{flex:1;}
#gm-modal .gm-row select{max-width:100%;}

.table-stage.compact-seats .opp-card{width:210px!important;}
.table-stage.compact-seats .player-core{grid-template-columns:42px minmax(104px,1fr) 48px!important;gap:8px!important;}
.table-stage.compact-seats .avatar-box{width:42px!important;min-height:68px!important;font-size:25px!important;}
.table-stage.compact-seats .familiar-card{width:48px!important;min-height:68px!important;}
.table-stage.compact-seats .player-main{min-height:68px;padding:4px!important;}
.table-stage.compact-seats .player-name{font-size:12px!important;}
.played-zone.is-narrow .played-heading:after{display:none;}
.played-heading{flex:none;}

#gm-preview-art{font-size:12px;line-height:1.4;overflow-wrap:anywhere;}
