/*
 * Cezalı 101 — graphics tiers below "Yüksek" (docs/PERF_PLAN.md §5.4, §5.5). First cut.
 *
 * The tier is a class on <html>, set by js/ui/gfx.js while it loads: gfx-high (the default — today's
 * look), gfx-mid ("Dengeli"), gfx-low ("Hafif"). In this release it changes only from the Tanı overlay.
 *
 * The contract of this file (tests/perf/css.test.js keeps it):
 *   - every selector is `html.gfx-mid ` or `html.gfx-low ` + a selector that css/style.css has, so a
 *     tier rule out-ranks the rule it changes whatever that rule's specificity — and with no tier
 *     class, or gfx-high, not one rule of this file matches: nothing changes;
 *   - a tier changes how things are painted and animated, never where they are: no rule here sets a
 *     size, a position, a margin, a font or the box model (the board's fit and every cached anchor
 *     are the same on every tier). `display: none` only on decoration that takes no room;
 *   - the performance rules of css/style.css hold here too (animate opacity / transform only, no
 *     endless animation of a painted property, no filled one-shot, nothing on the stage itself);
 *   - no @keyframes of its own: the animations are style.css's.
 * What stays on every tier: the last-5-seconds warning (.seat-glow, .rk-turn.is-urgent), the turn
 * frame on the ıstaka, the one-shot cues (banners, flashes, bumps), the spinners that mean "wait".
 * Not in this file — they need ui.js (Gfx.cfg): the ghost's tilt, the confetti count, building the
 * menu's floating tiles, and the deal / meld-opening variants of Wave 2.
 */

/* --------------------------------------------------------------------------------------
   1. Nothing animates while nothing happens (B2)
   -------------------------------------------------------------------------------------- */
/* Prompt glows — deck, side tile, the tile taken from the side, Aç / Çift Aç, the menu's gold button.
   Dengeli: the glow rises three times and stays lit (2.5 runs of glowPulse end on its bright point,
   which is the rule's own opacity: no jump, no fill mode). Hafif: lit from the start. */
html.gfx-mid .deck.can-draw .deck-top::after { animation: glowPulse 1.6s ease-in-out 2.5; opacity: 1; }
html.gfx-mid .pile.can-take .pile-anchor::before { animation: glowPulse 1.6s ease-in-out 2.5; opacity: 1; }
html.gfx-mid .rack-tiles .rack-tile.is-taken .rack-tile-face::after { animation: glowPulse 1.3s ease-in-out 2.5; opacity: 1; }
html.gfx-mid .btn.is-ready::before { animation: glowPulse 1.5s ease-in-out 2.5; opacity: 1; }
html.gfx-mid .menu-btns::before { animation: glowPulse 2.6s ease-in-out 1.4s 2.5 backwards; opacity: 1; }
html.gfx-low .deck.can-draw .deck-top::after,
html.gfx-low .pile.can-take .pile-anchor::before,
html.gfx-low .rack-tiles .rack-tile.is-taken .rack-tile-face::after,
html.gfx-low .btn.is-ready::before,
html.gfx-low .menu-btns::before { animation: none; opacity: 1; }
/* (the two endless animations of a painted property that are left, tablet layout: a still button, a
   still alert ring at its bright point) */
html.gfx-mid .btn-dive,
html.gfx-low .btn-dive { animation: none; }
html.gfx-mid .ci-row-3.is-alert .ci-status,
html.gfx-low .ci-row-3.is-alert .ci-status { animation: none; box-shadow: inset 0 0 0 1px rgba(255, 150, 140, 0.95); }

/* A bot's ring: the gold arc stands still (online the ring is the server's clock on every tier). */
html.gfx-mid .seat-bot.is-active .seat-ring,
html.gfx-low .seat-bot.is-active .seat-ring { animation: none; }

/* Menu: the halo, the floating tiles and the logo stand still, the light over the word is gone — the
   halo's and the tiles' layers merge into the background. */
html.gfx-mid .menu-halo,
html.gfx-low .menu-halo,
html.gfx-mid .float-tile,
html.gfx-low .float-tile,
html.gfx-mid .menu-logo-in,
html.gfx-low .menu-logo-in { animation: none; }
html.gfx-mid .c101-logo-band,
html.gfx-low .c101-logo-band { animation: none; }
html.gfx-mid .c101-logo-sheen,
html.gfx-low .c101-logo-sheen { display: none; }
/* (Hafif on a phone: no floating tiles at all — ui.js does not build them, Gfx.cfg.menuFloat; this
   covers a menu that was built before the tier changed) */
html.gfx-low .is-phone .float-tile { display: none; }

/* Hafif: the boot mark's tiles stand still. */
html.gfx-low .boot-mark .bm-t { animation: none; }

/* --------------------------------------------------------------------------------------
   2. No backdrop blur, no mask (B5)
   -------------------------------------------------------------------------------------- */
/* Glass buttons keep their fill — the dialogs' ones included (B5's modal rule lives here, not in
   style.css: on Yüksek the blur of the dialog's felt grain and the buttons' own layers are visible, one
   device pixel at some stage scales); the seat cards and the two drawers get a denser one in exchange
   for the blur (through the variable their fill reads, so the phone's box-less seat stays box-less). */
html.gfx-mid .btn-glass,
html.gfx-low .btn-glass { -webkit-backdrop-filter: none; backdrop-filter: none; }
html.gfx-mid .seat-info,
html.gfx-low .seat-info { --glass: rgba(8, 20, 25, 0.82); -webkit-backdrop-filter: none; backdrop-filter: none; }
/* The drawers lose the blur while they are open, the only time they are seen. A closed drawer keeps it:
   it is hidden (visibility), so the blur is never drawn — but with no blur left anywhere on the phone
   table Chromium gave the whole stage a full-screen layer of its own (Edge census, 800 × 360 @2:
   +1 screen of layer memory on Dengeli and Hafif). */
html.gfx-mid .log-panel,
html.gfx-low .log-panel,
html.gfx-mid .chat-panel,
html.gfx-low .chat-panel { --glass-strong: rgba(9, 22, 27, 0.95); }
html.gfx-mid .log-panel.is-open,
html.gfx-low .log-panel.is-open,
html.gfx-mid .chat-panel.is-open,
html.gfx-low .chat-panel.is-open { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* The edge fades of a scrolling meld board and of a long dialog are masks — a render pass of their
   own on every frame that draws them. First cut: a plain edge (the cut-off row still reads as "more
   below"). The gradient overlay of the plan needs an element of its own: Wave 2. */
html.gfx-mid .is-phone .melds-area.fade-b,
html.gfx-low .is-phone .melds-area.fade-b,
html.gfx-mid .is-phone .melds-area.fade-t,
html.gfx-low .is-phone .melds-area.fade-t,
html.gfx-mid .is-phone .melds-area.fade-t.fade-b,
html.gfx-low .is-phone .melds-area.fade-t.fade-b,
html.gfx-mid .is-phone .modal-body.fade-b,
html.gfx-low .is-phone .modal-body.fade-b { -webkit-mask-image: none; mask-image: none; }

/* --------------------------------------------------------------------------------------
   3. Dialogs (B8): a 28 px shadow instead of 90 px, a flat backdrop, a calm entry
   -------------------------------------------------------------------------------------- */
html.gfx-mid .modal,
html.gfx-low .modal { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
html.gfx-mid .modal { animation: fadeUp 0.26s var(--ease-out) backwards; } /* fade + slide */
html.gfx-low .modal { animation: fadeIn 0.2s ease backwards; } /* fade */
html.gfx-mid .modal-wrap,
html.gfx-low .modal-wrap { background: rgba(3, 10, 12, 0.7); }

/* --------------------------------------------------------------------------------------
   4. Banner
   -------------------------------------------------------------------------------------- */
/* its word: two filter shadows — Dengeli keeps the hard one, Hafif none (the dark patch behind it stays) */
html.gfx-mid .banner-main { filter: drop-shadow(0 4px 0 rgba(70, 40, 0, 0.8)); }
html.gfx-low .banner-main { filter: none; }

/* --------------------------------------------------------------------------------------
   5. Hafif only
   -------------------------------------------------------------------------------------- */
/* a flying tile: a hairline instead of the soft shadow */
html.gfx-low .fly-tile,
html.gfx-low .fly-back { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4); }
/* highlight changes are instant: no box-shadow / background morph (each step of one is a repaint) */
html.gfx-low .meld,
html.gfx-low .meld-group,
html.gfx-low .rack-tile-face { transition: none; }
html.gfx-low .deck-top { transition: transform 0.2s var(--ease-out); }
/* the logo in the felt: plain opacity, no blend pass — at about a third of the opacity, which is what the
   soft-light of the light logo adds to the felt's greens (0.10 -> 0.035, with melds 0.045 -> 0.016) */
html.gfx-low .felt-emblem { mix-blend-mode: normal; opacity: 0.035; }
html.gfx-low .screen-game.has-melds .felt-emblem { opacity: 0.016; }
