:root {
  color-scheme: light;
  --bg: #f2f0eb;
  --header: #244236;
  --header-dark: #d6b36a;
  --heading: #8f3152;
  --text: #2f3230;
  --muted: #74736f;
  --line: #d6d0c5;
  --chip: #e4ddcf;
  --card: #fffdf8;
  --white: #ffffff;
}

:root[data-theme="noir"] {
  color-scheme: dark;
  --bg: #151313;
  --header: #090909;
  --header-dark: #ff3d3d;
  --heading: #c0182f;
  --text: #eeeeee;
  --muted: #b6aaaa;
  --line: #3a3030;
  --chip: #2c2525;
  --card: #1f1c1c;
  --white: #ffffff;
}

:root[data-theme="gold"] {
  color-scheme: dark;
  --bg: #11100d;
  --header: #050505;
  --header-dark: #d9b76c;
  --heading: #9f7a32;
  --text: #f1ead9;
  --muted: #b6aa92;
  --line: #3b3426;
  --chip: #2c261a;
  --card: #1a1711;
  --white: #ffffff;
}

:root[data-theme="wine"] {
  color-scheme: dark;
  --bg: #1b1118;
  --header: #381528;
  --header-dark: #f3a9bd;
  --heading: #a52258;
  --text: #f4edf2;
  --muted: #c3aeba;
  --line: #4a293d;
  --chip: #3a2031;
  --card: #241620;
  --white: #ffffff;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eeeeee;
  --header: #ff5a3d;
  --header-dark: #5a2419;
  --heading: #ff4b2f;
  --text: #333333;
  --muted: #777777;
  --line: #cccccc;
  --chip: #d8d8d8;
  --card: #ffffff;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 12px;
  background: var(--header);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 8px 2px;
  background: color-mix(in srgb, var(--header) 22%, #050505);
  color: color-mix(in srgb, var(--card) 86%, #ffffff);
  font-family: Arial Black, Impact, Arial, sans-serif;
  font-size: clamp(34px, 8vw, 58px);
  line-height: 0.9;
  letter-spacing: -2px;
  text-decoration: none;
}

.logo-mark {
  color: var(--header-dark);
}

.logo-mascot {
  width: clamp(38px, 8vw, 58px);
  height: clamp(38px, 8vw, 58px);
  flex: 0 0 auto;
  object-fit: contain;
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

nav a {
  color: var(--header-dark);
  text-decoration: none;
}

.nav-icon,
.menu-popover summary {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  border: 0;
  color: var(--header-dark);
  background: transparent;
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}

.menu-popover {
  position: relative;
}

.menu-popover summary::-webkit-details-marker {
  display: none;
}

.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 20;
  display: grid;
  width: min(320px, calc(100vw - 24px));
  max-height: min(72vh, 620px);
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 14px 30px rgba(22, 28, 24, 0.22);
}

.menu-panel a {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.menu-panel a:last-child {
  border-bottom: 0;
}

.menu-section {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.menu-section p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.menu-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.menu-tags a {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--chip);
  color: var(--text);
  font-size: 12px;
}

.menu-tags a[aria-current="true"] {
  border-color: var(--heading);
  background: var(--heading);
  color: #ffffff;
}

main {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 0 0 28px;
}

.top-ad-space {
  min-height: 92px;
  background:
    linear-gradient(90deg, rgba(214, 179, 106, 0.12), rgba(143, 49, 82, 0.08)),
    var(--bg);
}

.theme-switcher {
  padding: 10px;
  background: color-mix(in srgb, var(--bg) 86%, var(--heading));
}

.theme-switcher > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-button {
  min-height: 32px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 0 10px;
  font-weight: 800;
  cursor: pointer;
}

.theme-button[aria-pressed="true"] {
  border-color: var(--heading);
  background: var(--heading);
  color: #ffffff;
}

.public-page .toolbar {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 210px;
  gap: 10px;
  padding: 10px;
  background: #ebe5d9;
  border-bottom: 1px solid var(--line);
}

.toolbar label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar input,
.toolbar select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #bdbdbd;
  background: var(--card);
  color: var(--text);
  padding: 0 10px;
  border-radius: 0;
}

.section-heading {
  margin: 0;
  padding: 16px 12px;
  background: var(--heading);
  color: #ffffff;
  font-size: clamp(22px, 5vw, 34px);
  line-height: 1;
}

.video-heading-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: stretch;
  margin: 0 0 10px;
  background: var(--heading);
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px;
}

.quick-filters label {
  display: grid;
  gap: 3px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 800;
}

.quick-filters select {
  min-height: 32px;
  max-width: 150px;
  border: 1px solid color-mix(in srgb, var(--heading) 70%, #ffffff);
  background: color-mix(in srgb, var(--heading) 82%, #000000);
  color: #ffffff;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 800;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0 10px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 18px 10px 8px;
}

.pagination button,
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.pagination button[aria-current="page"],
.pagination a[aria-current="page"] {
  border-color: var(--heading);
  background: var(--heading);
  color: #ffffff;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.video-card {
  display: grid;
  grid-template-columns: minmax(190px, 35%) 1fr;
  min-height: 150px;
  overflow: hidden;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.embed-wrap,
.thumb-button,
.thumb-preview {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 150px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 0;
  background: #050505;
  color: #ffffff;
  padding: 0;
}

.thumb-button {
  cursor: pointer;
  text-decoration: none;
}

.thumb-button img,
.thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duration-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.thumb-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #cccccc;
  font-weight: 800;
  text-align: center;
  background: #050505;
}

.embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.embed-wrap video,
.watch-embed video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #050505;
  object-fit: contain;
}

.x-embed {
  display: grid;
  min-height: 260px;
  aspect-ratio: auto;
  place-items: center;
  padding: 10px;
}

.x-embed .twitter-tweet {
  width: 100%;
  max-width: 520px;
}

.video-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  padding: 12px 14px;
}

.video-body h3 {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: clamp(18px, 3vw, 30px);
  font-weight: 900;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-title-link {
  color: inherit;
  text-decoration: none;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.public-page .video-card .tag {
  display: none;
}

.tag,
.source,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--chip);
  color: var(--text);
  font-size: 15px;
}

.status-pill {
  color: var(--header-dark);
  font-weight: 800;
}

.notes {
  display: -webkit-box;
  overflow: hidden;
  margin: 10px 0 0;
  color: #777777;
  font-size: 15px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-stats {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 10px;
  align-self: end;
  margin-top: 18px;
  color: #777777;
  font-size: 16px;
}

.video-stats .view-count {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.review-actions code {
  display: block;
  width: 100%;
  overflow-x: auto;
  padding: 6px;
  border: 1px solid var(--line);
  background: #f3f3f3;
  color: #555555;
  font-size: 12px;
}

.review-card {
  align-items: stretch;
}

.review-editor {
  gap: 10px;
}

.review-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.review-card-header code {
  padding: 4px 6px;
  border: 1px solid var(--line);
  background: #f3f0e9;
  color: #555555;
  font-size: 12px;
}

.review-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.review-field input,
.review-field textarea,
.review-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.review-field input,
.review-field select {
  min-height: 38px;
  padding: 0 10px;
}

.review-field textarea {
  resize: vertical;
  min-height: 76px;
  padding: 9px 10px;
  line-height: 1.5;
}

.review-field input:disabled,
.review-field textarea:disabled,
.review-field select:disabled {
  background: #f3f3f3;
  color: #777777;
}

.manual-add summary {
  cursor: pointer;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  list-style: none;
}

.manual-add summary::-webkit-details-marker {
  display: none;
}

.manual-add summary::after {
  content: "＋";
  float: right;
  color: var(--heading);
}

.manual-add details[open] summary {
  margin-bottom: 12px;
}

.manual-add details[open] summary::after {
  content: "−";
}

.manual-add h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.manual-add-form {
  display: grid;
  gap: 12px;
}

.review-readonly p {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #f3f0e9;
  color: #555555;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.quick-tags {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quick-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-tag-button {
  min-height: 30px;
  border: 1px solid var(--line);
  padding: 0 9px;
  background: #eee8dc;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.quick-tag-button:hover {
  border-color: var(--gold);
  background: #f5ead0;
}

.quick-tag-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.quick-tag-custom {
  display: inline-flex;
}

.quick-tag-custom .quick-tag-button {
  border-right: 0;
}

.quick-tag-remove {
  min-width: 28px;
  min-height: 30px;
  border: 1px solid var(--line);
  padding: 0 7px;
  background: #d8d2c6;
  color: var(--heading);
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
}

.quick-tag-remove:hover {
  border-color: var(--heading);
  background: #ead6dc;
}

.quick-tag-remove:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.quick-tag-add {
  min-width: 34px;
  background: var(--gold);
  color: var(--header-dark);
  font-size: 16px;
}

.review-stats {
  margin-top: 4px;
}

.view-count-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(140px, 0.7fr);
  gap: 10px;
}

.review-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-links a {
  color: var(--heading);
  font-weight: 800;
  text-decoration: none;
}

.review-button {
  min-height: 38px;
  border: 0;
  padding: 0 14px;
  background: #d8d2c6;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.review-button:hover {
  filter: brightness(0.96);
}

.review-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.review-button-save {
  background: var(--gold);
}

.review-button-suggest {
  background: #eee8dc;
  color: var(--heading);
}

.review-button-publish {
  background: var(--header-dark);
  color: #ffffff;
}

.review-button-reject {
  background: var(--heading);
  color: #ffffff;
}

.review-button-delete {
  background: #4f4a45;
  color: #ffffff;
}

.review-button-review {
  background: #eee8dc;
}

.review-message {
  min-height: 20px;
  margin: 0;
  color: var(--heading);
  font-size: 13px;
  font-weight: 800;
}

.review-message-warning {
  color: #b42342;
}

.review-command-fallback {
  display: grid;
  gap: 6px;
}

.analytics-panel h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 20px;
}

.analytics-summary {
  display: grid;
  gap: 12px;
}

.analytics-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.analytics-metric {
  display: grid;
  gap: 4px;
  margin: 0;
  border: 1px solid var(--line);
  padding: 12px;
  background: #f7f3eb;
}

.analytics-metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.analytics-metric strong {
  color: var(--heading);
  font-size: 24px;
  line-height: 1;
}

.analytics-list {
  display: grid;
  gap: 6px;
}

.analytics-list p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  font-size: 13px;
}

.analytics-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-list span {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.review-command-fallback:empty {
  display: none;
}

.review-command-fallback p {
  margin: 0;
  color: var(--heading);
  font-size: 13px;
  font-weight: 800;
}

.review-command-fallback code {
  display: block;
  overflow-x: auto;
  padding: 6px;
  border: 1px solid var(--line);
  background: #f3f3f3;
  color: #555555;
  font-size: 12px;
}

.tab-nav {
  display: none;
}

.content-band {
  margin: 14px 10px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
}

.content-band h2 {
  margin: 0 0 10px;
  color: var(--muted);
}

.review-flow h1 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 22px;
}

.review-command-grid {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.review-command-grid code {
  display: block;
  overflow-x: auto;
  padding: 10px;
  border: 1px solid var(--line);
  background: #f3f3f3;
  color: #333333;
  font-size: 13px;
}

.content-band ul,
.content-band p {
  color: var(--muted);
  line-height: 1.8;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 8px;
  padding: 0 14px;
  background: var(--heading);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.empty {
  padding: 40px 16px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  text-align: center;
}

.watch-container {
  padding: 22px 22px 0;
}

.watch-embed {
  position: relative;
  width: min(100%, 760px);
  aspect-ratio: 16 / 9;
  background: #050505;
}

.watch-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.watch-title {
  max-width: 920px;
  margin: 24px 0 12px;
  color: var(--text);
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 900;
  line-height: 1.35;
}

.watch-tags {
  max-width: 920px;
}

.watch-tags a {
  text-decoration: none;
}

.watch-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 28px;
  padding-bottom: 28px;
  color: var(--text);
  font-size: clamp(18px, 3vw, 28px);
}

.watch-description {
  max-width: 920px;
  margin: -8px 0 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.related-section {
  margin-top: 28px;
}

.related-heading {
  margin-bottom: 10px;
  font-size: clamp(20px, 4vw, 30px);
}

.related-grid {
  padding: 0;
}

.related-card {
  min-height: 118px;
  grid-template-columns: minmax(150px, 30%) 1fr;
}

.related-card .embed-wrap,
.related-card .thumb-button,
.related-card .thumb-preview {
  min-height: 118px;
}

footer {
  width: min(100%, 960px);
  margin: 20px auto 40px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.86);
}

.age-gate.is-hidden {
  display: none;
}

.age-panel {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid #555555;
  background: var(--card);
  color: var(--text);
}

.age-panel h1 {
  margin: 0;
  font-size: 28px;
}

.label {
  margin: 0 0 4px;
  color: var(--heading);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.age-panel p:not(.label) {
  color: var(--muted);
  line-height: 1.7;
}

.gate-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}

.gate-actions button {
  min-height: 44px;
  border: 0;
  background: var(--heading);
  color: #ffffff;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.gate-actions a {
  color: var(--muted);
}

@media (max-width: 640px) {
  .site-header {
    min-height: 104px;
    padding: 0;
  }

  .site-logo {
    font-size: 54px;
    padding-left: 0;
  }

  nav {
    padding-right: 10px;
    gap: 10px;
  }

  .top-ad-space {
    min-height: 92px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .video-grid {
    padding: 0 10px;
    gap: 6px;
  }

  .video-heading-bar {
    grid-template-columns: 1fr;
  }

  .quick-filters {
    justify-content: stretch;
    padding-top: 0;
  }

  .quick-filters label {
    flex: 1 1 30%;
  }

  .quick-filters select {
    width: 100%;
    max-width: none;
  }

  .video-card {
    grid-template-columns: 35% 1fr;
    min-height: 122px;
  }

  .embed-wrap,
  .thumb-button,
  .thumb-preview {
    min-height: 122px;
  }

  .video-body {
    padding: 8px 10px;
  }

  .video-body h3 {
    font-size: 17px;
    -webkit-line-clamp: 3;
  }

  .meta {
    gap: 5px;
    margin-top: 7px;
  }

  .tag,
  .source,
  .status-pill {
    min-height: 24px;
    padding: 3px 7px;
    font-size: 12px;
  }

  .notes {
    display: none;
  }

  .video-stats {
    column-gap: 5px;
    margin-top: 12px;
    font-size: 11px;
  }

  .watch-container {
    padding: 20px 22px 0;
  }

  .watch-embed {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .site-logo {
    font-size: 44px;
  }

  .video-body h3 {
    font-size: 15px;
  }

  .video-stats {
    column-gap: 4px;
    font-size: 10px;
  }
}
