/* The "Forge" start screen (forge.js), as the owner approved it
   (.design/loading-screens/APPROVED.md). Shared by the web app's start screen
   (index.html, .sp-page: the whole page) and the Windows app's start splash
   (desktop/splash/: a small transparent window, the rounded card is all of it).
   Font paths are relative: /forge/ on the web, ui/forge/ in the Windows app. */
@font-face {
  font-family: Fredoka;
  src: url(../assets/fonts/fredoka-700.woff2) format('woff2');
  font-weight: 700;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url(../assets/fonts/plus-jakarta-sans-latin.woff2) format('woff2');
  font-weight: 200 800;
}
.sp {
  --forge-ember: #f0461e;
  --forge-gold: #ffc53d;
  --forge-hex-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='48.5'%3E%3Cpath d='M14 0 28 8.08v16.17L14 32.33 0 24.25V8.08zM14 32.33v16.17' fill='none' stroke='rgba(255,140,90,0.18)' stroke-width='1'/%3E%3C/svg%3E");
}
.sp {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  color: #fff;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.07);
  animation: sp-in 0.42s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.sp > * {
  position: relative;
}
.sp .fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.sp-name {
  font: 700 34px/1 Fredoka;
  letter-spacing: -0.01em;
  margin-top: 14px;
}
.sp-name b {
  color: var(--forge-ember);
  font-weight: inherit;
}
.sp-tag {
  margin-top: 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.36em;
  padding-left: 0.36em;
  color: rgba(255, 255, 255, 0.42);
}
.sp-status {
  margin-top: 12px;
  min-height: 17px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.68);
}
.sp-version {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  font: 700 11px/1 Fredoka;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.28);
}
.sp-logo {
  width: 66px;
  height: 66px;
  overflow: visible;
  transition: filter 0.26s;
}
.sp-logo .hex {
  fill: none;
  stroke: var(--forge-ember);
  stroke-width: 9;
  stroke-linejoin: round;
}
.sp-logo .glyph {
  fill: none;
  stroke: #fff;
  stroke-width: 10;
  stroke-linecap: square;
}
.sp-logo .play {
  fill: var(--forge-ember);
  transform-origin: 68px 78px;
}
.sp-logo .spark {
  fill: #fff;
  filter: drop-shadow(0 0 5px #ffd0a0) drop-shadow(0 0 12px var(--forge-ember));
  opacity: 0;
}
.sp.forge {
  background:
    radial-gradient(70% 70% at 50% 30%, rgba(240, 70, 30, 0.32), transparent 70%),
    linear-gradient(180deg, #1c0c08, #0a0607);
}
.sp.forge::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background: var(--forge-hex-tile) 0 0 / 28px 48.5px;
  mask: radial-gradient(60% 70% at 50% 35%, #000, transparent 75%);
}
.sp.forge::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 190, 150, 0.22),
    inset 0 0 0 1px rgba(240, 70, 30, 0.22);
}
.sp.forge .sp-logo.lit {
  filter: drop-shadow(0 0 16px rgba(240, 70, 30, 0.95));
}
.sp-meter {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sp-meter i {
  width: 13px;
  aspect-ratio: 1/1.1547;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: rgba(255, 255, 255, 0.1);
  transition:
    background 0.25s,
    filter 0.25s;
}
.sp-meter i.on {
  background: linear-gradient(180deg, var(--forge-gold), var(--forge-ember));
  filter: drop-shadow(0 0 6px rgba(255, 140, 60, 0.9));
}
.sp-meter i.pop {
  animation: as-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.sp-meter b {
  margin-left: 8px;
  min-width: 3em;
  text-align: left;
  font: 700 13px/1 Fredoka;
  color: var(--forge-gold);
  font-variant-numeric: tabular-nums;
}
/* The exit (splash.js): the logo flashes, then the splash fades out growing. */
.sp-logo.flash {
  animation: sp-logo-flash 0.26s ease both;
}
.sp.leaving {
  pointer-events: none;
  animation: sp-out 0.26s ease 0.26s both;
}
@keyframes as-pop {
  40% {
    scale: 1.5;
  }
}
@keyframes sp-in {
  from {
    opacity: 0;
    transform: scale(0.9);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
@keyframes sp-out {
  to {
    opacity: 0;
    transform: scale(1.05);
  }
}
@keyframes sp-logo-flash {
  50% {
    filter: brightness(2.2) drop-shadow(0 0 16px rgba(240, 70, 30, 0.95));
  }
}
/* The web app's start screen: the whole page, no card corners, a bit larger. */
.sp.sp-page {
  position: fixed;
  z-index: 9999;
  border-radius: 0;
  box-shadow: none;
}
.sp.sp-page::after {
  display: none;
}
@media (min-width: 720px) and (min-height: 520px) {
  .sp-page > :not(.fx) {
    zoom: 1.4;
  }
}
/* Reduced motion: no embers, the logo drawn at once, nothing pops; the exit is a fade. */
@media (prefers-reduced-motion: reduce) {
  .sp,
  .sp-meter i.pop,
  .sp-logo.flash {
    animation: none;
  }
  .sp.leaving {
    animation: sp-fade-out 0.26s ease both;
  }
}
@keyframes sp-fade-out {
  to {
    opacity: 0;
  }
}
