* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #000; color: #fff; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
.hidden { display: none !important; }

/* ---------- Feed ---------- */
#app { position: fixed; inset: 0; background: #000; }
#video-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
#player { width: 100%; height: 100%; object-fit: contain; background: #000; }
.topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px; background: linear-gradient(rgba(0,0,0,.6), transparent); z-index: 5; }
.brand { font-weight: 700; font-size: 17px; }
.gear { text-decoration: none; font-size: 20px; opacity: .85; }
.side-actions { position: absolute; right: 10px; bottom: 110px; display: flex; flex-direction: column; gap: 14px; z-index: 5; }
.side-actions button { width: 48px; height: 48px; border-radius: 50%; border: none; background: rgba(255,255,255,.14); font-size: 22px; cursor: pointer; backdrop-filter: blur(4px); }
.side-actions button.saved { background: rgba(46, 204, 113, .35); }
.caption { position: absolute; left: 14px; right: 70px; bottom: calc(env(safe-area-inset-bottom, 0px) + 26px); z-index: 5; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
#cap-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
#cap-count { font-size: 12px; opacity: .7; }
#empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; z-index: 4; }
#empty p { font-size: 17px; margin-bottom: 8px; }
#empty .sub { font-size: 14px; opacity: .7; }
#loader { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; z-index: 6; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: rgba(20,20,20,.92); color: #fff; padding: 10px 18px; border-radius: 24px; font-size: 14px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 50; max-width: 86vw; text-align: center; }
#toast.show { opacity: 1; }

/* ---------- Admin ---------- */
.admin-body { overflow-y: auto; background: #111; display: flex; justify-content: center; padding: 24px 14px; }
.admin-card { width: 100%; max-width: 480px; background: #1c1c1e; border-radius: 14px; padding: 22px; height: fit-content; }
.admin-card h1 { font-size: 20px; margin-bottom: 16px; }
.admin-card h2 { font-size: 16px; margin: 18px 0 10px; }
.admin-card input { width: 100%; padding: 12px; margin-bottom: 10px; border-radius: 10px; border: 1px solid #3a3a3c; background: #2c2c2e; color: #fff; font-size: 15px; }
.admin-card button { width: 100%; padding: 12px; border-radius: 10px; border: none; background: #0a84ff; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; }
.admin-card button:active { opacity: .8; }
.admin-card button.ghost { background: transparent; border: 1px solid #3a3a3c; margin-top: 14px; font-weight: 400; font-size: 14px; }
.err { color: #ff6b6b; font-size: 14px; margin-top: 8px; min-height: 18px; }
.hint { font-size: 12px; opacity: .6; margin-top: 10px; }
.add-form { border-bottom: 1px solid #2c2c2e; padding-bottom: 6px; }
.video-row { display: flex; align-items: center; gap: 10px; background: #2c2c2e; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.video-row .meta { flex: 1; min-width: 0; }
.video-row .t { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-row .u { font-size: 11px; opacity: .55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-row button { width: auto; padding: 8px 12px; font-size: 13px; background: #ff453a; }
