:root {
  color-scheme: light;
  --bg: #f6f3ea;
  --card: #ffffff;
  --card-soft: #f0eee7;
  --text: #071426;
  --muted: #6b7788;
  --accent: #f8bf3b;
  --accent-dark: #d99b00;
  --ink: #071426;
  --danger: #f43f5e;
  --success: #16a34a;
  --line: rgba(7,20,38,.10);
  --shadow: 0 24px 70px rgba(7,20,38,.11);
  font-family: Barlow, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(248,191,59,.25), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(7,20,38,.07), transparent 26%),
    var(--bg);
  color: var(--text);
}
.app-shell {
  width: min(520px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}
.app-header { text-align: center; padding: 10px 0 12px; }
.logo { width: min(265px, 70vw); height: auto; }
.logo.compact { width: min(290px, 76vw); }
.subtitle { margin: 6px 0 0; color: var(--muted); font-weight: 600; }
.screen, .sheet {
  background: rgba(255,255,255,.86);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(16px);
}
.screen { min-height: calc(100vh - 145px); display: flex; flex-direction: column; justify-content: center; }
.progress { display: flex; gap: 8px; justify-content: center; margin-bottom: 22px; }
.progress span { width: 38px; height: 7px; border-radius: 999px; background: rgba(7,20,38,.13); }
.progress .active-dot { background: var(--accent); }
.eyebrow { color: var(--accent-dark); text-transform: uppercase; letter-spacing: .16em; font-weight: 900; font-size: .78rem; margin: 0 0 10px; text-align: center; }
h1 { font-weight: 900; letter-spacing: -0.055em; font-size: clamp(2.35rem, 13vw, 4.3rem); line-height: .88; text-align: center; margin: 0; }
h2 { font-size: 1.45rem; margin: 0 0 8px; letter-spacing: -0.025em; }
.screen-copy { color: var(--muted); text-align: center; font-size: 1.03rem; line-height: 1.45; margin: 18px auto 28px; max-width: 390px; }
.wheel-wrap { display: grid; gap: 16px; justify-items: center; }
.wheel {
  width: min(330px, 78vw);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 30px;
  background: conic-gradient(from 0deg, #f8bf3b, #fff0b8, #071426, #f8bf3b, #ffffff, #071426, #f8bf3b);
  position: relative;
  color: var(--ink);
  font-weight: 900;
  font-size: clamp(1.35rem, 6vw, 2.25rem);
  box-shadow: inset 0 0 0 15px rgba(255,255,255,.62), 0 18px 50px rgba(7,20,38,.16);
  transition: transform .8s cubic-bezier(.17,.67,.22,1.18);
}
.wheel::after { content: ""; position: absolute; inset: 34px; border-radius: 50%; background: rgba(255,255,255,.91); z-index: 0; }
.wheel span { z-index: 1; }
.wheel.spinning { animation: pulse 460ms infinite alternate; }
@keyframes pulse { from { transform: rotate(-4deg) scale(.99); } to { transform: rotate(5deg) scale(1.01); } }
.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 15px 22px;
  min-height: 52px;
  font-weight: 900;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: transform .15s ease, opacity .2s ease, box-shadow .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.primary { background: var(--accent); color: var(--ink); box-shadow: 0 12px 24px rgba(248,191,59,.28); }
.secondary { background: var(--ink); color: #ffffff; box-shadow: 0 12px 24px rgba(7,20,38,.20); }
.ghost { background: var(--card-soft); color: var(--text); border: 1px solid var(--line); }
.full { width: 100%; }
.status { color: var(--muted); margin: 0; min-height: 1.4em; text-align: center; font-weight: 600; }
.back-button { border: 0; background: transparent; color: var(--muted); font-weight: 800; padding: 0; margin: 0 0 20px; align-self: flex-start; cursor: pointer; }
.upload-box {
  min-height: 190px;
  border: 2px dashed rgba(7,20,38,.17);
  border-radius: 28px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(240,238,231,.55));
  cursor: pointer;
  padding: 24px;
  margin-bottom: 14px;
}
.upload-box input { display: none; }
.upload-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 20px; background: var(--accent); font-size: 2.2rem; font-weight: 900; line-height: 1; margin-bottom: 8px; }
.upload-box strong { font-size: 1.2rem; }
.upload-box small { color: var(--muted); font-weight: 600; }
.preview { display: block; width: 100%; max-height: 440px; object-fit: cover; border-radius: 28px; margin: 10px 0 14px; background: #ece8dd; box-shadow: 0 14px 34px rgba(7,20,38,.10); }
.sheet { margin-top: 16px; }
.result.success { border-color: rgba(22,163,74,.28); }
.result.fail { border-color: rgba(244,63,94,.28); }
.result-summary { font-size: 1.1rem; margin: 0 0 14px; font-weight: 800; }
.reason { background: rgba(7,20,38,.045); border-radius: 20px; padding: 16px; color: var(--muted); line-height: 1.45; font-weight: 600; margin-bottom: 14px; }
.muted { color: var(--muted); margin-top: 0; }
.certificate { display: block; width: 100%; border-radius: 18px; background: #f7f0dd; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.hidden { display: none !important; }
.unsupported { min-height: 100vh; width: min(520px, calc(100% - 36px)); margin: 0 auto; display: grid; align-content: center; gap: 20px; text-align: center; }
.phone-card { background: rgba(255,255,255,.86); border: 1px solid var(--line); border-radius: 32px; box-shadow: var(--shadow); padding: 28px; }
.phone-card h1 { font-size: clamp(2.2rem, 10vw, 3.7rem); }
.phone-card p { color: var(--muted); font-weight: 600; line-height: 1.45; }
@media (min-width: 900px) {
  .app-shell { padding-top: 28px; }
}
