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

* { 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%, #d8eee7 0, transparent 48%),
    radial-gradient(ellipse at 86% 90%, #3dc2b11f 0, transparent 42%),
    #f4f8f7;
}

.device-shell {
  position: relative;
  width: min(var(--device-width), calc(100vw - 32px));
  aspect-ratio: 410 / 868;
  padding: 12px 10px;
  border: 1px solid #304947;
  border-radius: 46px;
  background: linear-gradient(145deg, #254845, #111f1e 65%);
  box-shadow: 0 26px 64px #12443f2b, 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: #111f1e;
  transform: translateX(-50%);
  pointer-events: none;
}
.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 34px;
  background: #f4f8f7;
}
#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: #566c68;
  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: #566c6880;
  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%, #3dc2b120, transparent 48%), linear-gradient(145deg, #12443f, #1b5f57);
}
.loader-mark { width: 72px; height: 72px; border-radius: 16px; }
.loader-ring { width: 28px; height: 28px; border: 3px solid #ffffff26; border-top-color: #3dc2b1; 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: #26756b; 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; } }
