/* Tubium default theme - dark, dense, orange-red accent. Edit freely. */

:root {
  --bg: #0d0d10;
  --surface: #16161b;
  --surface-2: #1e1e25;
  --line: #2a2a33;
  --text: #f3f3f5;
  --muted: #9a9aa6;
  --muted-2: #6e6e7a;
  --accent: #ff5a1f;
  --accent-2: #ff8a3d;
  --radius: 10px;
  --display: "Bebas Neue", "Arial Narrow", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
  max-width: 100%;
}
::selection {
  background: var(--accent);
  color: #fff;
}

.wrap {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 13, 16, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  flex: none;
}
.brand img {
  height: 32px;
  width: auto;
}
.brand-name {
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: 1px;
  line-height: 1;
  transition: color 0.15s ease;
}
.brand:hover .brand-name {
  color: var(--accent);
}
.tagline {
  color: var(--muted);
  font-size: 13px;
}
.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex: 0 1 440px;
}
.search input {
  flex: 1;
  min-width: 0;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 0 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}
.search input:focus {
  border-color: var(--accent);
}
.search input::placeholder {
  color: var(--muted-2);
}
.search button {
  height: 40px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.search button:hover {
  background: var(--accent-2);
}

/* Main + headings */
main.wrap {
  padding-top: 28px;
  padding-bottom: 48px;
  flex: 1;
}
.page-title,
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.5px;
  margin: 0 0 20px;
}
.page-title {
  font-size: 32px;
}
.section-title {
  font-size: 26px;
}
.page-title::before,
.section-title::before {
  content: "";
  width: 5px;
  height: 0.8em;
  background: var(--accent);
  border-radius: 2px;
}

/* Video grid + cards */
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px 18px;
}
.card {
  display: flex;
  flex-direction: column;
}
.card-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-thumb img {
  transform: scale(1.06);
}
.card-thumb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.card:hover .card-thumb::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.card-dur {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  padding: 2px 6px;
  border-radius: 4px;
}
.card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 10px 2px 4px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  transition: color 0.15s ease;
}
.card:hover .card-title {
  color: var(--accent-2);
}
.card-meta {
  padding: 0 2px;
  font-size: 12px;
  color: var(--muted);
}
.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

/* Pager */
.pager {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
}
.pager a {
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.pager a:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}

/* Watch page */
.watch {
  max-width: 1000px;
}
.player {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.5);
}
.player video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}
.watch-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin: 20px 0 8px;
}
.watch-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}
.watch-desc {
  color: #d2d2d8;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  margin: 0 0 8px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.related {
  margin-top: 36px;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 22px;
  padding-bottom: 22px;
}
.footer-warn {
  color: var(--muted-2);
}

/* Age gate */
body.age-gate {
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% -10%, #1c1c26, var(--bg) 60%);
}
.gate-card {
  max-width: 460px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
.gate-logo {
  height: 44px;
  margin: 0 auto 12px;
}
.gate-brand {
  font-family: var(--display);
  font-size: 42px;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 6px;
}
.gate-card h1 {
  font-size: 22px;
  margin: 6px 0 14px;
}
.gate-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 20px;
}
.gate-enter {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.gate-enter:hover {
  background: var(--accent-2);
}
.gate-leave {
  display: inline-block;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}
.gate-leave:hover {
  color: var(--text);
}
.gate-fine {
  margin-top: 18px;
  font-size: 11px;
  color: var(--muted-2);
}

/* Footer ad banners: 4 fixed 300x250 placeholder slots for future ad spots. */
.ad-banners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 28px 0 8px;
}
.ad-slot {
  width: 300px;
  height: 250px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* 404 page */
.notfound {
  text-align: center;
  padding: 80px 0 100px;
}
.notfound-code {
  font-family: var(--display);
  font-size: 110px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: 2px;
}
.notfound-title {
  font-size: 26px;
  margin: 6px 0 10px;
}
.notfound-text {
  color: var(--muted);
  margin-bottom: 22px;
}
.notfound-home {
  color: var(--accent-2);
  font-weight: 600;
}
.notfound-home:hover {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 720px) {
  .tagline {
    display: none;
  }
  .header-inner {
    gap: 12px;
    height: 56px;
  }
  .brand-name {
    font-size: 26px;
  }
  .search {
    flex-basis: auto;
  }
}
@media (max-width: 560px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 18px 12px;
  }
  .card-title {
    font-size: 13px;
  }
  .page-title {
    font-size: 28px;
  }
}

/* Header auth (viewer login state) */
.header-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.header-auth a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: color 0.15s ease;
}
.header-login:hover {
  color: var(--accent);
}
.header-register {
  padding: 8px 14px;
  background: var(--accent);
  color: #fff !important;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.header-register:hover {
  background: var(--accent-2);
}
.header-user {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.logout-form {
  margin: 0;
}
.logout-form button {
  height: 36px;
  padding: 0 14px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.logout-form button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Account pages (login / register) */
main.account {
  max-width: 420px;
}
.account h1 {
  font-family: var(--display);
  font-size: 40px;
  letter-spacing: 1px;
  margin-bottom: 24px;
}
.account-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.account-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.account-form input {
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease;
}
.account-form input:focus {
  border-color: var(--accent);
}
.account-form button {
  height: 46px;
  margin-top: 4px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.account-form button:hover {
  background: var(--accent-2);
}
.account > p {
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}
.account > p a {
  color: var(--accent-2);
}
.account > p a:hover {
  text-decoration: underline;
}
.form-error {
  background: rgba(255, 90, 31, 0.12);
  border: 1px solid var(--accent);
  color: #ffb99a;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 18px;
}
@media (max-width: 560px) {
  .header-auth {
    gap: 8px;
  }
  .header-user {
    display: none;
  }
  .account h1 {
    font-size: 32px;
  }
}

/* Video like / dislike (SP2) */
.votes {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 4px;
  flex-wrap: wrap;
}
.vote-form {
  margin: 0;
}
.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.vote-btn:hover {
  border-color: var(--muted);
}
.vote-like.on {
  border-color: var(--accent);
  color: var(--accent);
}
.vote-dislike.on {
  border-color: var(--muted);
  background: var(--surface-2);
}
.vote-count {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.vote-btn.on .vote-count {
  color: inherit;
}
.rating-bar {
  flex: 0 1 160px;
  height: 6px;
  border-radius: 999px;
  background: #b23b2e;
  overflow: hidden;
}
.rating-bar[data-empty] {
  background: var(--line);
}
.rating-fill {
  display: block;
  height: 100%;
  background: var(--accent);
}
.rating-bar[data-empty] .rating-fill {
  width: 0 !important;
}

/* Comments (SP3) */
.comments {
  margin-top: 28px;
}
.comment-note {
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 12px;
}
.comment-login {
  color: var(--muted);
}
.comment-login a {
  color: var(--accent-2);
}
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  max-width: 720px;
}
.comment-form textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  resize: vertical;
  outline: none;
}
.comment-form textarea:focus {
  border-color: var(--accent);
}
.comment-form button {
  align-self: flex-start;
  height: 40px;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.comment-form button:hover {
  background: var(--accent-2);
}
.comment-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 720px;
}
.comment {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.comment-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.comment-author {
  font-weight: 700;
  font-size: 14px;
}
.comment-ago {
  color: var(--muted);
  font-size: 12px;
}
.comment-body {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-del {
  margin-top: 6px;
}
.comment-del button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.comment-del button:hover {
  color: var(--accent);
}
