/* Cinéma RuStrim — v0.1.0 — thème sombre, mobile-first, sans dépendance. */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "gg sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: #0b0d13; color: #e7e9ee;
  display: flex; flex-direction: column; height: 100%;
  overflow: hidden; -webkit-tap-highlight-color: transparent;
}

#app { display: flex; flex-direction: column; height: 100%; max-width: 1400px; margin: 0 auto; width: 100%; }

/* ---------- topbar ---------- */
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; flex: 0 0 auto;
  background: linear-gradient(180deg, #141824, #10131c);
  border-bottom: 1px solid #232838;
}
#brand { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
#brand span { color: #ff4d4d; }
#topbar-right { display: flex; align-items: center; gap: 10px; }
#participants { display: flex; gap: 4px; }
#participants img {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #141824; background: #2b3245; object-fit: cover;
}
#participants .p-more {
  width: 24px; height: 24px; border-radius: 50%; background: #2b3245;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #cfd4e1;
}
#conn { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #9aa3b5; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.on  { background: #3ba55c; box-shadow: 0 0 6px #3ba55c; }
.dot.off { background: #667; }

/* ---------- scène vidéo ---------- */
#stage { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#video-wrap {
  position: relative; flex: 1 1 auto; min-height: 0;
  background: #000; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
#vid { width: 100%; height: 100%; object-fit: contain; background: #000; }

#overlay-title {
  position: absolute; left: 10px; top: 10px; max-width: 70%;
  background: rgba(8, 10, 16, .72); backdrop-filter: blur(4px);
  border-radius: 10px; padding: 8px 12px; font-size: 13px; line-height: 1.45;
  pointer-events: none;
}
#overlay-title .art { color: #aeb6c8; font-size: 12px; }

#need-gesture {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: rgba(5, 6, 10, .55); backdrop-filter: blur(2px);
}
#bigplay {
  width: 84px; height: 84px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 34px; background: rgba(255, 77, 77, .92); color: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
#gesture-hint { font-size: 13px; color: #dfe3ec; text-shadow: 0 1px 4px #000; }

#empty-state {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; text-align: center;
  background: radial-gradient(60% 60% at 50% 45%, #171c2b 0%, #0b0d13 100%);
}
#empty-art { font-size: 44px; }
#empty-title { font-size: 18px; font-weight: 700; }
#empty-sub { font-size: 13px; color: #aeb6c8; line-height: 1.6; }

#vid-error {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: #2b1216; color: #ffb4b4; border: 1px solid #7a2e33;
  border-radius: 10px; padding: 12px 16px; font-size: 13px; max-width: 85%;
  white-space: pre-wrap; word-break: break-all;
}

/* ---------- contrôles ---------- */
#controls {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; background: #10131c; border-top: 1px solid #232838;
  flex-wrap: nowrap; overflow-x: auto;
}
.ctl {
  background: #1c2130; color: #fff; border: 1px solid #2a3044;
  border-radius: 10px; min-width: 40px; height: 40px; cursor: pointer;
  font-size: 15px; flex: 0 0 auto;
}
.ctl:active { transform: scale(.96); }
.ctl.big { background: #ff4d4d; border-color: #ff4d4d; font-size: 17px; }
.ctl:disabled { opacity: .35; cursor: default; }
#seek-wrap { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 120px; }
#seek { flex: 1 1 auto; accent-color: #ff4d4d; height: 18px; }
#t-cur, #t-dur { font-size: 11px; color: #9aa3b5; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
#vol-wrap { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
#vol { width: 74px; accent-color: #8fa1ff; }
#drift-badge {
  flex: 0 0 auto; font-size: 11px; color: #9aa3b5; min-width: 34px; text-align: right;
  font-variant-numeric: tabular-nums;
}
#drift-badge.big { color: #ffb84d; font-weight: 700; }

/* ---------- onglets ---------- */
#tabs { display: flex; gap: 4px; padding: 6px 10px 0; background: #10131c; flex: 0 0 auto; }
.tab {
  background: transparent; border: none; color: #9aa3b5; cursor: pointer;
  padding: 8px 14px; font-size: 13px; font-weight: 600;
  border-bottom: 2px solid transparent;
}
.tab.active { color: #fff; border-bottom-color: #ff4d4d; }

/* ---------- panneaux ---------- */
.panel { display: none; flex: 0 0 auto; max-height: 34vh; overflow-y: auto; padding: 10px 12px; background: #0e111a; }
.panel.active { display: block; }

#search-bar { display: flex; gap: 6px; margin-bottom: 8px; }
#q {
  flex: 1 1 auto; background: #171c2b; color: #e7e9ee; border: 1px solid #2a3044;
  border-radius: 10px; padding: 9px 12px; font-size: 14px; outline: none;
}
#q:focus { border-color: #ff4d4d; }
#b-search, #b-random {
  background: #1c2130; border: 1px solid #2a3044; color: #fff;
  border-radius: 10px; width: 42px; cursor: pointer; font-size: 15px;
}
#search-status { font-size: 12px; color: #9aa3b5; padding: 2px 2px 6px; }

#search-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.res {
  display: flex; gap: 8px; background: #151a28; border: 1px solid #232838;
  border-radius: 10px; padding: 6px; align-items: center;
}
.res .thumb {
  width: 64px; height: 40px; border-radius: 6px; object-fit: cover; background: #232838; flex: 0 0 auto;
}
.res .thumb.noimg { display: flex; align-items: center; justify-content: center; font-size: 18px; }
.res .meta { flex: 1 1 auto; min-width: 0; }
.res .rt { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res .ra { font-size: 11.5px; color: #9aa3b5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res .acts { display: flex; gap: 4px; flex: 0 0 auto; }
.res .acts button, .qrow button {
  background: #1c2130; border: 1px solid #2a3044; color: #fff;
  border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 13px;
}
.res .acts .primary { background: #ff4d4d; border-color: #ff4d4d; }

#queue-now { font-size: 13px; color: #aeb6c8; margin-bottom: 8px; }
#queue-now .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; display: block; color: #7d879e; }
#queue-list { display: flex; flex-direction: column; gap: 6px; }
.qrow {
  display: flex; align-items: center; gap: 8px; background: #151a28;
  border: 1px solid #232838; border-radius: 10px; padding: 6px 8px; font-size: 13px;
}
.qrow .num { color: #7d879e; width: 20px; text-align: right; flex: 0 0 auto; }
.qrow .meta { flex: 1 1 auto; min-width: 0; }
.qrow .rt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow .ra { font-size: 11.5px; color: #9aa3b5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow .acts { display: flex; gap: 4px; flex: 0 0 auto; }
.qrow .acts button:disabled { opacity: .3; cursor: default; }
#queue-empty { color: #7d879e; font-size: 13px; text-align: center; padding: 14px; }

/* ---------- pied ---------- */
#foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 12px; background: #0b0d13; border-top: 1px solid #1a1f2e;
  font-size: 11px; color: #6d778f; flex: 0 0 auto;
}
#demo-banner { color: #ffb84d; }

/* ---------- mobile ---------- */
@media (max-width: 560px) {
  #brand { font-size: 13px; }
  #vol-wrap { display: none; }        /* volume contrôlé par Discord sur mobile */
  #controls { gap: 4px; padding: 6px 8px; }
  .ctl { min-width: 36px; height: 36px; font-size: 14px; }
  #drift-badge { display: none; }
  .res .thumb { width: 52px; height: 34px; }
}
