/* Liquid Magnetic (liquid-buttons.js, mouse and pen only) on the hub and in the match: an SVG surface draws the button
   instead of its background, so a short stretch of the edge can reach for the cursor, and the hover tone pours in as
   paint. Every variant keeps its own colours: paper with a line, ink for primary, red for «bad», the state frame and
   tint of «Купить»/«Продать», the hatching of «Заложить»; the paint is that variant's own hover, a step further. The surface selector is doubled
   to stay above icon-sizing rules like `.bug-plate .btn svg`. Buttons keep their own `position` (static, fixed and
   absolute ones all exist) and `overflow`; a zero `translate` alone makes the button the surface's containing block. */
.liquid-button { translate: 0 0; isolation: isolate; background: transparent !important; box-shadow: none !important; }
.liquid-button.liquid-button > svg.liquid-surface { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none;
  overflow: visible; z-index: -1; pointer-events: none; fill: none; stroke: none; }
.liquid-surface > .liquid-rest { fill: var(--surface); stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke;
  pointer-events: visiblePainted; transition: stroke var(--t-ui) ease, stroke-width var(--t-ui) ease; }
.liquid-surface .liquid-paint { fill: var(--surface-2); stroke: none; pointer-events: none; }
.liquid-surface .liquid-hold-paint { fill:var(--surface-2); stroke:none; pointer-events:none; }

.liquid-button:is(.primary, .go) > .liquid-surface > .liquid-rest { fill: var(--ink); stroke: none; }
.liquid-button:is(.primary, .go) > .liquid-surface .liquid-paint { fill: var(--ink-2); }
.liquid-button:is(.ghost, .icon-btn) > .liquid-surface > .liquid-rest { fill: transparent; stroke: none; }
.return .liquid-button.primary > .liquid-surface > .liquid-rest { fill: var(--on-ink); }
.return .liquid-button.primary > .liquid-surface .liquid-paint { fill: color-mix(in srgb, var(--on-ink) 88%, var(--ink)); }
/* match: «bad» is a red key, its hover a touch brighter */
.liquid-button.bad > .liquid-surface > .liquid-rest { fill: var(--bad); stroke: none; }
.liquid-button.bad > .liquid-surface .liquid-paint { fill: color-mix(in srgb, var(--bad) 92%, white); }
.liquid-button.bad:hover { filter: none !important; }   /* the paint carries the brightening, not a filter on top */
/* match: the roll key clips nothing, so its edge can reach out; the hold fill keeps its corners on its own */
.liquid-button.roll-btn { overflow: visible; }
/* match: property actions are paper tinted and framed in their state colour; the hover deepens both */
.liquid-button:is(.buy, .sell) > .liquid-surface > .liquid-rest { fill: color-mix(in srgb, var(--state) 9%, var(--surface));
  stroke: var(--state); stroke-width: 1.5; }
.liquid-button:is(.buy, .sell) > .liquid-surface .liquid-paint { fill: color-mix(in srgb, var(--state) 14%, var(--surface)); }
/* match: «Заложить» keeps the pledged cell's warn frame and hatching (the hatching is an SVG pattern set by the script);
   its paint is a light warm wash over the stripes, so they stay visible */
.liquid-button.pledge > .liquid-surface > .liquid-rest { stroke: var(--warn); stroke-width: 1.5; }
.liquid-surface .liquid-hatch-ground { fill: var(--surface); }
.liquid-surface .liquid-hatch-stripe { fill: color-mix(in srgb, var(--warn) 16%, transparent); }
.liquid-button.pledge > .liquid-surface .liquid-paint { fill: color-mix(in srgb, var(--warn) 9%, transparent); }

@media (hover: hover) {
  .liquid-button:not(.primary, .go, .ghost, .icon-btn, .bad, .buy, .sell, .pledge):hover > .liquid-surface > .liquid-rest { stroke: var(--ink); }
  .app .liquid-button:not(.primary, .go, .ghost, .icon-btn, .bad, .buy, .sell, .pledge):hover > .liquid-surface > .liquid-rest { stroke-width: 1.5; }
  .liquid-button:is(.buy, .sell, .pledge):hover > .liquid-surface > .liquid-rest { stroke-width: 2.5; }
}
/* the profile chip and the match's «Меню» as Liquid Magnetic buttons: their own line (the chip a hairline, «Меню»
   transparent paper with the stronger rule) */
.liquid-button.me-chip > .liquid-surface > .liquid-rest { stroke: var(--line); }
.liquid-button.more-btn > .liquid-surface > .liquid-rest { fill: transparent; }

/* Gooey dropdowns (gooey-menus.js): the popup keeps its place, size, rows and paper; its panel is drawn by the drop,
   with the popup's own soft lift only once it stands, never while the drop flows */
.gooey-liquid { isolation: isolate; background: transparent !important; box-shadow: none !important; animation: none !important; }
.gooey-liquid.gooey-settled { box-shadow: var(--shadow-pop) !important; transition: box-shadow 120ms var(--ease-out); }
.gooey-surface { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; z-index: -1; pointer-events: none; }
/* the outline: with no shadow while it flows, the hairline alone holds the edge on light paper, so the light theme
   takes the stronger rule of the same warm grey; the dark theme's hairline already reads */
:root { --gooey-line: var(--line-2); }
:root[data-theme="dark"] { --gooey-line: var(--line); }
/* no stroke under the goo: the hub's `svg { stroke: currentColor }` would ink every drop and the goo would smear it */
.gooey-drop { fill: var(--surface); stroke: none; }
.gooey-plain .gooey-drop { stroke: var(--gooey-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.gooey-goo-line { flood-color: var(--gooey-line); }
.gooey-ghost { position: absolute; z-index: 30; pointer-events: none; }
/* a popup on its way out (the player menu's fade) is hidden at once: only its drop leaves */
.gooey-gone { visibility: hidden !important; }
/* the match's card popover: the card is paper on the drop's paper, so its own fill, line and lift step aside */
.gooey-liquid > .card { background: transparent !important; box-shadow: none !important; animation: none !important; }
/* while a popup is out, the opener's frame is drawn by the goo: its own surface steps aside, its content stays above the
   panel without leaning, and its label stays ink on the shared paper (not «Меню»'s pressed light-on-ink) */
.gooey-merged { position: relative; translate: 0 0 !important; }
.gooey-merged, .gooey-merged:hover { color: var(--ink) !important; }
.gooey-merged > .liquid-surface { visibility: hidden; }
/* the rows: paper on the popup's paper, the row under the pointer a light tint of the brand pink */
.liquid-row > .liquid-surface > .liquid-rest { fill: transparent !important; stroke: none !important; }
.liquid-row > .liquid-surface .liquid-paint { fill: color-mix(in srgb, var(--pink) 32%, var(--surface)); }
:root[data-theme="dark"] .liquid-row > .liquid-surface .liquid-paint { fill: color-mix(in srgb, var(--pink) 16%, var(--surface)); }
/* a player menu opened from a match player card continues the card: no second avatar and name */
.gooey-pm-card .pm-head { padding: 8px 10px 10px; gap: 0; }
.gooey-pm-card .pm-head > .pm-av, .gooey-pm-card .pm-head > .av, .gooey-pm-card .pm-who > b { display: none; }

/* Keep the hit rectangle stable on press. The tinted layer follows the same moving contour. */
.liquid-button.liquid-button:active:not(:disabled) { transform: none; }
.liquid-surface > .liquid-press-paint { fill: currentColor; stroke: none; pointer-events: none;
  opacity: 0; transition: opacity 135ms var(--ease-out); }
.liquid-pressed > .liquid-surface > .liquid-press-paint { opacity: .13; transition-duration: 45ms; }
@media (prefers-reduced-motion: reduce) {
  .liquid-surface > .liquid-press-paint { transition: none; }
}
