/* Settings sheet, FPS counter, full-screen chip, iOS card and loader. Same look as the field guide sheets. */

/* Text size and subtitle size (set from the sheet as CSS variables on :root). */
.prompt,.objective,#routeHint,#awareness,.status-line,.rule-card,.page-card{zoom:var(--font-scale,1)}
.subtitle,#soundCaption{zoom:var(--subtitle-scale,1)}
/* Reduced flashing: the lead's effects read body.reduced-flashing; these CSS ones are muted here. */
body.reduced-flashing .scare,body.reduced-flashing .fx{opacity:.55}
body.reduced-flashing .clock.late,body.reduced-flashing .chapter-card,body.reduced-flashing .page-card{animation:none}

/* ---- the sheet ---- */
.set-sheet{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:#050d13e6;backdrop-filter:blur(7px);font-size:calc(14px*var(--font-scale,1))}
.set-panel{position:relative;display:flex;flex-direction:column;width:min(760px,100%);max-height:100%;background:#102127;border:1px solid #52686c;border-radius:14px;box-shadow:0 20px 80px #000a;color:#dfe6df;overflow:hidden}
.set-head{padding:22px 24px 8px;padding-right:76px}
.set-head small{font-size:.72em;letter-spacing:2px;color:#a8c1b3}
.set-head h2{font:600 clamp(24px,4vw,34px) Georgia,serif;letter-spacing:-.5px;margin:6px 0 8px;color:#e6ece5;outline:none}
.set-status{margin:0;font-size:.93em;line-height:1.5;color:#c3d1c9}
.set-x{position:absolute;top:12px;right:12px;width:48px;height:48px;border:1px solid #53686a;border-radius:8px;background:#132227;color:#d8e2de;font-size:26px;line-height:1;cursor:pointer;z-index:3}
.set-tabs{display:flex;gap:6px;padding:8px 24px;overflow-x:auto;border-bottom:1px solid #2f4448;scrollbar-width:thin}
.set-tab{flex:none;min-height:44px;padding:0 14px;border:1px solid #3e5558;border-radius:8px;background:#15292f;color:#c8d6cf;font:600 .93em Inter,sans-serif;cursor:pointer}
.set-tab.on{background:#2c4b45;border-color:#8fb9a2;color:#fff}
.set-body{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:6px 24px 18px;position:relative;-webkit-overflow-scrolling:touch}
.set-sec{padding-top:16px}
.set-sec h3{margin:0 0 6px;font:600 1.15em Georgia,serif;color:#cfe0c8;letter-spacing:.5px;padding-bottom:6px;border-bottom:1px solid #2f4448}
.set-item{padding:10px 0;display:flex;flex-direction:column;gap:6px}
.set-item b{font-weight:600}
.set-hint{display:block;color:#98acaa;font-size:.86em;line-height:1.45;margin:0}
.set-lab{display:flex;justify-content:space-between;gap:12px}
.set-lab output{color:#c5d7b5;font-variant-numeric:tabular-nums}
.set-range,.set-select{display:flex;flex-direction:column;gap:6px;font-weight:400}
.set-range input[type=range]{width:100%;height:44px;margin:0;padding:0;accent-color:#a6c6ac;background:none;border:0}
.set-sheet select{min-height:44px;color:#e2e9e5;background:#17282c;border:1px solid #4c6468;border-radius:8px;padding:10px;font:inherit;width:100%}
.set-check{display:flex;flex-direction:row;align-items:flex-start;gap:12px;min-height:44px;cursor:pointer;font-weight:400}
.set-check input{flex:none;width:26px;height:26px;margin:9px 0 0;accent-color:#a6c6ac}
.set-check span{display:flex;flex-direction:column;gap:2px;padding-top:7px}
.set-btn{min-height:44px;padding:0 16px;border:1px solid #53686a;border-radius:8px;background:#17313a;color:#e0e9e4;font:600 .93em Inter,sans-serif;cursor:pointer}
.set-btn[aria-pressed=true]{background:#2c4b45;border-color:#8fb9a2}
.set-pair{gap:8px}
.set-tests{flex-direction:row;flex-wrap:wrap;gap:10px}
.set-tests .set-hint{flex-basis:100%}
.brightness-guide{display:flex;gap:8px}
.brightness-guide span{background:#1f3037;padding:12px;flex:1;text-align:center;font-size:.85em;color:#809499}
.brightness-guide span:nth-child(2){background:#405651;color:#aabeb0}
.brightness-guide span:nth-child(3){background:#a8bcb0;color:#23342e}
.key-list{display:flex;flex-direction:column;gap:4px}
.key-list h4{margin:12px 0 2px;font:600 .8em Inter,sans-serif;letter-spacing:1.5px;text-transform:uppercase;color:#a8c1b3}
.key-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:6px 12px;border:1px solid #3a4f53;border-radius:8px;background:#15292f;color:#dbe5df;font:inherit;text-align:left;cursor:pointer}
.key-row kbd{font:600 .9em ui-monospace,Consolas,monospace;color:#e8efe0;background:#0c181c;border:1px solid #4c6468;border-radius:5px;padding:4px 8px;white-space:nowrap}
.key-row.waiting{border-color:#e0c987;background:#2a2b1c}
.key-row[aria-disabled=true]{opacity:.65;cursor:default}
.set-notice{min-height:1.4em;margin-top:6px}
.meter{height:14px;background:#0c181c;border:1px solid #3a4f53;border-radius:7px;overflow:hidden}
.meter i{display:block;height:100%;width:0;background:linear-gradient(90deg,#6fb58a,#d8c978 75%,#e7936c);transition:width .1s linear}
.set-foot{display:flex;flex-wrap:wrap;gap:10px;align-items:center;padding:14px 24px calc(14px + env(safe-area-inset-bottom,0px));border-top:1px solid #2f4448;background:#0e1d22}
.set-foot .btn{flex:1 1 130px;min-height:48px}
.set-ask{flex:1 1 100%;margin:0;color:#ffd7af;font-weight:600}
.set-sheet button:focus-visible,.set-sheet select:focus-visible,.set-sheet input:focus-visible{outline:3px solid #bde3cc;outline-offset:2px}
@media(max-width:600px){.set-head{padding:16px 16px 6px;padding-right:68px}.set-tabs{padding:8px 16px}.set-body{padding:4px 16px 14px}.set-foot{padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px))}.set-sheet{padding:0}.set-panel{border-radius:0;height:100%}}
@media(max-height:480px){.set-head h2{font-size:22px;margin:2px 0}.set-status{display:none}.set-panel{border-radius:10px}}

/* ---- FPS counter ---- */
#fpsCounter{position:fixed;top:max(6px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:90;padding:3px 9px;border-radius:5px;background:#000a;color:#bfe6c9;font:11px/1.3 ui-monospace,Consolas,monospace;pointer-events:none;white-space:nowrap}

/* ---- full-screen chip and iOS card ---- */
.fs-chip{position:fixed;top:max(10px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:95;display:flex;align-items:center;gap:8px;padding:6px 8px 6px 14px;border:1px solid #53686a;border-radius:999px;background:#0b171df2;color:#dfe6df;font:600 13px Inter,sans-serif;box-shadow:0 8px 30px #0008;animation:fsIn .25s ease-out}
.fs-chip button{min-height:44px;min-width:44px;padding:0 14px;border:1px solid #53686a;border-radius:999px;background:#17313a;color:#e0e9e4;font:600 13px Inter,sans-serif;cursor:pointer}
.fs-chip button.go{background:#2c4b45;border-color:#8fb9a2}
.fs-chip button:focus-visible{outline:3px solid #bde3cc;outline-offset:2px}
.fs-card{position:fixed;left:50%;bottom:max(16px,env(safe-area-inset-bottom));transform:translateX(-50%);z-index:95;width:min(360px,calc(100% - 24px));padding:16px 16px 12px;border:1px solid #53686a;border-radius:12px;background:#0b171df7;color:#dfe6df;font:14px/1.5 Inter,sans-serif;box-shadow:0 12px 40px #000a}
.fs-card b{display:block;margin-bottom:4px;font-size:15px}
.fs-card ol{margin:6px 0 10px;padding-left:20px}
.fs-card button{min-height:44px;width:100%;border:1px solid #53686a;border-radius:8px;background:#17313a;color:#e0e9e4;font:600 14px Inter,sans-serif;cursor:pointer}
@keyframes fsIn{from{opacity:0;transform:translate(-50%,-8px)}to{opacity:1;transform:translate(-50%,0)}}

/* ---- loader ---- */
.loader{position:fixed;inset:0;z-index:200;display:grid;place-content:center;gap:14px;justify-items:center;padding:24px;text-align:center;background:radial-gradient(circle at 50% 30%,#1b1b2e 0,#07070c 70%);color:#e5e7eb;font-family:Inter,system-ui,sans-serif}
.loader h1{margin:0;font:400 clamp(54px,16vw,84px) Creepster,cursive;color:#dc2626;text-shadow:0 0 18px #dc262688,0 4px 0 #000;letter-spacing:2px}
.loader .ld-bar{width:min(320px,76vw);height:4px;border-radius:2px;background:#2a2a3a;overflow:hidden}
.loader .ld-bar i{display:block;height:100%;width:0;background:#c9b88a;transition:width .25s ease-out}
.loader .ld-label{margin:0;min-height:1.4em;font-size:14px;color:#a9adbf}
.loader .ld-error{max-width:420px;display:grid;gap:12px;justify-items:center}
.loader .ld-error h2{margin:0;font:600 24px Georgia,serif;color:#f0d7c4}
.loader .ld-error p{margin:0;line-height:1.5;color:#c7c9d6}
.loader .ld-error button{min-height:48px;padding:0 26px;border:0;border-radius:12px;background:#dc2626;color:#fff;font:800 16px Inter,sans-serif;cursor:pointer}
.loader button:focus-visible{outline:3px solid #bde3cc;outline-offset:3px}
.loader.out{opacity:0;transition:opacity .35s;pointer-events:none}

@media(prefers-reduced-motion:reduce){.fs-chip{animation:none}.loader .ld-bar i,.meter i,.loader.out{transition:none}}
/* the header, tab row and footer keep their height; only the body scrolls */
.set-head,.set-tabs,.set-foot{flex:none}
.set-team .team{margin-top:8px}
.set-sheet input[type=text]{min-height:44px;color:#e2e9e5;background:#17282c;border:1px solid #4c6468;border-radius:8px;padding:10px;font:inherit;width:100%;box-sizing:border-box}
.set-sheet input[type=text]:invalid{border-color:#f87171}
.set-stream .set-hint{color:#bde3cc}
