/* Rule34 Organizer — mobile browser interface.
 *
 * Dark surfaces with the desktop's green accent so the phone reads as the
 * same product.  The feed is a normal scrolling document: one column of
 * cards, each keeping its own aspect ratio.  Nothing here hides the page
 * behind a full-screen swipe surface. */

:root {
  --bg: #12150f;
  --bg-soft: #171b13;
  --surface: #1d221a;
  --surface-2: #242b20;
  --surface-3: #2c3427;
  --border: #333d2c;
  --border-soft: #2a3324;
  --text: #eef3e8;
  --text-muted: #a8b5a0;
  --text-faint: #7d8a77;
  --accent: #8fd889;
  --accent-ink: #10240f;
  --action: #4c9bea;
  --action-ink: #06131f;
  --danger: #e07070;
  --warning: #d8ab5a;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --pad: 12px;
  --pad-lg: 16px;
  --topbar-h: 52px;
  --tap: 44px;
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

/* Several containers are flex/grid boxes, so the hidden attribute needs to
   win explicitly. */
[hidden] { display: none !important; }

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}

body.locked { overflow: hidden; }

button, input { font: inherit; color: inherit; }

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 14px;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
  background: rgba(18, 21, 15, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: var(--radius-sm);
  color: var(--text);
  flex: none;
}
.icon-button:active { background: var(--surface-2); }

.brand {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand span { color: var(--accent); font-weight: 500; }
.brand.big { font-size: 22px; flex: none; text-align: center; }

.burger {
  display: block;
  width: 20px;
}
.burger i {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: currentColor;
}

.refresh {
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}
.icon-button:active .refresh { transform: rotate(40deg); }

/* ---------- search ---------- */

.searchbar {
  position: sticky;
  top: calc(var(--topbar-h) + env(safe-area-inset-top));
  z-index: 25;
  padding: 8px var(--pad) 6px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--tap);
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.search-field:focus-within { border-color: var(--accent); }

.search-icon {
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid var(--text-faint);
  border-radius: 50%;
  position: relative;
}
.search-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  background: var(--text-faint);
  transform: rotate(45deg);
  border-radius: 2px;
}

#searchInput {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: 0;
  outline: none;
  font-size: 16px; /* keeps iOS from zooming on focus */
}
#searchInput::-webkit-search-cancel-button { display: none; }
#searchInput::placeholder { color: var(--text-faint); }

.clear-button {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1;
}

.suggestions {
  margin-top: 6px;
  max-height: 46vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.suggestions button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--tap);
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
.suggestions button:last-child { border-bottom: 0; }
.suggestions button[aria-selected="true"],
.suggestions button:hover { background: var(--surface-2); }
.suggestions .tag-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestions .tag-count { color: var(--text-faint); font-variant-numeric: tabular-nums; font-size: 13px; }
.suggestions .tag-exclude { color: var(--danger); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 0;
}
.chips:not(:empty) { padding-top: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 10px;
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.chip.exclude { border-color: rgba(224, 112, 112, 0.5); color: #f0b6b6; }
.chip button { color: var(--text-faint); font-size: 15px; line-height: 1; padding: 0 2px; }

/* ---------- feed ---------- */

main { display: block; }

.view-title {
  margin: 0;
  padding: 12px var(--pad) 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-faint);
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px var(--pad) 24px;
}

.post {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: auto 380px;
}

.post-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 12px 7px;
}
.post-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-kind {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text-muted);
}
.post-kind.video { color: #b9d8ff; }
.post-kind.comic { color: var(--accent); }

.media-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0c0e0a;
  min-height: 120px;
}
.media-frame img,
.media-frame video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  background: #0c0e0a;
}
/* width/height attributes on the element carry the real aspect ratio, so no
   inline styles are needed and the CSP can stay strict. */
.media-frame video[height] { height: auto; }

/* Comic previews keep roughly half the vertical space of the full reader
   and show the top of the page; the reader opens the whole thing. */
.post.comic .media-frame {
  max-height: 45vh;
  overflow: hidden;
  align-items: flex-start;
  cursor: pointer;
}
.post.comic .media-frame img { max-height: none; }
.post.comic .media-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 96px;
  background: linear-gradient(to bottom, rgba(12, 14, 10, 0), rgba(12, 14, 10, 0.92));
  pointer-events: none;
}
.comic-open {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  z-index: 2;
  white-space: nowrap;
}

.badge-strip {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  gap: 4px;
}
.badge {
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
  background: rgba(12, 14, 10, 0.72);
  color: var(--text-muted);
  backdrop-filter: blur(4px);
}
.badge.playable { color: #cfe6ff; }

.play-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(12, 14, 10, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
}
.play-hint::before {
  content: "";
  margin-left: 4px;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #fff;
}
.post.needs-tap .play-hint { display: flex; }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 9px 12px 4px;
}
.tag-pill {
  padding: 3px 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-pill:active { color: var(--accent); }

.post-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px 10px;
  font-size: 11px;
  color: var(--text-faint);
}

.feed-status {
  padding: 0 var(--pad) 28px;
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
}
.feed-status:empty { display: none; }
.sentinel { height: 1px; }

.empty {
  margin: 40px var(--pad);
  text-align: center;
  color: var(--text-muted);
}
.empty h3 { margin: 0 0 6px; font-size: 16px; color: var(--text); }

.skeleton {
  height: 260px;
  border-radius: var(--radius-lg);
  background: linear-gradient(100deg, var(--surface) 20%, var(--surface-2) 50%, var(--surface) 80%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 140% 0; } to { background-position: -40% 0; } }

/* ---------- pages ---------- */

.page { padding: 8px var(--pad) 32px; }
.page h2 {
  margin: 12px 0 10px;
  font-size: 18px;
  font-weight: 650;
}
.muted { color: var(--text-muted); }
.small { font-size: 13px; }

.collection-list, .upload-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.collection-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.collection-list .count { margin-left: auto; color: var(--text-faint); font-size: 13px; }

.picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 92px;
  margin: 14px 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: var(--bg-soft);
}
.picker:active { border-color: var(--accent); color: var(--accent); }
.picker-icon { font-size: 22px; }

.upload-item {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.upload-head {
  display: flex;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 8px;
}
.upload-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-state { color: var(--text-faint); flex: none; }
.upload-state.done { color: var(--accent); }
.upload-state.error { color: var(--danger); }
.bar {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.18s ease;
}
.upload-actions { display: flex; gap: 6px; margin-top: 8px; }
.upload-actions button {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
}

.session-facts {
  display: grid;
  grid-template-columns: 42% 58%;
  gap: 8px 12px;
  margin: 0 0 16px;
  font-size: 14px;
}
.session-facts dt { color: var(--text-faint); }
.session-facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- drawer ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 45;
  width: min(84vw, 320px);
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  animation: slide-in 0.18s ease-out;
}
@keyframes slide-in { from { transform: translateX(-12px); opacity: 0.4; } to { transform: none; opacity: 1; } }

.drawer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.drawer-nav { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.drawer-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--tap);
  padding: 0 12px;
  text-align: left;
  border-radius: var(--radius-sm);
  color: var(--text);
}
.drawer-nav button:active, .drawer-nav button:hover { background: var(--surface-2); }
.nav-icon { width: 18px; text-align: center; color: var(--accent); }
.drawer-foot { padding: 12px; border-top: 1px solid var(--border-soft); }
.drawer-foot .danger {
  width: 100%;
  min-height: var(--tap);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(224, 112, 112, 0.4);
  color: var(--danger);
}

/* ---------- viewer ---------- */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: #07080a;
  animation: fade-in 0.16s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: env(safe-area-inset-top) 8px 0;
  height: calc(48px + env(safe-area-inset-top));
  background: rgba(7, 8, 10, 0.9);
}
.viewer-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewer-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
/* The picture fades in over its own placeholder; the stage keeps its size so
   nothing reflows or jumps while the bytes arrive. */
.viewer-media {
  opacity: 1;
  transition: opacity 0.12s linear;
}
.viewer-media.loading {
  opacity: 0;
}
.viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}
.viewer-loading-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  filter: blur(16px) saturate(0.85);
  opacity: 0.32;
}
.viewer-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: rgba(255, 255, 255, 0.78);
  animation: viewer-spin 0.8s linear infinite;
}
@keyframes viewer-spin { to { transform: rotate(360deg); } }
.viewer-error {
  max-width: 280px;
  padding: 24px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  transform-origin: center center;
  will-change: transform;
}
.viewer-stage video {
  width: 100%;
  max-height: 100%;
  background: #000;
}
.viewer-stage.comic {
  display: block;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 0 0 40px;
}
.viewer-stage.comic img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
}
/* Enabled only while the viewer slides between two posts, so dragging keeps
   following the finger instead of lagging behind a transition. */
.viewer-stage.viewer-animating {
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.viewer-stage.comic.viewer-animating {
  overflow: hidden;
}

.viewer-hint {
  position: absolute;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 7px 12px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(20, 24, 18, 0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* ---------- pairing gate ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}
.gate-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.gate-card h1 { margin: 4px 0 0; font-size: 19px; }
.gate-card p { margin: 0; font-size: 14px; color: var(--text-muted); }
.gate-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

.code-input {
  width: 100%;
  height: 56px;
  padding: 0 14px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 9px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
}
.code-input:focus { border-color: var(--accent); }

.primary {
  height: 48px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}
.primary:disabled { opacity: 0.55; }

.error { color: var(--danger); font-size: 13px; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 70;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  font-size: 13px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

@media (min-width: 720px) {
  .feed { max-width: 680px; margin: 0 auto; }
  .searchbar { max-width: 680px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .post { content-visibility: visible; }
}

/* ---------- collection previews ---------- */

.collection-list button.collection-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 8px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.collection-list button.collection-card:active { border-color: var(--accent); }

.collection-preview {
  flex: none;
  width: 84px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: #0c0e0a;
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 22px;
  font-weight: 700;
}
.collection-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.collection-preview.empty { background: var(--surface-2); }

.collection-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.collection-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collection-list .collection-card .count {
  margin-left: 0;
  color: var(--text-faint);
  font-size: 12px;
}

/* ---------- custom video player ---------- */

.viewer.video .viewer-hint {
  bottom: calc(96px + env(safe-area-inset-bottom));
}

.player {
  flex: 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  background: #000;
}

.player-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}
.player-stage video {
  display: block;
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
}
/* Sits over the poster while the first frame decodes. */
.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 24px;
}

/* The control bar is its own band underneath the picture, never floating over
   it.  Hiding the controls keeps the band's space so the video does not jump. */
.player-bar {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  background: #0d0f0c;
  border-top: 1px solid var(--border-soft);
  transition: opacity 0.16s ease;
}
.player.controls-hidden .player-bar {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.player input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  margin: 0;
  background: transparent;
  touch-action: none;
}
.player input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
}
.player input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
}
.player input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
}
.player input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
}
.player .seek { height: 22px; }

.player-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.player .volume {
  flex: 0 1 88px;
  width: 88px;
  height: 22px;
}

.player-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text);
  background: var(--surface-2);
}
.player-button:active { background: var(--surface-3); }
.player-button svg { width: 20px; height: 20px; fill: currentColor; }
.player-button.primary-control {
  background: var(--accent);
  color: var(--accent-ink);
  width: 44px;
  height: 44px;
}
.player-button.primary-control svg { width: 22px; height: 22px; }

.player-time {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skip-flash {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(12, 14, 10, 0.86);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.skip-flash.back { left: 24%; }
.skip-flash.forward { left: 76%; }
.skip-flash.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.player:fullscreen { background: #000; }
