:root {
  --paper: #f6f4ef;
  --card: #ffffff;
  --ink: #23272b;
  --muted: #6b7178;
  --line: #d9d6cf;
  --brand: #1f5c4a;
  --brand-ink: #ffffff;
  --player-bg: #000;
  --bar-bg: #111;
  --btn-bg: rgba(20, 20, 20, .72);
  --btn-on: #2f8f6f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }

/* ---- support form ---- */
.site-head { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.brand small { font-weight: 400; color: var(--muted); }
.logo { background: var(--brand); color: var(--brand-ink); border-radius: 6px;
  padding: 4px 7px; font-size: 13px; letter-spacing: .5px; }
nav { display: flex; gap: 20px; color: var(--muted); font-size: 15px; }
nav .active { color: var(--brand); font-weight: 600; }
.card { max-width: 640px; margin: 32px auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 28px 32px; }
.card h1 { margin: 0 0 6px; font-size: 26px; }
.lead { color: var(--muted); margin: 0 0 22px; }
form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
form input, form select, form textarea { display: block; width: 100%; margin-top: 5px;
  font: inherit; font-weight: 400; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--ink); }
form input:focus, form select:focus, form textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card button { background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 6px;
  padding: 11px 22px; font: inherit; font-weight: 600; cursor: pointer; }
.card button:disabled { opacity: .6; cursor: default; }
#thanks h2 { margin-top: 0; color: var(--brand); }
.site-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 16px 30px; }
@media (max-width: 560px) {
  .card { margin: 16px; padding: 20px 16px; }
  .row { grid-template-columns: 1fr; gap: 0; }
  nav { display: none; }
}

/* ---- player ---- */
body.playing { background: var(--player-bg); overflow: hidden; }
#player-view { position: fixed; inset: 0; display: flex; flex-direction: column;
  background: var(--player-bg); height: 100dvh; }
#topbar { display: flex; align-items: center; gap: 12px; padding: 6px 10px; background: var(--bar-bg);
  color: #bbb; font-size: 13px; flex: 0 0 auto; }
#topbar button { background: #2a2a2a; color: #fff; border: 1px solid #3a3a3a; border-radius: 5px;
  padding: 6px 14px; font: 600 13px system-ui, sans-serif; cursor: pointer; letter-spacing: .3px; }
#topbar button:hover { background: #3a3a3a; }
#upload-btn { background: var(--btn-on) !important; border-color: var(--btn-on) !important; }
#status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.spacer { flex: 1; }
#grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 2px; min-height: 0; }

.pane { position: relative; background: #000; overflow: hidden; min-width: 0; min-height: 0;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.pane video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.pane.max { position: fixed; inset: 0; z-index: 50; }   /* full screen (or its stand-in) */
.pane:fullscreen, .pane:-webkit-full-screen { width: 100%; height: 100%; }
.pane.no-cursor { cursor: none; }

.side { position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px; opacity: 0; pointer-events: none;
  transition: opacity .15s; z-index: 2; }
.pane.show .side, .pane.show .title { opacity: 1; pointer-events: auto; }
.side button { min-width: 118px; min-height: 40px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px; background: var(--btn-bg); color: #fff; font: 600 14px system-ui, sans-serif;
  cursor: pointer; text-align: center; }
.side button:hover { background: rgba(60, 60, 60, .85); }
.side button.on { background: var(--btn-on); border-color: var(--btn-on); }
.title { position: absolute; left: 10px; top: 8px; right: 140px; color: #fff; font-size: 13px;
  text-shadow: 0 0 4px #000, 0 0 4px #000; opacity: 0; transition: opacity .15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; z-index: 2; }
.msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #888; font-size: 14px; text-align: center; padding: 20px; pointer-events: none; }
