/* ПОКЕР-ШКОЛА — темний зал, зелене сукно столу, чотириколірна колода, латунні
   фішки банку. Підказки тренера — спокійним блоком під твоїми картами. */
:root {
  --bg: #0f1a16;
  --bg-2: #16251f;
  --bg-3: #1e3029;
  --bg-4: #2d4a3e;
  --ink: #f2efe6;
  --muted: #a9bbb1;
  --dim: #6f8479;
  --fire: #e8c27a;
  --fire-ink: #1f1606;
  --ember: #e8c27a;
  --water: #2f6fd6;
  --water-ink: #0b1a33;
  --block: #8f7ae0;
  --block-ink: #1d1240;
  --leaf: #3fbf77;
  --danger: #e5484d;
  --danger-ink: #ffc9c9;
  --ash: #1a2420;
  --tree-a: #16251f; --tree-b: #16251f; --tree-c: #16251f; --tree-d: #16251f;
  --felt: #13573b;
  --felt-2: #0d3f2b;
  --radius: 14px;
  --f-display: "Unbounded", "Arial Black", Impact, sans-serif;
  --f-body: "Onest", "Segoe UI", Roboto, system-ui, sans-serif;
  --f-data: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse 80% 45% at 50% 108%, rgba(63, 191, 119, 0.10), transparent 70%),
    radial-gradient(ellipse 60% 35% at 50% -10%, rgba(243, 236, 224, 0.06), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
button, [role="button"] { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 2px; border-radius: 8px; }
.noscript { padding: 24px; text-align: center; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

#app { max-width: 1120px; margin: 0 auto; min-height: 100%; padding-top: var(--safe-top); padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }

/* ---------- boot ---------- */
.boot { min-height: 80vh; display: grid; place-content: center; gap: 18px; justify-items: center; }
.boot-logo { font-family: var(--f-display); font-size: 40px; color: var(--ember); letter-spacing: 0.03em; line-height: 0.95; text-align: center; text-shadow: 0 0 30px rgba(232, 194, 122, 0.3); }
.boot-flame { width: 44px; height: 56px; color: var(--ember); animation: flick 0.9s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.boot-flame svg { width: 100%; height: 100%; }
@keyframes flick { from { transform: scale(1, 0.94) rotate(-2deg); opacity: 0.85; } to { transform: scale(1.04, 1.06) rotate(2deg); opacity: 1; } }

/* ---------- buttons ---------- */
.btn { border: 0; border-radius: 12px; padding: 12px 14px; font-weight: 700; font-size: 15px; background: var(--bg-3); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform 0.08s, background 0.2s, opacity 0.2s; min-height: 46px; text-align: center; line-height: 1.15; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn.primary, .btn.tone-fire { background: var(--fire); color: var(--fire-ink); }
.btn.green { background: var(--leaf); color: #052e16; }
.btn.tone-water { background: var(--water); color: var(--water-ink); }
.btn.tone-block { background: var(--block); color: var(--block-ink); }
.btn.tone-wind { background: #c9d3df; color: #16202b; }
.btn.tone-danger, .btn.danger-solid { background: var(--danger); color: #fff; }
.btn.danger { background: transparent; color: var(--danger-ink); box-shadow: inset 0 0 0 1.5px rgba(239, 68, 68, 0.6); }
.btn.bucket { background: #1f3a4a; color: #d6f4ff; box-shadow: inset 0 0 0 1.5px rgba(76, 201, 240, 0.6); }
.btn.reckless { background: #4a1f1f; color: #ffd6d6; box-shadow: inset 0 0 0 1.5px rgba(239, 68, 68, 0.6); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bg-4); }
.btn.block { width: 100%; }
.btn:disabled { background: var(--bg-3); color: var(--dim); box-shadow: none; }
.btn.opt { flex-direction: column; gap: 2px; }
.btn.opt small { font-weight: 500; font-size: 12px; opacity: 0.75; }
.icon-btn { border: 0; background: var(--bg-2); width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.link-btn { border: 0; background: none; color: var(--ember); padding: 4px 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 7px; padding: 8px 0 6px; position: sticky; top: 0; z-index: 20; background: linear-gradient(var(--bg) 78%, transparent); }
.logo { font-family: var(--f-display); color: var(--ember); font-size: 19px; letter-spacing: 0.02em; white-space: nowrap; text-shadow: 0 0 14px rgba(232, 194, 122, 0.25); }
.pill { background: var(--bg-2); border-radius: 999px; padding: 4px 10px 4px 6px; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pill b { color: var(--ink); font-family: var(--f-data); font-size: 12px; }
.deck-ico { display: inline-flex; width: 16px; height: 16px; }
.deck-ico svg { width: 100%; height: 100%; }
.wind-pill .wr { display: inline-flex; width: 24px; height: 24px; }
.wind-pill .wr svg { width: 100%; height: 100%; }
.wind-pill b { font-family: var(--f-body); font-weight: 800; }
.wind-pill.spin .wr svg { animation: spin 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes spin { from { transform: rotate(-360deg) scale(1.3); } }
@media (max-width: 380px) { .wind-pill .wl { display: none; } }

/* ---------- players strip ---------- */
.players-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.players-strip::-webkit-scrollbar { display: none; }
.pchip { flex: none; display: flex; align-items: center; gap: 6px; background: var(--bg-2); border-radius: 12px; padding: 4px 10px 4px 4px; box-shadow: inset 0 0 0 1.5px transparent; max-width: 190px; transition: box-shadow 0.2s, opacity 0.3s; }
.pchip .ptw { flex: none; width: 28px; height: 28px; border-radius: 8px; background: rgba(0, 0, 0, 0.25); display: grid; place-items: center; }
.pchip .ptw svg { width: 24px; height: 24px; display: block; }
.pchip .pwho { min-width: 0; display: grid; }
.pchip b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pchip small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pchip.active { box-shadow: inset 0 0 0 2px var(--tw); background: var(--bg-3); }
.pchip.me b { color: var(--ember); }
.pchip.out { opacity: 0.45; filter: grayscale(0.7); }

/* ---------- turn banner ---------- */
.turn { border-radius: 11px; padding: 8px 12px; font-size: 13.5px; font-weight: 600; background: var(--bg-2); color: var(--muted); text-wrap: balance; }
.turn.mine { background: var(--fire); color: var(--fire-ink); }
.turn.ev { background: #2a2140; color: #e9e1ff; }
.turn.mine.ev { background: var(--ember); color: #3a2702; }

/* ---------- event panel (Взаємодопомога) ---------- */
.ev-panel { background: linear-gradient(160deg, #3a2f12, #2a2140); border-radius: 16px; padding: 12px; display: grid; gap: 8px; box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.45), 0 12px 30px rgba(0, 0, 0, 0.4); animation: evIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ev-head { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.ev-panel p { margin: 0; font-size: 13px; color: #efe7d0; }
.eo-ic { display: inline-flex; width: 26px; height: 26px; }
.eo-ic svg { width: 100%; height: 100%; }
.ev-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ev-opt { border: 0; border-radius: 12px; padding: 9px 6px; display: grid; justify-items: center; gap: 3px; text-align: center; color: #160f08; }
.ev-opt b { font-size: 13px; }
.ev-opt small { font-size: 10.5px; line-height: 1.15; opacity: 0.8; }
.ev-opt.o-fire { background: linear-gradient(160deg, #ffe0c2, #ff8a3d); }
.ev-opt.o-block { background: linear-gradient(160deg, #ece6ff, #a48cf0); }
.ev-opt.o-discard3 { background: linear-gradient(160deg, #eef2f7, #a8b5c7); }
.ev-opt.o-discard3 .eo-ic { color: #1b130c; }
@keyframes evIn { from { transform: translateY(-8px) scale(0.98); opacity: 0; } }

/* ---------- table layout ---------- */
.table { display: grid; gap: 8px; padding-bottom: calc(118px + var(--safe-bottom)); }
@media (min-width: 900px) {
  .table { grid-template-columns: minmax(0, 600px) minmax(300px, 1fr); align-items: start; column-gap: 22px; }
  .table > .col-side { position: sticky; top: 58px; }
}
.col-main, .col-side { display: grid; gap: 8px; min-width: 0; }
.sec { display: grid; gap: 7px; }
.sec-title { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.sec-title em { font-style: normal; letter-spacing: 0.03em; text-transform: none; font-weight: 600; color: var(--ink); font-family: var(--f-data); }
.empty-note { font-size: 12.5px; color: var(--dim); padding: 6px 2px; }

/* ---------- board ---------- */
.board-wrap { margin: 0 -8px; }
@media (min-width: 640px) { .board-wrap { margin: 0; } }
.board {
  position: relative; display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); grid-template-rows: repeat(16, minmax(0, 1fr));
  gap: 1px; aspect-ratio: 1; width: 100%; padding: 2px; border-radius: 12px; background: #08100b;
  box-shadow: 0 0 0 1px rgba(167, 179, 160, 0.14), 0 18px 40px rgba(0, 0, 0, 0.45);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.c { position: relative; border-radius: 3px; min-width: 0; min-height: 0; display: grid; place-items: center; }
.c:focus-visible { outline: 2px solid #fff; outline-offset: -2px; z-index: 5; }

/* ліс: ялинка з невеликими варіаціями */
.k-forest {
  background: var(--tree-a) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l5.2 7.6h-2.9l3.8 5.6H4.1l3.6-5.6H4.8z' fill='%23336b3b'/%3E%3Cpath d='M9.2 15.6h1.6v2.6H9.2z' fill='%23243d27'/%3E%3C/svg%3E") 50% 55% / 74% no-repeat;
}
.k-forest.v1 { background-color: var(--tree-b); background-size: 62%; background-position: 38% 62%; }
.k-forest.v2 { background-color: var(--tree-c); background-size: 70%; background-position: 64% 46%; }
.k-forest.v3 { background-color: var(--tree-d); background-size: 58%; background-position: 50% 40%; }

/* вогонь тремтить */
.k-fire { background: radial-gradient(circle at 50% 78%, #ffd166 0 16%, #ff8a1f 42%, #c2410c 78%, #7c2d12); box-shadow: 0 0 7px rgba(255, 122, 26, 0.55); z-index: 1; }
.k-fire::after, .k-eternal::after {
  content: ""; position: absolute; inset: 8% 14% 6%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24'%3E%3Cpath d='M10 1c1.4 4.2 6.6 6 6.6 12.2A6.6 6.6 0 0 1 3.4 13.2c0-3.6 2.2-5.1 2.9-8 .8 2.2 2.2 3 2.2 3C8.5 5.2 8.5 3 10 1z' fill='%23fff3c4' fill-opacity='.9'/%3E%3Cpath d='M10 10.5c.8 2.2 3 3 3 6a3 3 0 0 1-6 0c0-1.5.8-2.3 1.5-3.7.7.7 1.5.7 1.5-2.3z' fill='%23ff7a1a'/%3E%3C/svg%3E") 50% 100% / contain no-repeat;
  transform-origin: 50% 100%; animation: flame 1.1s ease-in-out infinite alternate; pointer-events: none;
}
.c.v1.k-fire::after { animation-delay: -0.3s; animation-duration: 0.9s; }
.c.v2.k-fire::after { animation-delay: -0.6s; animation-duration: 1.25s; }
.c.v3.k-fire::after { animation-delay: -0.9s; }
@keyframes flame { from { transform: scale(0.92, 0.88) rotate(-3deg); opacity: 0.85; } to { transform: scale(1.04, 1.06) rotate(3deg); opacity: 1; } }
.k-eternal { background: radial-gradient(circle at 50% 62%, #fffbe8 0 16%, #ffd166 38%, #ff7a1a 72%, #9a3412); box-shadow: 0 0 14px rgba(255, 209, 102, 0.75); z-index: 1; animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 22px rgba(255, 209, 102, 0.95); } }

/* протидія пожежі: перекопана смуга */
.k-block { background: repeating-linear-gradient(135deg, #4c3f8a 0 3px, #7a68c4 3px 6px); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35); }

/* згарище: вугілля з жаринками */
.k-burned { background: radial-gradient(circle at 30% 35%, rgba(255, 122, 26, 0.75) 0 7%, transparent 11%), radial-gradient(circle at 70% 68%, rgba(255, 209, 102, 0.6) 0 6%, transparent 10%), radial-gradient(circle at 62% 26%, rgba(232, 194, 122, 0.25) 0 5%, transparent 8%), var(--ash); animation: ember 2.8s ease-in-out infinite; }
.c.v1.k-burned { animation-delay: -1s; } .c.v2.k-burned { animation-delay: -2s; }
@keyframes ember { 50% { filter: brightness(1.35); } }

/* зони веж: підфарбування кольором гравця + рамка */
.z-NW { --tw: #e5484d; } .z-NE { --tw: #3b82f6; } .z-SE { --tw: #facc15; } .z-SW { --tw: #22c55e; }
.k-forest.zo::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--tw); opacity: 0.2; pointer-events: none; }
.zone-frame { position: relative; z-index: 2; pointer-events: none; border-radius: 6px; margin: -1px; border: 1.5px dashed rgba(167, 179, 160, 0.22); }
.zone-frame.NW { grid-area: 1 / 1 / 4 / 4; --tw: #e5484d; }
.zone-frame.NE { grid-area: 1 / 14 / 4 / 17; --tw: #3b82f6; }
.zone-frame.SE { grid-area: 14 / 14 / 17 / 17; --tw: #facc15; }
.zone-frame.SW { grid-area: 14 / 1 / 17 / 4; --tw: #22c55e; }
.zone-frame.zo { border: 2px solid var(--tw); box-shadow: 0 0 12px color-mix(in srgb, var(--tw) 45%, transparent); }
.zone-frame.mine { border-width: 2.5px; }
.zone-frame.out { border-color: #6b5f57; box-shadow: none; }
.c.roof { z-index: 3; }
.c.roof svg { width: 96%; height: 96%; display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }

/* підсвітка вибору */
.board[data-mode]:not([data-mode=""]):not([data-mode="place"]) .c:not(.cand):not(.sel):not([class*=" g-"]):not(.roof) { opacity: 0.55; }
.c.cand { z-index: 4; box-shadow: inset 0 0 0 2px var(--ember), 0 0 8px rgba(255, 209, 102, 0.55); animation: cand 1.1s ease-in-out infinite; }
@keyframes cand { 50% { box-shadow: inset 0 0 0 2px #fff7d6, 0 0 12px rgba(255, 209, 102, 0.85); } }
.c.sel { z-index: 6; outline: 3px solid #fff; outline-offset: -3px; animation: none; }
.c.sel.cand { box-shadow: 0 0 12px rgba(255, 255, 255, 0.7); }
.c.g-fire { z-index: 5; box-shadow: inset 0 0 0 2px var(--ember), inset 0 0 0 99px rgba(255, 122, 26, 0.62); }
.c.g-water { z-index: 5; box-shadow: inset 0 0 0 2px #d6f6ff, inset 0 0 0 99px rgba(76, 201, 240, 0.7); }
.c.g-block { z-index: 5; box-shadow: inset 0 0 0 2px #e2d9ff, inset 0 0 0 99px rgba(157, 124, 242, 0.72); }
.c.g-forest { z-index: 5; box-shadow: inset 0 0 0 2px #c8ffd6, inset 0 0 0 99px rgba(34, 197, 94, 0.6); }
.c.g-soft { z-index: 5; box-shadow: inset 0 0 0 1.5px rgba(214, 246, 255, 0.85), inset 0 0 0 99px rgba(76, 201, 240, 0.18); }
.c.g-bad { z-index: 5; box-shadow: inset 0 0 0 2px #ff5a5a, inset 0 0 0 99px rgba(127, 0, 0, 0.6); }
.c.nope { animation: nope 0.35s ease-out; }
@keyframes nope { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* ефекти клітинок під час ходів */
.c[class*="fx-"] { z-index: 7; }
.c.fx-ignite { animation: ignite 0.7s ease-out; }
@keyframes ignite { 0% { transform: scale(0.35); filter: brightness(2.4); } 55% { transform: scale(1.25); } 100% { transform: none; filter: none; } }
.c.fx-douse { animation: douse 0.85s ease-out; }
@keyframes douse { 0% { box-shadow: inset 0 0 0 99px rgba(76, 201, 240, 0.95), 0 0 12px rgba(76, 201, 240, 0.9); transform: scale(1.15); } 100% { box-shadow: inset 0 0 0 99px rgba(76, 201, 240, 0); transform: none; } }
.c.fx-build { animation: build 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes build { from { transform: scale(1.6); opacity: 0.2; } }
.c.fx-grow { animation: grow 0.8s ease-out; }
@keyframes grow { 0% { transform: scale(0.3); box-shadow: inset 0 0 0 99px rgba(34, 197, 94, 0.8); } 70% { transform: scale(1.12); } 100% { transform: none; } }
.c.fx-burn { animation: burnfx 1.5s ease-out; }
@keyframes burnfx { 0% { filter: brightness(3) saturate(2); transform: scale(1.35); } 100% { filter: none; transform: none; } }

/* рамка вітру: з боку, куди дме вітер, біжать світні шеврони */
.board-frame { display: grid; grid-template-columns: 13px minmax(0, 1fr) 13px; grid-template-rows: 13px auto 13px; gap: 2px; }
.board-frame > .board { grid-area: 2 / 2; }
.wind-edge { position: relative; display: grid; place-items: center; border-radius: 6px; background: rgba(167, 179, 160, 0.06); overflow: hidden; transition: background 0.4s, box-shadow 0.4s; }
.wind-edge.e-N { grid-area: 1 / 2; } .wind-edge.e-S { grid-area: 3 / 2; }
.wind-edge.e-W { grid-area: 2 / 1; } .wind-edge.e-E { grid-area: 2 / 3; }
.we-l { position: relative; z-index: 1; font-size: 8.5px; font-weight: 800; letter-spacing: 0.02em; color: var(--dim); padding: 0 3px; line-height: 1; border-radius: 4px; transition: color 0.4s, background 0.4s; }
.wind-edge::before { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.4s; background-repeat: repeat; }
.e-N::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M3 6.5l4-4 4 4' stroke='%23ffd166' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-size: 14px 9px; animation: chevN 0.9s linear infinite; }
.e-S::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M3 2.5l4 4 4-4' stroke='%23ffd166' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-size: 14px 9px; animation: chevS 0.9s linear infinite; }
.e-W::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 14'%3E%3Cpath d='M6.5 3l-4 4 4 4' stroke='%23ffd166' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-size: 9px 14px; animation: chevW 0.9s linear infinite; }
.e-E::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 14'%3E%3Cpath d='M2.5 3l4 4-4 4' stroke='%23ffd166' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-size: 9px 14px; animation: chevE 0.9s linear infinite; }
@keyframes chevN { from { background-position: 0 0; } to { background-position: 0 -9px; } }
@keyframes chevS { from { background-position: 0 0; } to { background-position: 0 9px; } }
@keyframes chevW { from { background-position: 0 0; } to { background-position: -9px 0; } }
@keyframes chevE { from { background-position: 0 0; } to { background-position: 9px 0; } }
.board-frame[data-wind="N"] .e-N, .board-frame[data-wind="S"] .e-S, .board-frame[data-wind="W"] .e-W, .board-frame[data-wind="E"] .e-E {
  background: rgba(255, 122, 26, 0.22); box-shadow: 0 0 14px rgba(232, 194, 122, 0.25), inset 0 0 0 1px rgba(255, 209, 102, 0.5);
}
.board-frame[data-wind="N"] .e-N::before, .board-frame[data-wind="S"] .e-S::before, .board-frame[data-wind="W"] .e-W::before, .board-frame[data-wind="E"] .e-E::before { opacity: 0.9; }
.board-frame[data-wind="N"] .e-N .we-l, .board-frame[data-wind="S"] .e-S .we-l, .board-frame[data-wind="W"] .e-W .we-l, .board-frame[data-wind="E"] .e-E .we-l { color: var(--fire-ink); background: var(--ember); }
.board-frame.gust .wind-edge { animation: gust 0.9s ease-out; }
@keyframes gust { 30% { filter: brightness(1.8); } }

/* потоки повітря над полем */
.wind-streaks { position: absolute; inset: 0; z-index: 8; overflow: hidden; border-radius: inherit; pointer-events: none; }
.wind-streaks i { position: absolute; border-radius: 2px; opacity: 0; }
.board-frame[data-wind="N"] .wind-streaks i, .board-frame[data-wind="S"] .wind-streaks i { left: var(--p); width: 2px; height: var(--l); }
.board-frame[data-wind="E"] .wind-streaks i, .board-frame[data-wind="W"] .wind-streaks i { top: var(--p); height: 2px; width: var(--l); }
.board-frame[data-wind="N"] .wind-streaks i { background: linear-gradient(rgba(255, 247, 214, 0.55), transparent); animation: wsN 2.6s linear infinite; animation-delay: var(--d); }
.board-frame[data-wind="S"] .wind-streaks i { background: linear-gradient(transparent, rgba(255, 247, 214, 0.55)); animation: wsS 2.6s linear infinite; animation-delay: var(--d); }
.board-frame[data-wind="W"] .wind-streaks i { background: linear-gradient(90deg, rgba(255, 247, 214, 0.55), transparent); animation: wsW 2.6s linear infinite; animation-delay: var(--d); }
.board-frame[data-wind="E"] .wind-streaks i { background: linear-gradient(90deg, transparent, rgba(255, 247, 214, 0.55)); animation: wsE 2.6s linear infinite; animation-delay: var(--d); }
@keyframes wsN { 0% { top: 105%; opacity: 0; } 15%, 80% { opacity: 0.7; } 100% { top: -40%; opacity: 0; } }
@keyframes wsS { 0% { top: -40%; opacity: 0; } 15%, 80% { opacity: 0.7; } 100% { top: 105%; opacity: 0; } }
@keyframes wsW { 0% { left: 105%; opacity: 0; } 15%, 80% { opacity: 0.7; } 100% { left: -40%; opacity: 0; } }
@keyframes wsE { 0% { left: -40%; opacity: 0; } 15%, 80% { opacity: 0.7; } 100% { left: 105%; opacity: 0; } }
/* поки обираєш клітинку — потоки не заважають */
.board[data-mode]:not([data-mode=""]) .wind-streaks { opacity: 0.35; }

/* легенда */
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--muted); padding: 0 2px; }
.lg { display: inline-flex; align-items: center; gap: 5px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; position: relative; }
.sw.k-fire::after, .sw.k-eternal::after { display: none; }
.sw.k-eternal, .sw.k-burned { animation: none; }
.sw.tw { width: 14px; height: 14px; }
.sw.tw svg { width: 100%; height: 100%; display: block; }

/* ---------- cards in hand ---------- */
.hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 6px; }
@media (min-width: 900px) { .hand { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hcard { position: relative; border: 0; border-radius: 12px; padding: 7px 5px 6px; min-height: 104px; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: center; gap: 3px; text-align: center; color: #160f08; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35); transition: transform 0.15s, box-shadow 0.15s; }
.hcard:active { transform: scale(0.97); }
.hcard .cic svg { width: 26px; height: 26px; display: block; }
.hcard .cname { font-weight: 800; font-size: 11px; line-height: 1.1; overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
.hcard .cname.long { font-size: 9.5px; }
.hcard .cname.xlong { font-size: 8.6px; letter-spacing: -0.01em; }
.hcard .cpat svg, .hcard .cwind svg { width: 30px; height: 30px; display: block; }
.hcard .cspec { font-size: 10px; font-weight: 700; line-height: 1.1; opacity: 0.75; }
.hcard.sel { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--ink), 0 10px 22px rgba(0, 0, 0, 0.45); }
.hcard.using { box-shadow: 0 0 0 3px var(--ember), 0 0 18px rgba(255, 209, 102, 0.6); }
.hcard.dead { filter: saturate(0.3) brightness(0.72); }
.t-wind { background: linear-gradient(160deg, #f1f4f8, #a8b5c7); }
.t-fire { background: linear-gradient(160deg, #ffe0c2, #ff8a3d); }
.t-water { background: linear-gradient(160deg, #dcf6ff, #5cc8ef); }
.t-block { background: linear-gradient(160deg, #eee8ff, #a48cf0); }
.t-reckless { background: linear-gradient(160deg, #ffd6d6, #f87171); }

/* ---------- action bar ---------- */
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 16px max(10px, env(safe-area-inset-right, 0px)) calc(10px + var(--safe-bottom)) max(10px, env(safe-area-inset-left, 0px)); background: linear-gradient(transparent, rgba(14, 23, 18, 0.94) 22%, var(--bg)); }
.actionbar .inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 8px; }
.actionbar .inner.three { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.35fr); }
.actionbar .hint { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); text-align: center; text-wrap: balance; min-height: 1em; }
.actionbar .rot { padding: 12px 12px; white-space: nowrap; }
body[data-busy="1"] .actionbar .btn { opacity: 0.6; pointer-events: none; }

/* ---------- feed ---------- */
.feed { display: grid; gap: 6px; }
.feed-item { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; background: var(--bg-2); border-radius: 10px; padding: 7px 9px; }
.feed-item .av { width: 22px; height: 22px; flex: none; }
.feed-item.fresh { animation: feedIn 0.4s ease-out; }
@keyframes feedIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(4, 8, 6, 0.64); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: #15221a; border-radius: 22px 22px 0 0; padding: 10px 16px calc(16px + var(--safe-bottom)); display: grid; gap: 12px; animation: up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.5); }
@media (min-width: 700px) { .scrim { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0.4; } }
.sheet-grab { width: 40px; height: 4px; border-radius: 2px; background: var(--bg-4); justify-self: center; }
.sheet h3 { margin: 0; font-weight: 800; font-size: 19px; line-height: 1.2; text-wrap: balance; }
.sheet p { margin: 0; }
.sheet .actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.sheet .actions.one { grid-template-columns: 1fr; }
.sheet .why { font-size: 13.5px; color: var(--muted); }
.sheet .why.warn { color: var(--ember); }
.opts { display: grid; gap: 8px; }
.stack { display: grid; gap: 10px; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 7px; background: rgba(22, 15, 8, 0.16); }
.card-head { border-radius: 16px; padding: 12px; display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; color: #160f08; }
.card-head h3 { color: #160f08; }
.card-head .cic svg { width: 50px; height: 50px; display: block; }
.card-head .cpat svg, .card-head .cwind svg { width: 54px; height: 54px; display: block; }

/* ---------- play animations ---------- */
.play-banner { position: fixed; left: 50%; top: calc(54px + var(--safe-top)); transform: translateX(-50%); z-index: 74; display: flex; align-items: center; gap: 10px; background: rgba(21, 34, 26, 0.97); border-radius: 14px; padding: 8px 14px 8px 8px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 209, 102, 0.2); width: max-content; max-width: calc(100% - 24px); pointer-events: none; animation: pbIn 0.25s ease-out; transition: opacity 0.3s, transform 0.3s; }
.play-banner.out { opacity: 0; transform: translate(-50%, -8px); }
.play-banner .pb-card { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.play-banner .pb-card svg { width: 30px; height: 30px; }
.play-banner b { display: block; font-size: 13.5px; }
.play-banner span { display: block; font-size: 12px; color: var(--muted); }
@keyframes pbIn { from { opacity: 0; transform: translate(-50%, -10px); } }
.stamp { position: fixed; left: 50%; top: 40%; z-index: 80; font-family: var(--f-display); font-size: clamp(26px, 8.5vw, 46px); letter-spacing: 0.02em; padding: 8px 18px; border: 5px double currentColor; border-radius: 10px; color: var(--leaf); background: rgba(8, 14, 10, 0.82); white-space: nowrap; pointer-events: none; animation: stampIn 0.32s cubic-bezier(0.3, 1.6, 0.5, 1) both; transform: translate(-50%, -50%) rotate(-8deg); }
.stamp.fail { color: var(--fire); text-shadow: 0 0 18px rgba(255, 122, 26, 0.6); }
@keyframes stampIn { from { transform: translate(-50%, -50%) rotate(-8deg) scale(1.9); opacity: 0; } }
canvas.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 95; }

/* ---------- toast ---------- */
.toasts { position: fixed; top: calc(10px + var(--safe-top)); left: 0; right: 0; z-index: 90; display: grid; justify-items: center; gap: 6px; pointer-events: none; padding: 0 12px; }
.toast { max-width: 520px; background: rgba(27, 42, 33, 0.97); color: var(--ink); border-radius: 12px; padding: 8px 12px; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); animation: toastIn 0.25s ease-out; pointer-events: none; }
.toast.err { background: #4a1f1f; color: #ffd8d8; }
.toast.turn { background: var(--fire); color: var(--fire-ink); font-weight: 700; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- home ---------- */
.home { display: grid; gap: 20px; padding: 14px 0 40px; max-width: 560px; margin: 0 auto; }
.hero { display: grid; gap: 10px; }
.hero h1 { margin: 0; font-family: var(--f-display); font-weight: 800; color: var(--ember); font-size: clamp(36px, 11vw, 64px); line-height: 0.95; letter-spacing: 0.01em; text-shadow: 0 0 34px rgba(232, 194, 122, 0.25); }
.hero h1 span { color: var(--fire); }
.hero p { margin: 0; color: var(--muted); font-size: 15px; max-width: 48ch; }
.hero-forest { position: relative; margin-top: 4px; padding: 6px; border-radius: 16px; background: #08100b; box-shadow: 0 0 0 1px rgba(167, 179, 160, 0.14); overflow: hidden; }
.hf-grid { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 2px; }
.hf { aspect-ratio: 1; border-radius: 3px; background: var(--tree-a); animation: hfIn 0.5s ease-out both; animation-delay: var(--d); }
.hf.forest:nth-child(3n) { background: var(--tree-c); }
.hf.fire { background: radial-gradient(circle at 50% 75%, #ffd166 0 18%, #ff8a1f 45%, #c2410c 80%); box-shadow: 0 0 8px rgba(255, 122, 26, 0.6); animation: hfIn 0.5s ease-out both, glow 1.8s ease-in-out infinite; animation-delay: var(--d), var(--d); }
.hf.eternal { background: radial-gradient(circle at 50% 62%, #fffbe8 0 16%, #ffd166 40%, #ff7a1a 75%); box-shadow: 0 0 14px rgba(255, 209, 102, 0.8); }
.hf.block { background: repeating-linear-gradient(135deg, #4c3f8a 0 3px, #7a68c4 3px 6px); }
@keyframes hfIn { from { opacity: 0; transform: scale(0.6); } }
.hf-tower { position: absolute; width: 30px; height: 30px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
.hf-tower svg { width: 100%; height: 100%; display: block; }
.hf-tower.NW { left: 4px; top: 2px; } .hf-tower.NE { right: 4px; top: 2px; } .hf-tower.SE { right: 4px; bottom: 2px; } .hf-tower.SW { left: 4px; bottom: 2px; }
.panel { background: var(--bg-2); border-radius: 18px; padding: 16px; display: grid; gap: 12px; }
.panel h2 { margin: 0; font-size: 17px; font-weight: 800; }
.panel .why { font-size: 13px; color: var(--muted); margin: 0; }
.why { margin: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 9px 4px; font-weight: 700; font-size: 13px; color: var(--muted); display: grid; gap: 1px; }
.seg button small { font-weight: 500; font-size: 10.5px; color: var(--dim); }
.seg button.on { background: var(--bg-4); color: var(--ink); }
.seg button.on small { color: var(--muted); }
.seg button:disabled { opacity: 0.4; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.input { width: 100%; border: 0; border-radius: 12px; background: var(--bg); color: var(--ink); padding: 13px 14px; font: inherit; font-size: 16px; box-shadow: inset 0 0 0 1.5px var(--bg-4); }
.input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--ember); }
.input.code { font-family: var(--f-data); font-size: 20px; letter-spacing: 0.25em; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.me-row { display: flex; align-items: center; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.me-row .av { width: 34px; height: 34px; }
.foot { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-size: 13px; color: var(--dim); }
.btn.install { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--bg-2); color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(255, 209, 102, 0.55); }
.btn.install .ico { display: inline-flex; width: 22px; height: 22px; color: var(--ember); }
.btn.install .ico svg { width: 100%; height: 100%; }

/* ---------- lobby ---------- */
.lobby { display: grid; gap: 16px; padding: 14px 0 120px; max-width: 560px; margin: 0 auto; }
.room-code { display: grid; justify-items: center; gap: 8px; padding: 18px 12px; background: var(--bg-2); border-radius: 18px; text-align: center; }
.room-code h3 { margin: 0; }
.big-tag { display: inline-flex; align-items: center; gap: 10px; background: #2f5d36; color: #f3ece0; border-radius: 8px; padding: 8px 16px 8px 10px; box-shadow: inset 0 0 0 2px #f3ece0, 0 0 0 3px #2f5d36; font-family: var(--f-data); font-weight: 700; font-size: 38px; letter-spacing: 0.14em; line-height: 1; }
.big-tag .cross { font-size: 26px; letter-spacing: 0; }
.room-code .url { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.players { display: grid; gap: 8px; }
.player { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--bg-2); border-radius: 14px; padding: 8px 10px; }
.player .av { width: 40px; height: 40px; }
.player b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player span { font-size: 12px; color: var(--muted); }
.player .seg { grid-column: 1 / -1; }
.player .rm { border: 0; background: var(--bg-3); width: 32px; height: 32px; border-radius: 9px; color: var(--muted); }

/* ---------- finished ---------- */
.finish { display: grid; gap: 16px; padding: 14px 0 60px; max-width: 560px; margin: 0 auto; }
.cert { position: relative; background: #f4eedf; color: #1b130c; border-radius: 16px; padding: 22px 18px 18px; text-align: center; display: grid; gap: 8px; justify-items: center; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); overflow: hidden; }
.cert::before { content: ""; position: absolute; inset: 8px; border: 2px solid #c9b98f; border-radius: 10px; pointer-events: none; }
.cert .t1 { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: #7c5a1e; font-weight: 800; }
.cert h2 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 30px; line-height: 1.05; color: #9a3412; }
.cert .av { width: 76px; height: 76px; }
.cert .who { font-size: 20px; font-weight: 800; }
.cert-tower svg { width: 54px; height: 54px; display: block; }
.cert .stats { font-size: 14px; font-weight: 600; color: #4a3b26; }
.cert .seal { position: absolute; right: 12px; bottom: 10px; font-family: var(--f-display); font-size: 10px; color: #b45309; border: 2px solid #b45309; border-radius: 50%; width: 80px; height: 80px; text-align: center; display: grid; place-items: center; transform: rotate(-14deg); line-height: 1.05; padding: 6px; opacity: 0.85; }
.rank { display: grid; gap: 6px; }
.rank .player { grid-template-columns: 28px 36px minmax(0, 1fr) auto; }
.rank .place { font-family: var(--f-display); color: var(--ember); font-size: 20px; text-align: center; }
.rank .av { width: 36px; height: 36px; }
.mini-tower svg { width: 28px; height: 28px; display: block; }

/* ---------- tips / rules / menu ---------- */
.tip { position: fixed; left: 50%; bottom: calc(124px + var(--safe-bottom)); transform: translateX(-50%); z-index: 40; width: min(520px, calc(100% - 24px)); background: #f4eedf; color: #1b130c; border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); animation: toastIn 0.3s ease-out; font-size: 14px; }
.tip b { display: block; margin-bottom: 2px; }
.tip button { border: 0; background: #1b130c; color: #f4eedf; border-radius: 9px; padding: 7px 10px; font-weight: 700; font-size: 12.5px; }
.rules { display: grid; gap: 12px; font-size: 14.5px; }
.rules h4 { margin: 4px 0 0; font-size: 15px; color: var(--ember); }
.rules p { margin: 0; color: #dcd6c9; }
.rules ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: #dcd6c9; }
.menu-list { display: grid; gap: 6px; }
.menu-list button, .menu-list a { border: 0; background: var(--bg-2); color: var(--ink); border-radius: 12px; padding: 13px 14px; text-align: left; font-weight: 600; font-size: 14.5px; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-decoration: none; }
.menu-list .danger { color: var(--danger-ink); }
.menu-list .accent { box-shadow: inset 0 0 0 1.5px rgba(255, 209, 102, 0.55); }
.textarea { width: 100%; min-height: 120px; border: 0; border-radius: 12px; background: var(--bg); color: var(--ink); padding: 12px; font: inherit; box-shadow: inset 0 0 0 1.5px var(--bg-4); resize: vertical; }
.lang-pick { display: grid; gap: 8px; }

/* ---------- install ---------- */
.ins-frame { display: grid; place-items: center; background: #070d09; border-radius: 18px; padding: 10px; }
.ins-video { display: block; width: auto; max-width: 100%; height: min(52vh, 460px); aspect-ratio: 9 / 16; border-radius: 14px; background: #070d09; object-fit: contain; }
.ins-steps { margin: 0; padding-left: 22px; display: grid; gap: 4px; color: var(--ink); font-size: 14px; }
.ins-steps li::marker { color: var(--ember); font-family: var(--f-data); }
.ins-action { display: grid; gap: 8px; min-height: 8px; }
.ins-action .ins-go { animation: insIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.ins-note { margin: 0; font-size: 13.5px; color: var(--muted); }
@keyframes insIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.logo-wrap{display:inline-flex;align-items:center;gap:8px;min-width:0}
.hub-link{display:inline-grid;place-items:center;width:32px;height:32px;flex:none;border-radius:10px;color:inherit;opacity:.75;
  background:rgba(255,255,255,.07);text-decoration:none;transition:opacity .15s,background .15s}
.hub-link:hover,.hub-link:focus-visible{opacity:1;background:rgba(255,255,255,.14)}

/* no-sideways: жодного горизонтального скролу (особливо у вітрині-застосунку, де гра в iframe) */
html, body { overflow-x: clip; max-width: 100%; overscroll-behavior-x: none; }
/* fit-cols: колонки столу не ширші за екран */
.col-main { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 899px) { .table { grid-template-columns: minmax(0, 1fr); } }
.col-main > * { min-width: 0; }
html.framed { --safe-top: 0px; }
/* logo-fit */
.logo-wrap { flex: none; }
.topbar > *:not(.logo-wrap) { min-width: 0; }
@media (max-width: 420px) { .topbar .logo { font-size: 17px; } .topbar { gap: 6px; } }

/* шторки: кнопка «Назад» + свайп униз */
.scrim { overscroll-behavior: contain; }
.sheet { max-height: 88dvh; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.sheet-top { position: sticky; top: 0; z-index: 2; margin: -10px -16px 0; padding: 10px 12px 6px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: inherit; border-radius: inherit; }
.sheet-top .sheet-grab { grid-column: 2; }
.sheet-back { grid-column: 1; justify-self: start; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 12px 0 6px; border: 0; border-radius: 12px; background: rgba(255,255,255,.08); color: inherit; font: 600 15px/1 inherit; font-family: inherit; cursor: pointer; }
.sheet-back:active { background: rgba(255,255,255,.16); }


/* ================= ПОКЕР-ШКОЛА ================= */
.logo { font-size: 15px; font-weight: 800; letter-spacing: 0; }
.boot-logo { font-weight: 800; font-size: 32px; }
.hero h1 span { color: var(--leaf); }
.hero-street { position: relative; height: 150px; border-radius: 18px; background: radial-gradient(ellipse at 50% 40%, var(--felt), var(--felt-2)); box-shadow: inset 0 0 0 6px #3b2717, inset 0 0 0 8px #5a3a20; overflow: hidden; }
.hs { position: absolute; left: 50%; top: 22px; width: 64px; transform-origin: 50% 160%; transform: translateX(-50%) rotate(calc(var(--i) * 9deg)); animation: hsIn 0.5s ease-out both; animation-delay: calc((var(--i) + 2) * 0.07s); filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }
.hs svg { width: 100%; height: auto; display: block; }
.hs-chips { position: absolute; right: 18px; bottom: 14px; display: flex; gap: 2px; }
.hs-chips span { width: 26px; display: block; }
@keyframes hsIn { from { opacity: 0; translate: 0 18px; } }

.pcard { display: block; width: 100%; height: auto; }
.pcard.xs { width: 22px; } .pcard.s { width: 30px; } .pcard.m { width: 100%; } .pcard.l { width: 64px; }
.chipsvg { width: 100%; height: 100%; display: block; }

.seats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.seats.n1 { grid-template-columns: minmax(0, 1fr); }
.seat { background: var(--bg-2); border-radius: 12px; padding: 6px 8px; display: grid; gap: 4px; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s, opacity .3s; min-width: 0; }
.seat.active { box-shadow: inset 0 0 0 2px var(--ember), 0 0 16px rgba(232, 194, 122, 0.25); }
.seat.folded { opacity: 0.5; } .seat.out { opacity: 0.3; }
.seat.allin { box-shadow: inset 0 0 0 1.5px var(--danger); }
.seat-top { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 6px; align-items: center; }
.pav { width: 30px; height: 30px; } .pav svg { width: 100%; height: 100%; display: block; }
.seat-who b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-who small { display: flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); }
.chipsn { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; }
.chipsn.big { font-size: 18px; } .chipsn.big span { width: 18px; height: 18px; display: inline-block; }
.pos { font-style: normal; font-size: 9.5px; font-weight: 900; border-radius: 999px; padding: 1px 5px; background: #e9e4d6; color: #1b1b1b; }
.pos.sb { background: #8fb6ff; } .pos.bb { background: #ffb38f; }
.seat-bottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 26px; }
.seat-cards { display: flex; gap: 2px; } .seat-cards span { width: 22px; display: block; }
.bet { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bet span { width: 16px; height: 16px; display: inline-block; }
.st { font-size: 11px; color: var(--muted); }

.felt { border-radius: 22px; padding: 10px 10px 12px; display: grid; gap: 8px; justify-items: center;
  background: radial-gradient(ellipse at 50% 35%, var(--felt), var(--felt-2) 80%); box-shadow: inset 0 0 0 5px #3b2717, inset 0 0 0 7px #5a3a20, 0 10px 24px rgba(0, 0, 0, 0.35); }
.street { font-size: 11.5px; color: #cfe8d9; font-weight: 700; letter-spacing: 0.04em; }
.board5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; width: 100%; max-width: 340px; }
.bslot { display: block; aspect-ratio: 60 / 84; border-radius: 7px; transition: transform .2s; }
.bslot.empty { border: 1.5px dashed rgba(255, 255, 255, 0.22); display: grid; place-items: center; color: rgba(255,255,255,.3); font-size: 11px; font-weight: 800; }
.bslot.hl, .me-cards .hl, .sd-hole .hl { transform: translateY(-4px); filter: drop-shadow(0 0 6px rgba(232, 194, 122, 0.9)); }
.pot { display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, 0.3); border-radius: 999px; padding: 4px 12px 4px 6px; font-variant-numeric: tabular-nums; }
.pot span { width: 22px; height: 22px; display: inline-block; }

.mine-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; background: var(--bg-2); border-radius: 16px; padding: 10px 12px; box-shadow: inset 0 0 0 1.5px transparent; }
.mine-box.active { box-shadow: inset 0 0 0 2px var(--ember); }
.mine-box.folded { opacity: 0.55; }
.me-cards { display: flex; gap: 6px; }
.me-cards span { display: block; width: 64px; transition: transform .2s; }
.me-info { display: grid; gap: 3px; min-width: 0; }
.me-info b { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.me-info small { color: var(--muted); }

.coach { background: #14221d; border-radius: 16px; padding: 10px 12px; display: grid; gap: 6px; box-shadow: inset 0 0 0 1.5px #24453a; }
.muted-box { color: var(--muted); font-size: 13px; }
.c-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.c-row small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.c-row .c-hand { grid-column: 2 / -1; font-size: 15px; }
.meter { position: relative; height: 10px; border-radius: 999px; background: #0b1512; overflow: hidden; }
.meter > i:first-child { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--danger); transition: width .4s; }
.meter.mid > i:first-child { background: #e0b341; } .meter.good > i:first-child { background: var(--leaf); }
.meter .fair { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #fff; opacity: .7; }
.c-eq { font-family: var(--f-data); font-size: 17px; } .c-eq.good { color: var(--leaf); } .c-eq.mid { color: #e0b341; } .c-eq.bad { color: #ff8d8f; }
.c-sub, .c-line { font-size: 12.5px; color: var(--muted); }
.c-tip { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #1c3a2e; border-radius: 10px; padding: 7px 10px; font-size: 14px; }
.c-tip.t-fold { background: #3a1f20; } .c-tip.t-raise, .c-tip.t-bet { background: #3a3218; }
.c-why { margin: 0; font-size: 13px; line-height: 1.45; color: #dfe9e3; }

.btn.advised { box-shadow: 0 0 0 3px var(--ember), 0 0 18px rgba(232, 194, 122, 0.5); }
.btn.danger { color: #ffd6d6; }
.raise-val { font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.raise-range { width: 100%; accent-color: var(--ember); height: 32px; }
.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.presets .btn { min-height: 40px; padding: 8px 4px; font-size: 13px; }

.sd { display: grid; gap: 10px; }
.sd h3 { margin: 0; }
.sd-board { display: grid; grid-template-columns: repeat(5, minmax(0, 46px)); gap: 4px; justify-content: center; }
.sd-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who hole" "hand hand"; gap: 4px 8px; background: var(--bg-3); border-radius: 12px; padding: 8px; }
.sd-row.win { box-shadow: inset 0 0 0 2px var(--leaf); background: #1d3a2c; }
.sd-row.me { outline: 1.5px solid rgba(232, 194, 122, 0.4); }
.sd-who { grid-area: who; display: flex; align-items: center; gap: 6px; min-width: 0; }
.sd-who svg { width: 26px; height: 26px; display: block; }
.sd-hole { grid-area: hole; display: flex; gap: 3px; } .sd-hole span { width: 30px; display: block; }
.sd-hand { grid-area: hand; display: flex; justify-content: space-between; font-size: 13px; }
.won { color: var(--leaf); font-weight: 800; }
.sd-line { margin: 0; }
.sd-pots { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }

.hand-table { display: grid; gap: 6px; }
.ht-title { margin: 6px 0 0; }
.ht-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; align-items: center; background: var(--bg-3); border-radius: 10px; padding: 6px 8px; }
.ht-n { font-weight: 800; color: var(--ember); font-size: 12px; }
.ht-row b { display: block; font-size: 13px; } .ht-row small { color: var(--muted); font-size: 11px; }
.ht-cards { display: flex; gap: 2px; }
.cert-tower svg { width: 70px; height: 70px; }
.mini-tower svg { width: 26px; height: 26px; }
.stamp { color: var(--leaf); } .stamp.fail { color: #ff8d8f; }
@media (min-width: 900px) { .me-cards span { width: 84px; } .board5 { max-width: 420px; } }
@media (prefers-reduced-motion: reduce) { .hs { animation: none; } }
