/**
 * The app's two glass surfaces — one definition each, reused everywhere, so a
 * panel and a button read as one visual system (docs/21 §21.2).
 *
 * Deliberately global CSS (loaded once per HTML entry, like tokens.css)
 * rather than duplicated inside each component's <style scoped> block, since
 * Vue's style scoping otherwise forces the same handful of declarations to
 * be re-typed per component (DRY) — see project_log.md's 2026-09-12 entry.
 *
 * A pure dark tint over this game's near-black starfield is invisible —
 * "glass" only reads as glass once there's something to catch the light, so
 * the tint leans toward the signal-cyan/white end rather than toward the
 * dark hull colour, per standard glassmorphism practice (blur + a light,
 * low-opacity tint + a bright hairline edge), not a from-scratch design:
 * https://dev.to/nickbenksim/glassmorphism-effect-with-backdrop-filter-16jh
 *
 * Both shapes are the same straight 45° cut on the top-right and bottom-left
 * corners (docs/21 §21.2 — a chamfer, never a border-radius).
 *
 * Apply as an additional class alongside a component's own layout class
 * (padding, sizing, etc. stay in that component's own scoped styles). A
 * component that needs a different corner size sets `--c` on itself; one that
 * needs a different shape (a hex, a full-bleed bar) sets its own `clip-path`,
 * which out-specifies this.
 */
.glass-panel,
.glass-button {
  --c: var(--chamfer-md, 10px);
  background: linear-gradient(
    165deg,
    rgba(61, 224, 208, 0.10) 0%,
    rgba(255, 255, 255, 0.05) 35%,
    rgba(4, 6, 10, 0.20) 100%
  );
  clip-path: polygon(
    0 0, calc(100% - var(--c)) 0, 100% var(--c),
    100% 100%, var(--c) 100%, 0 calc(100% - var(--c))
  );
}

/**
 * Panels: a pane of glass over the scene behind it — blurred, tinted, edged in
 * a subdued signal cyan. The hero card (the TV's placement card) sets its own
 * full-strength `--signal` edge on top of this.
 */
.glass-panel {
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(61, 224, 208, 0.35);
}

/**
 * Flat panels: the same glass with no edge and square corners. The TV's top bar and
 * its two side panels are one scene rather than three framed boxes, so they drop
 * the hairline and the chamfer (the placement card and dialogs keep both).
 */
.glass-panel.glass-flat {
  border: none;
  clip-path: none;
}

/**
 * Buttons: the same glass, quieter edge, a small spaced uppercase label — the
 * look of the Lobby's open seats. Hover and focus light the edge signal cyan;
 * `.active` keeps it lit (a selected chip). No backdrop blur: dozens of these
 * can be on a phone screen at once, and blur per button is a real cost.
 */
.glass-button {
  border: 1px solid var(--grid, #1C2836);
  color: var(--text-dim, #8494A6);
  font-family: var(--font-display, system-ui, sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color var(--duration-base, 200ms) var(--ease-machine, ease),
    color var(--duration-base, 200ms) var(--ease-machine, ease);
}
.glass-button:not(:disabled):hover,
.glass-button:focus-visible,
.glass-button.active {
  border-color: var(--signal, #3DE0D0);
  color: var(--signal-bright, #7BFFF2);
}
.glass-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/**
 * Prompts — every dialog in the game opens and closes like the TV's placement card (docs/07 §7.9).
 * Vuetify's `VDialog` default transition is set to `prompt` in `plugins/vuetify.ts`, so a new dialog gets this
 * without asking. The transition classes land on the dialog's own content wrapper.
 *
 * In: a bright pop that settles, with a diagonal sweep of light across it (the buttons' hover sweep).
 * Out: it contracts vertically to a line across the middle, very quickly, while its glass turns white, then
 * goes out with a flicker, like an old TV switching off.
 */
/* The pop is a scale on the wrapper and the brightness flash on the panel inside it. Nothing that makes a backdrop
   root (opacity below 1, filter) may sit on the wrapper: the panel's own glass blur would then see only the wrapper's
   empty contents until the animation ended, and the blur would appear after the shimmer instead of with the panel. */
.prompt-enter-active {
  animation: prompt-in 480ms cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}
.prompt-enter-active > * { animation: prompt-flash 480ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.prompt-enter-active::after {
  content: ''; position: absolute; inset: -40% -60%; pointer-events: none;
  background: linear-gradient(100deg, transparent 40%, var(--signal-ghost, rgba(61, 224, 208, 0.35)) 50%, transparent 60%);
  animation: prompt-sweep 700ms ease-out;
}
/* `scale`, the individual property, not `transform: scale()`: an element centred with `translateX(-50%)` (the enemy step card, a strip)
   keeps its centring while it pops in and out. A `transform` keyframe replaced the centring for the length of the animation, so the
   words came in on the right of the middle and jumped to the centre when it ended (2026-10-15, from Per). */
@keyframes prompt-in {
  0% { scale: 0.94; }
  100% { scale: 1; }
}
@keyframes prompt-flash {
  0% { opacity: 0; filter: brightness(2.2); }
  40% { opacity: 1; }
  100% { opacity: 1; filter: brightness(1); }
}
@keyframes prompt-sweep { from { transform: translateX(-120%); } to { transform: translateX(120%); } }

.prompt-leave-active { animation: prompt-out 460ms cubic-bezier(0.55, 0, 0.75, 0.4) forwards; pointer-events: none; }
.prompt-leave-active > * { animation: prompt-content-out 160ms ease-out forwards; }
@keyframes prompt-out {
  0%   { scale: 1 1; opacity: 1; background-color: rgba(255, 255, 255, 0); }
  40%  { scale: 1 0.012; opacity: 1; background-color: rgba(255, 255, 255, 0.7); }
  60%  { scale: 1 0.012; opacity: 1; background-color: rgba(255, 255, 255, 0.85); }
  70%  { scale: 1 0.012; opacity: 0.25; }
  80%  { scale: 1 0.012; opacity: 1; }
  90%  { scale: 0.35 0.012; opacity: 0.4; }
  100% { scale: 0 0.012; opacity: 0; }
}
@keyframes prompt-content-out { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .prompt-enter-active, .prompt-enter-active > *, .prompt-enter-active::after { animation: none; }
  .prompt-leave-active { animation: none; transition: opacity 120ms ease; opacity: 0; }
  .prompt-leave-active > * { animation: none; }
}

/**
 * The logo's glow — the halo the TV's lobby puts behind it, so the phone's screens
 * carry the same mark the same way.
 */
.brand-glow {
  filter: drop-shadow(0 0 40px var(--signal-glow, rgba(61, 224, 208, 0.35)));
}

/**
 * Slide-out drawers on the phone (Vuetify `v-navigation-drawer`, `class="glass-drawer"`): the same glass as a panel, so the
 * console shows through, blurred, behind the action sheet. Square corners and a single edge on the open side, since a drawer is
 * flush with the screen. Needs `.v-navigation-drawer` in the selector to out-specify Vuetify's own opaque surface colour.
 */
.v-navigation-drawer.glass-drawer {
  background:
    linear-gradient(165deg, rgba(61, 224, 208, 0.10) 0%, rgba(255, 255, 255, 0.05) 35%, rgba(4, 6, 10, 0.20) 100%),
    rgba(6, 10, 16, 0.55);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-left: 1px solid rgba(61, 224, 208, 0.35);
  box-shadow: none;
}

/** The phone's notice bar (Vuetify `v-snackbar`, `class="glass-snackbar"`): glass over the console, a signal edge. */
.v-snackbar.glass-snackbar .v-snackbar__wrapper {
  background:
    linear-gradient(165deg, rgba(61, 224, 208, 0.10) 0%, rgba(255, 255, 255, 0.05) 35%, rgba(4, 6, 10, 0.20) 100%),
    rgba(6, 10, 16, 0.55);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(61, 224, 208, 0.35);
  box-shadow: none;
}

/** A drawer with a close button in its top right corner (`SlideoutClose.vue`): leave the corner clear of the content. */
.v-navigation-drawer.glass-drawer.has-close .v-navigation-drawer__content {
  padding-top: calc(3.4rem + env(safe-area-inset-top, 0px));
}

