@font-face{font-family:'Montserrat';font-style:normal;font-weight:400 600;font-display:swap;src:url(assets/fonts/montserrat-var.woff2) format('woff2')}
@font-face{font-family:'Raleway';font-style:normal;font-weight:600 800;font-display:swap;src:url(assets/fonts/raleway-var.woff2) format('woff2')}
/* Low Cost Glasses – virtual try-on. Brand tokens taken from lowcostglasses.co.uk:
   navy #0e254f (headings/nav, --pri-cl), CTA blue #0b5fff, text #222, muted #878787, line #e6e6e6, soft bg #f4f4f4;
   fonts Raleway (headings/buttons) + Montserrat (body). */
:root{--navy:#0e254f;--blue:#0b5fff;--blue-dk:#0a4fd6;--text:#222;--muted:#878787;--line:#e6e6e6;--soft:#f4f4f4;--hdr:56px;--tray:178px}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:var(--navy);color:var(--text);font-family:Montserrat,system-ui,sans-serif;-webkit-text-size-adjust:100%}
button,a{font:inherit;color:inherit}
[hidden]{display:none!important}

/* header */
#top{position:fixed;top:0;left:0;right:0;height:var(--hdr);z-index:30;display:flex;align-items:center;justify-content:space-between;
 padding:0 max(14px,env(safe-area-inset-right)) 0 max(14px,env(safe-area-inset-left));background:#fff;border-bottom:1px solid var(--line)}
.brand{display:block;height:100%;padding:9px 0}
.brand img{height:100%;width:auto;display:block}
.shoplink{display:inline-flex;align-items:center;gap:2px;text-decoration:none;font:700 14px Raleway,sans-serif;color:var(--navy);padding:8px 4px}
.shoplink svg{width:16px;height:16px}
.shoplink:hover{color:var(--blue)}

/* camera view */
#view{position:fixed;top:var(--hdr);left:0;right:0;bottom:0;overflow:hidden;background:var(--navy)}
#stage{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scaleX(-1)}
#stage video,#stage canvas{position:absolute;inset:0;width:100%;height:100%}
#flash{position:absolute;inset:0;background:#fff;opacity:0;pointer-events:none;z-index:6}
#flash.go{animation:flash .35s ease-out}
@keyframes flash{0%{opacity:.85}100%{opacity:0}}

/* overlay cards (welcome / problem) */
.card-overlay{position:absolute;inset:0 0 var(--tray) 0;display:flex;align-items:center;justify-content:center;padding:16px;z-index:5;
 background:linear-gradient(180deg,rgba(14,37,79,.92),rgba(14,37,79,.97))}
.card-overlay.clear{background:none;pointer-events:none}
.welcome-card{width:min(420px,100%);background:#fff;border-radius:16px;padding:26px 22px 20px;text-align:center;box-shadow:0 12px 40px rgba(0,0,0,.28)}
.welcome-card .glyph{width:64px;height:32px;color:var(--navy)}
.welcome-card h1,.welcome-card h2{font:800 22px/1.2 Raleway,sans-serif;color:var(--navy);margin:10px 0 8px}
.welcome-card p{font-size:13.5px;line-height:1.55;color:var(--text);margin:0 0 18px}
.tips{list-style:none;margin:16px 0 0;padding:0;display:flex;gap:8px 16px;justify-content:center;flex-wrap:wrap;font-size:12px;color:var(--muted)}
.tips li::before{content:"✓ ";color:var(--blue);font-weight:700}
.btn-primary,.btn-ghost{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 24px;border-radius:6px;border:0;cursor:pointer;
 font:700 16px Raleway,sans-serif;text-decoration:none;transition:background .15s,opacity .15s}
.btn-primary{background:var(--blue);color:#fff;width:100%}
.btn-primary:hover:not(:disabled){background:var(--blue-dk)}
.btn-primary:disabled{opacity:.6;cursor:default}
.btn-ghost{background:#fff;color:var(--navy);border:1.5px solid var(--navy)}
.btn-ghost:hover{background:var(--soft)}

/* pills */
#hint,#toast{position:absolute;left:50%;transform:translateX(-50%);z-index:4;max-width:calc(100% - 32px);text-align:center;
 background:rgba(14,37,79,.88);color:#fff;font:600 13px Montserrat,sans-serif;padding:9px 16px;border-radius:999px;backdrop-filter:blur(6px)}
#hint{top:14px}
#toast{top:14px;background:#fff;color:var(--navy);box-shadow:0 4px 18px rgba(0,0,0,.25)}

/* action row above the tray */
#actions{position:absolute;left:0;right:0;bottom:calc(var(--tray) + 14px);z-index:4;display:grid;grid-template-columns:1fr 72px 1fr;align-items:center;justify-items:center;padding:0 16px}
#actions .act{grid-column:auto}
#compare{justify-self:end;margin-right:14px}
.act{display:flex;flex-direction:column;align-items:center;gap:5px;background:none;border:0;cursor:pointer;text-decoration:none;color:#fff;
 text-shadow:0 1px 4px rgba(0,0,0,.5);font:600 11px Montserrat,sans-serif}
.act .ico{width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.94);color:var(--navy);display:grid;place-items:center;box-shadow:0 2px 10px rgba(0,0,0,.28);transition:background .15s,color .15s}
.act .ico svg{width:24px;height:24px}
.act[aria-pressed=true] .ico{background:var(--blue);color:#fff}
.shutter{width:68px;height:68px;border-radius:50%;border:4px solid #fff;background:rgba(255,255,255,.18);padding:4px;cursor:pointer;box-shadow:0 2px 12px rgba(0,0,0,.35)}
.shutter span{display:block;width:100%;height:100%;border-radius:50%;background:#fff;transition:transform .12s}
.shutter:active span{transform:scale(.88)}

/* bottom tray: frame picker */
#tray{position:fixed;left:0;right:0;bottom:0;height:var(--tray);z-index:20;background:#fff;border-radius:16px 16px 0 0;box-shadow:0 -6px 24px rgba(14,37,79,.18);
 padding:12px 0 env(safe-area-inset-bottom);display:flex;flex-direction:column}
.tray-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:0 max(16px,env(safe-area-inset-left)) 8px}
.tray-head strong{font:800 16px Raleway,sans-serif;color:var(--navy)}
#fcolour{margin-left:8px;font:500 12px Montserrat,sans-serif;color:var(--muted)}
#fcount{display:block;font:500 11px Montserrat,sans-serif;color:var(--muted);white-space:nowrap;margin-top:1px}
.tname{min-width:0}.tname>div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.btn-select{flex:none;display:inline-flex;align-items:center;gap:2px;min-height:38px;padding:0 10px 0 16px;border-radius:6px;background:var(--blue);color:#fff;text-decoration:none;font:700 14px Raleway,sans-serif;transition:background .15s}
.btn-select:hover{background:var(--blue-dk)}.btn-select svg{width:16px;height:16px}
.rail-wrap{position:relative;flex:1;min-height:0}
#rail{list-style:none;margin:0;padding:2px 16px 8px;display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x proximity;height:100%;
 scrollbar-width:none;-webkit-overflow-scrolling:touch}
#rail::-webkit-scrollbar{display:none}
#rail li{flex:none;scroll-snap-align:center}
.card{width:104px;height:100%;display:flex;flex-direction:column;border:2px solid transparent;background:var(--soft);border-radius:10px;padding:4px 4px 5px;cursor:pointer;text-align:center;transition:border-color .15s,background .15s}
.card:hover{background:#eceef3}
.card[aria-current=true]{border-color:var(--blue);background:#fff;box-shadow:0 0 0 3px rgba(11,95,255,.14)}
.card img{width:100%;height:auto;aspect-ratio:2/1;object-fit:contain;display:block;margin:auto 0;flex:none}
.card .n{font:700 11px/1.2 Raleway,sans-serif;color:var(--navy);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card .c{font:500 10px/1.2 Montserrat,sans-serif;color:var(--muted);height:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card.loading{opacity:.55}
.chev{position:absolute;top:calc(50% - 22px);width:34px;height:34px;border-radius:50%;border:0;background:#fff;color:var(--navy);box-shadow:0 2px 10px rgba(14,37,79,.3);cursor:pointer;display:none;place-items:center;z-index:2}
.chev svg{width:18px;height:18px}
#prev{left:6px}#next{right:6px}
@media (hover:hover) and (pointer:fine){.chev{display:grid}#rail{padding-left:46px;padding-right:46px}}

/* photo review */
#photo{position:fixed;inset:0;z-index:50;background:rgba(14,37,79,.94);display:flex;align-items:center;justify-content:center;padding:16px}
.photo-card{width:min(520px,100%);max-height:100%;display:flex;flex-direction:column;gap:14px}
#photo-img{display:block;margin:0 auto;max-width:100%;min-height:0;max-height:calc(100dvh - 190px);object-fit:contain;border-radius:10px}
.photo-btns{display:flex;flex-direction:column;gap:10px}

/* roomier layout on large screens */
@media (min-width:900px){:root{--hdr:64px;--tray:190px}.card{width:116px}.brand{padding:11px 0}}
@media (max-width:360px){.shoplink{display:none}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
