:root {
  --bg: #0d0f12;
  --panel: #16191f;
  --panel-2: #1e232b;
  --border: #2a3038;
  --text: #e8eaed;
  --muted: #9aa4b0;
  --accent: #2ee06f;
  --accent-dark: #17a94e;
  --danger: #e5484d;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- Top bar --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.logo { font-size: 22px; font-weight: 800; letter-spacing: 0.5px; }
.logo span { color: var(--accent); }

.online {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.online .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* --- Layout --- */
.layout {
  flex: 1;
  display: flex;
  gap: 14px;
  padding: 14px;
  min-height: 0;
}

.stage {
  flex: 3;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* --- Videos --- */
.video-box {
  position: relative;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.stranger-box { flex: 1; min-height: 0; }

.you-box {
  width: 240px;
  height: 150px;
  position: absolute;
  right: 28px;
  bottom: 84px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  z-index: 2;
}

.stage { position: relative; }

.video-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

#localVideo { transform: scaleX(-1); } /* mirror selfie view */

.tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 16px;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.status.hidden { display: none; }

/* --- Controls --- */
.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 14px 42px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  color: #06130b;
  transition: transform 0.06s ease, filter 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-next {
  background: var(--accent);
  min-width: 200px;
  box-shadow: 0 0 18px rgba(46, 224, 111, 0.35);
}
.btn-next:hover:not(:disabled) { filter: brightness(1.1); }

.btn-stop { background: var(--danger); color: #fff; }

/* --- Chat panel --- */
.chat-panel {
  flex: 1;
  min-width: 280px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}
.msg .who { display: block; font-size: 11px; font-weight: 700; margin-bottom: 2px; opacity: 0.7; }
.msg.you { align-self: flex-end; background: var(--accent-dark); color: #fff; border-bottom-right-radius: 4px; }
.msg.stranger { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 4px; }
.msg.system {
  align-self: center;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  font-style: italic;
  text-align: center;
  max-width: 100%;
}

.typing {
  padding: 4px 14px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  visibility: hidden;
  height: 22px;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
}

.chat-form input {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.chat-form input:focus { border-color: var(--accent); }

.chat-form button {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  color: #06130b;
}
.chat-form button:disabled { opacity: 0.35; cursor: not-allowed; }

/* --- Start overlay --- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 12, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.overlay.hidden { display: none; }

.overlay-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 44px 56px;
  text-align: center;
  max-width: 420px;
}
.overlay-card h1 { font-size: 34px; margin-bottom: 10px; }
.overlay-card h1 span { color: var(--accent); }
.overlay-card p { color: var(--muted); margin-bottom: 26px; }
.overlay-card small { display: block; margin-top: 18px; color: var(--muted); }

.btn-start {
  background: var(--accent);
  box-shadow: 0 0 24px rgba(46, 224, 111, 0.4);
  width: 100%;
}

/* --- Small screens --- */
@media (max-width: 860px) {
  body { overflow: auto; }
  .layout { flex-direction: column; }
  .chat-panel { max-width: none; min-height: 260px; }
  .you-box { width: 120px; height: 80px; right: 14px; bottom: 74px; }
  .stranger-box { min-height: 46vh; }
}

/* --- Sponsored slot strip --- */
#featured {
  padding: 10px 14px 6px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

#slot-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

/* Strip cards lay the thumbnail beside the text. A full-width banner here
   would push the strip tall enough to shove the video stage below the fold,
   which is the opposite of what a top bar is for. */
.slot-card {
  flex: 1 0 200px;
  min-width: 200px;
  max-width: 280px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.06s ease;
}
.slot-card:hover { border-color: var(--accent); }
.slot-card:active { transform: scale(0.98); }

.slot-card.rank1 {
  border-color: #e8b93e;
  box-shadow: 0 0 12px rgba(232, 185, 62, 0.25);
}
.slot-card.rank1 .slot-rank { color: #e8b93e; }

.slot-card.empty {
  border-style: dashed;
  color: var(--muted);
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-align: center;
}

/* min-width:0 lets the text column actually shrink inside the flex row —
   without it, long titles force the card wider and blow out the strip. */
.slot-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.slot-thumb {
  width: 52px;
  height: 52px;
  flex: none;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
  display: block;
  pointer-events: none; /* clicks belong to the card link */
}

.slot-rank { font-size: 11px; font-weight: 800; color: var(--muted); }
.slot-title { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.slot-meta { font-size: 11.5px; color: var(--muted); }

.burn-ticker {
  padding: 5px 2px 0;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.burn-item { color: #e8a54b; }
.burn-sep { margin: 0 10px; opacity: 0.4; }

/* --- Header additions --- */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.burned-counter {
  font-size: 13px;
  font-weight: 700;
  color: #e8a54b;
  transition: text-shadow 0.2s ease;
}
.burned-counter.pulse { animation: burn-pulse 0.6s ease; }
@keyframes burn-pulse {
  0% { text-shadow: 0 0 0 rgba(232, 165, 75, 0); }
  40% { text-shadow: 0 0 14px rgba(232, 165, 75, 0.9); }
  100% { text-shadow: 0 0 0 rgba(232, 165, 75, 0); }
}

.btn-promote {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--accent);
  padding: 8px 18px;
  font-size: 14px;
  border-radius: 8px;
}
.btn-promote:hover { background: var(--accent); color: #06130b; }

/* --- Start overlay now covers only the chat area, slots stay visible --- */
.layout { position: relative; }
.overlay.in-layout { position: absolute; }

/* --- Promote modal --- */
.promote-card { position: relative; text-align: left; max-width: 440px; }
.promote-card h2 { margin-bottom: 8px; }
.promote-rules { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.promote-rules strong { color: #e8a54b; }

.promote-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.promote-close:hover { color: var(--text); }

.promote-wallet {
  display: flex;
  justify-content: space-between;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
}
.promote-wallet b { color: var(--text); }

#promote-form { display: flex; flex-direction: column; gap: 10px; }
#promote-form input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
#promote-form input:focus { border-color: var(--accent); }

.promote-minbid { font-size: 12.5px; color: var(--muted); }
.promote-error { font-size: 13px; color: var(--danger); min-height: 17px; }

.ticker-sym { opacity: 0.85; }

@media (max-width: 860px) {
  .header-right { gap: 10px; }
  .burned-counter { display: none; }
  .slot-card { flex-basis: 150px; min-width: 150px; }
}

/* --- Fairlaunch bar --- */
#fairlaunch-bar {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  padding-bottom: 8px;
  letter-spacing: 0.2px;
}
#fairlaunch-bar strong { color: var(--accent); }

/* --- Side rails --- */
.with-rails {
  flex: 1;
  display: flex;
  min-height: 0;
}

.rail {
  width: 184px;
  flex: 0 0 184px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 10px;
  overflow-y: auto;
}

/* Rails stack: banner on top, text beneath. Same markup as the strip — only
   the direction and the thumbnail's dimensions change. */
.rail-card {
  flex: none;
  min-width: 0;
  max-width: none;
  width: 100%;
  padding: 8px;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.rail-card .slot-thumb {
  width: 100%;
  height: 96px;
  border-radius: 6px;
}

.rail-card.empty { min-height: 90px; }

/* --- Image upload in modal --- */
.promote-file {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.promote-file input { font-size: 12.5px; color: var(--muted); }

#promote-preview {
  max-width: 100%;
  max-height: 110px;
  border-radius: 8px;
  align-self: center;
  border: 1px solid var(--border);
}

.overlay-token {
  margin-top: 6px;
  color: #e8a54b !important;
}

/* --- Responsive: rails give way first --- */
@media (max-width: 1180px) {
  .rail { display: none; }
}

/* --- Brand: logo mark + hero --- */
.logo { display: flex; align-items: center; gap: 9px; }
.logo-mark-sm { width: 26px; height: 26px; }

.hero-mark {
  width: 92px;
  height: 92px;
  margin-bottom: 14px;
  animation: mark-spin 24s linear infinite;
}
@keyframes mark-spin {
  to { transform: rotate(360deg); }
}

.hero-line {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.hero-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 26px;
}
