/* GameTube — YouTube-faithful desktop shell */
:root[data-theme="dark"] {
  --bg: #0f0f0f;
  --bg-raised: #212121;
  --bg-menu: #282828;
  --bg-hover-menu: #3e3e3e;
  --text: #f1f1f1;
  --text-2: #aaaaaa;
  --text-3: #717171;
  --hover: rgba(255, 255, 255, 0.1);
  --hover-2: rgba(255, 255, 255, 0.2);
  --border: #303030;
  --search-bg: #121212;
  --search-btn: #222222;
  --search-placeholder: #888;
  --chip: rgba(255, 255, 255, 0.1);
  --chip-hover: rgba(255, 255, 255, 0.2);
  --chip-active-bg: #f1f1f1;
  --chip-active-text: #0f0f0f;
  --brand: #ff0000;
  --link: #3ea6ff;
  --sub-bg: #f1f1f1;
  --sub-text: #0f0f0f;
  --subbed-bg: rgba(255, 255, 255, 0.1);
  --subbed-text: #f1f1f1;
  --icon: #ffffff;
  --desc-bg: rgba(255, 255, 255, 0.1);
  --pill: rgba(255, 255, 255, 0.1);
  --shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
  --masthead: #0f0f0f;
  --tooltip: #616161;
  --player: #000;
  --divider: rgba(255, 255, 255, 0.2);
  --scrim: rgba(0, 0, 0, 0.6);
  --badge-bg: rgba(0, 0, 0, 0.8);
  --logo-word: #ffffff;
  --focus: #3ea6ff;
  --like-on: #f1f1f1;
  --toast-bg: #282828;
  --scroll: #aaa;
  --mini-label: #f1f1f1;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-raised: #ffffff;
  --bg-menu: #ffffff;
  --bg-hover-menu: #f2f2f2;
  --text: #0f0f0f;
  --text-2: #606060;
  --text-3: #909090;
  --hover: rgba(0, 0, 0, 0.05);
  --hover-2: rgba(0, 0, 0, 0.1);
  --border: #ccc;
  --search-bg: #ffffff;
  --search-btn: #f8f8f8;
  --search-placeholder: #909090;
  --chip: #f2f2f2;
  --chip-hover: #e5e5e5;
  --chip-active-bg: #0f0f0f;
  --chip-active-text: #ffffff;
  --brand: #ff0000;
  --link: #065fd4;
  --sub-bg: #0f0f0f;
  --sub-text: #ffffff;
  --subbed-bg: #f2f2f2;
  --subbed-text: #0f0f0f;
  --icon: #030303;
  --desc-bg: #f2f2f2;
  --pill: #f2f2f2;
  --shadow: 0 4px 32px rgba(0, 0, 0, 0.18);
  --masthead: #ffffff;
  --tooltip: #606060;
  --player: #000;
  --divider: rgba(0, 0, 0, 0.15);
  --scrim: rgba(0, 0, 0, 0.5);
  --badge-bg: rgba(0, 0, 0, 0.8);
  --logo-word: #0f0f0f;
  --focus: #065fd4;
  --like-on: #0f0f0f;
  --toast-bg: #222;
  --scroll: #888;
  --mini-label: #0f0f0f;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", "Arial", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  min-height: 100%;
  overflow: hidden;
  height: 100%;
}

body { display: flex; flex-direction: column; height: 100vh; }

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

button { cursor: pointer; border: 0; background: none; padding: 0; }

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

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

/* Scrollbars — thin, YouTube-ish */
.sidebar,
.chips-row,
#main,
.menu-panel,
.notif-panel {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll) transparent;
}
.sidebar::-webkit-scrollbar,
#main::-webkit-scrollbar { width: 8px; }
.chips-row::-webkit-scrollbar { height: 0; }
.sidebar::-webkit-scrollbar-thumb,
#main::-webkit-scrollbar-thumb {
  background: var(--scroll);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* ========== Masthead ========== */
.masthead {
  height: 56px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--masthead);
  position: sticky;
  top: 0;
  z-index: 40;
  gap: 12px;
}

.mh-left, .mh-right, .mh-center {
  display: flex;
  align-items: center;
}

.mh-left { flex: 0 0 auto; gap: 4px; min-width: 180px; }
.mh-right { flex: 0 0 auto; gap: 8px; justify-content: flex-end; }
.mh-center { flex: 1 1 auto; justify-content: center; max-width: 732px; margin: 0 auto; width: 100%; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--icon);
  position: relative;
  flex: 0 0 auto;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }

.logo {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px 0 6px;
  height: 40px;
  color: var(--logo-word);
  user-select: none;
}
.logo-mark { width: 32px; height: 22px; display: block; flex: 0 0 auto; }
.logo-word {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.8px;
  line-height: 1;
  font-family: "Roboto", "Arial", sans-serif;
}
.logo-word em {
  font-style: normal;
  letter-spacing: -1px;
}
.logo-country {
  font-size: 10px;
  color: var(--text-2);
  align-self: flex-start;
  margin-top: 6px;
  margin-left: 1px;
  font-weight: 400;
  letter-spacing: 0;
}

/* Search */
.search-form {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  max-width: 640px;
  width: 100%;
  position: relative;
}
.search-field {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  height: 40px;
  position: relative;
}
.search-field input {
  flex: 1 1 auto;
  background: var(--search-bg);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 40px 0 0 40px;
  padding: 0 16px 0 18px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  min-width: 0;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}
:root[data-theme="light"] .search-field input { box-shadow: none; }
.search-field input::placeholder { color: var(--search-placeholder); }
.search-field input:focus {
  border-color: #1c62b9;
}
.search-field.has-query input { padding-left: 44px; }
.search-leading {
  display: none;
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--icon);
  pointer-events: none;
}
.search-field.has-focus .search-leading { display: block; }
.search-field.has-focus input { padding-left: 44px; }
.search-submit {
  width: 64px;
  height: 40px;
  background: var(--search-btn);
  border: 1px solid var(--border);
  border-radius: 0 40px 40px 0;
  color: var(--icon);
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-submit:hover { background: var(--hover-2); }
.search-submit svg { width: 24px; height: 24px; fill: currentColor; }
.mic-btn { margin-left: 8px; background: var(--hover); }
.mic-btn:hover { background: var(--hover-2); }

.search-suggest {
  display: none;
  position: absolute;
  top: 44px;
  left: 0;
  right: 64px;
  background: var(--bg-menu);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px 0;
  z-index: 50;
  overflow: hidden;
}
.search-suggest.open { display: block; }
.search-suggest button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 8px 16px;
  text-align: left;
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
}
.search-suggest button:hover,
.search-suggest button.active { background: var(--hover); }
.search-suggest svg { width: 20px; height: 20px; fill: var(--text-2); flex: 0 0 auto; }

.publish-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px 0 12px;
  border-radius: 18px;
  background: var(--hover);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.publish-btn:hover { background: var(--hover-2); }
.publish-btn svg { width: 24px; height: 24px; fill: currentColor; }

.notif-wrap, .avatar-wrap { position: relative; }
.notif-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #cc0000;
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--masthead);
  pointer-events: none;
}

.avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin: 0 6px 0 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 13px;
  color: #fff;
  background: #7c3aed;
}

/* ========== App shell ========== */
.app {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  position: relative;
}

.sidebar {
  width: 240px;
  flex: 0 0 240px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 12px 16px;
  background: var(--bg);
  z-index: 25;
}
.sidebar.mini {
  width: 72px;
  flex-basis: 72px;
  padding: 8px 4px;
}
body.watch-mode .sidebar:not(.overlay) {
  display: none;
}
.sidebar.overlay {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  height: 100%;
  display: block;
  box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  z-index: 35;
  padding-top: 8px;
}
.sidebar.overlay.hidden-overlay { display: none; }

.scrim {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--scrim);
  z-index: 30;
}
.scrim.show { display: block; }

.sb-item {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  width: 100%;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}
.sb-item svg { width: 24px; height: 24px; fill: currentColor; flex: 0 0 auto; }
.sb-item:hover { background: var(--hover); }
.sb-item.active {
  background: var(--hover);
  font-weight: 500;
}
.sidebar.mini .sb-item {
  flex-direction: column;
  height: auto;
  gap: 5px;
  padding: 16px 0 14px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 400;
  justify-content: center;
  text-align: center;
}
.sidebar.mini .sb-item svg { width: 24px; height: 24px; }
.sidebar.mini .sb-section,
.sidebar.mini .sb-heading,
.sidebar.mini .sb-studio,
.sidebar.mini hr { display: none; }
.sidebar.mini .sb-mini-hide { display: none; }

.sb-heading {
  font-size: 16px;
  font-weight: 500;
  padding: 6px 12px 4px;
  color: var(--text);
}
.sb-section { padding: 8px 0 4px; }
hr.sb-div {
  border: 0;
  border-top: 1px solid var(--hover);
  margin: 12px 0;
}

.sb-studio {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  width: 100%;
  font-size: 14px;
  text-align: left;
  color: var(--text);
}
.sb-studio:hover { background: var(--hover); }
.sb-av {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  flex: 0 0 auto;
}

/* ========== Main ========== */
#main {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
}

/* Chips */
.home-top {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--bg);
}
.chips-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px 12px 24px;
  overflow-x: auto;
  white-space: nowrap;
}
.chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--chip);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  flex: 0 0 auto;
  line-height: 32px;
}
.chip:hover { background: var(--chip-hover); }
.chip.active {
  background: var(--chip-active-bg);
  color: var(--chip-active-text);
}

/* Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px 16px;
  padding: 8px 24px 48px;
}
@media (min-width: 1200px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1600px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); padding: 8px 16px 48px; }
  .chips-row { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
  .publish-label { display: none; }
  .publish-btn { width: 40px; padding: 0; justify-content: center; border-radius: 50%; }
}

.card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border-radius: 12px;
  position: relative;
  text-align: left;
  width: 100%;
  color: inherit;
  background: transparent;
}
.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  transition: border-radius 0.15s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card-thumb svg.art { width: 100%; height: 100%; display: block; }
.card-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: var(--badge-bg);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  padding: 3px 4px;
  border-radius: 4px;
  letter-spacing: 0.2px;
}
.card-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.card-play-icon svg { width: 48px; height: 48px; fill: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }
.card:hover .card-play-icon { opacity: 1; }
.card:hover .card-thumb {
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  transform: translateY(-2px);
}

.card-meta {
  display: flex;
  gap: 12px;
  padding: 12px 0 20px;
}
.card-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-top: 2px;
}
.card-text { min-width: 0; flex: 1 1 auto; }
.card-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.375;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 4px;
}
.card-sub, .card-stats {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.card-sub { margin-top: 2px; }
.verified {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  display: inline-block;
}
.card-menu {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  opacity: 0;
  margin: -6px -6px 0 0;
}
.card:hover .card-menu, .card-menu.open { opacity: 1; }
.card-menu:hover { background: var(--hover); }
.card-menu svg { width: 24px; height: 24px; fill: currentColor; }

.empty-state {
  padding: 72px 24px;
  text-align: center;
  color: var(--text-2);
}
.empty-state h2 { color: var(--text); font-weight: 500; font-size: 24px; margin: 0 0 8px; }
.empty-state p { margin: 0; font-size: 14px; }

.results-label {
  padding: 8px 24px 0;
  font-size: 16px;
  color: var(--text);
  font-weight: 500;
}

/* ========== Watch / Play page ========== */
.watch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 402px;
  gap: 24px;
  padding: 24px 24px 64px;
  max-width: 1750px;
  margin: 0 auto;
}
@media (max-width: 1100px) {
  .watch { grid-template-columns: 1fr; padding: 16px 16px 64px; }
}

.player-wrap {
  background: var(--player);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.player-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}
.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(20,20,20,0.55), rgba(0,0,0,0.72));
  color: #fff;
  text-align: center;
  padding: 24px;
  z-index: 3;
}
.player-overlay.hidden { display: none; }
.player-overlay h2 {
  margin: 16px 0 6px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.3px;
}
.player-overlay p {
  margin: 0 0 20px;
  color: #ddd;
  max-width: 520px;
  font-size: 14px;
  line-height: 1.5;
  text-shadow: 0 1px 8px rgba(0,0,0,0.8);
}
.player-overlay h2 { text-shadow: 0 2px 12px rgba(0,0,0,0.7); }
.yt-play {
  width: 68px;
  height: 48px;
  border-radius: 14px;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255,0,0,0.35);
}
.yt-play:hover { background: #cc0000; }
.yt-play svg { width: 28px; height: 28px; fill: #fff; margin-left: 3px; }

.player-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
  font-weight: 500;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.player-hud.hidden { display: none; }
.hud-chip {
  background: rgba(0,0,0,0.45);
  padding: 4px 10px;
  border-radius: 6px;
  backdrop-filter: blur(6px);
}

.player-bar {
  height: 48px;
  background: linear-gradient(180deg, #0f0f0f 0%, #000 100%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  color: #fff;
}
.player-bar .icon-btn { color: #fff; width: 36px; height: 36px; }
.player-bar .spacer { flex: 1; }
.player-time { font-size: 13px; color: #ddd; padding: 0 8px; font-variant-numeric: tabular-nums; }

.watch-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin: 14px 0 8px;
  color: var(--text);
}

.watch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.studio-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.studio-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  font-size: 15px;
  flex: 0 0 auto;
}
.studio-name {
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
}
.studio-subs { font-size: 12px; color: var(--text-2); margin-top: 1px; }

.follow-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  background: var(--sub-bg);
  color: var(--sub-text);
  font-size: 14px;
  font-weight: 500;
  margin-left: 8px;
  white-space: nowrap;
}
.follow-btn:hover { filter: brightness(0.92); }
.follow-btn.on {
  background: var(--subbed-bg);
  color: var(--subbed-text);
}

.watch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  height: 36px;
  background: var(--pill);
  border-radius: 18px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
}
.pill button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  color: inherit;
  font-weight: 500;
  font-size: 14px;
}
.pill button:hover { background: var(--hover); }
.pill button svg { width: 24px; height: 24px; fill: currentColor; }
.pill button.active { color: var(--like-on); }
.pill-split { width: 1px; height: 24px; background: var(--divider); flex: 0 0 auto; }

.desc-box {
  background: var(--desc-bg);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 8px 0 24px;
  font-size: 14px;
  cursor: pointer;
}
.desc-box .desc-stats {
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}
.desc-box p { margin: 0; color: var(--text); white-space: pre-wrap; }
.desc-box.collapsed p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.desc-more {
  font-weight: 500;
  margin-top: 8px;
  color: var(--text);
  display: block;
}
.desc-tags { margin-top: 8px; }
.desc-tags span {
  color: var(--link);
  margin-right: 8px;
  font-weight: 500;
}

/* Comments */
.comments-head {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 8px 0 20px;
  font-size: 20px;
  font-weight: 700;
}
.comments-head .sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.comment-form {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}
.comment-form input {
  flex: 1;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.comment-form input:focus { border-bottom-color: var(--text); }
.comment-form input::placeholder { color: var(--text-2); }
.c-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  flex: 0 0 auto;
  font-size: 14px;
}
.comment {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}
.comment .c-av { width: 40px; height: 40px; }
.c-body { min-width: 0; }
.c-meta { font-size: 13px; margin-bottom: 4px; }
.c-meta strong { font-weight: 500; font-size: 13px; margin-right: 6px; }
.c-meta span { color: var(--text-2); }
.c-text { font-size: 14px; color: var(--text); line-height: 1.5; }
.c-acts { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.c-acts button {
  height: 32px;
  padding: 0 8px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  font-size: 12px;
}
.c-acts button:hover { background: var(--hover); }
.c-acts svg { width: 16px; height: 16px; fill: currentColor; }
.c-reply { font-weight: 500; font-size: 12px; color: var(--text-2); padding: 0 10px; }

/* Up next */
.upnext h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 12px;
  color: var(--text);
}
.up-item {
  display: flex;
  gap: 8px;
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  color: inherit;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}
.up-item:hover .up-thumb { box-shadow: 0 2px 10px rgba(0,0,0,0.25); }
.up-thumb {
  width: 168px;
  flex: 0 0 168px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #111;
}
.up-thumb svg.art { width: 100%; height: 100%; display: block; }
.up-thumb .card-badge { transform: scale(0.92); transform-origin: bottom right; }
.up-text { min-width: 0; padding-top: 2px; }
.up-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
  margin: 0 0 4px;
}
.up-sub, .up-stats { font-size: 12px; color: var(--text-2); line-height: 1.35; }

/* Menus, panels */
.menu-panel, .notif-panel {
  position: absolute;
  top: 48px;
  right: 0;
  background: var(--bg-menu);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 280px;
  padding: 8px 0;
  z-index: 60;
  display: none;
  overflow: hidden;
}
.menu-panel.open, .notif-panel.open { display: block; }
.menu-panel button, .notif-panel .notif-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 0 16px;
  height: 40px;
  text-align: left;
  font-size: 14px;
  color: var(--text);
}
.menu-panel button:hover, .notif-panel .notif-row:hover { background: var(--bg-hover-menu); }
.menu-panel button svg { width: 24px; height: 24px; fill: currentColor; }
.notif-panel { width: 360px; max-height: 70vh; overflow-y: auto; padding-top: 0; }
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid var(--hover);
}
.notif-row { height: auto; padding: 12px 16px; align-items: flex-start; }
.notif-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.notif-row strong { display: block; font-weight: 500; font-size: 14px; }
.notif-row span { color: var(--text-2); font-size: 12px; }

.card-pop {
  position: absolute;
  background: var(--bg-menu);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 240px;
  padding: 8px 0;
  z-index: 70;
  display: none;
}
.card-pop.open { display: block; }
.card-pop button {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 0 16px;
  height: 40px;
  font-size: 14px;
  text-align: left;
  color: var(--text);
}
.card-pop button:hover { background: var(--bg-hover-menu); }
.card-pop svg { width: 24px; height: 24px; fill: currentColor; }

/* Modal */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-scrim.open { display: flex; }
.modal {
  background: var(--bg-raised);
  border-radius: 16px;
  width: 520px;
  max-width: 100%;
  padding: 24px;
  box-shadow: var(--shadow);
  color: var(--text);
}
.modal h2 { margin: 0 0 8px; font-size: 20px; font-weight: 500; }
.modal p { margin: 0 0 20px; color: var(--text-2); }
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-2);
  margin-bottom: 20px;
}
.modal-acts { display: flex; justify-content: flex-end; gap: 8px; }
.modal-acts button {
  height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  font-weight: 500;
}
.btn-ghost:hover { background: var(--hover); }
.btn-primary { background: #3ea6ff; color: #0f0f0f; }
.btn-primary:hover { filter: brightness(0.95); }

/* Toast */
.toasts {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--toast-bg);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: var(--shadow);
  min-width: 240px;
  text-align: center;
}

/* Tooltips */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--tooltip);
  color: #fff;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 80;
  font-weight: 400;
}

.hidden { display: none !important; }

/* 2048 tiles drawn on canvas; snake etc too */

/* Light mode masthead hairline */
:root[data-theme="light"] .masthead {
  border-bottom: 1px solid #e5e5e5;
}
