/* app.css — Disseny Mobile-First PWA per a Color Cultura TGN */

:root {
  /* Paleta Corporativa & Festiva */
  --primary: #1E50FF;
  --primary-dark: #0D33B3;
  --primary-light: #EEF2FF;
  --accent: #FFB703;
  --accent-orange: #FF5A36;
  --bg: #F5F8FC;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --text: #0F172A;
  --muted: #64748B;
  --success: #10B981;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(30, 80, 255, 0.08);
  --shadow-lg: 0 14px 40px rgba(30, 80, 255, 0.12);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

.app {
  width: 100%;
  max-width: 460px;
  padding: max(14px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* TOPBAR & BRANDING */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-dmes {
  height: 26px;
  width: auto;
  display: block;
}

.top-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--card);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.stat-badge.streak {
  background: #FFF7ED;
  border-color: #FED7AA;
  color: #C2410C;
}

.icon-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}

.icon-btn:active {
  transform: scale(0.92);
}

.btn-install {
  display: none;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary), #3B6CFF);
  color: #FFF;
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30, 80, 255, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* CARROUSEL / SELECTOR DE REPTES */
.challenges-nav-wrap {
  overflow-x: auto;
  white-space: nowrap;
  padding: 2px 0 6px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.challenges-nav-wrap::-webkit-scrollbar { display: none; }

.challenges-nav {
  display: inline-flex;
  gap: 8px;
}

.challenge-pill {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.challenge-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text);
  font-size: 10px;
}

.challenge-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFF;
  box-shadow: 0 4px 14px rgba(30, 80, 255, 0.25);
}

.challenge-pill.active span {
  background: #FFF;
  color: var(--primary);
}

/* TARGETA PRINCIPAL DEL REPTE */
.repte-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 16px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.repte-header {
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-align: left;
  grid-column: 1 / -1;
}

.repte-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.repte-comptador {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--text);
}

.repte-punt {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 80, 255, 0.12);
  animation: repte-punt 2.4s ease-in-out infinite;
}

@keyframes repte-punt {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.8); }
}

.repte-bloc {
  flex: none;
  max-width: 46%;
  padding: 4px 8px;
  border-radius: 999px;
  background: #EEF2F8;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.repte-progres {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.repte-seg {
  height: 5px;
  border-radius: 999px;
  background: #E2E8F0;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.repte-seg.fet {
  background: var(--primary);
}

.repte-seg.actual {
  background: var(--primary);
  box-shadow: 0 0 0 2px rgba(30, 80, 255, 0.18);
}

.repte-objectiu-fila {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.repte-objectiu-text {
  flex: 1 1 auto;
  min-width: 0;
}

.repte-objectiu-label {
  display: block;
  margin-bottom: 1px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.repte-objectiu {
  margin: 0;
  font-size: 17px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.repte-element {
  flex: 0 1 auto;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(30, 80, 255, 0.08);
  border: 1px solid rgba(30, 80, 255, 0.18);
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
  .repte-punt { animation: none; }
}

/* CANVAS DE LA IL·LUSTRACIÓ */
.canvas-container {
  display: flex;
  justify-content: center;
}

.canvas-wrap {
  position: relative;
  /* Crea un context de capes propi: sense això el z-index del canvas
     escapa amunt i tapa el resultat, que és un germà sense posicionar. */
  isolation: isolate;
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 34px 44px rgba(0, 0, 0, 0.17);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #000;
}

/* Llamada de llum al peu de la carta: separa la il·lustració del negre.
   Va ABANS del canvas (z-index 0 vs 1), com el spotlightFloor de dialed. */
.canvas-wrap::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 77%;
  width: 72%;
  height: 28%;
  transform: translate(-50%, -50%);
  background: radial-gradient(#ffffff7e 0%, #ffffff41 35%, #ffffff16 60%, #fff0 80%);
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
}

#canvas {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
}

/* Els controls (resultat, color, sliders) han de pintar SOBRE la carta del
   dibuix i la seva ombra, que és molt ample i cau cap avall.
   Sense això, .canvas-wrap és position:relative i es pinta després dels
   elements estàtics: la seva omra fosca s'abraonaria sobre el resultat. */
.repte-controls {
  position: relative;
  z-index: 2;
}

/* ---------- COMPTE ENRERE: Preparats, llestos... ja! ---------- */
.countdown {
  --cd-inset: 16px;
  --cd-duration: 0.76s;
  position: absolute;
  inset: 0;
  z-index: 6;
  background: #000;
  cursor: pointer;
}

.countdown-word {
  position: absolute;
  top: var(--cd-inset);
  right: var(--cd-inset);
  font-size: min(56px, 14vw);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 1;
  color: #fff;
  text-transform: lowercase;
  text-shadow: 0 0 30px #b4d2ff66, 0 0 60px #8caaff33;
  opacity: 0;
  white-space: nowrap;
}

.countdown-word.compte-anim {
  animation: compte-pulse var(--cd-duration) ease-out forwards;
}

/* 0-14% impacte, 14-72% la paraula llegible, cap al 100% es marxa */
@keyframes compte-pulse {
  0%   { opacity: 0; transform: scale(0.94); }
  14%  { opacity: 1; transform: scale(1); }
  72%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.97); }
}

@media (min-width: 560px) {
  .countdown {
    --cd-inset: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .countdown-word.compte-anim {
    animation: none;
    opacity: 1;
  }
}

.canvas-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.3s ease;
}

.overlay-score {
  font-size: 64px;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 4px 20px rgba(255, 183, 3, 0.5);
  line-height: 1;
  animation: pop 0.4s ease-out;
}

.overlay-max {
  font-size: 20px;
  color: #FFF;
  font-weight: 700;
  opacity: 0.85;
}

/* BARRA DE COLOR ACTUAL */
.color-bar-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.color-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatch-round {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #FFF;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
  background: #000;
  flex-shrink: 0;
}

.color-val-text {
  font-size: 13px;
  color: var(--text);
}

.color-bar-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* RODA DE TO + SLIDERS ERGONÒMICS HSB */
.selector-to {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roda-bloque {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.roda-color {
  position: relative;
  width: 132px;
  height: 132px;
  flex: none;
  border-radius: 50%;
  outline: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.roda-color:active {
  cursor: grabbing;
}

.roda-color:focus-visible {
  outline: 3px solid rgba(30, 80, 255, 0.4);
  outline-offset: 4px;
}

.roda-color.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.roda-anell {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    #f00 0deg,
    #ff0 60deg,
    #0f0 120deg,
    #0ff 180deg,
    #00f 240deg,
    #f0f 300deg,
    #f00 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 19px), #000 calc(100% - 18px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 19px), #000 calc(100% - 18px));
  pointer-events: none;
}

.roda-centre {
  position: absolute;
  inset: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: 50%;
  background: #FFF;
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 6px rgba(15, 23, 42, 0.05);
  pointer-events: none;
}

.roda-centre b {
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.roda-centre small {
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}

.roda-thumb {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #FFF;
  background: #F00;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.08);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: background-color 0.12s linear;
}

.roda-ajuda {
  max-width: 26ch;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  color: var(--muted);
}

.sliders {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-ocult {
  display: none !important;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.slider-val {
  color: var(--primary);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
  background: #CBD5E1;
}

#h {
  background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}

#s {
  background: linear-gradient(to right, #FFFFFF, #FF0000);
}

#v {
  background: linear-gradient(to right, #000000, #FFFFFF);
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FFF;
  border: 3px solid var(--primary);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.25);
  cursor: pointer;
  transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:active {
  transform: scale(1.15);
}

input[type=range]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FFF;
  border: 3px solid var(--primary);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.25);
  cursor: pointer;
}

input[type=range]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* BOTÓ PRINCIPAL DE COMPROVACIÓ */
.btn-comprovar {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), #3B6CFF);
  color: #FFF;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(30, 80, 255, 0.35);
  transition: all 0.2s ease;
  margin-top: 4px;
}

.btn-comprovar:active {
  transform: scale(0.98);
  box-shadow: 0 4px 12px rgba(30, 80, 255, 0.25);
}

/* TARGETA DE RESULTATS */
.resultat-card {
  background: #FFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideUp 0.35s ease-out;
}

/* Resultat dins la il·lustració: missatge, punts i percentatge d'encert */
.overlay-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 26px;
  border-radius: var(--radius-md, 14px);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  text-align: center;
  max-width: 85%;
}

.overlay-missatge {
  font-size: clamp(15px, 4.2vw, 19px);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.overlay-encert {
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.3px;
}

.swatches-comparison {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #F8FAFC;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.swatch-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.swatch-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #FFF;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.swatch-info {
  display: flex;
  flex-direction: column;
}

.swatch-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.swatch-val {
  font-size: 13px;
  font-weight: 800;
}

.swatch-divider {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.curiositat-box {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-sm);
  padding: 12px;
}

.curiositat-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.curiositat-box p {
  font-size: 12px;
  color: #1E3A8A;
  line-height: 1.45;
}

/* BOTONS DE CONTROL POST-PARTIDA */
.action-buttons-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.btn-action {
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.btn-action.btn-next {
  grid-column: span 2;
  background: var(--primary);
  color: #FFF;
  border: none;
  box-shadow: 0 4px 14px rgba(30, 80, 255, 0.3);
}

.btn-action:active {
  transform: scale(0.97);
}

/* CANVAS DE CONFETI */
#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

/* FOOTER INFORMATIU */
.app-footer {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.app-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

/* ANIMACIONS & UTILITATS */
.hidden { display: none !important; }

@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== COMPOSICIÓ EN DUES COLUMNES ==================== */
/* Base (mòbil en vertical): les columnes es van apilant en ordre */
.repte-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.repte-visual,
.repte-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Quan l'orientació és horitzontal i hi ha prou amplada (mòbil girat o escriptori),
   el joc es mostra com una partició en tres franges horitzontals:
   1ª · capçalera: logo Diari Més + nom de l'element i la pregunta
   2ª · il·lustració a tota l'alçada útil
   3ª · controls i footer
   Així la imatge és la protagonista, res amagat i sense scroll vertical. */
/* ============================================================
   ORIENTACIÓ HORITZONTAL (mòbil girat o escriptori):
   L'app és una partició en TRES franges horitzontals que ocupen
   tota la pantalla sense scroll i sense res ocult:
     1ª FRANJA · capçalera: logo Diari Més + nom + pregunta
     2ª FRANJA · il·lustració al MÀXIM d'alçada
     3ª FRANJA · controls compactes + footer
   ============================================================ */
@media (orientation: landscape) and (min-width: 560px) {
  /* ============================================================
     ORIENTACIÓ HORITZONTAL (mòbil girat o escriptori):
     el joc torna a la COMPOSICIÓ EN DUES COLUMNES de sempre:
        . esquerra · la il·lustració al MÀXIM d'alçada (contain: mai retallada)
        . dreta    · controls compactes + footer
     Res amagat i sense scroll vertical.
     ============================================================ */
  .app {
    max-width: 1180px;
  }

  .repte-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(300px, 1fr);
    align-items: center;
    gap: 22px;
  }

  .repte-card {
    padding: 20px 24px;
  }

  .repte-header {
    gap: 6px;
  }

  .repte-objectiu {
    font-size: 15px;
  }

  .repte-objectiu-label {
    display: none;
  }

  .roda-color {
    width: 104px;
    height: 104px;
  }

  .roda-centre {
    inset: 18px;
  }

  .roda-centre b {
    font-size: 15px;
  }

  .roda-ajuda {
    display: none;
  }

  .selector-to {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .roda-bloque {
    flex: none;
  }

  .selector-to .sliders {
    flex: 1;
    min-width: 0;
  }

  .repte-visual {
    min-width: 0;
  }

  .canvas-container {
    min-width: 0;
  }

  .canvas-wrap {
    max-width: none;
    width: auto;
    margin: 0;
  }

  /* Contain pur: la il·lustració sempre HI CAP sencera, mai es retalla. */
  #canvas {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100dvh - 150px);
    min-height: 180px;
    aspect-ratio: 809 / 1024;
    margin: 0 auto;
  }

  /* --- CONTROLES COMPACTES en horitzontal --- */
  .repte-controls {
    gap: 9px;
  }

  .color-bar-pill {
    padding: 6px 10px;
  }

  .sliders {
    gap: 2px;
  }

  .slider-group {
    gap: 1px;
  }

  .slider-header {
    font-size: 10px;
  }

  input[type=range] {
    height: 14px;
  }

  input[type=range]::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
    border-width: 2px;
  }

  .btn-comprovar {
    padding: 11px 12px;
    font-size: 15px;
    margin-top: 0;
  }

  .action-buttons-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .btn-action {
    padding: 10px 4px;
    font-size: 12px;
    white-space: nowrap;
  }
}

@media (min-width: 1024px) and (orientation: landscape) {
  .app {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .canvas-wrap {
    max-width: 100%;
  }
}

/* ==================== PORTADA (PÀGINA INICIAL) ==================== */
.portada {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: var(--primary-dark);
  overflow: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.portada.oculta {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.portada-bg {
  position: absolute;
  inset: 0;
  background: url('../assets/images/frontal.jpeg') center 25% / cover no-repeat;
}

.portada-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(13, 51, 179, 0.40) 0%,
    rgba(13, 51, 179, 0.10) 45%,
    rgba(6, 15, 48, 0.88) 100%
  );
}

.portada-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  padding: max(34px, env(safe-area-inset-top)) 24px max(42px, env(safe-area-inset-bottom));
}

.portada-brand img {
  height: 34px;
  width: auto;
}

.portada-brand h1 {
  color: #FFF;
  font-size: 29px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-top: 14px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.portada-brand p {
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.1px;
  margin: 12px auto 0;
  max-width: 330px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

/* Icones: formes plenes, sense detall, al mateix pes que el text */
.icona-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icona {
  width: 1.15em;
  height: 1.15em;
  margin-right: 9px;
  vertical-align: -0.2em;
  fill: currentColor;
  flex: 0 0 auto;
}

/* Icona dins d'un sol button, sense text al costat */
.icona-sol {
  width: 1.3em;
  height: 1.3em;
  margin: 0;
  flex: 0 0 auto;
}

/* Icona al final d'un text (fletxa de "seguent") */
.icona-md {
  width: 1em;
  height: 1em;
  margin-left: 7px;
  vertical-align: -0.18em;
  fill: currentColor;
  flex: 0 0 auto;
}

/* La gota de la portada, una mida per damunt perque ha de pesar com a icona principal */
.icona-portada {
  width: 1.45em;
  height: 1.45em;
  margin-right: 11px;
  vertical-align: -0.3em;
  fill: currentColor;
  flex: 0 0 auto;
}

/* Icona dins la capella d'un bloc de la pantalla de progrés */
.icona-bloc-card {
  width: 1.5em;
  height: 1.5em;
  margin: 0;
  fill: currentColor;
}

/* Estat superat / no superat de cada element dins el resum del bloc */
.icona-estat {
  width: 1.25em;
  height: 1.25em;
  margin: 0;
  fill: currentColor;
  flex: 0 0 auto;
}

.portada-cta {
  width: 100%;
  max-width: 320px;
  animation: slideUp 0.6s ease 0.2s both;
}

.btn-inici {
  width: 100%;
  padding: 17px 22px;
  background: linear-gradient(135deg, var(--accent), #FFD84D);
  color: #1F2937;
  border: none;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-inici:active {
  transform: scale(0.97);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.portada-foot {
  color: #C9D4FE;
  font-size: 12px;
  letter-spacing: 0.4px;
  line-height: 1.7;
}
.portada-foot strong {
  color: #E8EEFF;
  font-weight: 700;
}
.portada-foot a {
  color: #C9D4FE;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* ============================================================
   ACCÉS I REGISTRE D'USUARIS (amb consentiment de dades)
   ============================================================ */

/* Botó secundari (contorn) que conviu amb .btn-inici */
.btn-inici.btn-outline {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  box-shadow: none;
  font-size: 15px;
  padding: 13px 18px;
  font-weight: 700;
}

.btn-inici.btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #fff;
}

.btn-inici.btn-small {
  max-width: 220px;
  margin: 14px auto 0;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(1200px 600px at 50% 20%, rgba(0,0,0,0.98), #000 70%);
  backdrop-filter: none;
  overflow-y: auto;
}

.auth-modal[hidden] {
  display: none;
}

.auth-box {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 26px 22px 24px;
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255,255,255,0.02) inset;
  color: #fff;
  max-height: 92dvh;
  overflow-y: auto;
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}

.auth-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* --- Pestanyes Accedir / Crear compte --- */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 20px;
}

.auth-tab {
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-tab.is-active {
  background: #0F172A;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.06) inset;
}

.auth-form[hidden],
.auth-logged[hidden] {
  display: none;
}

.auth-form h2 {
  margin: 0 0 16px;
  font-size: 19px;
  color: #fff;
}

.auth-label {
  display: block;
  margin: 12px 0 5px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.auth-opcional {
  text-transform: none;
  font-weight: 500;
  opacity: 0.75;
}

.auth-input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: #fff;
  background: #0F172A;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 80, 255, 0.14);
}

.auth-input.is-invalid {
  border-color: var(--accent-orange);
}

.auth-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-left: 3px solid #EF4444;
  border-radius: 12px;
  color: #fecaca;
}

.auth-error[hidden] {
  display: none;
}

/* --- Barra de força de la contrasenya --- */
.auth-strength {
  height: 5px;
  margin-top: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.auth-strength span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent-orange);
  transition: width 0.2s ease, background 0.2s ease;
}

.auth-strength[data-level="2"] span { background: var(--accent); }
.auth-strength[data-level="3"] span { background: var(--success); }

/* --- CONSENTIMENT DE PROTECCIÓ DE DADES --- */
.auth-consent {
  margin-top: 18px;
  padding: 13px;
  background: var(--primary-light);
  border: 1px solid rgba(30, 80, 255, 0.18);
  border-radius: var(--radius-sm);
}

.auth-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}

/* Casella NO premarcada: es fa visible i destacada quan es marca */
.auth-check-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.auth-check-mark {
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
  margin-top: 1px;
  border: 2px solid var(--primary);
  border-radius: 5px;
  background: #fff;
  position: relative;
  transition: background 0.15s ease;
}

.auth-check-input:checked + .auth-check-mark {
  background: var(--primary);
}

.auth-check-input:checked + .auth-check-mark::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(43deg);
}

.auth-check-input:focus-visible + .auth-check-mark {
  box-shadow: 0 0 0 3px rgba(30, 80, 255, 0.2);
}

.auth-check-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
}

.auth-check-text a {
  color: var(--primary);
  font-weight: 700;
}

.auth-consent-note {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid rgba(30, 80, 255, 0.16);
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

/* --- Sessió iniciada --- */
.auth-logged {
  text-align: center;
  padding: 6px 0 4px;
}

.auth-avatar {
  font-size: 40px;
  line-height: 1;
}

.auth-logged h2 {
  margin: 10px 0 4px;
  font-size: 19px;
}

.auth-mail {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
}

/* ============================================================
   PÀGINA DE PROTECCIÓ DE DADES
   ============================================================ */
.pagina-legal {
  background: var(--bg);
}

.legal-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 34px 20px 60px;
  line-height: 1.65;
  color: var(--text);
}

.legal-wrap h1 {
  font-size: 27px;
  margin: 0 0 6px;
  color: var(--primary-dark);
}

.legal-sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.legal-wrap h2 {
  font-size: 17px;
  margin: 28px 0 8px;
  color: var(--primary-dark);
}

.legal-avís {
  padding: 13px 15px;
  background: #FFFBEB;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
}

.legal-taula {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 12.5px;
}

.legal-taula th,
.legal-taula td {
  border: 1px solid var(--border);
  padding: 8px 9px;
  text-align: left;
  vertical-align: top;
}

.legal-taula th {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.legal-versio {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

.legal-torna {
  margin-top: 22px;
}

.legal-torna a {
  color: var(--primary);
  font-weight: 700;
}

/* ============================================================
   PERFIL DE L'USUARI (resultats i drets del titular)
   ============================================================ */

/* Capçalera del perfil: avatar + nom */
.perfil-cap {
  display: flex;
  gap: 13px;
  align-items: center;
  text-align: left;
  margin-bottom: 16px;
}

.perfil-cap h2 {
  margin: 0 0 2px;
  font-size: 18px;
}

.perfil-cap .auth-mail {
  font-size: 12.5px;
}

.auth-logged {
  padding: 4px 0 0;
}

/* --- Targetes de resum --- */
.perfil-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.perfil-stat {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 11px 6px;
  text-align: center;
}

.perfil-stat b {
  display: block;
  font-size: 20px;
  color: var(--primary);
  line-height: 1.1;
}

.perfil-stat span {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.perfil-encerts {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 11px;
  background: #ECFDF5;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #065F46;
  margin-bottom: 18px;
}

/* --- Històric de resultats --- */
.perfil-titol {
  margin: 0 0 9px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.perfil-buit {
  margin: 0;
  padding: 16px 14px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.perfil-resultats {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 250px;
  overflow-y: auto;
}

.perfil-resultats li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border);
}

.perfil-resultats li:last-child {
  border-bottom: none;
}

/* Mostreta del color que va triar el jugador */
.perfil-sw {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1.5px solid rgba(15, 23, 42, 0.14);
}

.perfil-res {
  flex: 1;
  min-width: 0;
}

.perfil-res b {
  display: block;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.perfil-res span {
  font-size: 11px;
  color: var(--muted);
}

.perfil-punts {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  text-align: right;
}

.perfil-punts.molt-alt { color: var(--success); }
.perfil-punts.baix { color: var(--muted); }

.btn-mes {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-mes:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* --- Botons de drets --- */
.perfil-drets {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn-inici.btn-outline-dark {
  background: #F1F5F9;
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: none;
  margin-top: 0;
}

.btn-inici.btn-outline-dark:hover {
  background: #E2E8F0;
  border-color: var(--muted);
}

.btn-perfil-danger {
  width: 100%;
  padding: 12px 16px;
  background: #FEF2F2;
  color: #B42318;
  border: 1.5px solid #FCA5A5;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-perfil-danger:hover {
  background: #FEE2E2;
}

.perfil-avís {
  padding: 12px 14px;
  background: #FFFBEB;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 6px;
}

.perfil-avís p {
  margin: 0 0 7px;
}

.perfil-avís ul {
  margin: 0;
  padding-left: 18px;
}

.perfil-avís li {
  margin-bottom: 4px;
}

.perfil-botons {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 9px;
  margin-top: 14px;
}

.perfil-botons .btn-inici.btn-outline-dark {
  margin-top: 0;
}

@media (max-width: 380px) {
  .perfil-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .perfil-botons {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   BLOCS DE REPTES I MODE BLOC
   ========================================================== */

.blocs-screen {
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 24px);
  background: linear-gradient(160deg, #1a1035 0%, #2d1b54 55%, #46236b 100%);
  color: #fff;
}

.blocs-header {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto 18px;
}

.blocs-titol { margin: 0; font-size: 1.35rem; line-height: 1.2; }
.blocs-sub   { margin: 4px 0 0; font-size: .85rem; opacity: .75; }

.blocs-list {
  display: grid;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}

.bloc-card {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  padding: 14px 16px;
  color: #fff;
  font: inherit;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.bloc-card:hover:not(:disabled) { background: rgba(255, 255, 255, .12); transform: translateY(-2px); }
.bloc-card:disabled { cursor: not-allowed; opacity: .5; }
.bloc-card.superat { border-color: #4ade80; background: rgba(74, 222, 128, .10); }

.bloc-card-top { display: flex; align-items: center; gap: 12px; }
.bloc-card-icona { font-size: 1.6rem; }
.bloc-card-top h3 { margin: 0; font-size: 1.05rem; }
.bloc-card-estat { font-size: .78rem; opacity: .75; }
.bloc-card-punts {
  margin-left: auto;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fbbf24;
}

.bloc-card-bar {
  height: 6px;
  margin: 12px 0 8px;
  background: rgba(255, 255, 255, .15);
  border-radius: 99px;
  overflow: hidden;
}
.bloc-card-fill { height: 100%; background: linear-gradient(90deg, #fbbf24, #f97316); border-radius: 99px; }
.bloc-card.superat .bloc-card-fill { background: linear-gradient(90deg, #4ade80, #22c55e); }

.bloc-card-meta { margin: 0; font-size: .78rem; opacity: .7; }

.blocs-buit { text-align: center; padding: 40px 16px; opacity: .7; }

/* --- Resultat de bloc --- */

.bloc-resultat {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 20px) 16px calc(env(safe-area-inset-bottom) + 24px);
  background: linear-gradient(160deg, #1a1035 0%, #2d1b54 55%, #46236b 100%);
  color: #fff;
}

.bloc-resultat-box {
  width: 100%;
  max-width: 520px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 20px;
  padding: 26px 22px;
  text-align: center;
}

.bloc-resultat-emoji { font-size: 3.2rem; line-height: 1; color: var(--primary); }
.bloc-resultat-emoji svg { width: 1em; height: 1em; fill: currentColor; }
.bloc-resultat-titol  { margin: 10px 0 4px; font-size: 1.5rem; }
.bloc-resultat-sub    { margin: 0 0 18px; font-size: .9rem; opacity: .8; }

.bloc-puntuacio-gran {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}
.bloc-puntuacio-gran span { font-size: 3.4rem; font-weight: 800; color: #fbbf24; line-height: 1; }
.bloc-puntuacio-gran small { font-size: 1rem; opacity: .7; }

.bloc-elements { list-style: none; margin: 0 0 20px; padding: 0; text-align: left; }
.bloc-el {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  margin-bottom: 6px;
  font-size: .9rem;
}
.bloc-el.ok { background: rgba(74, 222, 128, .12); }
.bloc-el.ko { background: rgba(248, 113, 113, .12); }
.bloc-el-nom { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bloc-el strong { font-size: .95rem; }

.bloc-resultat-accions { display: flex; flex-direction: column; gap: 10px; }

/* --- Progrés dins del joc --- */

.bloc-avís {
  max-width: 760px;
  margin: 0 auto 10px;
  padding: 8px 16px;
  font-size: .82rem;
  text-align: center;
  color: #4ade80;
  font-weight: 600;
}

@media (min-width: 900px) {
  .blocs-list { grid-template-columns: repeat(2, 1fr); }
  .bloc-resultat-accions { flex-direction: row; justify-content: center; }
  .bloc-resultat-accions .btn-inici { width: auto; }
}

/* --- Portada: nota sota el botó de joc sense registre --- */
.portada-nota {
  margin: -4px 0 4px;
  font-size: .78rem;
  line-height: 1.45;
  opacity: .7;
  max-width: 30ch;
  margin-inline: auto;
}

/* --- Comptador d'element, al costat del botó Següent --- */
.btn-next-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
}
.btn-next-wrap .btn-next { flex: 1; }
.bloc-comptador {
  flex: none;
  padding: 6px 11px;
  border-radius: 99px;
  background: rgba(251, 191, 36, .16);
  border: 1px solid rgba(251, 191, 36, .45);
  color: #fbbf24;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

/* --- Selecció d'elements per repetir --- */
.bloc-el-check {
  width: 20px;
  height: 20px;
  flex: none;
  accent-color: #f97316;
  cursor: pointer;
}
.bloc-el.seleccionat {
  background: rgba(251, 146, 60, .18);
  box-shadow: inset 0 0 0 1px rgba(251, 146, 60, .5);
}
.bloc-el { cursor: default; }
.bloc-elements .bloc-el-nom { flex: 1; }
