/* The sign-on ident, the moment the Game Center opens. On the TV the LED floor powers up from the middle and drains
   back down to the four tiles of the mark, the last tile is claimed in gold, the name slides out from behind it, and
   the lockup flies up into the corner of the top bar as the stage fades in under it. A phone gets a one-second cut.
   splash.js runs the timeline. Should it stop partway, this sheet takes the cover away by itself after eight seconds.
   Only opacity and transform move, on plain boxes, so a phone's compositor runs all of it while the page under the
   cover is still starting up; the gold tile's flash is a layer fading over it. Lite mode drops the floor and the light. */

/* splash.js puts the cover up (.run) and holds the lockup back until its clock starts (.go). */
.splash { display: none; position: fixed; inset: 0; z-index: 60; overflow: hidden; }
.splash.run { display: block; animation: splash-fallback 400ms 8s forwards; }
.splash:not(.go) .splash-stage { visibility: hidden; }
@keyframes splash-fallback { to { opacity: 0; visibility: hidden; } }
/* The real mark waits under the cover for the lockup to land on it. */
html.splashing .top .mark, html.splashing .bar .mark { opacity: 0; animation: splash-mark 1ms 8.3s forwards; }
@keyframes splash-mark { to { opacity: 1; } }

.splash-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 125% 105% at 50% 46%, transparent 50%, rgba(0, 0, 0, 0.66) 100%),
    radial-gradient(ellipse 62% 58% at 50% 46%, var(--surface-3), var(--obsidian) 76%);
}
.splash-floor { position: absolute; inset: 0; width: 100%; height: 100%; }

/* One key light from the rig onto the lockup, and the pool it leaves on the floor. */
.splash-cone { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.splash-cone::before, .splash-cone::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); }
.splash-cone::before {
  top: -6%; width: 64vw; height: 62%;
  background: linear-gradient(180deg, rgba(var(--cyan-rgb), 0.17), rgba(var(--cyan-rgb), 0.04) 70%, transparent);
  clip-path: polygon(36% 0, 64% 0, 100% 100%, 0 100%);
}
.splash-cone::after {
  top: 40%; width: 84vw; height: 34vh;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(var(--cyan-rgb), 0.1), transparent 72%);
}

/* splash.js pins the stage's height as the clock starts: a phone opened from its home screen can grow the window
   partway through, and the lockup stays where it is instead of jumping to the new middle. */
.splash-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-bottom: 8vh; }
/* The lockup is the top bar's mark at four and a half times the size, in the same proportions, so one uniform scale
   lands it exactly on the real one. */
.splash-lockup {
  display: flex; align-items: center; gap: 0.6em; margin: 0;
  font-size: min(10.8vh, 6.2vw); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; line-height: 1.3;
  color: var(--ink); white-space: nowrap; transform-origin: 0 0;
}
/* The mark's grid, drawn as boxes: a 20-unit square holding four 8-unit tiles with 1.6-unit outlines, the same
   geometry as the bar's SVG mark. */
.splash-grid { --u: calc(1.3em / 20); position: relative; flex: none; width: calc(20 * var(--u)); height: calc(20 * var(--u)); }
.splash-grid i {
  position: absolute; left: 1%; top: 1%; width: 48%; height: 48%;
  border: calc(1.6 * var(--u)) solid var(--cyan);
}
.splash-grid .g, .splash-grid .br { left: 51%; }
.splash-grid .bl, .splash-grid .br { top: 51%; }
.splash-grid .g { border-color: var(--gold); background: rgba(var(--gold-rgb), 0.4); }
.splash-grid .g b { position: absolute; inset: 0; background: var(--gold); opacity: 0; }
/* The ping off the gold tile, drawn at the size it spreads to and scaled down to the tile to start. */
.splash-grid .bloom {
  left: calc(15 * var(--u)); top: calc(5 * var(--u)); width: calc(24.96 * var(--u)); height: calc(24.96 * var(--u));
  margin: calc(-12.48 * var(--u)); border: calc(2.08 * var(--u)) solid var(--gold); opacity: 0;
}
/* The name comes out from behind the mark through this window, which moves with the mark's edge. */
.splash-reveal { display: block; overflow: hidden; }
.splash-word { display: block; }

/* The phone's bar mark: 13px type, a 16px grid and an 8px gap, in the bar's semibold. */
body.phone .splash-stage { padding-bottom: 6vh; }
body.phone .splash-lockup { gap: 0.6154em; font-size: min(7vw, 36px); font-weight: 600; }
body.phone .splash-grid { --u: calc(1.2308em / 20); }

html.lite .splash-cone { display: none; }
html.lite .splash-bg { background: var(--obsidian); }
html.legacy-tv .splash,
html.legacy-tv .splash-bg,
html.legacy-tv .splash-floor,
html.legacy-tv .splash-cone,
html.legacy-tv .splash-stage,
html.legacy-tv .splash-grid .g b { top: 0; right: 0; bottom: 0; left: 0; }
html.legacy-tv .splash-lockup { font-size: 6.2vw; }
