/* Patrol Scans V14 warning visuals. Pure presentation: no timers, logging or sounds. */
/* In Android native fullscreen, viewport rotation can expose the HTML root
   behind the resized app. The older root uses --mode-bg (legacy warning red).
   Keep that root dark only while a Patrol Scans warning is active; leave
   saved warning colors, body textures, and non-Patrol themes untouched. */
html.ps-theme:fullscreen:has(body:is(.mode-warning,.ps-v14-warning)),
html.ps-theme:has(body.room-fullscreen:is(.mode-warning,.ps-v14-warning)){
  background:#050607!important;
}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #alarmClockFrame{
  position:relative!important;isolation:isolate;overflow:visible!important;
  background-color:#07090d!important;
  background-image:linear-gradient(145deg,rgba(9,11,17,.83),rgba(3,4,8,.95)),var(--ps-tv2-body,none)!important;
  border-color:#e8c253!important;
  box-shadow:inset 0 0 0 1px #805b21,0 0 0 1px #35280d,0 4px 20px #000a!important;
  animation:none!important;filter:none!important;opacity:1!important;
}
html.ps-theme body:is(.mode-warning,.ps-v14-warning){
  background-color:#050607!important;
  background-image:radial-gradient(ellipse at 50% 30%,#151417,#060709 76%)!important;
}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #alarmClockFrame>.top>.mini,
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #clock{
  color:#f9fafb!important;border-color:#e7bd45!important;filter:none!important;opacity:1!important;
  background-color:#101114!important;background-image:
    linear-gradient(145deg,rgba(10,11,15,.88),rgba(3,4,8,.92)),var(--ps-tv2-panels,none)!important;
  box-shadow:inset 0 0 0 1px #a77b2b55,inset 0 0 19px #000a!important;
}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #clock{
  position:relative;isolation:isolate;overflow:hidden!important;
}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #clock::before{
  content:"";position:absolute;inset:2% 8%;z-index:0;
  background:url("themes/patrol-scans/assets/badge-tools.webp") center/contain no-repeat!important;
  opacity:.44!important;filter:brightness(.64) saturate(.9)!important;pointer-events:none;
}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #clock::after{
  content:"";position:absolute;inset:0;z-index:0;pointer-events:none;
  background:linear-gradient(90deg,transparent 1%,#1686ff36 22%,transparent 43%,transparent 58%,#ff234227 81%,transparent 99%);
  opacity:.28!important;
}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #clock :is(.label,#current,#ampm,#betaLastCheck,.last-check-caption,.last-check-value){
  position:relative;z-index:4;opacity:1!important;filter:none!important;
}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #current{
  color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;
  text-shadow:0 3px 7px #000,0 0 6px #ffffff25!important;
}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #countdown{color:#ffdf25!important;-webkit-text-fill-color:#ffdf25!important}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #next{color:#fa3b57!important;-webkit-text-fill-color:#fa3b57!important}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #quickUser{color:#ffffff!important;-webkit-text-fill-color:#ffffff!important}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #betaLastCheck b{color:#fa3b57!important;text-shadow:0 2px 4px #000!important}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #alarmClockFrame #quickActionsMount .btn[data-ps-action="patrolCheck"],
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #alarmClockFrame #quickActionsMount .btn[data-ps-action="recordRestart"]{
  color:white!important;background-image:linear-gradient(145deg,#1b8cda,#084474)!important;
  background-color:#075599!important;border-color:#63b5ee!important;box-shadow:inset 0 1px #ffffff44,0 3px 9px #000a!important;
}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #alarmClockFrame #quickActionsMount .btn[data-ps-action="stopAudio"]{
  color:white!important;background-image:linear-gradient(145deg,#d61d42,#6a0a21)!important;
  background-color:#aa1530!important;border-color:#fd6785!important;box-shadow:inset 0 1px #ffffff33,0 3px 9px #000a!important;
}
/* Explicitly retire all old warning-mode frame filters/blinks in V14.
   Decorative layers below supply the independent effects. */
html.rcm-web-fusion.ps-theme body:is(.mode-warning,.ps-v14-warning).rcm-warning-blink #alarmClockFrame,
html.rcm-web-fusion.ps-theme body:is(.mode-warning,.ps-v14-warning).rcm-warning-blink #clock,
html.rcm-web-fusion.ps-theme body:is(.mode-warning,.ps-v14-warning).rcm-warning-blink .mode-banner{
  animation:none!important;filter:none!important;
}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #modeBanner{
  position:relative;isolation:isolate;overflow:hidden;display:flex!important;
  align-items:center;justify-content:center;gap:5px;
  min-height:40px;margin:7px 0 8px;padding:8px 6px!important;
  border:2px solid #f3b449!important;border-radius:12px!important;
  color:var(--ps-v14-text,#fff0cf)!important;
  background:linear-gradient(90deg,#470b16,var(--ps-v14-banner,#571322),#420b15)!important;
  box-shadow:inset 0 1px #ffe8a454,0 0 9px #f33d3430!important;
  font-family:Impact,"Arial Narrow",system-ui,sans-serif!important;
  font-size:clamp(10px,2.9vw,16px)!important;
  letter-spacing:.01em!important;
}
/* Prevent two different warning text nodes rendering during the transition. */
#psV14Message{display:none!important}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #modeBannerText{display:none!important}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #psV14Message{
  flex:1;min-width:0;display:block!important;text-align:center;position:relative;z-index:4;
  font-weight:900;line-height:1.15;text-shadow:0 1px 3px #000;
  color:var(--ps-v14-text,#fff0cf)!important;
}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #modeBanner.ps-v14-tape::before,
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #modeBanner.ps-v14-tape::after{
  content:"";position:absolute;left:0;right:0;height:5px;z-index:3;pointer-events:none;
  background:repeating-linear-gradient(115deg,var(--ps-v14-tape-dark,#100b0a) 0 9px,var(--ps-v14-tape-light,#e7b52b) 9px 19px);
  background-size:38px 5px;
}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #modeBanner.ps-v14-tape::before{top:0}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #modeBanner.ps-v14-tape::after{bottom:0}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #modeBanner.ps-v14-tape.ps-v14-tape-moving::before,
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #modeBanner.ps-v14-tape.ps-v14-tape-moving::after{
  animation:psV14Tape .85s linear infinite;
}
@keyframes psV14Tape{to{background-position:38px 0}}
#psV14Message.ps-v14-text-blink{animation:psV14TextBlink var(--ps-v14-text-speed,1.5s) steps(1,end) infinite}
@keyframes psV14TextBlink{0%,41%{opacity:1}45%,83%{opacity:0}88%,100%{opacity:1}}
#modeBanner.ps-v14-dialog-flash{animation:psV14DialogFlash 2.8s ease-in-out infinite!important}
@keyframes psV14DialogFlash{0%,100%{opacity:1}50%{opacity:.21}}
html.ps-theme #modeBanner #psV14SirenLeft,
html.ps-theme #modeBanner #psV14SirenRight{
  width:clamp(18px,4vw,26px);height:26px;flex:0 0 auto;position:relative;z-index:4;
  display:block;filter:drop-shadow(0 0 3px #ff344c) drop-shadow(0 0 4px #ff344c);
}
html.ps-theme #modeBanner.ps-v14-siren-blink #psV14SirenLeft{animation:psV14Siren 1.15s ease-in-out infinite}
html.ps-theme #modeBanner.ps-v14-siren-blink #psV14SirenRight{animation:psV14Siren 1.15s ease-in-out infinite -.57s}
@keyframes psV14Siren{0%,100%{opacity:1}50%{opacity:.43}}
/* Moving gold reflection is constrained to a narrow border mask, not a line across text. */
.ps-v14-sheen{position:absolute;inset:0;z-index:5;pointer-events:none;border-radius:inherit;padding:2px;
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;mask-composite:exclude;overflow:hidden}
.ps-v14-sheen::before,.ps-v14-sheen::after{
  content:"";position:absolute;inset:-23% -32%;opacity:0;
  background:linear-gradient(90deg,transparent 0%,#ffc74c00 34%,#fff7df 48%,#f7cc68 51%,#e8a83d55 60%,transparent 74%);
  filter:drop-shadow(0 0 3px #fff2a5a8);animation:psV14Sheen 3.1s ease-in-out infinite;
}
.ps-v14-sheen::after{animation-delay:-1.7s}
@keyframes psV14Sheen{0%{opacity:0;transform:translateX(-110%)}28%{opacity:1}60%{opacity:1}100%{opacity:0;transform:translateX(110%)}}
.ps-v14-glint{position:absolute;inset:0;z-index:6;pointer-events:none;overflow:visible}
.ps-v14-glint rect{fill:none;stroke-linecap:round;stroke-dasharray:1.1 98.9;animation:psV14TinyOrbit 8.2s linear infinite}
.ps-v14-glint .soft{stroke:#ffcb54;stroke-width:6;filter:blur(3px);opacity:.8}
.ps-v14-glint .core{stroke:#fffdf2;stroke-width:2.2;filter:drop-shadow(0 0 2px #ffe2a9)}
@keyframes psV14TinyOrbit{to{stroke-dashoffset:-100}}
.ps-v14-trim{position:absolute;inset:0;z-index:1;pointer-events:none;border-radius:inherit;border:2px solid transparent}
body.ps-v14-warning.ps-v14-gold-pulse .ps-v14-trim{animation:psV14GoldPulse 2.4s ease-in-out infinite}
@keyframes psV14GoldPulse{
  0%,100%{box-shadow:inset 0 0 8px #ffe7a51a,0 0 4px #dba62a33;border-color:#ffe48b55}
  50%{box-shadow:inset 0 0 13px #ffe7a54a,0 0 15px #f5bc4b90;border-color:#fff2b0bc}
}
/* V7-inspired star flares: large blooms and distinct star rays, but no
   expensive SVG filters or fullscreen box-shadow compositing. Two staggered
   reflections move independently behind CURRENT TIME and LAST CHECK. */
/* V14 warning badge: the real Patrol Scans artwork is explicitly layered
   above the clock texture and below both the animated flares and white digits.
   It appears only after the image is successfully loaded. */
.ps-v14-clock-watermark{
  display:none;position:absolute;inset:7% 10%;width:80%;height:86%;
  object-fit:contain;object-position:center;
  z-index:1;opacity:.40;pointer-events:none;user-select:none;
  filter:brightness(.83) contrast(1.09) saturate(.85);
}
html.ps-theme body:is(.mode-warning,.ps-v14-warning) #alarmClockFrame #clock > .ps-v14-clock-watermark[data-loaded="true"]{
  display:block!important;
}
.ps-v14-clock-flares{
  position:absolute;inset:0;z-index:2;overflow:hidden;
  pointer-events:none;isolation:isolate;
}
.ps-v14-clock-flare{
  --flare-rgb:255,44,80;
  position:absolute;left:50%;top:50%;
  width:min(96%,670px);height:clamp(160px,36vh,300px);
  pointer-events:none;opacity:0;
  transform:translate(-50%,-50%) scale(.4);
  background:
    radial-gradient(circle 6px at 50% 50%,#fff 0%,#fff 55%,transparent 100%),
    radial-gradient(circle 25px at 50% 50%,
      rgba(255,255,255,.98) 0%,rgba(var(--flare-rgb),.9) 31%,transparent 100%),
    radial-gradient(circle 92px at 50% 50%,
      rgba(var(--flare-rgb),.39) 0%,rgba(var(--flare-rgb),.15) 45%,transparent 100%),
    linear-gradient(90deg,
      transparent 0%,rgba(var(--flare-rgb),.05) 12%,rgba(var(--flare-rgb),.42) 36%,
      rgba(255,255,255,.98) 50%,rgba(var(--flare-rgb),.42) 64%,
      rgba(var(--flare-rgb),.05) 88%,transparent 100%) center/100% 3px no-repeat,
    linear-gradient(0deg,
      transparent 0%,rgba(var(--flare-rgb),.06) 18%,rgba(var(--flare-rgb),.38) 39%,
      rgba(255,255,255,.95) 50%,rgba(var(--flare-rgb),.38) 61%,
      rgba(var(--flare-rgb),.06) 82%,transparent 100%) center/3px 96% no-repeat,
    radial-gradient(ellipse 44% 11px at 50% 50%,rgba(var(--flare-rgb),.32),transparent 98%),
    radial-gradient(ellipse 12px 44% at 50% 50%,rgba(var(--flare-rgb),.31),transparent 98%);
  filter:none;
  animation:psV14ClockFlare 3.8s ease-in-out infinite;
}
.ps-v14-clock-flare::before,
.ps-v14-clock-flare::after{
  content:"";position:absolute;left:50%;top:50%;width:75%;height:2px;
  pointer-events:none;border-radius:999px;
  background:linear-gradient(90deg,
    transparent,rgba(var(--flare-rgb),.06) 19%,
    rgba(var(--flare-rgb),.46) 38%,rgba(255,255,255,.93) 50%,
    rgba(var(--flare-rgb),.46) 62%,rgba(var(--flare-rgb),.06) 81%,transparent);
}
.ps-v14-clock-flare::before{transform:translate(-50%,-50%) rotate(43deg)}
.ps-v14-clock-flare::after{transform:translate(-50%,-50%) rotate(-43deg)}
.ps-v14-clock-flare.blue{--flare-rgb:24,140,255;animation-delay:-1.85s}
@keyframes psV14ClockFlare{
  0%,100%{opacity:0;transform:translate(-50%,-50%) scale(.4)}
  11%{opacity:.15;transform:translate(-50%,-50%) scale(.7)}
  26%{opacity:.85;transform:translate(-50%,-50%) scale(1.1)}
  39%{opacity:1;transform:translate(-50%,-50%) scale(1.35)}
  52%{opacity:.93;transform:translate(-50%,-50%) scale(1.40)}
  68%{opacity:.48;transform:translate(-50%,-50%) scale(1.2)}
  82%{opacity:.04;transform:translate(-50%,-50%) scale(.8)}
  94%{opacity:0;transform:translate(-50%,-50%) scale(.45)}
}
.ps-v14-perimeter{
  position:fixed;top:0;left:0;z-index:39;overflow:visible;pointer-events:none;
  filter:saturate(1.08);
}
.ps-v14-perimeter path{fill:none;stroke-linecap:round;stroke-linejoin:round}
.ps-v14-perimeter .halo{filter:blur(4px)}
.ps-v14-perimeter .bloom{filter:blur(2px)}
.ps-v14-dim{position:fixed;inset:0;z-index:42;pointer-events:none;background:#000;opacity:0;visibility:hidden}
body.ps-v14-warning.ps-v14-dimming .ps-v14-dim{
  visibility:visible;animation:psV14Dim var(--ps-v14-dim-speed,1.35s) steps(1,end) infinite;
}
@keyframes psV14Dim{
  0%,41%{opacity:0}
  45%,83%{opacity:var(--ps-v14-dim-opacity,.45)}
  88%,100%{opacity:0}
}
.ps-v14-settings{margin:10px 4px 13px;padding:10px;border:1px solid #c89e36;border-radius:12px;background:linear-gradient(#101a29,#060e1b);color:#fff}
.ps-v14-settings>h3{color:#ffdf71;margin:4px 0 10px;font-size:16px}
.ps-v14-settings details{margin:9px 0;border:1px solid #43556d;border-radius:9px;background:#101a2a}
.ps-v14-settings details>summary{cursor:pointer;padding:12px;color:#fbd35d;font-weight:800}
/* A single Warnings accordion, with all controls visible in four labeled
   sections when expanded. No nested disclosure controls or duplicated IDs. */
.ps-v14-settings{border:0;background:transparent;padding:0;margin:12px 0 16px}
.ps-v14-settings .ps-v14-combined{margin:0;border:1px solid #c89e36;background:#0d1726}
.ps-v14-settings .ps-v14-combined>summary{
  border-radius:8px;color:#ffdf71;background:#131e30;
  font-size:16px;letter-spacing:.015em;padding:13px 14px;
}
.ps-v14-settings .ps-v14-combined-body{padding:10px 12px 14px}
.ps-v14-settings .ps-v14-combined-body>.ps-v14-note{margin:3px 2px 12px}
.ps-v14-settings .ps-v14-subsection{
  padding:12px 0 14px;border-top:1px solid #4b5e73;
}
.ps-v14-settings .ps-v14-subsection h4{
  color:#f5c852;font-weight:800;font-size:14px;
  margin:0 0 11px;padding:0 2px;
}
.ps-v14-settings .ps-v14-subsection .ps-v14-fieldset{padding:0 3px;gap:11px}

.ps-v14-settings .ps-v14-fieldset{padding:4px 12px 14px;display:grid;gap:11px}
.ps-v14-settings label{display:flex;flex-direction:column;gap:5px;color:#f1f3f9;font-size:13px;font-weight:650}
.ps-v14-settings label.ps-v14-check{flex-direction:row;gap:9px;align-items:flex-start;line-height:1.36}
.ps-v14-settings input[type=checkbox]{width:18px;height:18px;flex:0 0 18px;accent-color:#e9b431}
.ps-v14-settings input[type=range]{width:100%;accent-color:#ffcc43}
.ps-v14-settings input[type=text],.ps-v14-settings select{
  width:100%;padding:9px;border:1px solid #6a819c;background:#091324;border-radius:7px;color:#fff;
}
.ps-v14-settings .ps-v14-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;min-width:0}
.ps-v14-settings button{min-height:38px;padding:8px 10px;border:1px solid #a87c27;border-radius:8px;background:#11233a;color:#ffe5a1;font-weight:750}
.ps-v14-settings .ps-v14-note{margin:2px 0 4px;color:#d2dae4;font-size:12px;line-height:1.45}
.ps-v14-settings output{color:#ffdf77}
.ps-v14-settings .fields{display:block}
.ps-v14-settings .fields .field{margin:6px 0 10px}
.ps-v14-settings .fields input{max-width:100%}
.ps-v14-settings input:focus-visible,.ps-v14-settings select:focus-visible,.ps-v14-settings button:focus-visible{outline:2px solid #ffe177;outline-offset:2px}
@media(max-width:430px){.ps-v14-settings .ps-v14-row{grid-template-columns:1fr}html.ps-theme body:is(.mode-warning,.ps-v14-warning) #modeBanner{gap:3px;padding:7px 3px!important}}
@media(prefers-reduced-motion:reduce){
  .ps-v14-clock-flare,.ps-v14-sheen::before,.ps-v14-sheen::after,.ps-v14-glint rect,
  .ps-v14-trim,.ps-v14-dim,#psV14Message{animation:none!important}
  .ps-v14-perimeter{display:none!important}
}
body.ps-v14-reduce .ps-v14-clock-flare,body.ps-v14-reduce .ps-v14-sheen::before,
body.ps-v14-reduce .ps-v14-glint rect,body.ps-v14-reduce .ps-v14-trim,
body.ps-v14-reduce .ps-v14-dim,body.ps-v14-reduce #psV14Message{animation:none!important}
body.ps-v14-reduce .ps-v14-perimeter{display:none!important}
