/* Myanmar fonts (single weight each; the range stops browsers faking a bolder one) */
@font-face { font-family: "Z06 Walone"; src: url("../assets/fonts/Z06-Walone-Bold.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Z08 Strong"; src: url("../assets/fonts/Z08-Strong-Bold.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --bg-top: #48555e;
  --bg-mid: #48555e;
  --bg-bottom: #313237;
  --panel: rgba(62, 66, 80, 0.94);
  --panel-line: rgba(255, 255, 255, 0.12);
  --blue: #1aa3ff;
  --blue-2: #0f8cf0;
  --blue-text: #29a3ff;
  --glow: rgba(26, 163, 255, 0.75);
  --text: #ffffff;
  --muted: #b8c0cc;
  --red: #ff4d4d;
  --my: "Z06 Walone", "Noto Sans Myanmar", "Myanmar Text", "Pyidaungsu", sans-serif;
  --title: "Z08 Strong", "Z06 Walone", "Noto Sans Myanmar", "Myanmar Text", sans-serif;
  --en: "Roboto Condensed", "Arial Narrow", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--my);
  color: var(--text);
  position: relative;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 55%, var(--bg-bottom) 100%) var(--bg-bottom);
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- background scene ---------- */
.scene { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.scene::before { /* soft spotlight behind the title */
  content: ""; position: absolute; left: 50%; top: -120px; width: 680px; height: 520px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(26, 163, 255, .16), transparent);
}
.scene-bg { /* full backdrop, anchored to the bottom; its flat top blends into the page colour */
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, 560px); height: auto;
}
@media (min-width: 600px) {
  .scene-bg {
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  }
}
.char {
  position: absolute; bottom: 0; left: 50%; display: none;
  height: calc(min(100vw, 560px) * .74); width: auto;
  margin-left: calc(min(100vw, 560px) * -.04);
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .45));
  animation: char-in .6s cubic-bezier(.2, .9, .3, 1) both;
}
body[data-screen="check"] .char { height: calc(min(100vw, 560px) * .64); }
body[data-screen="check"] .char-check,
body[data-screen="result"][data-result="pass"] .char-pass,
body[data-screen="result"][data-result="fail"] .char-fail { display: block; }
@keyframes char-in { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

main { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 0 16px; }

.screen { display: none; position: relative; min-height: 100svh; padding: 22px 0 24px; }
#screen-check { padding-bottom: calc(min(100vw, 560px) * .6); }
.screen.active { display: flex; flex-direction: column; animation: rise .4s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- check screen ---------- */
.title {
  margin: 0 0 8px; text-align: center; font-family: var(--title); font-weight: 900; font-size: clamp(34px, 11vw, 50px); line-height: 1.4;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}
.eyebrow {
  align-self: center; display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px;
  padding: 3px 14px 3px 10px; border-radius: 999px; border: 1px solid rgba(26, 163, 255, .45);
  background: rgba(26, 163, 255, .12); color: #8fd0ff;
  font-family: var(--my); font-weight: 700; font-size: 12.5px; letter-spacing: 2.5px;
}
.eyebrow-bolt { letter-spacing: 0; filter: drop-shadow(0 0 6px rgba(255, 210, 31, .8)); }
.title .en { font-family: var(--en); font-weight: 800; font-size: .74em; color: var(--blue-text); letter-spacing: .3px; text-shadow: 0 0 22px rgba(26, 163, 255, .45), 0 2px 0 #0b5fb0; }
.subtitle { text-align: center; margin: 0 0 22px; font-size: clamp(12.5px, 3.8vw, 16px); line-height: 1.8; color: #eef2f7; }
.nw { white-space: nowrap; }

.form { position: relative; z-index: 2; }
.panel {
  padding: 18px 14px 16px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(44, 47, 60, .72), rgba(44, 47, 60, .5));
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.corner { position: absolute; width: 18px; height: 18px; border: 3px solid var(--blue); pointer-events: none; filter: drop-shadow(0 0 6px rgba(26, 163, 255, .6)); }
.corner.tl { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.corner.tr { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.corner.bl { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.corner.br { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.step {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
  font-family: var(--en); font-weight: 800; font-size: 14px; color: #fff;
  background: linear-gradient(180deg, #2bb0ff, #0f86e6); box-shadow: 0 0 0 3px rgba(26, 163, 255, .18);
}
.select-field .step { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); z-index: 1; pointer-events: none; }
.select-field:has(select:disabled) .step, .select-field:has(button:disabled) .step { background: #5b6172; box-shadow: none; }
.select-field {
  position: relative; display: block; margin-bottom: 14px;
}
.select-field::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 11px; height: 11px; pointer-events: none;
  border-right: 2.5px solid #c9d0da; border-bottom: 2.5px solid #c9d0da; transform: translateY(-70%) rotate(45deg);
}
select {
  width: 100%; height: 62px; appearance: none; -webkit-appearance: none;
  padding: 0 42px 0 52px; border-radius: 14px; font: inherit; font-size: 15px; color: var(--text);
  background: var(--panel); border: 1.5px solid var(--panel-line);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .25); transition: border-color .2s, box-shadow .2s, opacity .2s;
}
select:invalid, select:has(option:checked[value=""]) { color: #c2c9d3; }
select:disabled { opacity: .55; }
select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 163, 255, .2), inset 0 2px 8px rgba(0, 0, 0, .25); }
select option { color: #111; background: #fff; }

/* model picker trigger (looks like the brand dropdown) */
.picker-btn {
  width: 100%; height: 62px; padding: 0 42px 0 52px; border-radius: 14px; cursor: pointer; text-align: left;
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--panel); border: 1.5px solid var(--panel-line);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .25); transition: border-color .2s, box-shadow .2s, opacity .2s;
}
.picker-btn span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-btn.placeholder { color: #c2c9d3; }
.picker-btn:disabled { opacity: .55; cursor: not-allowed; }
.picker-btn:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 163, 255, .2), inset 0 2px 8px rgba(0, 0, 0, .25); }

/* ---------- model picker sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; justify-content: center; align-items: flex-end; background: rgba(20, 22, 30, .6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s ease both; }
.sheet[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.sheet-panel {
  display: flex; flex-direction: column; width: 100%; max-width: 480px; height: calc(100% - 44px); max-height: 760px;
  background: #3a3d4b; border-radius: 22px 22px 0 0; border: 1px solid rgba(255, 255, 255, .1); border-bottom: 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .45); animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1) both; overflow: hidden;
}
@keyframes sheet-up { from { transform: translateY(40%); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 6px 18px; }
.sheet-head h3 { margin: 0; font-family: var(--en), var(--my); font-size: 20px; font-weight: 800; letter-spacing: .3px; }
.sheet-close { width: 44px; height: 44px; border: 0; background: none; color: #c9d0da; font-size: 30px; line-height: 1; cursor: pointer; }
.sheet-search {
  position: relative; display: flex; align-items: center; gap: 10px; margin: 2px 14px 0; padding: 0 12px; height: 52px; border-radius: 14px;
  background: #2c2f3a; border: 1.5px solid var(--panel-line); transition: border-color .2s, box-shadow .2s;
}
.sheet-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 163, 255, .2); }
.sheet-search svg { width: 22px; height: 22px; flex: none; fill: none; stroke: #c9d0da; stroke-width: 2.4; stroke-linecap: round; }
.sheet-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; font-size: 16px; -webkit-appearance: none; appearance: none; }
.sheet-search input::placeholder { color: #aab2be; font-size: 14.5px; }
.sheet-search input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.search-clear[hidden] { display: none; }
.sheet-count { margin: 8px 18px 4px; font-size: 12.5px; color: var(--muted); font-family: var(--en), var(--my); }
.model-list { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; list-style: none; margin: 0; padding: 0 10px calc(16px + env(safe-area-inset-bottom)); }
.model-list .group {
  position: sticky; top: 0; z-index: 1; padding: 8px 8px 6px; margin-top: 4px; background: #3a3d4b;
  font-family: var(--en); font-size: 12.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #8fd0ff;
}
.model-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 48px; padding: 8px 12px;
  border: 0; border-radius: 12px; background: none; color: #fff; cursor: pointer; text-align: left;
  font-family: var(--en), var(--my); font-size: 16.5px;
}
.model-opt small { flex: none; color: var(--muted); font-size: 13px; }
.model-opt mark { background: none; color: var(--blue-text); font-weight: 700; }
.model-opt:hover, .model-opt:focus-visible { background: rgba(255, 255, 255, .07); outline: none; }
.model-opt[aria-selected="true"] { background: rgba(26, 163, 255, .2); box-shadow: inset 0 0 0 1.5px rgba(26, 163, 255, .6); }
.model-list .empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.9; }
body.sheet-open { overflow: hidden; }

.ram-group { border: 0; margin: 4px 0 0; padding: 0; animation: rise .3s ease both; }
.ram-group[hidden] { display: none; }
.ram-group legend { display: flex; align-items: center; gap: 10px; padding: 0; margin: 0 0 10px 2px; font-size: 15px; font-weight: 700; color: #eef2f7; }
.ram-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.ram-btn {
  height: 54px; border-radius: 14px; cursor: pointer;
  font-family: var(--en); font-size: 20px; font-weight: 700; color: #e6ebf1;
  background: var(--panel); border: 1.5px solid var(--panel-line); box-shadow: inset 0 2px 8px rgba(0, 0, 0, .2);
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
}
.ram-btn small { font-size: 14px; font-weight: 500; margin-left: 2px; opacity: .8; }
.ram-btn:active { transform: scale(.96); }
.ram-btn:hover:not([aria-pressed="true"]) { border-color: rgba(26, 163, 255, .55); }
.ram-btn[aria-pressed="true"] {
  color: #fff; border-color: var(--blue); background: linear-gradient(180deg, #22adff, var(--blue-2));
  box-shadow: 0 0 0 3px rgba(26, 163, 255, .25), 0 6px 16px rgba(15, 140, 240, .35);
}

.storage-note {
  display: flex; align-items: center; gap: 8px; margin: 16px 2px 0; padding: 8px 12px; border-radius: 12px; background: rgba(26, 163, 255, .08); border: 1px dashed rgba(26, 163, 255, .35); font-size: 13px; line-height: 1.7; color: #dbe2ea;
}
.storage-note svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--blue-text); stroke-width: 2.2; stroke-linecap: round; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  border: 0; cursor: pointer; text-decoration: none; font: inherit; color: #fff;
  border-radius: 999px; transition: transform .12s ease, filter .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ico { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn-primary { background: linear-gradient(180deg, #22adff, var(--blue-2)); box-shadow: 0 8px 22px rgba(15, 140, 240, .35); }
.btn-dark { background: rgba(58, 64, 74, .95); border: 1.5px solid rgba(255, 255, 255, .14); color: #dfe4ea; }
.btn-check { width: 100%; height: 64px; margin-top: 18px; font-size: 22px; font-weight: 700; }
.bolt-ico { fill: #ffd21f !important; stroke: none !important; width: 24px !important; height: 24px !important; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); }
.shine { position: relative; overflow: hidden; }
.shine::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg); animation: shine 3.2s ease-in-out infinite;
}
.shine:disabled::after { display: none; }
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }

/* ---------- result screen ---------- */
.bracket-title {
  position: relative; align-self: center; margin: 0 0 8px; padding: 2px 14px; white-space: nowrap;
  font-family: var(--title); font-weight: 700; font-size: clamp(19px, 6.6vw, 34px); line-height: 1.7;
  color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.bracket-title .en { font-family: var(--en); font-size: .7em; white-space: pre; }
.bracket-title::before, .bracket-title::after {
  content: ""; position: absolute; top: 4px; bottom: 4px; width: 10px; border: 3px solid var(--blue);
}
.bracket-title::before { left: 0; border-right: 0; }
.bracket-title::after { right: 0; border-left: 0; }

.sticker-frame { position: relative; z-index: 1; padding: 8px; }
.fail .sticker-frame .corner { border-color: #ff5a5a; filter: drop-shadow(0 0 6px rgba(255, 77, 77, .6)); }
.sticker-card {
  position: relative; z-index: 1; animation: glow 2.6s ease-in-out infinite; border-radius: 6px; overflow: hidden; aspect-ratio: 1 / 1;
  border: 3px solid var(--blue);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 0 22px var(--glow), 0 0 48px rgba(26, 163, 255, .35);
  background: #222;
}
.fail .sticker-card { border-color: #ff5a5a; box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 0 22px rgba(255, 77, 77, .6), 0 0 48px rgba(255, 77, 77, .3); }
.sticker-card.pop { animation: pop .5s cubic-bezier(.2, 1.5, .4, 1) both, glow 2.6s ease-in-out .5s infinite; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
@keyframes glow { 50% { filter: brightness(1.06) drop-shadow(0 0 10px rgba(26, 163, 255, .35)); } }
.sticker-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sticker-caption {
  position: absolute; left: 8px; right: 8px; bottom: 5%; margin: 0;
  text-align: center; font-weight: 900; font-size: 21px; line-height: 1.85; color: #fff; white-space: pre-line;
  -webkit-text-stroke: 5px #000; paint-order: stroke fill; text-shadow: 0 3px 0 #000;
}

.device-line { position: relative; z-index: 1; text-align: center; margin: 14px 0 0; font-size: 14px; color: var(--muted); font-family: var(--en), var(--my); }
.device-line b { color: #fff; }
.reasons { position: relative; z-index: 1; list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.reasons:empty { display: none; }
.reasons li { font-size: 13.5px; line-height: 1.7; text-align: center; padding: 6px 12px; border-radius: 10px; background: rgba(255, 77, 77, .14); color: #ffc2c2; border: 1px solid rgba(255, 77, 77, .3); }
.reasons li.note, .reasons li.info { background: rgba(26, 163, 255, .12); color: #bfe3ff; border-color: rgba(26, 163, 255, .3); }
.reasons li.caution { display: grid; gap: 2px; padding: 8px 12px; background: rgba(48, 52, 64, .92); }
.reasons li.caution b { color: #ffd21f; font-size: 14.5px; }
.reasons li.caution span { display: block; }
.fail .reasons li { font-size: 15px; font-weight: 700; }
.download-hint { position: relative; z-index: 2; margin: auto 0 8px; padding: 6px 10px; border-radius: 10px; text-align: center; font-size: 13.5px; line-height: 1.7; color: #fff; background: rgba(40, 43, 54, .82); }
.fail .download-hint { display: none; }

.btn-share { position: relative; z-index: 2; width: 100%; height: 62px; margin-top: 18px; border-radius: 18px; font-size: 19px; font-weight: 700; }
.action-row { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.action-row .btn { height: 54px; border-radius: 16px; font-size: 14.5px; white-space: nowrap; padding: 0 8px; gap: 8px; background: rgba(48, 52, 64, .92); }
.action-row .btn .ico { width: 22px; height: 22px; }

.btn-download {
  z-index: 2; margin-top: 0; height: 66px; font-size: 19px; font-family: var(--en), var(--my); font-weight: 500;
}
#screen-result { padding: 14px 0 22px; }
.fail .btn-download { display: none; }
#screen-result .action-row { margin-bottom: calc(min(100vw, 560px) * .26); }
.fail .action-row { margin-bottom: calc(min(100vw, 560px) * .44) !important; }


/* ---------- loading / toast ---------- */
.loading { position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; text-align: center; background: rgba(40, 45, 53, .88); backdrop-filter: blur(4px); }
.loading[hidden] { display: none; }
.loading p { font-weight: 700; margin: 14px 0 0; }
.spinner { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; border: 6px solid rgba(255,255,255,.15); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { position: relative; }
.spinner span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; animation: spin .8s linear infinite reverse; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: #fff; color: #222; padding: 10px 18px; border-radius: 999px; font-size: 14px;
  transition: .25s ease; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 8px 20px rgba(0,0,0,.3);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 360px) {
  .sticker-caption { font-size: 18px; }
  .action-row .btn { font-size: 14px; gap: 6px; }
  .action-row .btn .ico { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
