@font-face {
  font-family: "Fredoka";
  src: url("puzzboom-loader-font-2ba02e68b152868aef9ba28e24b3648c7d457fe6f25c761f2c2c53fb61a73fc8.ttf") format("truetype");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  font-family: "Fredoka", "Trebuchet MS", sans-serif;
  color: #fff0d0;
  background: #190b28;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body { overflow: hidden; }
[hidden] { display: none !important; }
#canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
#status {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  align-items: safe center;
  gap: 12px;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(52px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  overflow: auto;
  background: #190b28 url("puzzboom-loader-background-61a5461f364ba5ee8951e95bc56619e836b9db92f6ec43fd1c0d37ae846d9169.webp") center / cover;
  isolation: isolate;
}
#status::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, #190b2830, #100718c9 90%);
}
.ambience {
  position: fixed;
  inset: -15%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 43%, #ffb44916, transparent 48%);
  animation: glow 6s ease-in-out infinite alternate;
}
#loader-card { width: min(480px, 100%); text-align: center; }
.brand { display: flex; justify-content: center; }
#brand-image {
  width: auto;
  max-width: 100%;
  height: clamp(160px, 43svh, 430px);
  object-fit: contain;
  filter: drop-shadow(0 12px 24px #09030b80);
  animation: float 4s ease-in-out infinite;
}
.loading-panel {
  position: relative;
  padding: clamp(18px, 3vw, 28px);
  border: 2px solid #e9b17466;
  border-radius: 32px 32px 38px 38px;
  background: repeating-linear-gradient(4deg, transparent 0 3px, #ffe8c503 3px 4px),
    linear-gradient(145deg, #61404be8, #312136f5);
  box-shadow: inset 0 2px 0 #ffdfad18, 0 7px 0 #140b20a6, 0 20px 40px #09030b66;
}
.eyebrow { margin: 0 0 8px; color: #f3c887; font-size: clamp(13px, 2vw, 16px); }
h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 600;
  line-height: 1.12;
  text-shadow: 0 3px 0 #271524;
}
#status-detail { margin: 12px 0 22px; color: #e3cbd4; font-size: 17px; line-height: 1.45; }
.progress-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 16px;
  color: #f0d7b5;
}
#status-percent { font-weight: 600; color: #ffdc93; font-variant-numeric: tabular-nums; }
#status-progress {
  display: block;
  width: 100%;
  height: 24px;
  overflow: hidden;
  border: 2px solid #9f726c;
  border-radius: 20px;
  background: #1f142a;
  color: #ffc367;
  accent-color: #ffc367;
}
#status-progress::-webkit-progress-bar { border-radius: 20px; background: #1f142a; box-shadow: inset 0 3px 5px #09030b88; }
#status-progress::-webkit-progress-value {
  border-radius: 20px;
  background: linear-gradient(#ffe4a1, #ffb04f);
  box-shadow: inset 0 2px 0 #fff3cfaa, 0 0 16px #ffbf4d55;
  transition: width 120ms linear;
}
#status-progress::-moz-progress-bar { border-radius: 20px; background: linear-gradient(#ffe4a1, #ffb04f); }
#status-progress:not([value]) {
  background: repeating-linear-gradient(120deg, #3c283c 0 20px, #b37f4b 20px 36px, #3c283c 36px 56px);
  background-size: 112px 100%;
  animation: pending 2s linear infinite;
}
#status-progress:not([value])::-webkit-progress-bar { background: transparent; }
#status-notice { margin: 18px 0; color: #ffe5c3; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
#status-retry {
  min-width: 160px;
  min-height: 52px;
  padding: 12px 26px;
  border: 2px solid #ffd593;
  border-radius: 22px 22px 26px 26px;
  background: linear-gradient(#dca56a, #a5674f);
  box-shadow: inset 0 2px 0 #ffebba80, 0 5px 0 #432237;
  color: #fff0d0;
  font: 600 21px "Fredoka", sans-serif;
  text-shadow: 0 2px 0 #663c35;
  cursor: pointer;
  transition: transform 120ms, filter 120ms, box-shadow 120ms;
}
#status-retry:hover { filter: brightness(1.12); transform: translateY(-2px); }
#status-retry:active { transform: translateY(4px); box-shadow: inset 0 2px 0 #ffebba40, 0 1px 0 #432237; }
#status-retry:focus-visible { outline: 3px solid #ffe5ab; outline-offset: 5px; }
footer { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); color: #c4a0c0; font-size: 14px; letter-spacing: .06em; }
.no-script { color: #ffe5c3; line-height: 1.5; }
@keyframes float { 50% { transform: translateY(-7px); } }
@keyframes glow { to { opacity: .4; transform: scale(1.08); } }
@keyframes pending { to { background-position: 112px 0; } }
@media (max-height: 500px) and (min-width: 600px) {
  #status { padding-top: 18px; padding-bottom: 44px; }
  #loader-card { width: min(850px, 100%); display: grid; grid-template-columns: minmax(160px, .9fr) minmax(260px, 1fr); gap: 24px; align-items: center; }
  #brand-image { height: min(300px, 76svh); }
  .loading-panel { padding: 20px; }
}
@media (max-width: 360px), (max-height: 650px) and (max-width: 599px) {
  #status { padding-left: 14px; padding-right: 14px; }
  #brand-image { height: 34svh; min-height: 130px; }
  .loading-panel { padding: 18px; border-radius: 26px; }
  #status-detail { margin-bottom: 16px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  #status { background: Canvas; }
  .loading-panel { background: Canvas; border-color: CanvasText; }
  #status-progress, #status-retry { border-color: ButtonText; }
}
