/* RPRR Fast Clock — stand-alone page */
@font-face { font-family: "FC Barlow"; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "FC Barlow"; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "FC Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "FC Barlow Condensed"; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }

:root {
	--bg: #161614;
	--panel: #0d0d0c;
	--panel-line: #2c2b27;
	--line: #4a4740;
	--text: #ece8dc;
	--muted: #a8a292;
	--amber: #e0a43a;
	--green: #8fd19e;
	--dial: #f7f4ec;
	--ink: #141413;
	--sans: "FC Barlow", "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
	--cond: "FC Barlow Condensed", "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); }
body { display: flex; justify-content: center; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; }

.fc {
	container-type: inline-size;
	width: min(calc(100vw - 32px), 900px);
	min-height: 100vh;
	min-height: 100dvh;
	padding: max(20px, env(safe-area-inset-top)) 0 max(16px, env(safe-area-inset-bottom));
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

/* Header */
.fc-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fc-title { font-family: var(--cond); font-weight: 600; font-size: 15px; font-size: clamp(15px, 2.6cqw, 24px); letter-spacing: 3px; color: var(--muted); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-badge { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid #3a3833; border-radius: 999px; font-size: 12px; font-size: clamp(12px, 2cqw, 18px); font-weight: 600; letter-spacing: 1px; color: var(--muted); white-space: nowrap; }
.fc-badge .dot { display: none; }
.fc[data-role="controller"] .fc-badge { color: var(--amber); }
.fc[data-role="controller"] .fc-badge .dot { display: inline-block; background: var(--amber); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex-shrink: 0; }

/* Dial */
.fc-dial { width: min(100%, 60vh); margin-top: 8px; }
.fc[data-role="controller"] .fc-dial { width: min(100%, 40vh); margin-top: 0; }
.fc[data-frame="pocket"] .fc-dial, .fc[data-frame="custom"] .fc-dial { width: min(100%, 50vh); }
.fc[data-role="controller"][data-frame="pocket"] .fc-dial, .fc[data-role="controller"][data-frame="custom"] .fc-dial { width: min(100%, 34vh); }
.fc-dial svg { display: block; width: 100%; height: auto; overflow: visible; }
.fc-photo { position: relative; width: 100%; }
.fc-photo svg { position: absolute; }
.fc-photo img { position: absolute; left: 0; top: 0; width: 100%; height: auto; max-width: none; pointer-events: none; user-select: none; }

/* Digital readout */
.fc-readout { width: 100%; padding: 10px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 10px; }
.fc-digital { font-family: var(--cond); font-weight: 600; line-height: 1; letter-spacing: 2px; font-variant-numeric: tabular-nums; color: var(--dial); font-size: 88px; font-size: clamp(56px, 22cqw, 180px); }
.fc[data-role="controller"] .fc-digital { font-size: 60px; font-size: clamp(48px, 15cqw, 110px); }
.fc-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.fc-status { display: flex; align-items: center; gap: 6px; font-size: 13px; font-size: clamp(13px, 2.4cqw, 22px); font-weight: 600; letter-spacing: 1.5px; color: var(--amber); }
.fc-status .dot { background: currentColor; }
.fc-status.running { color: var(--green); }
.fc-ratio { font-family: var(--cond); font-weight: 600; font-size: 22px; font-size: clamp(22px, 5cqw, 40px); }

/* Controls */
.fc-controls { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.fc-field { display: flex; flex-direction: column; gap: 8px; }
.fc-field label, .fc-pin-field label { font-size: 12px; font-weight: 600; letter-spacing: 2px; color: var(--muted); }
.fc-field input[type="range"] { width: 100%; height: 32px; margin: 0; accent-color: var(--amber); }
.fc-ticks { display: flex; justify-content: space-between; font-family: var(--cond); font-size: 17px; font-weight: 600; color: var(--muted); }
.fc-buttons { display: flex; gap: 12px; }
.fc-btn { height: 52px; padding: 0 20px; border-radius: 10px; font-size: 17px; font-weight: 600; cursor: pointer; }
.fc-btn.primary { flex-grow: 1; border: none; background: var(--amber); color: var(--ink); }
.fc-btn.ghost { width: 120px; border: 1px solid var(--line); background: transparent; color: var(--text); font-weight: 500; }
.fc-btn:disabled { opacity: .6; cursor: default; }
.fc select { width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #22211e; color: var(--text); font-family: var(--cond); font-size: 20px; }
.fc :focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Footer */
.fc-foot { width: 100%; margin-top: auto; font-size: 14px; font-size: clamp(14px, 2.2cqw, 20px); color: var(--muted); }
.fc-foot-ctl, .fc-foot-view { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.fc-sync { display: flex; align-items: center; gap: 8px; }
.fc-sync .dot { width: 7px; height: 7px; }
.fc-sync.ok .dot { background: var(--green); }
.fc-sync.bad .dot { background: var(--amber); }
.fc-link { border: none; background: none; padding: 12px 0; color: var(--amber); font-weight: 600; text-decoration: underline; cursor: pointer; }

.fc-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 12px 18px; background: #f7f4ec; color: var(--ink); border-radius: 10px; font-size: 15px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.4); }

/* Dialog */
.fc-overlay { position: fixed; inset: 0; background: rgba(10,10,9,.72); display: flex; align-items: flex-end; justify-content: center; padding: 20px; }
@media (min-height: 700px) and (min-width: 600px) { .fc-overlay { align-items: center; } }
.fc-card { width: min(100%, 440px); padding: 26px 22px 22px; display: flex; flex-direction: column; gap: 16px; background: var(--dial); color: var(--ink); border-radius: 16px; }
.fc-card h2 { margin: 0; font-family: var(--cond); font-weight: 700; font-size: 30px; line-height: 1.05; }
.fc-card p { margin: 0; font-size: 15px; line-height: 1.45; color: #3d3b35; }
.fc-pin-field { display: flex; flex-direction: column; gap: 8px; }
.fc-card .fc-pin-field label { color: #57544c; }
.fc-pin-field input { height: 52px; padding: 0 16px; border: 1.5px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); font-family: var(--cond); font-size: 26px; letter-spacing: 8px; }
.fc-err { font-size: 14px; font-weight: 600; color: #a3281b; }
.fc-card-btns { display: flex; gap: 10px; }
.fc-card-btns .fc-btn { flex: 1 1 0; }
.fc-card .fc-btn.ghost { width: auto; border: 1.5px solid var(--ink); color: var(--ink); }
.fc-btn.dark { border: none; background: var(--ink); color: var(--dial); }
