:root {
  --device-width: 300px;
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7fa;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
  background:
    radial-gradient(ellipse at 24% 16%, #dce8f9 0, transparent 48%),
    radial-gradient(ellipse at 86% 90%, #ff7a0010 0, transparent 42%),
    #f6f7fa;
}

.device-shell {
  position: relative;
  width: min(var(--device-width), calc(100vw - 32px));
  aspect-ratio: 410 / 868;
  padding: 12px 10px;
  border: 1px solid #303d53;
  border-radius: 46px;
  background: linear-gradient(145deg, #263b5c, #071326 65%);
  box-shadow: 0 26px 64px #071f4b2b, inset 0 0 0 1px #ffffff24;
}
.device-shell::before {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: 50%;
  width: 30%;
  height: 20px;
  content: "";
  border-radius: 0 0 14px 14px;
  background: #071326;
  transform: translateX(-50%);
  pointer-events: none;
}
.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 34px;
  background: #f6f7fa;
}
#flutter_host { position: absolute; inset: 0; overflow: hidden; }
.device-status-bar {
  position: absolute;
  z-index: 6;
  top: 20px;
  left: 28px;
  right: 28px;
  height: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #6f7d91;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
}
.device-status-icons { display: flex; align-items: center; gap: 6px; }
.device-wifi { width: 13px; height: 11px; fill: currentColor; }
.device-battery {
  position: relative;
  width: 19px;
  height: 9px;
  padding: 1px;
  border: 1px solid currentColor;
  border-radius: 3px;
}
.device-battery::after {
  position: absolute;
  right: -3px;
  top: 2px;
  width: 2px;
  height: 3px;
  content: "";
  background: currentColor;
  border-radius: 0 1px 1px 0;
}
.device-battery > span { display: block; height: 100%; width: 78%; background: currentColor; border-radius: 1px; }
.device-home-indicator {
  position: absolute;
  z-index: 6;
  bottom: 18px;
  left: 36%;
  right: 36%;
  height: 4px;
  border-radius: 4px;
  background: #6f7d9180;
  pointer-events: none;
}
#web-loader {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 28px;
  color: #fff;
  text-align: center;
  background: radial-gradient(circle at 80% 10%, #ff7a0020, transparent 48%), linear-gradient(145deg, #071f4b, #0b3478);
}
.loader-mark { position: relative; font-size: 66px; font-weight: 800; line-height: 1; }
.loader-mark > span { position: absolute; color: #ff7a00; font-size: 44px; right: -14px; bottom: 0; }
.loader-ring { width: 28px; height: 28px; border: 3px solid #ffffff26; border-top-color: #ff7a00; border-radius: 50%; animation: spin .85s linear infinite; }
#loading-message { margin: 0; font-size: 13px; line-height: 1.6; color: #ffffffcc; }
#loading-message span { display: block; }
#reload-app { border: 0; border-radius: 12px; padding: 12px 18px; color: #fff; background: #d65f00; font: inherit; cursor: pointer; }
#reload-app[hidden] { display: none; }
#reload-app:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
#web-loader.failed .loader-ring { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) {
  body { padding: 6px; }
  .device-shell {
    width: min(var(--device-width), calc(100vw - 12px));
    border-radius: 36px;
  }
  .device-screen { border-radius: 24px; }
}
@media (prefers-reduced-motion: reduce) { .loader-ring { animation: none; } }
