* { box-sizing: border-box; }
body {
  margin: 0;
  background: #14332b;
  color: #f2ede2;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
.hidden { display: none !important; }
.screen { padding: 24px 16px; max-width: 900px; margin: 0 auto; }

h1 { font-weight: 600; text-align: center; }
h2, h3 { font-weight: 600; }

.card {
  background: #1c473c;
  border-radius: 14px;
  padding: 20px;
  max-width: 420px;
  margin: 0 auto;
}
label { display: block; font-size: 13px; color: #cfe3da; margin: 12px 0 4px; }
input[type="text"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2f6b58;
  background: #0f2b23;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
}
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 500;
  background: #e0a63e;
  color: #1c1c1c;
  margin-top: 10px;
  width: 100%;
}
button:disabled { opacity: 0.5; cursor: default; }
.lobby-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid #2f6b58; }
.cap-row { display: flex; gap: 8px; }
.cap-btn {
  flex: 1;
  background: #0f2b23;
  color: #fff;
  border: 1px solid #2f6b58;
}
.cap-btn.selected { background: #e0a63e; color: #1c1c1c; }
.handsize-btn {
  flex: 1;
  background: #0f2b23;
  color: #fff;
  border: 1px solid #2f6b58;
}
.handsize-btn.selected { background: #4a8a71; color: #fff; border-color: #4a8a71; }
#handsize-row { margin-top: 8px; }
#lobby-error { color: #ff8a80; font-size: 13px; text-align: center; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab-btn {
  flex: 1;
  background: #0f2b23;
  color: #cfe3da;
  border: 1px solid #2f6b58;
  margin: 0;
}
.tab-btn.selected { background: #e0a63e; color: #1c1c1c; }
#auth-error { color: #ff8a80; font-size: 13px; text-align: center; }

#turn-order {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 6px 10px;
  font-size: 12px;
  color: #cfe3da;
}
.turn-order-item {
  padding: 4px 10px;
  border-radius: 14px;
  background: #1c473c;
  border: 1px solid #2f6b58;
}
.turn-order-item.current {
  background: #e0a63e;
  color: #1c1c1c;
  font-weight: 600;
  border-color: #e0a63e;
}
.turn-order-arrow { color: #4a8a71; }

#spectator-count { font-size: 12px; color: #9fc9b8; }
#share-btn, #logout-game-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  margin: 0;
  padding: 0;
  font-size: 15px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#share-btn { background: #e0a63e; color: #1c1c1c; }
#logout-game-btn { background: rgba(15, 43, 35, 0.6); color: #ff8a80; border: 1px solid #7a2020; }

.rail-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(15, 43, 35, 0.85);
  border: 1px solid rgba(224,166,62,0.4);
  color: #fff;
  font-size: 17px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.rail-btn span { font-size: 10px; color: #cfe3da; }
.rail-btn:active { transform: scale(0.92); }
.rail-btn.active { background: rgba(224,166,62,0.95); border-color: #e0a63e; color: #1c1c1c; }
.rail-btn.active span { color: #1c1c1c; }

#reaction-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 24;
}
.floating-emoji {
  position: absolute;
  bottom: 90px;
  font-size: 28px;
  animation: floatUp 2.5s ease-out forwards;
}
@keyframes floatUp {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  15% { opacity: 1; transform: translateY(-20px) scale(1.1); }
  100% { transform: translateY(-320px) scale(1) translateX(var(--drift, 20px)); opacity: 0; }
}

body { overflow-x: hidden; }

#board-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px 4px;
  max-width: 100%;
  overflow: hidden;
}

#boneyard-pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  width: 76px;
  max-width: 76px;
}
#boneyard-count-label { font-size: 11px; color: #cfe3da; text-align: center; }
#boneyard-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  max-height: 150px;
  max-width: 76px;
  overflow-y: auto;
  overflow-x: hidden;
}
.boneyard-tile {
  width: 22px;
  height: 34px;
  border-radius: 5px;
  background: repeating-linear-gradient(45deg, #2f6b58, #2f6b58 3px, #234f40 3px, #234f40 6px);
  border: 1.5px solid #e0a63e;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  cursor: default;
  flex-shrink: 0;
}
#boneyard-pile.drawable .boneyard-tile { cursor: pointer; animation: boneyardPulse 1.4s infinite; }
#boneyard-pile.drawable .boneyard-tile:hover { transform: translateY(-3px); border-color: #fff; }
@keyframes boneyardPulse {
  0%, 100% { box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 1px 8px rgba(224,166,62,0.7); }
}
#table-mesa {
  position: relative;
  flex: 1;
  min-width: 0;
  height: min(210px, 26vh);
  border-radius: 24px;
  background:
    radial-gradient(ellipse at center, rgba(255,255,255,0.05) 0%, transparent 70%),
    linear-gradient(160deg, #1B4332 0%, #0f2b23 100%);
  border: 8px solid;
  border-image: linear-gradient(135deg, #8a5a2b, #C68642 40%, #7a4a1f) 1;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.5), 0 6px 18px rgba(0,0,0,0.4);
  overflow: hidden;
}
#table-mesa::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 20px;
  border: 1px solid rgba(224,166,62,0.25);
  pointer-events: none;
}
#board-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
}
#table-waiting-msg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #e0a63e;
  background: rgba(15,43,35,0.85);
  border: 1px solid rgba(224,166,62,0.4);
  border-radius: 12px;
  padding: 8px 10px;
  margin: 0;
  z-index: 2;
}
#mesa-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(224, 166, 62, 0.16);
  text-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 -1px 1px rgba(0,0,0,0.5);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.mesa-swatches { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; padding: 6px 0 10px; }
.mesa-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.mesa-swatch.active { border-color: #e0a63e; }
.mesa-swatch[data-felt="green"] { background: linear-gradient(160deg, #1B4332, #0f2b23); }
.mesa-swatch[data-felt="red"] { background: linear-gradient(160deg, #7a2020, #4a1010); }
.mesa-swatch[data-felt="blue"] { background: linear-gradient(160deg, #1e3a5f, #10223a); }
.mesa-swatch[data-felt="purple"] { background: linear-gradient(160deg, #4a2160, #2a1038); }

.style-swatch {
  width: auto;
  height: auto;
  padding: 7px 12px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: #0f2b23;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}
.style-swatch.active { border-color: #e0a63e; }

.cam-filter-swatch {
  width: auto;
  height: 28px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: #0f2b23;
  color: #fff;
  cursor: pointer;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}
.cam-filter-swatch.active { border-color: #e0a63e; }
#cam-filter-row { flex-wrap: wrap; }

/* Filtros de cámara: son 100% del lado del cliente (CSS), cada persona ve su propia
   versión y no se transmite a los demás participantes del video. Se aplican SOLO
   sobre la imagen de la cámara (.video-tile), nunca sobre el resto de la pantalla. */
.video-tile.cam-filter-warm { filter: saturate(1.2) hue-rotate(-8deg) brightness(1.06) sepia(0.12); }
.video-tile.cam-filter-golden { filter: sepia(0.32) saturate(1.45) hue-rotate(-12deg) brightness(1.12) contrast(1.05); }
.video-tile.cam-filter-vintage { filter: sepia(0.35) contrast(0.95) brightness(0.96) saturate(0.8); }
.video-tile.cam-filter-cinematic { filter: contrast(1.18) saturate(0.88) brightness(0.95) hue-rotate(-5deg); }
.video-tile.cam-filter-vivid { filter: saturate(1.6) contrast(1.15) brightness(1.03); }
.video-tile.cam-filter-cool { filter: saturate(1.1) hue-rotate(15deg) brightness(1.02) contrast(1.05); }
.video-tile.cam-filter-bw { filter: grayscale(1) contrast(1.1); }
.video-tile.cam-filter-softglow { filter: brightness(1.14) contrast(0.9) saturate(1.08) blur(0.4px); }
.video-tile.cam-filter-retro { filter: sepia(0.28) saturate(1.3) contrast(1.1) hue-rotate(-8deg) brightness(0.97); }

.pip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  padding: 3px;
  box-sizing: border-box;
}
.pip-dot {
  width: 62%;
  height: 62%;
  margin: auto;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.35) inset, 0 1px 2px rgba(0,0,0,0.35);
}
.domino-half.dots {
  padding: 0;
}

.domino.board-tile {
  position: absolute;
  width: 56px;
  height: 28px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.45);
  transition: left 0.25s ease, top 0.25s ease, transform 0.25s ease;
}
.scroll-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1c473c;
  color: #fff;
  border: 1px solid #2f6b58;
  font-size: 18px;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

#play-actions {
  text-align: center;
  padding: 8px;
  background: #0f2b23;
}
#play-actions-label { font-size: 13px; color: #cfe3da; margin: 0 0 6px; }
#play-actions-buttons { display: flex; gap: 8px; justify-content: center; }
#play-actions-buttons button { width: auto; padding: 8px 16px; margin: 0; }
.domino.hand-tile {
  width: 40px;
  height: 80px;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.1s;
}
.domino.hand-tile:active { transform: translateY(-4px); }
.domino.hand-tile.selected { outline: 2px solid #e0a63e; transform: translateY(-6px); }
.domino.hand-tile.disabled { opacity: 0.35; cursor: not-allowed; }

#copy-spectate-link { max-width: 320px; margin: 12px auto 0; }

#live-chat {
  position: fixed;
  left: 10px;
  right: 10px;
  width: auto;
  bottom: 54px;
  z-index: 21; /* por encima del panel de dominó, pero contenida en su propia zona */
  background: transparent;
  padding: 0;
  pointer-events: none; /* deja pasar los toques hacia lo que está debajo, salvo el cuadro de texto */
}
#chat-messages {
  max-height: 130px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12px;
  max-width: min(70vw, 300px);
  mask-image: linear-gradient(to bottom, transparent, black 28px);
}
.chat-line {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  background: rgba(20, 20, 20, 0.42);
  backdrop-filter: blur(2px);
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.chat-line-avatar {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #1c1c1c;
  background: #e0a63e;
}
.chat-line b { color: #ffd88a; font-weight: 600; }
.chat-line-in { animation: chatSlideIn 0.28s ease; }
@keyframes chatSlideIn {
  from { opacity: 0; transform: translateY(6px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#chat-input-row {
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
  overflow-x: auto;
  padding-bottom: 2px;
}
#chat-input-row input {
  flex: 1;
  min-width: 90px;
  margin: 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 999px;
  padding: 9px 16px;
}
#chat-send-btn { width: auto; padding: 8px 14px; margin: 0; border-radius: 999px; flex-shrink: 0; }

/* Los 5 botones (comentar/emoji/compartir/regalo/like), ahora en fila junto al comentario,
   igual que en la referencia de TikTok — no más flotando solos a un costado. */
.rail-btn-h {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: rgba(15, 43, 35, 0.85);
  border: 1px solid rgba(224,166,62,0.4);
  color: #fff;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  line-height: 1;
}
.rail-btn-h span { font-size: 8px; margin-top: 1px; }

.like-btn {
  background: none;
  border: none;
  width: auto;
  padding: 0 4px;
  font-size: 15px;
  margin: 0 0 0 4px;
  cursor: pointer;
}
.like-btn.pop { animation: likePop 0.35s ease; }
@keyframes likePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

#pack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0;
}
.pack-card {
  background: #0f2b23;
  border: 1px solid #2f6b58;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.pack-symbol { font-size: 26px; }
.pack-label { font-size: 12px; color: #cfe3da; margin: 2px 0; }
.pack-price { font-size: 12px; color: #e0a63e; font-weight: 600; margin-bottom: 6px; }
.pack-card > div[id^="paypal-"] { min-height: 35px; }
#undo-btn { max-width: 260px; margin: 8px auto 0; background: #0f2b23; color: #e0a63e; border: 1px solid #e0a63e; }

.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #2f6b58;
  font-size: 13px;
}
.player-row:last-child { border-bottom: none; }
.player-name { display: flex; align-items: center; gap: 6px; }
.player-name-clickable { cursor: pointer; }
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5a5a;
  display: inline-block;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.3; }
  100% { opacity: 1; }
}
.player-actions { display: flex; gap: 6px; }
.player-actions button { width: auto; padding: 5px 10px; font-size: 12px; margin: 0; }
.btn-follow { background: #e0a63e; color: #1c1c1c; }
.btn-unfollow { background: #0f2b23; color: #cfe3da; border: 1px solid #2f6b58; }
.btn-watch { background: #4a8a71; color: #fff; }
.empty-msg-small { font-size: 12px; color: #9fc9b8; }

#waiting { text-align: center; }
#waiting-code-big {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 6px;
  background: #1c473c;
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}
#waiting-list { list-style: none; padding: 0; }
#waiting-list li { padding: 6px; background: #1c473c; border-radius: 8px; margin-bottom: 6px; }

#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
}
#game::before, #game::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 5;
}
#game::before { top: 0; height: 140px; background: linear-gradient(rgba(0,0,0,0.55), transparent); }
#game::after { bottom: 0; height: 220px; background: linear-gradient(transparent, rgba(0,0,0,0.6)); }

#video-bar {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  gap: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, rgba(224,166,62,0.08) 0%, transparent 60%),
    linear-gradient(160deg, #1B4332 0%, #0a1a15 100%);
}
#video-bar:empty::after {
  content: "TableLive";
  color: rgba(224, 166, 62, 0.25);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 2px;
}
.video-tile { width: 100%; height: 100%; border-radius: 0; overflow: hidden; background: #000; position: relative; }
.video-tile video { width: 100%; height: 100%; object-fit: cover; }
.video-tile.cam-off video { visibility: hidden; }
.video-tile.cam-off { background: linear-gradient(160deg, #1B4332 0%, #0a1a15 100%); }

/* Cuando hay más de una persona en cámara, se acomodan solas en grilla */
#video-bar:not(.battle-split) {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  grid-auto-rows: 1fr;
  gap: 2px;
}
#video-bar:not(.battle-split):has(> .video-tile:only-child) { display: flex !important; }

#play-toggle-row {
  position: fixed;
  left: 0;
  right: 74px;
  bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 23;
}
#toggle-domino-btn {
  width: auto;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, #e0a63e, #c98a1f);
  color: #1c1c1c;
  border-radius: 20px;
  box-shadow: 0 4px 14px rgba(224,166,62,0.4);
  margin: 0;
}
#toggle-domino-btn.active { background: #1c473c; color: #e0a63e; border: 1px solid #e0a63e; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }
#request-seat-btn {
  width: auto;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  background: #1c473c;
  color: #fff;
  border: 1px solid #e0a63e;
  border-radius: 24px;
  margin: 0;
}

.icon-toggle-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: rgba(15, 43, 35, 0.35);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(224,166,62,0.3);
  color: #fff;
  font-size: 15px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-toggle-btn.active { background: #e0a63e; color: #1c1c1c; border-color: #e0a63e; }

.overlay-dropdown {
  position: fixed;
  top: 58px;
  right: 12px;
  width: 250px;
  max-width: calc(100vw - 24px);
  background: #1c473c;
  border: 1px solid #2f6b58;
  border-radius: 14px;
  padding: 12px 14px;
  z-index: 27;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  max-height: 60vh;
  overflow-y: auto;
}
.settings-label { font-size: 12px; color: #9fc9b8; margin: 8px 0 6px; }

#top-info {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 21;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: max(10px, env(safe-area-inset-top, 0)) 12px 0;
  font-size: 13px;
  color: #fff;
}
#top-info-left { display: flex; flex-direction: column; gap: 2px; max-width: 60%; }
#top-info-right { display: flex; align-items: center; gap: 8px; }
#live-timer {
  display: inline-block;
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  margin-bottom: 3px;
  letter-spacing: 0.3px;
}
#room-label { font-weight: 700; }
#turn-label { font-weight: 600; color: #e0a63e; }

#domino-game-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 72px;
  max-height: 62vh;
  overflow-y: auto;
  z-index: 20;
  background: #14332b;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.55);
  padding-bottom: 10px;
}
#domino-game-panel::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  background: #2f6b58;
  border-radius: 2px;
  margin: 10px auto 4px;
}

#opponents {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 6px;
  font-size: 13px;
}
.opp-badge {
  background: #1c473c;
  border-radius: 20px;
  padding: 6px 14px;
}
.opp-badge.active { background: #e0a63e; color: #1c1c1c; font-weight: 600; }

.domino {
  border-radius: 6px;
  display: flex;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.domino-half {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.domino.board-tile .domino-half:first-child { border-radius: 5px 0 0 5px; }
.domino.board-tile .domino-half:last-child { border-radius: 0 5px 5px 0; }
.domino.hand-tile .domino-half:first-child { border-radius: 5px 5px 0 0; }
.domino.hand-tile .domino-half:last-child { border-radius: 0 0 5px 5px; }
.domino.board-tile .domino-half:first-child { border-right: 2px solid rgba(255,255,255,0.5); }
.domino.hand-tile .domino-half:first-child { border-bottom: 2px solid rgba(255,255,255,0.5); }

#my-area {
  padding: 12px;
  text-align: center;
}
#my-hand {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px 0;
}
#pass-btn { max-width: 200px; margin: 8px auto 0; }

#gameover-wrap {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}
#gameover-text { text-align: center; font-size: 17px; margin-bottom: 8px; }

.end-picker {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.end-picker .card { display: flex; flex-direction: column; gap: 10px; }

#camera-guests-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  font-size: 12px;
  flex-wrap: wrap;
}
#camera-guests-bar.active { display: flex; }
#camera-guests-count { color: #cfe3da; }
#camera-guests-bar button {
  width: auto;
  margin: 0;
  padding: 5px 10px;
  font-size: 11px;
  background: #0f2b23;
  color: #fff;
  border: 1px solid #2f6b58;
  border-radius: 14px;
}
#camera-requests-panel {
  background: transparent;
  padding: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.camera-request-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #fff;
  padding: 8px 0;
  border-bottom: 1px solid #2f6b58;
}
.camera-request-row:last-child { border-bottom: none; }
.camera-request-name { font-size: 12px; }
.camera-request-actions { display: flex; gap: 10px; }
.camera-request-actions button { flex: 1; width: auto; margin: 0; padding: 8px 6px; font-size: 12px; font-weight: 600; border-radius: 8px; }
.camera-approve-btn { background: #2f9e5c; color: #fff; }
.camera-reject-btn { background: #7a2020; color: #fff; }

#wallet-bar {
  position: fixed;
  top: 54px;
  right: 12px;
  z-index: 21;
}
#wallet-pill {
  width: auto;
  margin: 0;
  padding: 7px 14px;
  background: rgba(15, 43, 35, 0.35);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(224,166,62,0.35);
  border-radius: 20px;
  font-size: 13px;
  color: #fff;
}
#wallet-actions {
  position: fixed;
  top: 96px;
  right: 12px;
  left: auto;
  width: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#wallet-actions button { width: 100%; padding: 8px 10px; font-size: 12px; margin: 0; border-radius: 10px; }
#withdraw-btn { background: #0f2b23; color: #fff; border: 1px solid #2f6b58; }

.pack-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #2f6b58;
}

.gift-btn {
  background: none;
  border: none;
  width: auto;
  padding: 0 4px;
  font-size: 15px;
  margin: 0 0 0 4px;
}

#gift-picker {
  position: absolute;
  background: #0f2b23;
  border: 1px solid rgba(224,166,62,0.4);
  border-radius: 12px;
  padding: 8px;
  z-index: 20;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  width: 220px;
}
#gift-picker-header {
  font-size: 12px;
  font-weight: 700;
  color: #e0a63e;
  padding: 2px 4px 8px;
}
#gift-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-height: 230px;
  overflow-y: auto;
}
.gift-catalog-item {
  width: auto;
  margin: 0;
  padding: 6px 2px 8px;
  background: rgba(224,166,62,0.08);
  border: 1px solid rgba(224,166,62,0.25);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.gift-catalog-item:active { background: rgba(224,166,62,0.25); }
.gift-catalog-item-locked { opacity: 0.4; }
.gift-catalog-icon { font-size: 20px; line-height: 1.3; }
.gift-catalog-name { font-size: 9px; color: #cfe3da; }
.gift-catalog-price { font-size: 10px; font-weight: 700; color: #e0a63e; }
#gift-picker-buy-coins {
  width: 100%;
  margin: 8px 0 0;
  padding: 8px;
  background: rgba(224,166,62,0.15);
  border: 1px solid rgba(224,166,62,0.4);
  color: #e0a63e;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
}

#emoji-picker {
  position: fixed;
  background: #1c473c;
  border-radius: 18px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  z-index: 30;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  max-width: calc(100vw - 24px);
}
#emoji-picker button {
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  font-size: 19px;
  border-radius: 50%;
  background: #0f2b23;
}

#gift-toast {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
}
.toast-item {
  background: #e0a63e;
  color: #1c1c1c;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  animation: fadeSlide 4s forwards;
}
@keyframes fadeSlide {
  0% { opacity: 0; transform: translateY(-6px); }
  10% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------------- Feed estilo TikTok (pantalla principal tras iniciar sesión) ---------------- */

#lobby { padding-bottom: 90px; } /* deja lugar para la nav inferior fija */

#feed-header {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 6px;
  text-align: center;
}
#feed-header-banner {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  border-radius: 0 0 16px 16px;
}
#lobby-name-label { font-size: 12px; color: #9fc9b8; margin: 8px 0 0; }

.lobby-tab { max-width: 900px; margin: 0 auto; padding: 4px 16px 16px; }

#feed-intro { text-align: center; margin-bottom: 14px; }
#feed-intro h2 { margin: 0 0 4px; }

.feed-card {
  background: #1c473c;
  border: 1px solid #2f6b58;
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.feed-card:hover { border-color: #e0a63e; transform: translateY(-2px); }
.feed-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #ff8a80;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.feed-card-players { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.feed-card-meta { font-size: 12px; color: #9fc9b8; margin-bottom: 12px; }
.feed-card .btn-watch { width: 100%; margin-top: 0; }
.feed-empty { text-align: center; padding: 40px 10px; color: #cfe3da; }

/* ---------------- Nav inferior + botón flotante de Crear (+) ---------------- */

#bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  background: #0f2b23;
  border-top: 1px solid #2f6b58;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 15;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn, .nav-plain-btn {
  background: none;
  width: auto;
  margin: 0;
  padding: 4px 6px;
  color: #9fc9b8;
  font-size: 19px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 44px;
  min-height: 48px;
  justify-content: center;
}
.nav-btn span, .nav-plain-btn span { font-size: 9px; }
.nav-btn.selected { color: #e0a63e; }
#messages-unread-dot:not(.hidden) {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5a5a;
  position: absolute;
  margin-left: 10px;
  margin-top: -14px;
}
#create-fab-btn {
  position: relative;
  width: 52px;
  height: 34px;
  min-width: 52px;
  border-radius: 10px;
  background: #fff;
  color: transparent;
  font-size: 0;
  margin: 0;
  border: none;
  box-shadow: 0 3px 10px rgba(0,0,0,0.45);
}
#create-fab-btn::before,
#create-fab-btn::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: calc(100% - 8px);
  border-radius: 10px;
}
#create-fab-btn::before {
  left: -6px;
  background: linear-gradient(135deg, #1fae7a, #0b3d2e);
}
#create-fab-btn::after {
  right: -6px;
  background: linear-gradient(135deg, #f4cf6a, #c98a2c);
}
#create-fab-btn span.fab-plus {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
#create-fab-btn span.fab-plus::before,
#create-fab-btn span.fab-plus::after {
  content: "";
  position: absolute;
  background: #1c1c1c;
  border-radius: 2px;
}
#create-fab-btn span.fab-plus::before { width: 18px; height: 3.5px; }
#create-fab-btn span.fab-plus::after { width: 3.5px; height: 18px; }

/* ---------------- Toggle Feed: En vivo / Videos ---------------- */
#feed-switch {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}
.feed-switch-btn {
  width: auto;
  margin: 0;
  padding: 8px 18px;
  border-radius: 20px;
  background: #1c473c;
  color: #cfe3da;
  border: 1px solid #2f6b58;
  font-size: 13px;
  font-weight: 600;
}
.feed-switch-btn.selected { background: #e0a63e; color: #1c1c1c; border-color: #e0a63e; }

/* ---------------- Grilla de videos (feed y perfil) ---------------- */
#videos-feed, #my-videos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.video-card {
  position: relative;
  aspect-ratio: 9 / 14;
  border-radius: 10px;
  overflow: hidden;
  background: #0f2b23;
  cursor: pointer;
  border: 1px solid #2f6b58;
}
.video-card video, .video-card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.video-card-text {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  font-size: 12px;
  color: #cfe3da;
  text-align: center;
  height: 100%;
}
.video-card-meta {
  position: absolute;
  left: 4px;
  bottom: 4px;
  font-size: 10px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  gap: 3px;
}
.video-card-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 13px;
}

/* En pantallas más chicas (celulares), un poco más compacto */
@media (max-width: 420px) {
  #feed-header-banner { max-height: 150px; }
  .feed-card { padding: 14px 12px; }
  .feed-card-players { font-size: 15px; }
  .nav-btn, .nav-plain-btn { min-width: 38px; font-size: 17px; }

  /* Tablero de dominó: un poco más chico para que entre cómodo en pantallas angostas */
  #boneyard-pile { width: 60px; max-width: 60px; }
  #boneyard-row { max-width: 60px; }
  .boneyard-tile { width: 18px; height: 28px; }
  #table-mesa { height: 180px; }
  .domino.hand-tile { width: 34px; height: 68px; }
  .domino.board-tile { width: 46px; height: 23px; }
  #board-wrap { gap: 6px; padding: 8px 8px 4px; }
  #domino-game-panel { max-height: 58vh; }
  #live-search-panel, #camera-panel, #settings-panel { width: calc(100vw - 24px); }
}

/* ---------------- Modal de crear contenido (menú + formulario) ---------------- */
.create-option-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 14px 16px;
  font-size: 15px;
  background: #0f2b23;
  color: #fff;
  border: 1px solid #2f6b58;
  margin-bottom: 10px;
}
.create-option-btn:active { background: #1c473c; }
#create-file-input.hidden { display: none; }
#create-caption-input {
  background: #0f2b23;
  border: 1px solid #2f6b58;
  color: #fff;
  border-radius: 10px;
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  margin: 8px 0;
}

/* ---------------- Visor de publicación a pantalla completa ---------------- */
#post-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  z-index: 60;
}
#post-viewer-media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#post-viewer-media video, #post-viewer-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
#post-viewer-media.text-post {
  background: linear-gradient(160deg, #1B4332 0%, #0f2b23 100%);
  padding: 30px;
}
#post-viewer-media.text-post p {
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
}
#post-viewer-top {
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 0));
  right: 14px;
  z-index: 62;
  display: flex;
  gap: 8px;
}
#post-viewer-search-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 15px;
  padding: 0;
  margin: 0;
}
#post-viewer-close {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 18px;
  padding: 0;
  margin: 0;
}
#post-viewer-info {
  position: fixed;
  left: 14px;
  right: 90px;
  bottom: 30px;
  z-index: 61;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
#post-viewer-author { font-weight: 700; margin-bottom: 4px; }
#post-viewer-caption { font-size: 14px; }
#post-viewer-rail {
  position: fixed;
  right: 10px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 61;
}

/* ---------------- Hoja de comentarios de una publicación ---------------- */
#post-comments-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 65vh;
  background: #14332b;
  border-radius: 20px 20px 0 0;
  z-index: 65;
  padding: 14px 14px 10px;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
}
#post-comments-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  max-height: 45vh;
}
.post-comment-row { display: flex; align-items: flex-start; gap: 8px; }
.post-comment-row .chat-line-avatar { position: relative; top: 2px; }
.post-comment-text { color: #fff; font-size: 13px; }
.post-comment-text b { color: #e0a63e; }
#post-comments-input-row { display: flex; gap: 6px; }
#post-comments-input-row input { flex: 1; margin: 0; }
#post-comments-input-row button { width: auto; padding: 8px 14px; margin: 0; }
#post-comments-close { position: absolute; top: 10px; right: 14px; background: none; color: #cfe3da; font-size: 16px; }

/* ---------------- Mensajes (bandeja tipo TikTok) ---------------- */
.conversation-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #2f6b58;
  cursor: pointer;
}
.conversation-row:last-child { border-bottom: none; }
.conversation-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #0f2b23;
}
.conversation-avatar-fallback {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  background: #e0a63e;
  color: #1c1c1c;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.conversation-body { flex: 1; min-width: 0; }
.conversation-name { font-weight: 600; font-size: 14px; }
.conversation-preview { font-size: 12px; color: #9fc9b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#thread-messages {
  max-height: 50vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 0;
}
.msg-bubble {
  position: relative;
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.4;
}
.msg-bubble.mine { align-self: flex-end; background: #e0a63e; color: #1c1c1c; border-bottom-right-radius: 4px; }
.msg-bubble.theirs { align-self: flex-start; background: #1c473c; color: #fff; border-bottom-left-radius: 4px; }
.msg-bubble.msg-deleted { opacity: 0.55; font-style: italic; }
.msg-delete-btn {
  width: auto;
  margin: 4px 0 0;
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  font-size: 11px;
  display: block;
}
.btn-message { background: #1c473c; color: #cfe3da; border: 1px solid #2f6b58; }

/* ---------------- Grabar video desde la cámara al crear contenido ---------------- */
#create-record-preview { transform: scaleX(-1); } /* como espejo, más natural para grabarse a uno mismo */
#create-video-source-row button, #create-record-box button { margin: 0; }

/* Mientras Jitsi está conectando, mostramos un texto simple en vez de pantalla negra */
.video-tile:empty::before {
  content: "Conectando video...";
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #9fc9b8;
  font-size: 13px;
}

#start-live-from-feed-btn {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #e0503e, #c72f2f);
  color: #fff;
  border-radius: 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(199,47,47,0.35);
}

#share-picker {
  position: fixed;
  background: #1c473c;
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}
#share-picker button {
  width: 100%;
  margin: 0;
  padding: 8px 16px;
  font-size: 13px;
  text-align: left;
  background: #0f2b23;
  color: #fff;
  border-radius: 8px;
}

/* ---------------- Batalla LIVE ---------------- */
.battle-target-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #2f6b58; }
.battle-target-row:last-child { border-bottom: none; }
#battle-target-list button { width: auto; padding: 6px 12px; margin: 0; font-size: 12px; }

#battle-bar {
  position: fixed;
  top: 96px;
  right: 12px;
  left: auto;
  width: 240px;
  z-index: 22;
  background: rgba(15, 43, 35, 0.32);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(224,166,62,0.35);
  border-radius: 14px;
  padding: 8px 10px;
  max-height: 220px;
  overflow-y: auto;
}
#battle-bar-names {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}
#battle-timer {
  background: rgba(220, 38, 38, 0.85);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}
#battle-scoreboard { display: flex; flex-direction: column; gap: 6px; }
.battle-scoreboard-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  grid-template-areas: "rank name score" "rank bar bar";
  align-items: center;
  gap: 2px 6px;
  font-size: 11px;
  color: #cfe3da;
}
.battle-scoreboard-rank { grid-area: rank; font-weight: 700; color: #9fc9b8; }
.battle-scoreboard-name { grid-area: name; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.battle-scoreboard-score { grid-area: score; font-weight: 700; color: #e0a63e; }
.battle-scoreboard-bar-track { grid-area: bar; height: 5px; border-radius: 3px; background: #0f2b23; overflow: hidden; }
.battle-scoreboard-bar-fill { height: 100%; background: linear-gradient(90deg, #e0a63e, #c98a1f); transition: width 0.4s ease; }
.battle-scoreboard-row.battle-scoreboard-leading .battle-scoreboard-rank { color: #e0a63e; }
.battle-scoreboard-row.battle-scoreboard-me .battle-scoreboard-name { color: #e0a63e; }
.battle-top-gifter { grid-column: 1 / -1; font-size: 9px; color: #9fc9b8; }

/* ---------------- Ranking final de la batalla (1°, 2°, 3°...) ---------------- */
#battle-result-ranking { margin-top: 14px; max-height: 40vh; overflow-y: auto; }
.battle-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(15,43,35,0.7);
  border-radius: 10px;
  margin-bottom: 6px;
}
.battle-rank-medal { font-size: 18px; width: 28px; text-align: center; }
.battle-rank-name { flex: 1; color: #fff; font-weight: 600; font-size: 13px; }
.battle-rank-score { color: #e0a63e; font-weight: 700; font-size: 13px; }
.battle-rank-row.battle-rank-me { border: 1px solid rgba(224,166,62,0.5); }

#battle-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}
#battle-result-text { font-size: 24px; font-weight: 800; color: #e0a63e; text-shadow: 0 2px 6px rgba(0,0,0,0.6); white-space: pre-line; }

/* Video partido a la mitad mientras hay una batalla activa */
#video-bar.battle-split { flex-direction: row; }
#video-bar.battle-split .video-tile { width: 50% !important; height: 100% !important; border-right: 3px solid #e0a63e; }
#video-bar.battle-split .opponent-remote-tile { border-right: none; }

/* ---------------- Suscripciones ---------------- */
.btn-subscribe { background: linear-gradient(135deg, #e0a63e, #c98a1f); color: #1c1c1c; font-weight: 700; }

.sub-tier-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #0f2b23;
  border: 2px solid #2f6b58;
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
}
.sub-tier-card:hover { border-color: #e0a63e; }
.sub-tier-name { font-weight: 700; font-size: 14px; }
.sub-tier-price { font-size: 12px; color: #9fc9b8; }
.sub-tier-card button { width: auto; margin: 0; padding: 8px 14px; }

.sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #2f6b58;
  font-size: 13px;
}
.sub-row:last-child { border-bottom: none; }
.sub-row button { width: auto; padding: 5px 10px; font-size: 11px; margin: 0; }

/* ---------------- Tienda ---------------- */
#store-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.store-item-card {
  background: #0f2b23;
  border: 2px solid #2f6b58;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.store-item-card.owned { border-color: #4a8a71; }
.store-item-preview { font-size: 30px; margin-bottom: 6px; }
.store-item-name { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.store-item-price { font-size: 11px; color: #9fc9b8; margin-bottom: 8px; }
.store-item-card button { width: 100%; margin: 0; padding: 6px; font-size: 11px; }
.store-item-card button.equipped-btn { background: #4a8a71; color: #fff; }

.name-badge { margin-right: 3px; }

/* Marcos de foto de perfil */
.frame-gold { border: 3px solid #e0a63e !important; box-shadow: 0 0 10px rgba(224,166,62,0.6); }
.frame-neon { border: 3px solid #5bc9ea !important; box-shadow: 0 0 14px rgba(91,201,234,0.8); }
.frame-fire { border: 3px solid #e0503e !important; box-shadow: 0 0 14px rgba(224,80,62,0.8); }

/* ---------------- Moderación del chat en vivo ---------------- */
.mod-tag { font-size: 10px; opacity: 0.8; }
.mod-controls {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
  pointer-events: auto;
}
.mod-btn {
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  margin: 0;
  font-size: 10px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  color: #fff;
}

/* ---------------- Ganancias ---------------- */
.earnings-row, .withdrawal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #2f6b58;
  font-size: 12px;
}
.earnings-row:last-child, .withdrawal-row:last-child { border-bottom: none; }
.withdrawal-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.withdrawal-status.pendiente { background: #4a3a1c; color: #e0a63e; }
.withdrawal-status.pagado { background: #1c473c; color: #8fd4a8; }

/* ---------------- Compartir publicación / denunciar ---------------- */
.share-post-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #2f6b58;
  font-size: 13px;
}
.share-post-result-row:last-child { border-bottom: none; }
.share-post-result-row button { width: auto; padding: 6px 12px; margin: 0; font-size: 12px; }

.shared-post-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.2);
  border: 1px solid #2f6b58;
  border-radius: 10px;
  padding: 6px;
  margin-top: 4px;
  cursor: pointer;
}
.shared-post-card img, .shared-post-card video { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.shared-post-card-text { font-size: 12px; }

/* ---------------- Flechas de respaldo para deslizar (funcionan aunque el gesto falle) ---------------- */
#post-viewer-nav {
  position: fixed;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 62;
}
#post-viewer-nav button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 0;
  margin: 0;
}

#live-nav {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 25;
}
#live-nav.visible { display: flex; }
#live-nav button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(224,166,62,0.3);
  color: rgba(255,255,255,0.8);
  font-size: 15px;

  padding: 0;
  margin: 0;
}

#post-viewer-author-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
#post-viewer-avatar-wrap { position: relative; width: 36px; height: 36px; }
#post-viewer-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: none; border: 2px solid #e0a63e; }
#post-viewer-avatar-fallback {
  width: 36px; height: 36px; border-radius: 50%; display: none;
  align-items: center; justify-content: center; font-weight: 700; color: #1c1c1c; font-size: 14px;
  border: 2px solid #e0a63e;
}
#post-viewer-author { margin: 0; font-weight: 700; }

/* Círculo de "seguir" pegado al avatar — estilo propio de TableLive (dorado/verde),
   distinto del signo rojo de TikTok, pero con la misma idea de estar sobre la foto. */
#post-follow-btn {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: #e0a63e;
  border: 2px solid #0a1a15;
  color: #1c1c1c;
  font-size: 11px;
  font-weight: 800;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#post-follow-btn.active { background: #2f6b58; color: #fff; }
#post-follow-btn.hidden { display: none; }
.fab-plus-mini { position: relative; display: block; width: 100%; height: 100%; }
.fab-plus-mini::before, .fab-plus-mini::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  background: #1c1c1c;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}
.fab-plus-mini::before { width: 10px; height: 2px; }
.fab-plus-mini::after { width: 2px; height: 10px; }

/* ---------------- Insignia de perfil de quien transmite (foto + nombre) ---------------- */
#host-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
#host-badge-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  display: none;
  border: 1.5px solid #e0a63e;
}
#host-badge-fallback {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #1c1c1c;
  border: 1.5px solid #e0a63e;
}

/* ---------------- Logo de la marca ---------------- */
#auth-logo-wrap { text-align: center; margin: 6px 0 14px; }
#auth-logo { width: 150px; max-width: 60vw; height: auto; }

/* ---------------- Formulario de tarjeta (PayPal Advanced Card Fields) ---------------- */
.card-fields-wrap { display: flex; flex-direction: column; gap: 8px; }
.card-field-label { font-size: 11px; color: #9fc9b8; margin: 6px 0 3px; display: block; }
.card-field-box {
  height: 42px;
  border-radius: 8px;
  border: 1px solid #2f6b58;
  background: #0f2b23;
  padding: 4px 10px;
}
.card-field-box iframe { width: 100%; height: 100%; }

/* ---------------- Tira de "en cámara", tocable para ver el perfil ---------------- */
#on-camera-strip {
  position: fixed;
  top: 96px;
  left: 12px;
  right: 90px;
  z-index: 23;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.on-camera-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 43, 35, 0.75);
  border: 1px solid rgba(224,166,62,0.4);
  border-radius: 20px;
  padding: 4px 10px 4px 4px;
  flex-shrink: 0;
  cursor: pointer;
}
.on-camera-pill img, .on-camera-pill .pill-fallback {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
}
.on-camera-pill .pill-fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #1c1c1c;
}
.on-camera-pill span.pill-name { font-size: 11px; color: #fff; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#host-badge { cursor: pointer; }

/* ---------------- Perfil público de un usuario ---------------- */
#user-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
#viewers-list-modal {
  position: fixed;
  inset: 0;
  z-index: 81;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
#viewers-list-modal .card { width: 100%; max-width: 420px; max-height: 70vh; overflow-y: auto; border-radius: 16px 16px 0 0; }
.viewer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  cursor: pointer;
  border-bottom: 1px solid rgba(224,166,62,0.12);
}
.viewer-row:last-child { border-bottom: none; }
.viewer-row-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #1c1c1c; font-weight: 700; font-size: 13px;
}
.spectator-count-clickable {
  cursor: pointer;
  background: rgba(0,0,0,0.4);
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid rgba(224,166,62,0.35);
  display: inline-block;
}
#user-profile-card {
  background: #14332b;
  width: 100%;
  max-width: 480px;
  max-height: 82vh;
  overflow-y: auto;
  border-radius: 18px 18px 0 0;
  padding: 20px;
  text-align: center;
  position: relative;
}
#close-user-profile {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  padding: 0;
  margin: 0;
}
#up-avatar, #up-avatar-fallback {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  margin: 8px auto;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #1c1c1c;
}
#up-name { font-size: 18px; font-weight: 700; margin: 6px 0 2px; }
#up-followers { font-size: 13px; color: #9fc9b8; }
#up-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
#up-level-badge {
  background: rgba(224,166,62,0.15);
  border: 1px solid rgba(224,166,62,0.5);
  color: #e0a63e;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
#up-gifts-gallery {
  background: rgba(15,43,35,0.6);
  border: 1px solid rgba(224,166,62,0.25);
  border-radius: 12px;
  padding: 12px;
  margin-top: 14px;
  text-align: left;
}
#up-gifts-total { font-size: 12px; color: #cfe3da; margin: 4px 0 10px; }
.up-gift-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #fff;
  padding: 5px 0;
  border-bottom: 1px solid rgba(224,166,62,0.12);
}
.up-gift-row:last-child { border-bottom: none; }
#up-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
#up-actions button { width: auto; padding: 8px 14px; margin: 0; font-size: 13px; }
#up-videos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 10px; }

/* ---------------- Reunión privada (tipo Zoom) ---------------- */
#meeting-screen {
  position: fixed;
  inset: 0;
  background: #0a1a15;
  z-index: 90;
  display: flex;
  flex-direction: column;
}
#meeting-video-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  grid-auto-rows: 1fr;
  gap: 3px;
  padding: 3px;
  overflow: hidden;
}
#meeting-video-grid .video-tile { border-radius: 10px; }
#meeting-top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), transparent);
}
#meeting-code-label { font-weight: 700; color: #fff; font-size: 14px; }
#meeting-timer { background: rgba(220,38,38,0.85); color: #fff; font-size: 12px; padding: 3px 9px; border-radius: 10px; font-weight: 700; }
#meeting-top-bar button { width: 38px; height: 38px; min-width: 38px; border-radius: 50%; background: rgba(0,0,0,0.4); backdrop-filter: blur(6px); border: 1px solid rgba(224,166,62,0.2); color: #fff; padding: 0; margin: 0; transition: background 0.2s ease; }
#meeting-top-bar button:active { background: rgba(224,166,62,0.35); }
#meeting-bottom-bar {
  position: absolute;
  bottom: 14px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 5;
}
#meeting-bottom-bar button {
  width: auto;
  padding: 12px 18px;
  margin: 0;
  border-radius: 24px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(224,166,62,0.4);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
#meeting-limit-msg {
  position: absolute;
  bottom: 70px;
  left: 12px; right: 12px;
  text-align: center;
  background: rgba(224,166,62,0.15);
  border: 1px solid rgba(224,166,62,0.4);
  color: #e0a63e;
  font-size: 12px;
  padding: 8px;
  border-radius: 10px;
}

.meeting-plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f2b23;
  border: 2px solid #2f6b58;
  border-radius: 12px;
  padding: 12px 14px;
}
.meeting-plan-card button { width: auto; padding: 8px 14px; margin: 0; }

/* ---------------- Grabaciones ---------------- */
.recording-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #2f6b58;
  font-size: 13px;
}
.recording-row:last-child { border-bottom: none; }
.recording-row-actions { display: flex; gap: 6px; }
.recording-row-actions button { width: auto; padding: 5px 10px; margin: 0; font-size: 11px; }

/* ---------------- Espada automática para quien más regala en una batalla ---------------- */
.battle-top-gifter {
  font-size: 10px;
  color: #cfe3da;
  background: rgba(224,166,62,0.15);
  border: 1px solid rgba(224,166,62,0.4);
  border-radius: 8px;
  padding: 1px 6px;
  margin-top: 2px;
}

/* ---------------- Destacar a alguien en pantalla grande (lo decide el anfitrión) ---------------- */
#video-bar:not(.battle-split) .video-tile.featured {
  grid-column: span 2;
  grid-row: span 2;
}
/* El anfitrión puede elegir el tamaño de cada video, sin necesidad de "destacarlo" del
   todo — chico, mediano o grande, como él quiera armar la pantalla. */
#video-bar:not(.battle-split) .video-tile.tile-size-small { grid-column: span 1; grid-row: span 1; opacity: 0.92; }
#video-bar:not(.battle-split) .video-tile.tile-size-medium { grid-column: span 2; grid-row: span 1; }
#video-bar:not(.battle-split) .video-tile.tile-size-large { grid-column: span 2; grid-row: span 2; }
.on-camera-pill { position: relative; }
.pill-feature-btn {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: rgba(224,166,62,0.9);
  color: #1c1c1c;
  font-size: 10px;
  padding: 0;
  margin: 0 0 0 2px;
}
.pill-feature-btn.active { background: #e0503e; color: #fff; }
.pill-remove-btn {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: rgba(122,32,32,0.9);
  color: #fff;
  font-size: 9px;
  padding: 0;
  margin: 0 0 0 2px;
}

/* ---------------- Ventanilla abierta: tocar para pedir TableUp directo ---------------- */
.open-slot-pill {
  border: 1.5px dashed rgba(224,166,62,0.6);
  background: rgba(224,166,62,0.08);
  color: #e0a63e;
  font-weight: 600;
  font-size: 11px;
  padding: 8px 12px;
  cursor: pointer;
}

/* ---------------- Interruptor del anfitrión para abrir/cerrar ventanillas ---------------- */
#toggle-guests-open-btn { background: #0f2b23; color: #cfe3da; border: 1px solid #2f6b58; }
#toggle-guests-open-btn.guests-open-active { background: #2f9e5c; color: #fff; border: 1px solid #2f9e5c; }
#toggle-comments-closed-btn.comments-closed-active { background: #7a2020; color: #fff; border: 1px solid #7a2020; }

/* ---------------- Fondos virtuales ---------------- */
.vbg-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 4px;
}
.vbg-swatch {
  height: 46px;
  border-radius: 8px;
  border: 2px solid #2f6b58;
  background-size: cover;
  background-position: center;
  color: #cfe3da;
  font-size: 10px;
  font-weight: 600;
  padding: 0;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.vbg-swatch.active { border-color: #e0a63e; box-shadow: 0 0 0 2px rgba(224,166,62,0.4); }

/* ---------------- Controles del anfitrión sobre cada video de la reunión ---------------- */
.meeting-tile-controls {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  z-index: 2;
}
.meeting-tile-btn {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 12px;
  padding: 0;
  margin: 0;
}
.meeting-tile-btn.meeting-tile-kick { background: rgba(122,32,32,0.85); }

/* ---------------- Pantalla de presentación al entrar a la app ---------------- */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #010403;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.6s ease;
}
#splash-screen.fade-out { opacity: 0; pointer-events: none; }
#splash-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: splashZoom 3.2s ease-out forwards;
}
@keyframes splashZoom {
  0% { transform: scale(1.06); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------------- Info encima de cada video (nombre, mic, anfitrión, botones) ---------------- */
.tile-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  padding: 6px;
}
.tile-overlay:empty { display: none; }
.tile-host-badge {
  align-self: flex-start;
  background: rgba(224,166,62,0.92);
  color: #1c1c1c;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  pointer-events: auto;
}
.tile-controls-row {
  align-self: flex-end;
  display: flex;
  gap: 4px;
  pointer-events: auto;
}
.tile-icon-btn {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 11px;
  padding: 0;
  margin: 0;
}
.tile-icon-btn.active { background: rgba(224,166,62,0.9); color: #1c1c1c; }
.tile-icon-btn.tile-icon-danger { background: rgba(122,32,32,0.85); }
.tile-name-row {
  pointer-events: auto;
  cursor: pointer;
  align-self: flex-start;
  background: rgba(0,0,0,0.55);
  border-radius: 20px;
  padding: 3px 10px;
  max-width: 90%;
}
.tile-name {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* ---------------- En vivo mezclado dentro del feed "Para ti" ---------------- */
.live-preview-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 40%, rgba(224,80,62,0.18) 0%, #0a1a15 70%);
}
.live-preview-badge {
  background: #e0503e;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 20px;
  animation: liveBadgePulse 1.6s ease-in-out infinite;
}
@keyframes liveBadgePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }
.live-preview-players { font-size: 20px; font-weight: 700; color: #fff; max-width: 90%; }
.live-preview-meta { font-size: 13px; color: #9fc9b8; }
.live-preview-card .btn-watch { width: auto; padding: 14px 28px; font-size: 15px; border-radius: 30px; margin-top: 8px; }

/* ---------------- Filtros al publicar foto/video ---------------- */
.create-filter-swatch {
  width: auto;
  white-space: nowrap;
  padding: 8px 12px;
  margin: 0;
  border-radius: 20px;
  background: rgba(15,43,35,0.85);
  border: 1px solid rgba(224,166,62,0.3);
  color: #cfe3da;
  font-size: 12px;
}
.create-filter-swatch.selected { background: rgba(224,166,62,0.9); color: #1c1c1c; border-color: #e0a63e; }

#create-photo-preview.pf-warm, #create-video-preview.pf-warm { filter: saturate(1.2) hue-rotate(-8deg) brightness(1.06) sepia(0.12); }
#create-photo-preview.pf-golden, #create-video-preview.pf-golden { filter: sepia(0.32) saturate(1.45) hue-rotate(-12deg) brightness(1.12) contrast(1.05); }
#create-photo-preview.pf-vintage, #create-video-preview.pf-vintage { filter: sepia(0.35) contrast(0.95) brightness(0.96) saturate(0.8); }
#create-photo-preview.pf-cinematic, #create-video-preview.pf-cinematic { filter: contrast(1.18) saturate(0.88) brightness(0.95) hue-rotate(-5deg); }
#create-photo-preview.pf-vivid, #create-video-preview.pf-vivid { filter: saturate(1.6) contrast(1.15) brightness(1.03); }
#create-photo-preview.pf-cool, #create-video-preview.pf-cool { filter: saturate(1.1) hue-rotate(15deg) brightness(1.02) contrast(1.05); }
#create-photo-preview.pf-bw, #create-video-preview.pf-bw { filter: grayscale(1) contrast(1.1); }
#create-photo-preview.pf-softglow, #create-video-preview.pf-softglow { filter: brightness(1.14) contrast(0.9) saturate(1.08) blur(0.4px); }
#create-photo-preview.pf-retro, #create-video-preview.pf-retro { filter: sepia(0.28) saturate(1.3) contrast(1.1) hue-rotate(-8deg) brightness(0.97); }

/* ---------------- Tocar el nombre de quien comenta en el en vivo abre su perfil ---------------- */
.chat-line-name-clickable { cursor: pointer; }

/* ---------------- Cartel de "Reconectando..." (discreto, no te saca de la cuenta) ---------------- */
#connection-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 998;
  background: rgba(224,166,62,0.95);
  color: #1c1c1c;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 0;
}

/* ---------------- Aviso de "alguien que seguís se puso en vivo" ---------------- */
#followed-live-banner {
  position: fixed;
  top: 50px;
  left: 12px;
  right: 12px;
  z-index: 997;
  background: #0f2b23;
  border: 1px solid rgba(224,166,62,0.5);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  animation: followedLiveSlideIn 0.3s ease;
}
@keyframes followedLiveSlideIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
#followed-live-banner img, .followed-live-avatar-fallback {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  color: #1c1c1c; font-weight: 700; flex-shrink: 0;
}
.followed-live-text { flex: 1; color: #fff; font-size: 13px; }
#followed-live-close { width: auto; margin: 0; padding: 4px 8px; background: none; border: none; color: #9fc9b8; font-size: 14px; }

/* ---------------- Grilla de datos del detalle de usuario (panel de admin) ---------------- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 12px;
  color: #cfe3da;
}
.detail-grid b { color: #e0a63e; font-size: 11px; }

/* ---------------- Mis conversaciones con soporte (Perfil) ---------------- */
.support-thread-card {
  background: rgba(15,43,35,0.6);
  border: 1px solid rgba(224,166,62,0.25);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.support-thread-subject { font-weight: 700; color: #e0a63e; font-size: 13px; margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.support-thread-message { font-size: 12px; color: #cfe3da; margin: 0; white-space: pre-wrap; }
.support-reply-row {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
}
.support-reply-row.support-reply-admin { background: rgba(224,166,62,0.12); }
.support-reply-row b { font-size: 11px; color: #9fc9b8; }
.support-reply-row.support-reply-admin b { color: #e0a63e; }
.support-reply-row p { margin: 2px 0 0; font-size: 12px; color: #fff; white-space: pre-wrap; }
.mini-btn-inline { width: auto; margin: 0; padding: 6px 12px; font-size: 12px; background: #e0a63e; color: #1c1c1c; border-radius: 8px; }

/* ---------------- Círculos de "en vivo ahora" arriba de Mensajes, como TikTok ---------------- */
#following-live-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(224,166,62,0.15);
}
.following-live-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  cursor: pointer;
  width: 62px;
}
.following-live-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, #e0503e, #e0a63e);
  display: flex;
  align-items: center;
  justify-content: center;
}
.following-live-ring img, .following-live-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #0a1a15;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1c1c1c;
  font-weight: 700;
}
.following-live-circle span {
  font-size: 10px;
  color: #cfe3da;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62px;
}

/* ---------------- Banner de regalo cruzando la pantalla, como TikTok ---------------- */
.gift-banner-fx {
  position: fixed;
  left: 0;
  top: 30%;
  z-index: 996;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, rgba(224,166,62,0.95), rgba(224,166,62,0.15));
  padding: 8px 16px 8px 8px;
  border-radius: 0 30px 30px 0;
  animation: giftBannerSlide 3.2s ease-out forwards;
  pointer-events: none;
}
@keyframes giftBannerSlide {
  0% { transform: translateX(-100%); opacity: 0; }
  10% { transform: translateX(0); opacity: 1; }
  80% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(0); opacity: 0; }
}
.gift-banner-icon {
  font-size: 30px;
  background: rgba(0,0,0,0.25);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gift-banner-text { color: #1c1c1c; font-size: 13px; font-weight: 600; }

/* ---------------- Pizarra opcional de la reunión (clases, cursos virtuales) ---------------- */
#meeting-whiteboard {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: #0b2e22;
  display: flex;
  flex-direction: column;
}
#meeting-whiteboard-canvas {
  flex: 1;
  width: 100%;
  touch-action: none;
  cursor: crosshair;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0px, transparent 1px, transparent 40px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0px, transparent 1px, transparent 40px),
    #0b2e22;
}
#meeting-whiteboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  background: rgba(0,0,0,0.35);
}
.whiteboard-chalk {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  margin: 0;
  padding: 0;
}
.whiteboard-chalk.active { border-color: #e0a63e; box-shadow: 0 0 0 2px rgba(224,166,62,0.5); }
#whiteboard-eraser, #whiteboard-clear, #whiteboard-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 15px;
  margin: 0;
  padding: 0;
}
#whiteboard-eraser.active { background: rgba(224,166,62,0.9); }

/* ---------------- Entrada moderna a la reunión (estética tecnología/IA) ---------------- */
#meeting-entry-fx {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: radial-gradient(circle at 50% 40%, #0f3d2e 0%, #010806 75%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  overflow: hidden;
  transition: opacity 0.5s ease;
}
#meeting-entry-fx.fade-out { opacity: 0; }
#meeting-entry-rings {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.meeting-entry-ring {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(224,166,62,0.55);
  border-radius: 50%;
  animation: meetingRingPulse 2.4s ease-out infinite;
}
.meeting-entry-ring:nth-child(2) { animation-delay: 0.7s; border-color: rgba(31,174,122,0.55); }
.meeting-entry-ring:nth-child(3) { animation-delay: 1.4s; border-color: rgba(224,166,62,0.35); }
@keyframes meetingRingPulse {
  0% { transform: scale(0.55); opacity: 0.9; }
  100% { transform: scale(1.3); opacity: 0; }
}
#meeting-entry-core {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1fae7a, #0b3d2e);
  border: 1.5px solid rgba(224,166,62,0.7);
  color: #f4cf6a;
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(224,166,62,0.35);
  animation: meetingCorePulse 1.6s ease-in-out infinite;
}
@keyframes meetingCorePulse {
  0%, 100% { box-shadow: 0 0 20px rgba(224,166,62,0.3); }
  50% { box-shadow: 0 0 40px rgba(224,166,62,0.55); }
}
#meeting-entry-status {
  color: #cfe3da;
  font-size: 13px;
  letter-spacing: 0.5px;
  min-height: 18px;
}
#meeting-entry-scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(31,174,122,0.8), transparent);
  animation: meetingScanline 2.6s linear infinite;
}
@keyframes meetingScanline {
  0% { top: 0%; }
  100% { top: 100%; }
}

/* ---------------- Etiquetar personas con @ (como TikTok) ---------------- */
#mention-suggestions, #post-comment-mention-suggestions {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: #1c473c;
  border: 1px solid #2f6b58;
  border-radius: 10px;
  margin-bottom: 6px;
  overflow: hidden;
  z-index: 30;
}
.mention-suggestion-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  margin: 0;
  border-radius: 0;
  background: transparent;
  color: #e0a63e;
  font-size: 13px;
  font-weight: 600;
}
.mention-suggestion-row:active { background: rgba(224,166,62,0.15); }
.mention-tag { color: #e0a63e; font-weight: 700; cursor: pointer; }
#chat-input-row, #post-comments-input-row { position: relative; }

/* ---------------- Bonus de la batalla: doble puntos sorpresa y PK Final ---------------- */
#battle-bonus-banner {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 8px;
  margin: 4px 0 8px;
  line-height: 1.3;
}
#battle-bonus-banner.battle-bonus-double {
  background: rgba(224,166,62,0.2);
  color: #f4cf6a;
  border: 1px solid rgba(224,166,62,0.5);
  animation: battleBonusPulse 1s ease-in-out infinite;
}
#battle-bonus-banner.battle-bonus-pkfinal {
  background: rgba(220,38,38,0.25);
  color: #ff8a80;
  border: 1px solid rgba(220,38,38,0.5);
  animation: battleBonusPulse 0.8s ease-in-out infinite;
}
@keyframes battleBonusPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ---------------- Reglas y Términos de uso ---------------- */
#terms-modal {
  position: fixed;
  inset: 0;
  z-index: 92;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#terms-card {
  max-width: 520px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
}
#terms-content p { font-size: 13px; color: #cfe3da; line-height: 1.5; }
#terms-content .settings-label { margin-top: 14px; }
