:root {
  --color-green:#10b981;
  --color-yellow: #f59e0b;
  --color-gray: #6b7280;
}

.ready-msg {
  color: var(--color-green);
}

.waiting-msg {
  color: var(--color-yellow);
}

/* ── EXAM MODE ───────────────────────────────────────────────────── */
.em-root {
  min-height: calc(100svh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.em-box {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.em-heading {
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
  margin: 0;
}

.em-sub {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  margin: 0.5rem 0 0;
}

.em-error-msg {
  font-size: 0.9375rem;
  color: var(--danger, #e5534b);
  margin: 0;
}

/* ── JOIN GAME ───────────────────────────────────────────────────── */
.form-label {
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.empty-msg {
  color: var(--text-primary) !important;
}

.join-root {
  min-height: calc(100svh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.join-box {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.join-heading {
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
  margin: 0;
}

.join-sub {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  margin: 0.5rem 0 0;
}

/* ── PUBLIC JOIN STYLES ───────────────────────────────────────────────────── */
/* Estilos consolidados desde quiz-styles.css para public_join.html */

/* ========== JOIN INPUT ========== */
.join-icon { font-size: 5rem; margin-bottom: 1rem; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.join-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--primary);
  animation: titleGlowPulse 2s ease-in-out infinite;
}

.join-subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

.join-label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.125rem;
}

.join-code-input {
  width: 100%;
  padding: 1.25rem;
  border: 3px solid var(--border-hover);
  border-radius: 12px;
  font-size: 2rem;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.5rem;
  text-transform: uppercase;
  transition: all 0.3s ease;
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.join-info {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
}

.join-tip {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

.join-session-code {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  margin: 1rem 0;
  letter-spacing: 0.25rem;
}

@keyframes titleGlowPulse {
  0%, 100% {
    text-shadow:
      0 0 10px rgba(124,58,237,0.6),
      0 0 20px rgba(124,58,237,0.4),
      0 0 30px rgba(124,58,237,0.2);
    transform: scale(1);
  }
  50% {
    text-shadow:
      0 0 20px rgba(124,58,237,0.8),
      0 0 30px rgba(124,58,237,0.6),
      0 0 40px rgba(124,58,237,0.4);
    transform: scale(1.02);
  }
}

/* ========== PUBLIC JOIN - PARTICIPANT & AUTH ========== */
.participant-info-card {
  background: var(--primary-dark);
  color: white;
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.participant-info-card .playing-as {
  font-size: 1rem;
  opacity: 0.85;
  margin-bottom: 0.5rem;
}

.participant-info-card .playing-name {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
}

.auth-user-banner {
  padding: 1.5rem;
  background: var(--primary-dark);
  border-radius: 8px;
  margin-bottom: 1rem;
  color: white !important;
  text-align: center;
}

.instructions-card {
  background: var(--primary-dark);
  color: white;
  text-align: center;
}

.instructions-card div ol {
  color: white !important;
}

/* ========== PROMO BANNER ========== */
.promo-banner {
  background: var(--primary-dark) !important;
  border: none;
}

.promo-banner-body {
  padding: 2rem;
  text-align: center;
  color: white;
}

.promo-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  text-align: left;
}

.promo-benefit {
  background: rgba(255,255,255,0.15);
  padding: 1rem;
  border-radius: 8px;
}

.promo-benefit-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.promo-benefit-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.promo-benefit-desc {
  font-size: 0.875rem;
  opacity: 0.9;
}

.promo-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.promo-note {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  opacity: 0.8;
}

/* ========== BADGE GALLERY GRID ========== */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 2rem;
  width: 100%;
  box-sizing: border-box;
  align-items: start;
}

@media (min-width: 1400px) {
  .badges-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 2.5rem;
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .badges-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .badges-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

/* ========== BADGE CARD ========== */
.badge-card {
  text-align: center;
  padding: 1rem 0.75rem;
  border-radius: 16px;
  border: 3px solid;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  min-height: 200px;
  max-height: 200px;
  height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.badge-icon-container {
  flex-shrink: 0;
  width: 100%;
  display: inline-block;
  word-spacing: 0.1em;
  line-height: 1.3;
  max-width: 100%;
  overflow-wrap: break-word;
}

.badge-name-text {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  flex-shrink: 0;
}

.badge-rarity-tag {
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-card.earned {
  cursor: pointer;
}

.badge-card.earned:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.badge-card.locked {
  background: var(--bg-secondary, #f9fafb);
  border-color: var(--border-color, #e5e7eb);
}

.badge-locked-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.85);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.badge-locked-icon {
  font-size: 3rem;
  opacity: 0.4;
}

.badge-icon {
  font-size: 4rem;
  margin-bottom: 0.75rem;
}

.badge-icon.locked {
  filter: grayscale(100%) opacity(0.3);
}

.badge-icon.earned {
  animation: badgeFloat 3s ease-in-out infinite;
}

.badge-name {
  font-size: 0.875rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.badge-name.locked {
  color: var(--text-muted);
}

.badge-rarity {
  display: inline-block;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 700;
}

.badge-rarity.locked {
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.95);
  color: white;
  padding: 1rem;
  border-radius: 12px;
  font-size: 0.8rem;
  white-space: normal;
  width: 220px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
  text-align: left;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.badge-card:hover .badge-tooltip {
  opacity: 1;
}

.badge-tooltip-title {
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.badge-tooltip-description {
  opacity: 0.95;
  line-height: 1.4;
}

.badge-tooltip-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(0,0,0,0.95);
}

.badge-selected-star {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 1rem;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
}

.badge-card.selected .badge-selected-star {
  display: block;
}

.selectable-badge {
  cursor: pointer !important;
}

.selectable-badge:active {
  transform: scale(0.95);
}

/* ========== BADGE PROGRESS ========== */
.badge-progress-track {
  height: 12px;
  background: var(--border-color, #e5e7eb);
  border-radius: 6px;
  overflow: hidden;
}

.badge-progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.5s ease;
}

/* ========== EFFECT OPTIONS ========== */
.content-effects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.effect-option {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.effect-option:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
}

.effect-option.active {
  background: rgba(255,255,255,0.4);
  border-color: white;
  box-shadow: 0 0 15px rgba(255,255,255,0.5);
}

.effect-option.locked {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(80%);
}

.effect-option.locked:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(0);
}

/* ========== ANIMATIONS ========== */
@keyframes badgeFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ========== RESPONSIVE - TABLETS & MOBILES ========== */
@media (max-width: 991px) {
  .badges-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .badge-card {
    min-height: 170px;
    max-height: 170px;
    height: 170px;
    padding: 0.9rem 0.7rem;
  }

  .badge-icon-container {
    font-size: 2.5rem !important;
    margin-bottom: 0.4rem !important;
  }

  .badge-name-text {
    font-size: 0.72rem !important;
    margin-bottom: 0.35rem !important;
  }

  .badge-rarity-tag {
    font-size: 0.55rem !important;
    padding: 0.2rem 0.5rem !important;
  }

  .promo-benefits {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .badges-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .badge-card {
    padding: 0.85rem 0.5rem !important;
    min-height: 150px;
    max-height: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
  }

  .badge-icon-container {
    font-size: 2.2rem !important;
    margin-bottom: 0.3rem !important;
  }

  .badge-name-text {
    font-size: 0.7rem !important;
    margin-bottom: 0.35rem !important;
    line-height: 1.1 !important;
  }

  .badge-rarity-tag {
    font-size: 0.5rem !important;
    padding: 0.15rem 0.4rem !important;
  }

  .badge-tooltip {
    width: 180px !important;
    font-size: 0.7rem !important;
  }

  .promo-actions {
    flex-direction: column;
  }

  .promo-actions a {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .badges-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .badge-card {
    padding: 0.7rem 0.4rem !important;
    border-width: 2px !important;
    border-radius: 12px !important;
    min-height: 135px;
    max-height: 135px;
    height: 135px;
    width: 100%;
    box-sizing: border-box;
  }

  .badge-icon-container {
    font-size: 1.85rem !important;
    margin-bottom: 0.25rem !important;
  }

  .badge-name-text {
    font-size: 0.62rem !important;
    margin-bottom: 0.25rem !important;
    line-height: 1.05 !important;
  }

  .badge-rarity-tag {
    font-size: 0.45rem !important;
    padding: 0.12rem 0.35rem !important;
  }

  .badge-tooltip {
    width: 160px !important;
    font-size: 0.65rem !important;
    padding: 0.75rem !important;
  }

  .join-title {
    font-size: 1.75rem;
  }

  .join-session-code {
    font-size: 2rem;
  }

  .promo-benefit {
    padding: 0.75rem;
  }
}

@media (max-width: 380px) {
  .badge-card {
    padding: 0.6rem 0.3rem !important;
    min-height: 120px;
    max-height: 120px;
    height: 120px;
    width: 100%;
    box-sizing: border-box;
  }

  .badge-icon-container {
    font-size: 1.75rem !important;
    margin-bottom: 0.25rem !important;
  }

  .badge-name-text {
    font-size: 0.58rem !important;
    margin-bottom: 0.2rem !important;
  }

  .badge-rarity-tag {
    font-size: 0.42rem !important;
    padding: 0.1rem 0.3rem !important;
  }

  .badge-tooltip {
    width: 140px !important;
    font-size: 0.6rem !important;
  }

  .join-code-input {
    font-size: 1.5rem;
    padding: 1rem;
  }
}

.effect-accordion .accordion-button::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m2 5 6 6 6-6'/%3e%3c/svg%3e")
}
.effect-accordion  .accordion-button:not(.collapsed)::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.join_game .accordion .accordion-button {
  color: white !important;
  background: var(--bg-gradient-purple);
  justify-content: center !important;
  text-align: center !important;
  font-weight: 700!important;
  padding: 1.5rem;
}

.join_game .accordion-body {
  padding: 0 !important;
}
.join_game .accordion-item {
  background: var(--bg-gradient-purple);
}

.card {
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  /* margin-bottom: 1rem; */
  transition: background 0.3s ease;
}

.card-body {
  padding-right:1.5rem;
  padding-left: 1.5rem;
}

.card-header {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 1.2rem 1.5rem;
  color: var(--primary);
  transition: color 0.3s ease;
}

[data-theme="dark"] .card-header {
  color: var(--primary-light);
}

.effect-locked {
  opacity: 0.4;
  cursor: not-allowed;
  position: relative;;
}

.effect-unlocked {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  font-size: 0.9rem;
}

.label-effect {
  font-size: 0.7rem;
  margin-top: 0.25rem;
}

.note-info-effect {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
  margin-top: 1rem;
  margin-bottom: 0
}

.note-devices {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.note-devices p {
  color: var(--text-muted);
}

#participant-list {
  max-height: 400px
}
ul#plist {
  max-height: 650px
}

.join_game .badge-title, .host_game .badge-title {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  color: white;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.btn-create-account, .btn-create-account:hover {
  background: white;
  color: var(--primary);
  font-weight: 700"
}

.btn-already-account, .btn-already-account:hover {
  border: 2px solid white;
  color: white;
  font-weight: 700;
}

.clean-block.clean-hero:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: currentColor;
  z-index: 1;
}

.clean-block.clean-hero.bg-bagdes {
  background-image: url('/static/assets/img/badges_dark.png');
  color: rgba(192, 38, 211, 0.75);
  border-radius: 16px;
  overflow: hidden;
}

[data-qa-theme="bright-playful"] .clean-block.clean-hero.bg-bagdes {
  background-image: url('/static/assets/img/bagdes_light.png');
}

@media (min-width: 576px) {
  .clean-block.clean-hero {
    min-height: 300px;
  }
}

.clean-block.clean-hero {
  position: relative;
  text-align: center;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 0;
}

@media (min-width: 576px) {
  .clean-block {
    padding-bottom: 100px;
  }
}

.clean-block {
  padding-bottom: 50px;
}

@media (min-width: 576px) {
  .clean-block.clean-hero .text {
    padding: 0px;
  }
}

.clean-block.clean-hero .text {
  max-width: 640px;
  z-index: 2;
  padding: 40px 15px;
  text-shadow: 1px 1px 1px rgba(0,0,0,.15);
}

/* ========== HOST ROOM ========== */
.host-code {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0;
  color: var(--bs-card-cap-color);
  border-bottom: none !important;
}

.shuffle-toggle {
  position:relative;
  width:46px;
  height:26px;
  border-radius:13px;
  transition:background 0.2s;
  cursor:pointer;
  flex-shrink:0;
  background:var(--color-gray);
}

.shuffle-toggle.active {
  background:var(--color-green);
}

.shuffle-toggle span.point-toggle {
  position:absolute;
  top:3px;
  width:20px;
  height:20px;
  border-radius:50%;
  background:white;
  transition:left 0.2s;
  box-shadow:0 1px 3px rgba(0,0,0,0.3);
}

.host-waiting-text {
  color: var(--warning);
}

@media (max-width:575px) {
  button#btn-close-session-host, button#nav-start-btn {
    width: 100%;
  }
}
@media (min-width:992px) and (max-width:1199px) {
  button#btn-close-session-host, button#nav-start-btn {
    width: 100% !important;
  }
}
