:root { --bg: #09090B; --panel: #111114; --line: rgba(255,255,255,.09); --text: #F4F4F5; --muted: #A1A1AA; --accent: #F50332; --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
body { display: grid; grid-template-rows: auto 1fr auto; min-height: 100dvh; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.rp-top { display: flex; align-items: center; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.rp-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; }
.rp-title { flex: 1; min-width: 0; } .rp-title h1 { margin: 0; font-size: 16px; } .rp-title p { margin: 0; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-main { display: grid; grid-template-columns: 1fr 280px; min-height: 0; }
.rp-stage { position: relative; display: grid; place-items: center; padding: 14px; min-height: 0; overflow: hidden; }
.rp-map { position: relative; width: min(100%, calc(100dvh - 190px)); aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #0c0c0f; cursor: grab; touch-action: none; }
.rp-map.is-drag { cursor: grabbing; }
.rp-map img, .rp-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; transform-origin: 0 0; user-select: none; }
.rp-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); text-align: center; padding: 20px; }
.rp-side { border-left: 1px solid var(--line); padding: 14px 16px; overflow: auto; }
.rp-side h2 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); } .rp-side h2 + ul { margin-bottom: 18px; }
.rp-legend, .rp-calls { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rp-legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; } .rp-legend i { width: 10px; height: 10px; border-radius: 50%; } .rp-legend b { margin-left: auto; font-weight: 600; }
.rp-calls button { width: 100%; display: grid; gap: 2px; text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.rp-calls button:hover, .rp-calls button:focus-visible { background: rgba(255,255,255,.05); outline: none; } .rp-calls small { color: var(--muted); } .rp-muted { color: var(--muted); font-size: 13px; }
.rp-controls { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.rp-play { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 15px; cursor: pointer; }
.rp-play:focus-visible, .rp-btn:focus-visible, #rp-seek:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.rp-time { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 52px; font-size: 13px; }
#rp-seek { flex: 1 1 240px; accent-color: var(--accent); }
.rp-sel, .rp-check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.rp-sel select { height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #18181b; color: var(--text); padding: 0 8px; }
.rp-btn { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: #18181b; color: var(--text); font: 600 13.5px var(--font); cursor: pointer; }
.rp-btn--go { background: var(--accent); border-color: var(--accent); color: #fff; } .rp-btn--ghost { background: transparent; }
.rp-dialog { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(5,5,7,.6); }
.rp-dialog[hidden] { display: none; } .rp-dialog__box { width: min(480px, 100%); display: grid; gap: 12px; padding: 20px; border-radius: 18px; border: 1px solid rgba(255,255,255,.12); background: #141418; }
.rp-dialog__box h2 { margin: 0; font-size: 17px; } .rp-dialog__box p { margin: 0; color: var(--muted); }
.rp-linkrow { display: flex; gap: 8px; } .rp-linkrow input { flex: 1; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #0c0c0f; color: var(--text); padding: 0 10px; }
.rp-dialog__actions { display: flex; gap: 8px; align-items: center; } .rp-grow { flex: 1; }
.rp-made { position: fixed; right: 14px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); padding: 6px 10px; border-radius: 999px; background: rgba(9,9,11,.85); border: 1px solid var(--line); color: var(--muted); font-size: 12px; text-decoration: none; }
.rp-made b { color: var(--text); }
@media (max-width: 860px) { .rp-main { grid-template-columns: 1fr; } .rp-side { border-left: 0; border-top: 1px solid var(--line); max-height: 30dvh; } .rp-map { width: min(100%, calc(100dvh - 330px)); } .rp-title p { display: none; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* Clip render mode (the video): no controls, fixed layouts */
body.rp-render { display: block; padding: 0; overflow: hidden; }
body.rp-render .rp-top, body.rp-render .rp-side, body.rp-render .rp-controls, body.rp-render .rp-made, body.rp-render .rp-dialog, body.rp-render .rp-empty { display: none !important; }
body.rp-render .rp-main { display: block; } body.rp-render .rp-stage { padding: 0; display: block; }
body.rp-render .rp-map { width: 1080px; height: 1080px; border-radius: 0; border: 0; }
.rp-ov { position: fixed; inset: 0; pointer-events: none; color: #fff; font-family: var(--font); }
.rp-ov__top, .rp-ov__bot { position: absolute; left: 0; right: 0; display: flex; padding: 36px 44px; }
.rp-ov__top { top: 0; flex-direction: column; gap: 6px; background: linear-gradient(rgba(9,9,11,.85), rgba(9,9,11,0)); }
.rp-ov__top b { font-size: 44px; line-height: 1.1; } .rp-ov__top span { font-size: 26px; color: #D4D4D8; }
.rp-ov__bot { bottom: 0; align-items: center; justify-content: space-between; background: linear-gradient(rgba(9,9,11,0), rgba(9,9,11,.85)); }
#rp-ov-clock { font: 600 34px ui-monospace, SFMono-Regular, Menlo, monospace; }
.rp-ov__brand { display: inline-flex; align-items: center; gap: 12px; font-size: 30px; font-weight: 700; } .rp-ov__brand img { border-radius: 10px; }
body.rp-render--vertical { background: #09090B; }
body.rp-render--vertical .rp-main { position: absolute; top: 420px; left: 0; }
body.rp-render--vertical .rp-ov__top { height: 420px; justify-content: center; background: none; padding: 0 60px; } body.rp-render--vertical .rp-ov__top b { font-size: 64px; } body.rp-render--vertical .rp-ov__top span { font-size: 34px; }
body.rp-render--vertical .rp-ov__bot { height: 420px; flex-direction: column; justify-content: center; gap: 26px; background: none; }
body.rp-render--vertical #rp-ov-clock { font-size: 52px; } body.rp-render--vertical .rp-ov__brand { font-size: 40px; }
