/* TOADBREW — Alchemical Arena. Портрет под телефон; на десктопе — колонка телефона по центру. */
:root {
  --ink: #120c07;
  --wood: #5a3b20;
  --brass: #c9a24a;
  --brass-l: #f0d58a;
  --brass-d: #7a5a20;
  --panel: rgba(24, 18, 13, 0.93);
  --panel-b: #6b5432;
  --blue: #2f7fe0;
  --blue-l: #7fc4ff;
  --red: #d8433a;
  --hp: #e0453b;
  --text: #f4ecdc;
  --muted: #b5a68c;
  --font-h: 'Cinzel', Georgia, serif;
  --font-b: 'Lilita One', 'Arial Black', system-ui, sans-serif;
  --font: 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #0d0906; overflow: hidden; }
body { font-family: var(--font); color: var(--text); user-select: none; -webkit-user-select: none; touch-action: none; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

#app { position: fixed; inset: 0; overflow: hidden; background: #1c140e; }

#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#labels > div { position: absolute; left: 0; top: 0; will-change: transform; }

/* ---------- шапка меты ---------- */
.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; padding: max(8px, env(safe-area-inset-top)) 10px 4px; }
.logo { background: linear-gradient(#6e4826, #3d2512); border: 2px solid #2a170a; border-radius: 10px; padding: 3px 14px 4px; box-shadow: 0 4px 0 #22130a, 0 0 0 2px #9a7334 inset; transform: rotate(-1.5deg); }
.logo-a { font-family: var(--font-h); font-weight: 900; font-size: 26px; line-height: 1; color: var(--brass-l); -webkit-text-stroke: 1px #3a2208; text-shadow: 0 3px 0 #2a1606; letter-spacing: 1px; }
.flask-o { color: #5fb8ff; text-shadow: 0 0 8px rgba(95,184,255,0.8); }
.logo-b { font-family: var(--font-h); font-weight: 700; font-size: 10px; text-align: center; color: #f3e6c6; letter-spacing: 1.5px; }
.chip { background: linear-gradient(#3b2f22, #241b12); color: var(--text); border: 1.5px solid var(--panel-b); border-radius: 999px; padding: 5px 13px; font-weight: 900; font-size: 12px; }
.chip.wide { min-width: 220px; padding: 9px 18px; font-size: 15px; }
.chip.danger { border-color: #a5463b; color: #ffc0b8; }

/* ---------- экраны меты ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: stretch; padding: 78px 10px 92px; overflow-y: auto; touch-action: pan-y; gap: 8px; }
.screen.meta { background: radial-gradient(ellipse at 50% 30%, rgba(110,70,30,0.35), rgba(15,10,6,0.85) 75%); }
.sec-head { display: flex; justify-content: space-between; align-items: center; }
.plaque { font-family: var(--font-h); font-weight: 900; font-size: 26px; color: #f6ead0; background: linear-gradient(#3a2c1e, #1d150d); border: 2px solid var(--brass-d); border-radius: 6px; padding: 2px 18px; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%); text-shadow: 0 2px 0 #000; }
.plaque.sm { font-size: 17px; padding: 3px 16px; }
.counter { font-family: var(--font-h); font-weight: 700; font-size: 12px; color: #e8dcc0; background: rgba(20,14,9,0.9); border: 1.5px solid var(--brass-d); border-radius: 6px; padding: 5px 10px; }

.roster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.card { position: relative; border: 2px solid #5b4a33; border-radius: 8px; background: linear-gradient(#3a2e22, #1c150e); padding: 0 0 4px; text-align: center; color: var(--text); overflow: hidden; }
.card canvas { width: 100%; height: auto; aspect-ratio: 1 / 1; display: block; background: radial-gradient(circle at 50% 60%, #4d3b2a, #1f1710); }
.card.sel { border-color: var(--blue-l); box-shadow: 0 0 0 2px var(--blue), 0 0 16px rgba(80,160,255,0.65); }
.card .cicon { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 6px; background: rgba(15,10,6,0.8); border: 1.5px solid var(--brass-d); display: grid; place-items: center; font-size: 13px; }
.card .check { position: absolute; bottom: 30px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--blue); border: 2px solid #fff; display: none; place-items: center; font-weight: 900; font-size: 13px; }
.card.sel .check { display: grid; }
.card .cname { font-family: var(--font-h); font-weight: 700; font-size: 11.5px; margin-top: 3px; letter-spacing: 0.3px; }
.card .stars { font-size: 9px; color: var(--brass); letter-spacing: 2px; }

.pair { display: grid; grid-template-columns: 1fr 1.05fr 1fr; gap: 4px; align-items: end; }
.ped { text-align: center; }
.ped canvas { width: 100%; height: auto; aspect-ratio: 1 / 1; display: block; }
.ped .pname { font-family: var(--font-h); font-weight: 700; font-size: 12px; background: linear-gradient(#24324a, #121a28); border: 1.5px solid #3c5f95; border-radius: 6px; padding: 3px 4px; margin-top: -10px; position: relative; }
.ped .pfl { display: flex; justify-content: center; gap: 3px; margin-top: 4px; }
.ped .empty { color: var(--muted); font-weight: 800; font-size: 12px; padding: 50px 0; border: 2px dashed #5b4a33; border-radius: 8px; }
.syn { text-align: center; align-self: center; }
.syn .s-ic { font-size: 26px; background: linear-gradient(#2c5ea8, #173564); border: 2px solid #7fc4ff; border-radius: 12px; display: inline-block; padding: 4px 10px; box-shadow: 0 0 14px rgba(80,160,255,0.6); }
.syn .s-l { font-family: var(--font-b); color: var(--blue-l); font-size: 13px; margin-top: 4px; }
.syn .s-n { font-family: var(--font-h); font-weight: 900; font-size: 12px; color: #fff3d0; margin-top: 2px; }
.syn .s-d { font-size: 11px; font-weight: 800; color: #d8ccb2; margin-top: 3px; line-height: 1.25; background: rgba(15,10,6,0.75); border-radius: 6px; padding: 4px; }

/* ---------- алхимия ---------- */
.rack { display: grid; grid-template-columns: 0.85fr 1.6fr; gap: 6px; align-items: center; background: rgba(20,14,9,0.75); border: 1.5px solid var(--panel-b); border-radius: 10px; padding: 6px; }
.rack canvas { width: 100%; height: auto; aspect-ratio: 1 / 1; display: block; }
.rack .rname { font-family: var(--font-h); font-weight: 700; font-size: 12px; text-align: center; margin-top: -6px; }
.seq-h { font-family: var(--font-h); font-weight: 700; font-size: 12px; color: #e8dcc0; margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.slot { border: 2px solid #5b4a33; border-radius: 8px; background: linear-gradient(#2c2219, #17110b); padding: 3px 2px 4px; text-align: center; color: var(--text); }
.slot.pick { border-color: var(--blue-l); box-shadow: 0 0 10px rgba(80,160,255,0.6); }
.slot .sl { font-size: 9px; font-weight: 900; color: var(--muted); }
.slot canvas { width: 34px; height: 40px; }
.slot .ln { font-family: var(--font-b); font-size: 11px; }
.panel-box { background: rgba(20,14,9,0.85); border: 1.5px solid var(--panel-b); border-radius: 10px; padding: 7px; }
.box-head { font-family: var(--font-h); font-weight: 700; font-size: 13px; margin-bottom: 6px; color: #f2e5c6; }
.box-head span { display: block; font-family: var(--font); font-weight: 800; font-size: 11px; color: var(--muted); margin-top: 1px; }
.reactions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.rx { border: 1.5px solid #4a3b28; border-radius: 8px; padding: 5px 6px; background: rgba(10,7,4,0.7); opacity: 0.6; }
.rx.on { opacity: 1; border-color: #b3893d; box-shadow: 0 0 10px rgba(255,190,90,0.25) inset; }
.rx .rf { font-weight: 900; font-size: 11px; }
.rx .rn { font-family: var(--font-b); font-size: 15px; }
.rx .rd { font-size: 10.5px; font-weight: 800; color: #cbbd9f; line-height: 1.2; }
.rx .rv { font-size: 9.5px; font-weight: 900; color: var(--blue-l); }
.liquids { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.liq { border: 2px solid #5b4a33; border-radius: 8px; background: linear-gradient(#2c2219, #17110b); text-align: center; padding: 4px 2px; color: var(--text); }
.liq canvas { width: 34px; height: 40px; }
.liq .ln { font-family: var(--font-b); font-size: 12px; }
.liq .lh { font-size: 9.5px; font-weight: 800; color: var(--muted); }
.liq.armed { border-color: var(--blue-l); }

/* ---------- навигация ---------- */
.nav { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: 1fr 1fr 1.5fr 1fr 1fr; align-items: end; gap: 2px; padding: 0 4px max(6px, env(safe-area-inset-bottom)); background: linear-gradient(rgba(20,14,9,0), #1a120b 30%); }
.tab { background: linear-gradient(#2b221a, #17110b); border: 1.5px solid #4a3b28; border-radius: 8px 8px 4px 4px; color: #cfc2a6; font-family: var(--font-b); font-size: 11px; padding: 4px 0 5px; display: flex; flex-direction: column; align-items: center; }
.tab .ti { font-size: 20px; line-height: 1.2; }
.tab.on { color: #fff; border-color: var(--blue-l); background: linear-gradient(#24477e, #142846); box-shadow: 0 -2px 0 var(--blue) inset; }
.tab:disabled { opacity: 0.45; }
.battle-btn { font-family: var(--font-b); font-size: 26px; color: #fff; padding: 10px 4px 12px; border-radius: 12px; border: 3px solid #c9a24a; background: linear-gradient(#3a8cff, #1e57c8 60%, #143b8a); text-shadow: 0 3px 0 #0b2456; box-shadow: 0 4px 0 #6a4f1c, 0 8px 20px rgba(0,0,0,0.5); margin-bottom: 2px; }
.battle-btn:disabled { filter: grayscale(0.8) brightness(0.7); }
.battle-btn span { font-size: 22px; }

/* ---------- бой ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud .top { position: absolute; top: 0; left: 0; right: 0; display: grid; grid-template-columns: minmax(0, 1fr) 62px minmax(0, 1fr); gap: 4px; padding: max(6px, env(safe-area-inset-top)) 6px 0; align-items: start; }
#hud .bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 6px max(6px, env(safe-area-inset-bottom)); }
.mine { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 5px; pointer-events: auto; }
.fcard { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 5px; align-items: center; background: var(--panel); border: 2px solid #3c5f95; border-radius: 8px; padding: 4px 6px 4px 4px; }
.fcard.enemy { border-color: #8f3a33; }
.fcard canvas { width: 38px; height: 38px; border-radius: 6px; background: #2a2016; border: 1.5px solid rgba(255,255,255,0.25); }
.fcard .fn { font-family: var(--font-h); font-weight: 700; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard .hpb { height: 12px; background: #3a1712; border-radius: 3px; overflow: hidden; position: relative; margin: 2px 0; border: 1px solid #000; }
.fcard .hpb i { display: block; height: 100%; background: linear-gradient(#ff6a5a, var(--hp)); transition: width 0.25s; }
.fcard.mine-c .hpb i { background: linear-gradient(#6fb0ff, #2f7fe0); }
.fcard .hpb em { position: absolute; inset: 0; text-align: center; font-style: normal; font-size: 9.5px; font-weight: 900; line-height: 11px; text-shadow: 0 1px 2px #000; }
.fcard .ffl { display: flex; align-items: center; gap: 3px; min-height: 16px; }
.fcard .ffl canvas { width: 13px; height: 16px; border: none; background: none; border-radius: 0; }
.fcard .ffl canvas.on { width: 17px; height: 20px; filter: drop-shadow(0 0 4px rgba(255,240,180,0.9)); }
.fcard .sts { font-size: 10px; margin-left: auto; }
.fcard.done { opacity: 0.55; }
.fcard.dead { filter: grayscale(1) brightness(0.6); }
.fcard.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--blue), 0 0 12px rgba(80,160,255,0.7); }
.fcard .tag { font-size: 8.5px; font-weight: 900; color: var(--muted); margin-left: 4px; }
.round { text-align: center; background: linear-gradient(#4a3d30, #241b12); border: 2px solid var(--brass-d); border-radius: 8px 8px 16px 16px; padding: 3px 0 4px; }
.round-l { font-family: var(--font-h); font-weight: 700; font-size: 10px; color: #e2d4b4; }
.round-n { font-family: var(--font-b); font-size: 24px; line-height: 1; color: var(--brass-l); text-shadow: 0 2px 0 #000; }
.ovl { font-family: var(--font-b); font-size: 9px; color: #ffb06a; animation: ovl 0.7s ease-in-out infinite alternate; }
@keyframes ovl { to { color: #ff4a2e; } }
.actbar { display: grid; grid-template-columns: 44px 1fr 64px; gap: 6px; align-items: stretch; pointer-events: auto; }
.gear { border-radius: 10px; border: 2px solid #4a3b28; background: #241b12; color: #d6c8aa; font-size: 22px; }
.skip { border-radius: 10px; border: 2px solid #4a3b28; background: linear-gradient(#3a2e22, #1c150e); color: #e8dcc0; font-family: var(--font-b); font-size: 14px; }
.skip:disabled, .bottom.wait .skip { opacity: 0.4; }
.pvcard { background: var(--panel); border: 2px solid #4a6c9e; border-radius: 10px; padding: 5px 8px; min-height: 52px; display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; }
.pvcard .pv-fl { display: flex; gap: 2px; align-items: center; font-weight: 900; }
.pvcard .pv-fl canvas { width: 22px; height: 26px; }
.pvcard .pv-t { font-family: var(--font-b); font-size: 17px; line-height: 1.05; }
.pvcard .pv-d { font-size: 11px; font-weight: 800; color: #d0c3a6; line-height: 1.2; }
.pvcard .pv-h { font-family: var(--font-b); font-size: 12px; color: var(--blue-l); }
.timer { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.timer b { flex: 1; height: 6px; border-radius: 3px; background: rgba(10,7,4,0.85); overflow: hidden; border: 1px solid #4a3b28; }
.timer b i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #3a8cff, #8fd0ff); }
.timer span { font-family: var(--font-b); font-size: 13px; min-width: 18px; }
.timer.low b i { background: linear-gradient(90deg, #ff4a3a, #ffa060); }
.timer.low span { color: #ff6b5a; }
.bottom.wait .timer { visibility: hidden; }

/* ---------- баннеры ---------- */
.banner { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-family: var(--font-b); font-size: 38px; color: #fff; -webkit-text-stroke: 2px var(--ink); text-shadow: 0 4px 0 var(--ink), 0 0 30px rgba(0,0,0,0.6); pointer-events: none; opacity: 0; transform: scale(0.7); transition: opacity 0.2s, transform 0.25s cubic-bezier(.2,1.6,.4,1); z-index: 6; }
.banner.show { opacity: 1; transform: scale(1); }
.banner.p { color: var(--blue-l); } .banner.b { color: #ff9a8a; } .banner.gold { color: var(--brass-l); font-size: 44px; } .banner.rx { font-size: 46px; }
.banner small { display: block; font-size: 16px; -webkit-text-stroke: 1px var(--ink); margin-top: 3px; }

/* ---------- результат ---------- */
#result { justify-content: center; align-items: center; gap: 10px; padding: 30px 12px; background: radial-gradient(circle at 50% 30%, rgba(255,210,120,0.3), rgba(12,8,5,0.85) 70%); }
.res-title { font-family: var(--font-h); font-weight: 900; font-size: 54px; color: var(--brass-l); -webkit-text-stroke: 2px #2a1606; text-shadow: 0 5px 0 #2a1606; padding: 6px 26px; background: linear-gradient(#2c5ea8, #173564); border: 3px solid var(--brass); border-radius: 12px; clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%); }
#result.lose .res-title { background: linear-gradient(#7a2a24, #3e1210); color: #efe4d2; }
.res-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.res-team { background: var(--panel); border: 2px solid #3c5f95; border-radius: 10px; padding: 6px; }
.res-team.enemy { border-color: #8f3a33; }
.rt-h { font-family: var(--font-h); font-weight: 700; font-size: 12px; margin-bottom: 4px; }
.rt-f { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.rt-f div { text-align: center; font-family: var(--font-h); font-weight: 700; font-size: 9.5px; position: relative; }
.rt-f canvas { width: 100%; aspect-ratio: 1 / 1; height: auto; background: #2a2016; border-radius: 6px; }
.rt-f .x { position: absolute; top: 20%; left: 0; right: 0; font-size: 34px; color: #ff4a3a; font-family: var(--font-b); text-shadow: 0 2px 0 #000; }
.rt-f .gone canvas { filter: grayscale(1) brightness(0.6); }
.res-sub { font-weight: 800; color: #d8ccb2; text-align: center; font-size: 13px; }
.big-btn { min-width: 230px; font-family: var(--font-b); font-size: 26px; color: #fff; padding: 8px 26px 10px; border-radius: 12px; border: 3px solid var(--brass); background: linear-gradient(#3a8cff, #1e57c8 60%, #143b8a); text-shadow: 0 3px 0 #0b2456; box-shadow: 0 4px 0 #6a4f1c, 0 8px 22px rgba(0,0,0,0.45); }

.modal { position: absolute; inset: 0; background: rgba(5,3,2,0.72); display: grid; place-items: center; padding: 16px; z-index: 10; }
.panel { background: #1e1610; border: 2px solid var(--panel-b); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; align-items: center; width: 100%; max-width: 390px; }
.panel h2 { font-family: var(--font-h); font-weight: 900; margin: 0 0 4px; font-size: 24px; color: var(--brass-l); }
.panel.help { align-items: stretch; max-height: 90vh; overflow-y: auto; touch-action: pan-y; }
.panel.help p { margin: 0; font-size: 13.5px; line-height: 1.4; color: #e2d6bc; }
.panel.help b { color: #fff0c0; }
.panel.help .big-btn { align-self: center; margin-top: 6px; }

@media (max-height: 720px) { .screen { padding-top: 70px; } .logo-a { font-size: 22px; } .card .cname { font-size: 10.5px; } }

/* ---------- итерация 2 ---------- */
.loading { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-b); font-size: 28px; color: var(--brass-l); background: #120c08; z-index: 20; }
.roster.r2 { grid-template-columns: repeat(2, 1fr); }
.card .cstats { font-size: 10.5px; font-weight: 900; color: #e8dcc0; }
.card .ctrait { font-size: 10px; font-weight: 800; color: var(--blue-l); }
.ped .ptr { font-size: 10px; font-weight: 800; color: var(--muted); margin-top: 3px; line-height: 1.2; }
.syn .s-a { font-size: 10px; font-weight: 900; color: var(--brass); margin-top: 1px; }
.tank { display: grid; grid-template-columns: 0.8fr 1.6fr; gap: 8px; align-items: center; background: rgba(20,14,9,0.75); border: 1.5px solid var(--panel-b); border-radius: 10px; padding: 6px; margin-bottom: 6px; }
.tank canvas { width: 100%; height: auto; aspect-ratio: 1 / 1; display: block; }
.tank .rname { font-family: var(--font-h); font-weight: 700; font-size: 12px; text-align: center; margin-top: -6px; }
.tier { font-size: 10px; color: var(--brass); border: 1px solid var(--brass-d); border-radius: 4px; padding: 0 5px; }
.els { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.elb { border: 2px solid #5b4a33; border-radius: 8px; background: linear-gradient(#2c2219, #17110b); color: var(--text); font-family: var(--font-b); font-size: 13px; padding: 6px 4px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.elb span { font-size: 17px; }
.elb.on { border-color: var(--c); box-shadow: 0 0 12px var(--c), 0 0 0 1px var(--c) inset; color: #fff; }
.el-d { font-size: 11px; font-weight: 800; color: #d0c3a6; margin-top: 6px; line-height: 1.25; }
.fcard .eli { font-size: 13px; }
.fcard .chg { font-size: 11px; background: rgba(255,230,140,0.15); border: 1px solid var(--brass); border-radius: 5px; padding: 0 3px; }

.zoomer { position: absolute; right: 6px; top: 40%; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
.zoomer button { width: 38px; height: 38px; border-radius: 10px; border: 2px solid #4a3b28; background: rgba(24,18,13,0.85); color: #e8dcc0; font-size: 20px; font-weight: 900; }
.gripbar { position: absolute; left: 15%; right: 15%; top: 30%; text-align: center; font-family: var(--font-b); font-size: 18px; color: #ffcf70; text-shadow: 0 2px 0 #000; }
.gripbar b { display: block; height: 10px; border-radius: 5px; background: rgba(10,7,4,0.85); border: 1px solid #ffb040; overflow: hidden; margin-bottom: 4px; }
.gripbar i { display: block; height: 100%; background: linear-gradient(90deg, #ff7a30, #ffd070); }

.flabel { margin-left: -24px; margin-top: -22px; width: 48px; text-align: center; }
.flabel .fl-hp { height: 6px; border-radius: 3px; background: rgba(20,8,6,0.8); border: 1px solid #000; overflow: hidden; }
.flabel .fl-hp i { display: block; height: 100%; background: #e0453b; transition: width 0.25s; }
.flabel.mine .fl-hp i { background: #4aa3ff; }
.flabel .fl-st { font-size: 11px; line-height: 13px; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.flabel .fl-st .ch { background: rgba(30,20,10,0.85); border: 1px solid var(--brass); border-radius: 5px; padding: 0 2px; }
.plabel { margin-left: -9px; margin-top: -10px; font-size: 16px; text-shadow: 0 1px 3px #000; }
.nlabel { margin-left: -50px; margin-top: -16px; width: 100px; text-align: center; font-family: var(--font-b); font-size: 10px; line-height: 1.1; text-shadow: 0 1px 2px #000, 0 0 6px #000; }
.ftext { margin-left: -80px; width: 160px; text-align: center; font-family: var(--font-b); font-size: 22px; color: #fff; -webkit-text-stroke: 1px #1a0e06; text-shadow: 0 2px 0 #1a0e06; white-space: nowrap; }
.ftext small { font-size: 13px; display: block; }
.ftext.fire { color: #ff7a4a; } .ftext.ice { color: #9fe0ff; } .ftext.poison { color: #8dff5a; } .ftext.light { color: #ffe23a; }
.ftext.slam { color: #ffd080; font-size: 24px; } .ftext.ko { color: #ff4a3a; font-size: 34px; } .ftext.gold { color: var(--brass-l); font-size: 18px; }
.ftext.rx { color: #fff3c0; font-size: 28px; } .ftext.charge { color: #ffe9a0; font-size: 18px; } .ftext.node { color: #ffd0a0; font-size: 13px; }
.alabel { margin-left: -70px; margin-top: -12px; width: 140px; text-align: center; font-family: var(--font-b); font-size: 17px; color: #ffd0c0; -webkit-text-stroke: 1px #1a0e06; text-shadow: 0 2px 0 #1a0e06; }
.alabel.rx { color: #fff3c0; font-size: 19px; } .alabel.gold { color: var(--brass-l); font-size: 14px; } .alabel.self { color: #ff9a8a; font-size: 14px; }

/* ---------- главное меню на весь экран без прокрутки (D-064) ---------- */
.screen.meta { overflow: hidden; touch-action: none; height: 100%; padding-left: max(10px, calc((100% - 600px) / 2)); padding-right: max(10px, calc((100% - 600px) / 2)); padding-bottom: max(100px, calc(92px + env(safe-area-inset-bottom))); }
#team.screen { display: grid; grid-template-rows: auto minmax(0, 1.3fr) auto minmax(0, 1fr); gap: 6px; }
.roster.r2 { grid-template-rows: 1fr 1fr; min-height: 0; }
.roster.r2 .card { display: flex; flex-direction: column; min-height: 0; padding-bottom: 3px; }
.roster.r2 .card canvas { flex: 1 1 0; min-height: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }
.pair { min-height: 0; height: 100%; align-items: stretch; }
.ped { display: flex; flex-direction: column; min-height: 0; justify-content: flex-end; }
.ped canvas { flex: 1 1 0; min-height: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }
.ped .ptr { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.syn .s-d { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
#alchemy.screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 6px; }
#tanks { display: grid; grid-template-rows: 1fr 1fr; gap: 6px; min-height: 0; }
.tank { margin: 0; min-height: 0; height: 100%; }
.tank > div:first-child { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.tank canvas { flex: 1 1 0; min-height: 0; height: 100%; aspect-ratio: auto; object-fit: contain; }
.tank .elb { padding: 4px; font-size: 12px; }
.tank .el-d { font-size: 10.5px; }
#alchemy .reactions { grid-template-columns: repeat(3, 1fr); gap: 4px; }
#alchemy .rx { padding: 3px 5px; }
#alchemy .rx .rn { font-size: 12.5px; line-height: 1.1; }
#alchemy .rx .rd { font-size: 9.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#alchemy .rx .rv { font-size: 9px; }
#alchemy .box-head span { font-size: 10px; }
#hud .top, #hud .bottom { max-width: 640px; margin: 0 auto; }
@media (max-height: 700px) { .card .ctrait, #alchemy .rx .rd { display: none; } .screen.meta { padding-top: 64px; } }
.tank .rname { margin-top: 0; font-size: 11px; white-space: nowrap; }

/* ---------- значки свойств и порядок хода (D-070) ---------- */
.tbadge { pointer-events: auto; display: inline-flex; align-items: center; gap: 5px; background: var(--panel); border: 2px solid #3c5f95; border-radius: 999px; padding: 2px 10px 2px 4px; font-family: var(--font-h); font-size: 10.5px; color: #f3e6c6; white-space: nowrap; }
.tbadge .ti { font-size: 16px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(#2c5ea8, #173564); border: 1.5px solid #7fc4ff; }
.tbadge.enemy { position: absolute; top: calc(max(6px, env(safe-area-inset-top)) + 60px); right: 8px; border-color: #8f3a33; }
.tbadge.enemy .ti { background: linear-gradient(#a8352c, #5a1712); border-color: #ff9a8a; }
.tbadge.mine { margin: 0 0 5px 2px; }
.order { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.order .o-h { font-family: var(--font-b); font-size: 10px; color: var(--brass-l); text-shadow: 0 1px 2px #000; }
.oslot { position: relative; width: 42px; height: 42px; border-radius: 50%; background: rgba(20,14,9,0.9); border: 3px solid #4aa3ff; display: grid; place-items: center; overflow: visible; transition: transform 0.2s; }
.oslot.enemy { border-color: #ff5a4a; }
.oslot canvas { width: 36px; height: 36px; border-radius: 50%; }
.oslot .q { font-family: var(--font-b); font-size: 20px; color: #e8dcc0; }
.oslot i { position: absolute; bottom: -4px; right: -6px; font-style: normal; font-family: var(--font-b); font-size: 11px; background: #1a120b; border: 1.5px solid var(--brass-d); border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; color: var(--brass-l); }
.oslot.done { opacity: 0.4; filter: grayscale(0.7); }
.oslot.now { transform: scale(1.18); box-shadow: 0 0 0 3px #fff, 0 0 14px rgba(255,240,180,0.9); }

/* ---------- плашка заряда комбинации (D-072) ---------- */
.notice { position: absolute; left: 50%; top: calc(max(6px, env(safe-area-inset-top)) + 100px); transform: translateX(-50%); min-width: 230px; max-width: 86%; text-align: center; background: rgba(18,12,8,0.94); border: 3px solid var(--c); border-radius: 14px; padding: 6px 14px 8px; box-shadow: 0 0 18px var(--c); pointer-events: none; animation: npop 0.25s cubic-bezier(.2,1.6,.4,1); }
.notice .n-t { font-family: var(--font-b); font-size: 13px; color: var(--c); letter-spacing: 0.5px; }
.notice .n-m { font-family: var(--font-b); font-size: 21px; color: #fff; text-shadow: 0 2px 0 #000; }
.notice .n-m b { color: var(--c); font-weight: normal; }
.notice .n-s { font-size: 11px; font-weight: 800; color: #d8ccb2; }
@keyframes npop { from { transform: translateX(-50%) scale(0.7); opacity: 0; } }

/* главное меню: три кнопки — Алхимия, Битва, Команда (D-087) */
.nav { grid-template-columns: 1fr 1.35fr 1fr; gap: 8px; padding-left: max(10px, calc((100% - 520px) / 2)); padding-right: max(10px, calc((100% - 520px) / 2)); }
.nav .tab { font-size: 13px; padding: 6px 0 7px; }
.nav .tab .ti { font-size: 24px; }

/* совет перед матчем (D-088) */
.tipbox { position: absolute; inset: 0; z-index: 12; background: rgba(6,4,2,0.78); display: grid; place-items: center; padding: 20px; animation: tipin 0.3s ease-out; }
@keyframes tipin { from { opacity: 0; } }
.tip-card { max-width: 360px; text-align: center; background: linear-gradient(#2a2016, #17110b); border: 2px solid var(--brass); border-radius: 16px; padding: 18px 18px 14px; box-shadow: 0 0 40px rgba(255,200,100,0.25); }
.tip-h { font-family: var(--font-h); font-weight: 700; font-size: 12px; color: var(--muted); letter-spacing: 2px; }
.tip-ic { font-size: 44px; margin: 6px auto 2px; width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(#2c5ea8, #173564); border: 2px solid #7fc4ff; box-shadow: 0 0 18px rgba(80,160,255,0.6); }
.tip-n { font-family: var(--font-b); font-size: 24px; color: var(--brass-l); margin-top: 6px; }
.tip-t { font-size: 15px; font-weight: 800; line-height: 1.4; color: #efe3c8; margin-top: 8px; }
.tip-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.12); overflow: hidden; margin-top: 14px; }
.tip-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #3a8cff, #8fd0ff); }
.tip-s { font-size: 11px; font-weight: 800; color: var(--muted); margin-top: 6px; }

/* таймер хода — кольцо под номером раунда, на виду, но вне поля (D-093) */
#timer { display: none !important; }
.round { position: relative; padding-bottom: 6px; }
.tring { position: relative; width: 50px; height: 50px; margin: 4px auto 0; transition: opacity 0.2s, transform 0.2s; }
.tring.off { opacity: 0; transform: scale(0.6); }
.tring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tring circle { fill: rgba(12,8,5,0.9); stroke-width: 4.5; }
.tring .bg { stroke: rgba(255,255,255,0.12); }
.tring .fg { fill: none; stroke: #5fb0ff; stroke-linecap: round; stroke-dasharray: 106.8; stroke-dashoffset: 0; transition: stroke-dashoffset 0.15s linear; filter: drop-shadow(0 0 3px rgba(95,176,255,0.8)); }
.tring span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-b); font-size: 19px; color: #fff; text-shadow: 0 2px 0 #000; }
.tring.low .fg { stroke: #ff5a3a; filter: drop-shadow(0 0 4px rgba(255,90,58,0.9)); }
.tring.low span { color: #ffb0a0; animation: tlow 0.5s ease-in-out infinite alternate; }
@keyframes tlow { to { transform: scale(1.18); } }
.ftext.big { font-size: 28px; color: #ffd0c0; }

/* ===== Relay Alchemy (ветка Quoridor, D-120): команда из трёх, HUD 3×3, последовательность, клетки ===== */
#team.screen { grid-template-rows: auto minmax(0, 1.6fr) auto auto; }
.roster.r4 { grid-template-columns: repeat(4, 1fr); gap: 5px; min-height: 0; }
.roster.r4 .card { display: flex; flex-direction: column; min-height: 0; padding-bottom: 3px; }
.roster.r4 .card canvas { flex: 1 1 auto; min-height: 0; object-fit: contain; }
.roster.r4 .cstats { font-size: 9.5px; } .roster.r4 .ctrait { font-size: 9px; line-height: 1.15; padding: 0 2px; }
.traits { display: grid; gap: 5px; }
.trc { display: grid; grid-template-columns: 34px 1fr; gap: 7px; align-items: center; background: rgba(20,14,9,0.85); border: 1.5px solid #3c5f95; border-radius: 9px; padding: 5px 7px; }
.trc .tr-ic { font-size: 20px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(#2c5ea8, #173564); border: 1.5px solid #7fc4ff; }
.trc .tr-n { font-family: var(--font-h); font-weight: 900; font-size: 11.5px; color: #fff3d0; }
.trc .tr-n small { font-family: var(--font); font-size: 9.5px; color: var(--brass); font-weight: 900; }
.trc .tr-d { font-size: 10.5px; font-weight: 800; color: #d8ccb2; line-height: 1.2; }
#alchemy .rx .rn small { display: block; font-family: var(--font); font-size: 9px; color: var(--brass); }
#alchemy .rx .rd { display: block; -webkit-line-clamp: unset; overflow: visible; }
#alchemy .reactions { grid-template-columns: repeat(2, 1fr); }

#hud .top { grid-template-columns: minmax(0, 1fr) 64px; }
.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; pointer-events: auto; }
.cards3.mine { margin-bottom: 5px; }
.cards3 .fcard { grid-template-columns: 30px minmax(0, 1fr); gap: 4px; padding: 3px 4px 3px 3px; border-radius: 7px; }
.fcard .fpic canvas { width: 30px; height: 30px; border-radius: 5px; background: #2a2016; border: 1.5px solid rgba(255,255,255,0.25); display: block; }
.cards3 .fcard .fn { font-size: 9.5px; }
.cards3 .fcard .hpb { height: 10px; } .cards3 .fcard .hpb em { font-size: 8.5px; line-height: 9px; }
.cards3 .fcard .ffl { min-height: 14px; gap: 2px; font-size: 10px; flex-wrap: nowrap; overflow: hidden; }
.fcard .emp { font-size: 9px; font-weight: 900; color: #ffb08a; white-space: nowrap; }
.fcard .hm { font-size: 8px; font-weight: 900; color: var(--blue-l); margin-left: auto; }
.pips { display: inline-flex; gap: 2px; align-items: center; }
.pips i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--c); background: transparent; display: block; }
.pips i.on { background: var(--c); box-shadow: 0 0 5px var(--c); }
.turnbox { text-align: center; background: linear-gradient(#4a3d30, #241b12); border: 2px solid var(--brass-d); border-radius: 8px 8px 16px 16px; padding: 2px 0 3px; }
.turnbox.mine { border-color: #4aa3ff; } .turnbox.enemy { border-color: #ff5a4a; }
.turnbox .tb-l { font-family: var(--font-h); font-weight: 900; font-size: 8.5px; color: #e2d4b4; }
.turnbox .tb-n { font-family: var(--font-b); font-size: 20px; line-height: 1; color: var(--brass-l); text-shadow: 0 2px 0 #000; }
.tbadges { display: flex; gap: 4px; pointer-events: auto; flex-wrap: wrap; }
.tbadges.enemy { position: absolute; top: calc(max(6px, env(safe-area-inset-top)) + 54px); right: 6px; justify-content: flex-end; max-width: 70%; }
.tbadges.mine { margin: 0 0 5px 0; }
.tbadges .tb { display: inline-flex; align-items: center; gap: 4px; background: var(--panel); border: 2px solid #3c5f95; border-radius: 999px; padding: 1px 8px 1px 2px; font-family: var(--font-h); font-size: 9px; color: #f3e6c6; white-space: nowrap; }
.tbadges .tb .ti { font-size: 13px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(#2c5ea8, #173564); border: 1.5px solid #7fc4ff; }
.tbadges.enemy .tb { border-color: #8f3a33; } .tbadges.enemy .tb .ti { background: linear-gradient(#a8352c, #5a1712); border-color: #ff9a8a; }
.seq { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 3px; align-items: center; pointer-events: auto; background: rgba(15,10,6,0.6); border: 1.5px solid #4a3b28; border-radius: 10px; padding: 4px 2px; }
.seq .sq-h { font-family: var(--font-b); font-size: 10px; color: var(--brass-l); }
.seq .sq { display: grid; grid-template-columns: 9px 26px 9px; align-items: center; }
.seq .sq.past { opacity: 0.35; }
.seq .sqi { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: rgba(10,7,4,0.9); border: 2px solid var(--c); box-shadow: 0 0 6px var(--c); }
.seq .mk { font-size: 9px; line-height: 1; } .seq .mk.me { color: #4aa3ff; text-align: right; } .seq .mk.foe { color: #ff5a4a; }
.actbar { grid-template-columns: 44px 1fr 74px; }
.acts { display: grid; grid-template-rows: 1fr 1fr; gap: 4px; }
.acts .skip { font-size: 12px; padding: 0; }
.acts .recall { border-color: #3c5f95; color: #bfe0ff; }
.acts .recall:disabled { opacity: 0.35; }
.flabel .fl-st { font-size: 10px; } .flabel .fl-st .eli { font-size: 11px; margin-right: 1px; }
.flabel .pips i { width: 7px; height: 7px; }
.flabel .emp { font-size: 9px; font-weight: 900; color: #ffb08a; background: rgba(20,10,6,0.75); border-radius: 4px; padding: 0 3px; }
.res-teams { grid-template-columns: 1fr; }
.res-team .rt-f { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.res-team .rt-f canvas { width: 100%; max-width: 110px; margin: 0 auto; display: block; }
.tbadges.enemy .tb { padding: 1px; } .tbadges.enemy .tb b { display: none; }
.flabel .emp.ice, .fcard .emp.ice { color: #bfefff; }
.ftext.ice, .alabel.ice { color: #bfefff; }
/* подпись над жабой: крупный бейдж элемента и точки зарядов (D-132) */
.flabel { width: 64px; margin-left: -32px; margin-top: -30px; }
.flabel .fl-st { display: flex; align-items: center; justify-content: center; gap: 3px; margin-bottom: 2px; }
.flabel .elb { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: rgba(12,8,4,0.85); border: 2px solid var(--c); box-shadow: 0 0 8px var(--c); }
.flabel .pips { gap: 3px; background: rgba(12,8,4,0.7); border-radius: 8px; padding: 2px 4px; }
.flabel .pips i { width: 10px; height: 10px; border-width: 2px; }
.flabel .pips i.on { box-shadow: 0 0 6px var(--c), inset 0 -2px 0 rgba(0,0,0,0.25); }
.flabel .emp { font-size: 10px; padding: 1px 4px; }
/* экран команды по макету автора (D-135): жабы слева столбиком, свойства пар справа, стрелки между ними */
#team.screen { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; }
.teamwrap { position: relative; display: grid; grid-template-columns: 34% 1fr; gap: 34px; min-height: 0; }
.roster.rv { display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); grid-template-columns: 1fr; gap: 8px; min-height: 0; }
.roster.rv .card { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 0; padding: 2px 2px 4px; border-color: #8f3a33; background: linear-gradient(#3a2420, #1c120e); }
.roster.rv .card canvas { flex: 1 1 0; min-height: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }
.roster.rv .card.sel { border-color: #ff8a6a; box-shadow: 0 0 0 2px #ff5a4a, 0 0 16px rgba(255,90,74,0.6); }
.roster.rv .card .check { background: #e0453b; bottom: auto; top: 4px; right: 4px; }
.roster.rv .cname { font-size: 11px; } .roster.rv .cstats { font-size: 9px; }
.teamwrap .traits { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; min-height: 0; }
.teamwrap .trc { border: 2px solid var(--tc, #3c5f95); box-shadow: 0 0 12px color-mix(in srgb, var(--tc, #3c5f95) 40%, transparent); padding: 7px 8px; }
.teamwrap .trc.new { animation: trIn 0.35s ease-out; }
@keyframes trIn { from { opacity: 0; transform: translateX(24px) scale(0.96); } to { opacity: 1; transform: none; } }
.teamwrap .trc .tr-ic { background: radial-gradient(circle, color-mix(in srgb, var(--tc, #2c5ea8) 60%, #000), #120c08); border-color: var(--tc, #7fc4ff); }
.trc .tr-p { font-size: 9.5px; font-weight: 900; color: var(--tc, #bfe0ff); margin: 1px 0 2px; }
.tr-empty { color: var(--muted); font-weight: 800; font-size: 12px; text-align: center; border: 2px dashed #5b4a33; border-radius: 10px; padding: 18px 10px; }
.tarrows { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.battle-btn.off { filter: grayscale(0.7) brightness(0.7); }
.counter.shake { animation: shk 0.4s; color: #ff8a6a; }
@keyframes shk { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
/* цель матча на стартовом окне (D-136) */
.tip-g { font-family: var(--font-b); font-size: 15px; color: #ffd36a; letter-spacing: 1px; margin-top: 2px; }
.tip-t .tip-goal { font-size: 15px; color: #fff3d0; background: rgba(255,200,90,0.12); border: 1.5px solid #c99a3d; border-radius: 10px; padding: 8px 10px; margin: 6px 0 8px; }
.tip-t p { margin: 4px 0; }
.tip-ic { width: auto !important; min-width: 0; padding: 4px 16px; border-radius: 999px !important; white-space: nowrap; display: inline-flex !important; align-items: center; gap: 6px; font-size: 34px !important; height: auto !important; }
/* экран команды — треугольник слотов по макету автора (D-138) */
.tri { position: relative; min-height: 0; }
.tri .tarrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 1; }
.tslot { position: absolute; width: 31%; height: 25%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 2px 2px 4px; border: 2.5px solid #c0473b; border-radius: 12px; background: linear-gradient(#3a2420, #1c120e); color: var(--text); box-shadow: 0 0 14px rgba(255,90,74,0.35); z-index: 2; }
.tslot canvas { flex: 1 1 0; min-height: 0; width: 100%; height: 100%; object-fit: contain; }
.tslot .cname { font-family: var(--font-h); font-weight: 700; font-size: 11px; }
.tslot.empty { border-style: dashed; box-shadow: none; background: rgba(28,18,14,0.75); justify-content: center; }
.tslot .plus { font-size: 34px; color: #ff8a6a; line-height: 1; }
.tslot.empty .cname { font-size: 9.5px; color: var(--muted); margin-top: 4px; }
.tslot[data-i="0"] { left: 34.5%; top: 1%; }
.tslot[data-i="1"] { left: 2%; top: 45%; }
.tslot[data-i="2"] { right: 2%; top: 45%; }
.syn2 { position: absolute; width: 36%; min-height: 15%; padding: 7px 9px; border: 2px solid #3f8f3a; border-radius: 999px / 60%; background: rgba(14,26,12,0.88); color: #e8f5e0; display: flex; flex-direction: column; justify-content: center; text-align: center; z-index: 2; box-shadow: 0 0 12px rgba(125,223,106,0.25); }
.syn2[data-p="0-1"] { left: 0; top: 23%; }
.syn2[data-p="0-2"] { right: 0; top: 23%; }
.syn2[data-p="1-2"] { left: 18%; width: 64%; top: 76%; }
.syn2:not(.on) { border-style: dashed; border-color: #5b4a33; background: rgba(20,14,9,0.6); box-shadow: none; }
.s2-empty { font-size: 10px; font-weight: 800; color: var(--muted); }
.s2-h { font-family: var(--font-h); font-weight: 900; font-size: 11px; color: #fff3d0; display: flex; align-items: center; justify-content: center; gap: 4px; }
.s2-ic { font-size: 16px; }
.s2-w { font-size: 8.5px; font-weight: 900; color: #7ddf6a; margin: 1px 0; }
.s2-d { font-size: 9.5px; font-weight: 800; color: #d8e8cc; line-height: 1.2; }
.pop { animation: popIn 0.3s ease-out; }
@keyframes popIn { from { transform: scale(0.85); opacity: 0.3; } to { transform: none; opacity: 1; } }
.tslot[data-i="0"].pop { animation: popIn 0.3s ease-out; }
.pickpop { position: absolute; inset: 0; z-index: 40; background: rgba(8,5,3,0.72); display: grid; place-items: center; padding: 16px; }
.pickpop.hidden { display: none; }
.pp-card { width: 100%; max-width: 420px; background: linear-gradient(#1c2740, #0f1626); border: 2.5px solid #4a6fd0; border-radius: 14px; padding: 10px; box-shadow: 0 0 30px rgba(74,111,208,0.5); text-align: center; }
.pp-h { font-family: var(--font-b); font-size: 18px; color: #bfd4ff; margin-bottom: 8px; }
.pp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.ppf { padding-bottom: 5px; border-color: #3c5f95; position: relative; }
.ppf canvas { width: 100%; aspect-ratio: 1 / 1; height: auto; }
.ppf.sel { border-color: #ff8a6a; box-shadow: 0 0 0 2px #ff5a4a; }
.ppf.other { opacity: 0.85; }
.ppf .pp-tag { position: absolute; top: 4px; left: 4px; right: 4px; font-size: 8.5px; font-weight: 900; color: #ffd36a; text-shadow: 0 1px 2px #000; }
.ppf .ctrait { font-size: 9px; }
.tslot { height: 22%; }
.tslot[data-i="0"] { top: 0; } .tslot[data-i="1"], .tslot[data-i="2"] { top: 52%; }
.syn2[data-p="0-1"], .syn2[data-p="0-2"] { top: 27%; width: 41%; }
.syn2[data-p="1-2"] { top: 80%; }
.battle-btn.off { white-space: nowrap; font-size: 18px; }
/* блоки свойств крупнее, с мини-превью (D-139) */
.syn2 { padding: 6px 10px; }
.s2-h { font-size: 13px; }
.s2-ic { font-size: 18px; }
.s2-w { font-size: 9.5px; letter-spacing: 0.5px; }
.s2-d { font-size: 12px; line-height: 1.25; color: #f0f8ea; }
.s2-pv { width: 100%; height: 50px; display: block; margin: 1px 0; }
.syn2[data-p="1-2"] .s2-pv { height: 44px; }
.syn2[data-p="0-1"], .syn2[data-p="0-2"] { top: 24.5%; }
.syn2[data-p="0-1"] .s2-pv, .syn2[data-p="0-2"] .s2-pv { height: 40px; }
.tslot { height: 20.5%; }
.tslot[data-i="1"], .tslot[data-i="2"] { top: 57%; }
.syn2[data-p="1-2"] { top: 80.5%; }
/* 6.0 — Relay Alchemy 2 (D-141…D-152) */
#team.screen { grid-template-rows: auto minmax(0, 1fr); }
.tslot[data-i="1"], .tslot[data-i="2"] { top: 50%; }
.perkb[data-s="0"] { left: 26%; width: 48%; top: 21.5%; }
.perkb[data-s="1"] { left: 0; width: 48.5%; top: 72%; }
.perkb[data-s="2"] { right: 0; width: 48.5%; top: 72%; }
.perkb .s2-pv { height: 40px; }
.verbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 2px 0 8px; }
.vb { display: flex; flex-direction: column; align-items: center; gap: 1px; border: 2px solid #4a3b28; border-radius: 9px; padding: 4px 2px; background: rgba(10,7,4,0.7); opacity: 0.45; }
.vb.on { opacity: 1; border-color: var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 45%, transparent); }
.vb .vb-i { font-size: 20px; line-height: 1.1; }
.vb b { font-family: var(--font-h); font-size: 9.5px; }
.vb em { font-style: normal; font-family: var(--font-b); font-size: 12px; color: var(--c); }
.rx .rv { color: #ffd36a; font-size: 10.5px; }
.seq.hidden { display: none; }
.seq .sq-h { font-family: var(--font-b); font-size: 9px; letter-spacing: 0.5px; }
.seq .sq-h.me { color: #7fc4ff; } .seq .sq-h.foe { color: #ff9a8a; }
.seq .sqi { width: 22px; height: 22px; font-size: 12px; opacity: 0.7; }
.seq .sqi.first { width: 28px; height: 28px; font-size: 15px; opacity: 1; }
.seq .sq-sep { width: 70%; height: 1.5px; background: #4a3b28; margin: 2px 0; }
.fcard { position: relative; }
.fcard .home { position: absolute; right: -5px; top: -7px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #7fc4ff; background: linear-gradient(#2c5ea8, #173564); color: #fff; font-size: 14px; font-weight: 900; line-height: 1; padding: 0; display: grid; place-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.6); pointer-events: auto; z-index: 3; }
.fcard .home.hidden { display: none; }
.fcard .home:disabled { opacity: 0.3; }
.fcard .home.hot { animation: homeHot 1.1s infinite; border-color: #ffd36a; }
@keyframes homeHot { 50% { box-shadow: 0 0 12px #ffd36a; transform: scale(1.12); } }
.fcard .fpk { margin-right: 2px; }
.emp.dry { color: #d8d0c4 !important; } .emp.anc { color: #ffd070 !important; }
.flabel .pk { font-size: 12px; filter: drop-shadow(0 1px 1px #000); }
.flabel .emp.dry { background: rgba(60,56,50,0.85); }
.acts { grid-template-rows: 1fr; }
/* 6.1 — пустая жаба стоит (D-153), подсказки первого матча (D-154) */
.emp.empty { color: #d8d0c4 !important; background: rgba(60,56,50,0.85); border-radius: 4px; padding: 0 3px; }
.fcard.empty { filter: saturate(0.45); }
.fcard.empty .home { filter: none; }
.fcard .home.nudge { animation: homeNudge 0.6s ease-out 2; }
@keyframes homeNudge { 0%, 100% { transform: none; } 30% { transform: translateY(-8px) scale(1.25); box-shadow: 0 0 14px #ffd36a; } 60% { transform: translateY(0) scale(1.1); } }
.coach { position: absolute; inset: 0; z-index: 30; background: rgba(6,4,2,0.45); display: flex; align-items: flex-end; justify-content: center; padding: 0 12px calc(170px + env(safe-area-inset-bottom)); pointer-events: auto; }
.coach.top { align-items: flex-start; padding: calc(max(6px, env(safe-area-inset-top)) + 70px) 12px 0; }
.coach.hidden, .coach-ring.hidden, .ghost.hidden { display: none; }
.co-card { width: 100%; max-width: 380px; background: linear-gradient(#2a1f14, #160f09); border: 3px solid #ffd36a; border-radius: 16px; padding: 10px 14px 12px; box-shadow: 0 0 26px rgba(255,200,90,0.45), 0 6px 18px rgba(0,0,0,0.6); animation: coPop 0.3s cubic-bezier(.2,1.6,.4,1); }
@keyframes coPop { from { transform: scale(0.8); opacity: 0; } }
.co-n { font-family: var(--font-b); font-size: 10px; letter-spacing: 1px; color: #c9a65a; }
.co-h { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; }
.co-ic { font-size: 28px; line-height: 1; }
.co-t { font-family: var(--font-b); font-size: 22px; color: #ffd36a; text-shadow: 0 2px 0 #000; }
.co-x { font-size: 14px; font-weight: 800; color: #f3e6c6; line-height: 1.3; }
.co-x b { color: #ffd36a; }
.co-b { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.co-b .big-btn { padding: 8px 22px; font-size: 16px; margin: 0; }
.co-b .chip { font-size: 11px; opacity: 0.8; }
.coach-ring { position: absolute; left: 0; top: 0; z-index: 31; border-radius: 50%; border: 4px solid #ffd36a; box-shadow: 0 0 0 4px rgba(0,0,0,0.35), 0 0 24px #ffd36a, inset 0 0 18px rgba(255,211,106,0.5); pointer-events: none; animation: ringPulse 1.1s ease-in-out infinite; }
@keyframes ringPulse { 50% { box-shadow: 0 0 0 4px rgba(0,0,0,0.35), 0 0 40px #ffd36a, inset 0 0 26px rgba(255,211,106,0.7); border-color: #fff3c0; } }
.coach-hi { position: relative; z-index: 32; box-shadow: 0 0 0 3px #ffd36a, 0 0 22px #ffd36a !important; border-radius: 10px; animation: ringPulse 1.1s ease-in-out infinite; }
.ghost { position: absolute; left: 0; top: 0; z-index: 9; font-size: 36px; pointer-events: none; filter: drop-shadow(0 2px 3px #000); animation: ghostPull 1.6s ease-in-out infinite; }
@keyframes ghostPull { 0% { margin-top: 0; opacity: 0; } 15% { opacity: 1; } 70% { margin-top: 70px; opacity: 1; } 100% { margin-top: 70px; opacity: 0; } }
/* 6.2 — очередь NEXT у своей колбы, «⟲ Домой» на плашках (D-156) */
.nextq { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: auto; background: rgba(12,16,26,0.82); border: 2px solid #4a6fd0; border-radius: 12px; padding: 3px 6px 5px; box-shadow: 0 0 12px rgba(74,111,208,0.45); }
.nextq.hidden { display: none; }
.nextq .nq-h { font-family: var(--font-b); font-size: 10px; letter-spacing: 1px; color: #9fc6ff; text-align: center; line-height: 1.2; }
.nextq .nq-row { display: flex; align-items: center; gap: 4px; }
.nextq .nq-i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: rgba(10,7,4,0.9); border: 2px solid var(--c); box-shadow: 0 0 6px var(--c); opacity: 0.75; }
.nextq .nq-i.first { width: 32px; height: 32px; font-size: 17px; opacity: 1; box-shadow: 0 0 12px var(--c); }
.nextq.pop .nq-i.first { animation: popIn 0.35s ease-out; }
.fcard .home { width: 38px; height: 38px; right: -8px; top: -12px; font-size: 22px; border: 2.5px solid #7fc4ff; background: radial-gradient(circle at 40% 35%, #34558e, #142546); box-shadow: 0 2px 6px rgba(0,0,0,0.7), 0 0 8px rgba(127,196,255,0.45); }
.fcard .homecta { display: none; position: absolute; top: -3px; right: -3px; bottom: -3px; left: 32px; z-index: 3; border-radius: 9px; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: linear-gradient(rgba(58,42,12,0.95), rgba(26,18,6,0.95)); border: 3px solid #ffd36a; box-shadow: 0 0 14px rgba(255,211,106,0.75); pointer-events: none; animation: ctaPulse 1.2s ease-in-out infinite; }
.fcard.cta { cursor: pointer; filter: none; pointer-events: auto; }
.fcard.cta .homecta { display: flex; }
.fcard .homecta b { font-family: var(--font-b); font-size: 18px; font-weight: normal; color: #ffd36a; text-shadow: 0 2px 0 #000; line-height: 1; white-space: nowrap; }
.fcard .homecta small { font-size: 9px; font-weight: 900; color: #f3e6c6; white-space: nowrap; }
@keyframes ctaPulse { 50% { box-shadow: 0 0 24px rgba(255,211,106,1); border-color: #fff0b0; } }
.fcard.nudge { animation: cardNudge 0.55s ease-out 2; }
@keyframes cardNudge { 0%, 100% { transform: none; } 25% { transform: translateY(-6px) rotate(-2deg); } 50% { transform: translateY(0) rotate(2deg); } 75% { transform: translateY(-3px); } }
