/* Admin, callback, terms and share pages. Loads AFTER style.css and reuses its
   variables, so they look like the game. Phone-first, one column, thumb-sized
   targets. */

body.page, body.admin {
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior: auto;
}

.wrap {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 20px 16px 48px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(48px, env(safe-area-inset-bottom));
}

.c-title { margin: 0 0 6px; font-family: var(--display); font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 800; }
.c-h2 { margin: 24px 0 8px; font-family: var(--display); font-size: 22px; font-weight: 700; }
.c-lede { margin: 0 0 14px; color: var(--dim); font-size: 18px; }
.c-dim { margin: 0 0 14px; color: var(--dim); font-size: 16px; }

.prose p { margin: 0 0 12px; font-size: 17px; line-height: 1.55; color: var(--fg); }
.prose a, .c-consent a, .c-foot a { color: var(--accent); }

.draft {
  margin: 0 0 18px; padding: 10px 14px; border-radius: 12px;
  background: rgba(229, 72, 77, 0.08);
  border: 1px solid rgba(229, 72, 77, 0.35);
  color: #9E2B2F; font-size: 15px; font-weight: 600;
}

/* ---------- cards + form ---------- */

.c-card {
  margin: 16px 0 0; padding: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow);
}

.c-label { display: block; margin: 0 0 6px; font-family: var(--display); font-size: 17px; font-weight: 600; }
.c-label + .c-input { margin-bottom: 14px; }
.c-opt { color: var(--dim); font-weight: 400; }

.c-input {
  display: block; width: 100%; height: 54px; padding: 0 16px;
  background: var(--card-2); color: var(--fg);
  border: 1px solid var(--line); border-radius: 14px;
  font: 18px/1 var(--body);
}
.c-input::placeholder { color: var(--dim); }
.c-input:focus { border-color: var(--accent); outline: none; }
.c-select {
  flex: 1 1 0; min-width: 0; height: 44px; padding: 0 12px;
  background: var(--card-2); color: var(--fg);
  border: 1px solid var(--line); border-radius: 12px; font: 16px/1 var(--body);
}

/* the real file input stays reachable for the keyboard and for tests, but the
   big label above it is what a thumb hits */
.c-file {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.c-photobtn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-width: 0; height: 60px; margin: 4px 0 0; cursor: pointer;
}
.c-file:focus-visible + .c-photobtn { outline: 2px solid var(--accent); outline-offset: 3px; }

.c-preview {
  display: block; width: 100%; max-height: 320px; object-fit: contain;
  margin: 12px 0 0; border-radius: 12px; background: #0B1220;
}

.c-consent { margin: 16px 0 14px; font-size: 16px; line-height: 1.5; color: var(--dim); }

.c-err {
  margin: 12px 0 0; padding: 10px 14px; border-radius: 12px;
  background: rgba(229, 72, 77, 0.08);
  border: 1px solid rgba(229, 72, 77, 0.35);
  color: #9E2B2F; font-size: 15px;
}

.c-card .btn + .btn { margin-top: 10px; }

/* ---------- saved ---------- */

.c-saved { margin: 0 0 6px; font-family: var(--display); font-size: 30px; font-weight: 800; color: var(--good); }

.c-linkrow { display: flex; gap: 8px; align-items: center; margin: 0 0 14px; }
.c-link {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--accent); font-size: 15px;
}
.c-copy { flex: 0 0 auto; height: 48px; min-width: 0; padding: 0 18px; font-size: 17px; }

/* ---------- people and players ---------- */

.c-people { margin-top: 28px; }
.c-list { list-style: none; margin: 0; padding: 0; }

.person, .player {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.person-thumb {
  flex: 0 0 auto; width: 64px; height: 64px; border-radius: 12px;
  object-fit: cover; background: var(--card-2);
}
.person-main { flex: 1 1 auto; min-width: 0; }
.person-name { display: block; font-family: var(--display); font-size: 18px; font-weight: 600; }
.person-meta {
  display: block; margin-top: 2px; color: var(--dim); font-size: 15px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.person-acts { display: flex; gap: 8px; margin-top: 8px; }
.person-acts .btn {
  height: 44px; width: auto; min-width: 0; padding: 0 16px; font-size: 16px;
  background: transparent; color: var(--fg); border: 1px solid var(--line);
}
.person-acts .del { color: var(--bad); border-color: rgba(229, 72, 77, 0.45); }

.player-score {
  flex: 0 0 auto; width: 64px; height: 64px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-2); border: 1px solid var(--line);
  font-family: var(--display); font-size: 17px; font-weight: 700;
}
.player-squares { display: block; margin-top: 4px; font-size: 15px; letter-spacing: 2px; }

/* ---------- the trimmer: two handles over a filmstrip ---------- */

.c-trim { margin-top: 28px; }
.t-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.t-row .btn.ghost.small { flex: 1 1 auto; height: 44px; font-size: 15px; padding: 0 10px; }
.t-video { display: block; width: 100%; max-height: 52vh; object-fit: contain; border-radius: 14px; background: #0B1220; margin: 0 0 10px; }
.t-track-wrap { position: relative; margin: 0 9px 30px; user-select: none; -webkit-user-select: none; }
.t-strip { display: flex; height: 56px; border-radius: 8px; overflow: hidden; background: #222; }
.t-strip canvas { flex: 1 1 0; height: 56px; width: 0; }
.t-track { position: relative; height: 56px; margin-top: -56px; cursor: crosshair; touch-action: none; }
.t-shade { position: absolute; top: 0; bottom: 0; background: rgba(0, 0, 0, 0.55); pointer-events: none; }
.t-range { position: absolute; top: 0; bottom: 0; border-top: 3px solid var(--accent); border-bottom: 3px solid var(--accent); pointer-events: none; }
.t-handle { position: absolute; top: -8px; bottom: -8px; width: 28px; margin-left: -14px; cursor: ew-resize; touch-action: none; }
.t-handle::after { content: ""; position: absolute; left: 9px; right: 9px; top: 0; bottom: 0; border-radius: 5px; background: #3B82F6; box-shadow: 0 0 0 2px #fff; }
.t-handle.out::after { background: var(--bad); }
.t-handle span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 8px; padding: 3px 6px; border-radius: 6px; background: #3B82F6; color: #fff; font: 600 12px/1 var(--display); white-space: nowrap; }
.t-handle.out span { background: var(--bad); }
.t-head { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); pointer-events: none; }
.t-times { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 10px; font-size: 15px; }
.t-times span { display: inline-flex; align-items: center; gap: 6px; }
.t-times b { font-variant-numeric: tabular-nums; min-width: 46px; display: inline-block; }
.t-nudge { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--card-2); color: var(--fg); font: 600 16px/1 var(--body); cursor: pointer; }
.t-keys { font-size: 14px; }
.t-list { list-style: none; margin: 0 0 12px; padding: 0; }
.t-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.t-list li.now { font-weight: 700; }
.t-list li b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- signed out ---------- */

.c-who { margin: 0 0 14px; color: var(--dim); font-size: 16px; }
.c-foot { margin: 28px 0 0; color: var(--dim); font-size: 16px; }
.c-linkbtn {
  padding: 0; background: none; border: 0; color: var(--accent);
  font: inherit; font-size: 16px; cursor: pointer; text-decoration: underline;
}

/* The separator belongs to the Sign out button: when that button is hidden the
   dot goes with it, so a signed-out footer reads "Game . Terms" and never ends
   on a dangling dot. Browsers without :has() simply never show this dot. */
.c-sep { display: none; }
.c-foot:has(#signout:not([hidden])) .c-sep { display: inline; }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
