/* Phone performance: the same look as the Windows app, drawn in a way a phone's GPU keeps smooth.
   Loaded last (after phone.css). Only shipped in the Android app; html.phone-app is set in index.html.

   Rules of thumb used here:
   - Moving things only move by transform / opacity (the GPU slides them; nothing is redrawn).
   - Effects that repaint every frame (moving background-position, pulsing box-shadow, animated conic
     borders) become still. On a phone they kept the whole screen repainting and caused the stutter.
   - No live blur behind panels (backdrop-filter): it re-blurs the screen on every scroll frame, which is
     what flickered. Panels get the same colour, slightly more solid, instead.
   - A touch screen has no hover: a tapped tile used to stay lifted, tilted and shining. */

/* ---------- 1. Glass panels: same tint, no live blur ---------- */
html.phone-app * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html.phone-app[data-pack="showcase"] { --panel: rgba(22, 25, 38, .94); --bg2: rgba(16, 18, 27, .95); --dialog: rgba(15, 17, 25, .97); }
html.phone-app[data-pack="showcase"] :is(.topbar, #round-strip) { background: rgba(10, 11, 16, .96); }
html.phone-app dialog::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ---------- 2. Showcase background: drifting glows stay (GPU), repainting layers go still ---------- */
html.phone-app .sc-floor { animation: none; }
/* The light sweep moved by `left` (a repaint per frame); here it slides by transform instead. */
html.phone-app :is(.sc-sweep, .ts-sweep) { left: -40%; animation-name: phone-sweep; will-change: transform; }
@keyframes phone-sweep { 0%, 60% { transform: translateX(0) skewX(var(--skew, -13deg)); } 100% { transform: translateX(567%) skewX(var(--skew, -13deg)); } }
html.phone-app .sc-aur { will-change: transform; }
/* The pointer spotlight follows a mouse; a finger only leaves it stuck where it last touched. */
html.phone-app .sc-glow { display: none; }
/* Floating dust (a canvas redrawn every frame) only where nothing scrolls: Home and the title. */
html.phone-app body:not(.home-on) .sc-dust { display: none; }

/* ---------- 3. Lit edges, shines and breathing glows: kept as a still glow ---------- */
html.phone-app[data-pack="showcase"] .brand strong { animation: none; background: none; color: var(--lime); -webkit-text-fill-color: currentColor; }
html.phone-app[data-pack="showcase"] .cta:not(:disabled, #turn-banner, #answer-pill)::before { animation: none; box-shadow: 6px 6px 0 var(--purple), 0 6px 24px color-mix(in srgb, var(--lime) 28%, transparent); }
html.phone-app[data-pack="showcase"] .cta::after { animation: none; background: none; }
html.phone-app[data-pack="showcase"] :is(body.in-round .notes, #home-daily, .result-sheet)::after { animation: none; background: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lime) 30%, transparent); }
/* Title screen: the RELAY sheen, the button's breathing glow and its passing light. */
html.phone-app .ts-floor { animation: none; }
html.phone-app :is(.ts-w2, .title-screen.ts-in .ts-w2) { animation-name: ts-slam; animation-iteration-count: 1; background: none; color: var(--lime); -webkit-text-fill-color: currentColor; }
html.phone-app .ts-play::before { animation: none; box-shadow: 6px 6px 0 var(--purple), 0 0 30px color-mix(in srgb, var(--lime) 35%, transparent); }
html.phone-app .ts-play::after { animation: none; background: none; }
/* Small pulsing rings (turn, answer, reveal wait) pulse by opacity of their own glow instead of redrawing it. */
html.phone-app #answer-pill.new-question { animation: answer-new .65s ease-out; }
html.phone-app .turn-plate.answering::before { animation: phone-fade 1.1s ease-in-out infinite; box-shadow: 0 0 0 4px color-mix(in srgb, var(--purple) 35%, transparent); }
html.phone-app .rt-wait .rt-back { animation: none; box-shadow: inset 0 0 0 2px var(--purple); }
@keyframes phone-fade { 50% { opacity: .35; } }

/* Settings > Appearance: each theme card is a small live preview. The Showcase and Holo previews shimmered
   by redrawing their backgrounds every frame, over the moving background, inside a scrolling window - the
   "glitching" in the theme list. On a phone the previews are still pictures of each theme. */
html.phone-app :is(.shot, .shot *, .pack-card, .pack-card *) { animation: none !important; }


/* ---------- 4. No hover on a touch screen ---------- */
@media (hover: none) {
  html.phone-app .character:hover:not(:disabled),
  html.phone-app .cards :is(.tile-wrap:not(.out) > .character, .character:not(.out)):hover:not(:disabled),
  html.phone-app :is(.private-card, .play-card, .guest-card, .pack-card):hover { transform: none; box-shadow: none; }
  html.phone-app .cards :is(.tile-wrap:not(.out) > .character, .character:not(.out)):hover:not(:disabled)::before,
  html.phone-app .character:hover .avatar::after { content: none; animation: none; }
  html.phone-app :is(.ghost, .cta, .close):not(#answer-pill):hover:not(:disabled) { transform: none; translate: none; }
  html.phone-app :is(.choice-tile, .variant-tile, .history-item):hover { translate: none; }
  html.phone-app .home-tile:hover svg { transform: none; }
  html.phone-app[data-pack="showcase"] :is(.home-tile, .choice-tile, .variant-tile):hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 14px 36px rgba(0, 0, 0, .28); }
  /* A short press shows instead: the tile dips while the finger is on it. */
  html.phone-app :is(.character, .home-tile, .choice-tile, .variant-tile, .history-item):active:not(:disabled) { transform: scale(.97); transition: transform .08s; }
}

/* ---------- 5. Character board: only the tiles on screen are drawn ---------- */
/* The board holds every character (4,392 tiles). A phone now lays out and paints only the tiles near the
   screen; the rest keep their place (auto remembers each tile's real size once it has been seen). */
html.phone-app .cards > * { content-visibility: auto; contain-intrinsic-size: auto var(--phone-tile-h, 176px); } /* --phone-tile-h: the real tile height, set by phone-board.js */
html.phone-app .character .avatar img { will-change: auto; }
/* Tiles dealt in with a 3D spin (48 at once) shimmered on phones; they rise and fade in instead. */
html.phone-app[data-pack="showcase"] #cards.sc-deal > :nth-child(-n+48) { animation-name: phone-deal; animation-duration: .45s; }
@keyframes phone-deal { from { opacity: 0; transform: translateY(18px); } }
/* Smooth, contained scrolling inside the board and dialogs (no pulling the whole page along). */
html.phone-app :is(#library-section, dialog, .notes) { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* While Home covers the screen, the page under it (Library, History, a board) is taken out of layout. With the
   board's tiles still laid out behind Home, the phone re-checked which tiles were on screen every frame
   (about 1,300 layouts): going back to Home froze for seconds after visiting the Library (1.0.5). */
html.phone-app body.home-on > main { display: none !important; }

/* ---------- 6. Shadows: one soft shadow instead of stacked large ones ---------- */
html.phone-app[data-pack="showcase"] :is(.home-card, .home-tile, .choice-tile, .variant-tile, .history-item, .play-card) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 8px 18px rgba(0, 0, 0, .3); }
html.phone-app[data-pack="showcase"] :is(.notes, .result-sheet, dialog) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 12px 28px rgba(0, 0, 0, .4); }
