/* Same mascot, Mochiy/M PLUS typography, indigo, coral and raised key as the game. */
.maintenance-document { margin: 0; }
.maintenance-screen,
.maintenance-document {
  box-sizing: border-box;
  color: #f6f3ee;
  background: #131426;
  font: 500 16px/1.6 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', system-ui, sans-serif;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}
.maintenance-screen *, .maintenance-document * { box-sizing: border-box; }
dialog.maintenance-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
dialog.maintenance-screen::backdrop { background: #131426; }
.maintenance-layout {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background:
    radial-gradient(ellipse at 20% 20%, rgb(254 145 54 / 0.09), transparent 45%),
    radial-gradient(ellipse at 85% 65%, rgb(183 189 249 / 0.11), transparent 50%),
    linear-gradient(145deg, #1e203a, #131426 65%);
}
.maintenance-layout::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.25;
  background-image: radial-gradient(circle, #b7bdf9 0.75px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(transparent, #000 30%, transparent);
}
.maintenance-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0 30px;
  font: 400 21px/1.4 'Mochiy Pop One', 'M PLUS Rounded 1c', system-ui, sans-serif;
  color: #f6f3ee;
}
.maintenance-brand > span { width: 15px; height: 15px; color: #f57868; }
.maintenance-brand svg, .maintenance-star svg { display: block; width: 100%; height: 100%; }
.maintenance-panel {
  position: relative;
  align-self: center;
  width: min(100%, 520px);
  padding: 34px 40px 38px;
  margin: 0 0 40px;
  text-align: center;
  background: #1f1f36;
  border: 1px solid #3b3c5c;
  border-radius: 32px;
  box-shadow: 0 8px 0 #0f101f, 0 24px 70px rgb(0 0 0 / 0.22), inset 0 1px 0 rgb(246 243 238 / 0.04);
}
.maintenance-portrait {
  position: relative;
  width: 216px;
  margin: 0 auto 22px;
}
.maintenance-portrait img { display: block; width: 144px; height: 144px; margin: auto; object-fit: contain; }
.maintenance-star { position: absolute; width: 20px; height: 20px; }
.maintenance-star-a { left: 8px; top: 28px; color: #f57868; transform: rotate(-12deg); }
.maintenance-star-b { right: 6px; bottom: 24px; width: 14px; height: 14px; color: #b7bdf9; transform: rotate(8deg); }
.maintenance-panel h1 {
  margin: 0 auto 18px;
  max-width: 430px;
  font: 400 clamp(24px, 4.7vw, 32px)/1.4 'Mochiy Pop One', 'M PLUS Rounded 1c', system-ui, sans-serif;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.maintenance-wait { margin: 0; color: #dbd7e4; font-size: 17px; line-height: 1.7; text-wrap: balance; }
.maintenance-divider { display: flex; align-items: center; gap: 12px; width: 96px; margin: 25px auto 20px; }
.maintenance-divider > span { flex: 1; height: 1px; background: #3b3c5c; }
.maintenance-divider > i { width: 6px; height: 6px; border-radius: 50%; background: #f57868; animation: maintenance-breathe 2.4s ease-in-out infinite; }
.maintenance-return { margin: 0 auto 24px; max-width: 340px; color: #c4bfd2; font-size: 14px; line-height: 1.8; text-wrap: balance; }
.maintenance-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  max-width: 100%;
  padding: 13px 22px;
  border: 1px solid #d9ddfe;
  border-bottom-color: #484b76;
  border-radius: 14px;
  background: #b7bdf9;
  color: #1e203a;
  box-shadow: 0 4px 0 #484b76;
  font: 800 15px/1.5 'M PLUS Rounded 1c', system-ui, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.maintenance-retry > svg { width: 19px; height: 19px; flex: 0 0 auto; }
.maintenance-retry > span { min-width: 0; overflow-wrap: anywhere; }
.maintenance-retry:focus-visible { outline: 3px solid #f6f3ee; outline-offset: 6px; }
.maintenance-retry:enabled:hover { background: #d9ddfe; }
.maintenance-retry:enabled:active { transform: translateY(3px); box-shadow: 0 1px 0 #484b76; }
.maintenance-retry:disabled { cursor: wait; }
@keyframes maintenance-breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@media (max-width: 430px) {
  .maintenance-layout { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .maintenance-brand { font-size: 18px; padding-bottom: 24px; }
  .maintenance-panel { padding: 26px 22px 30px; border-radius: 24px; margin-bottom: 16px; }
  .maintenance-portrait { margin-bottom: 18px; }
  .maintenance-portrait img { width: 120px; height: 120px; }
  .maintenance-wait { font-size: 16px; }
}
@media (max-height: 620px) {
  .maintenance-brand { padding-bottom: 18px; }
  .maintenance-panel { margin-bottom: 8px; padding-top: 22px; padding-bottom: 26px; }
  .maintenance-portrait img { width: 96px; height: 96px; }
  .maintenance-portrait { margin-bottom: 14px; }
  .maintenance-divider { margin-top: 18px; margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) { .maintenance-divider > i { animation: none; opacity: 0.85; } }
