/* Joc de Comarques de Catalunya */

.jcc-app,
.jcc-app * {
  box-sizing: border-box;
}

.jcc-app {
  width: 100%;
  margin: 0 auto;
  background: #e9eef2;
  font-family: Arial, sans-serif;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
  border-radius: 16px;
}

.jcc-info {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: bold;
  color: #111827;
  padding: 8px 16px;
  background: white;
  border-radius: 12px;
  text-align: center;
}

.jcc-hud {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.jcc-pill {
  font-size: 17px;
  font-weight: bold;
  color: #374151;
  background: white;
  padding: 8px 14px;
  border-radius: 999px;
}

.jcc-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  background: #2563eb;
  color: white;
  line-height: 1.2;
}

.jcc-btn:hover {
  background: #1d4ed8;
}

.jcc-secondary {
  background: #16a34a;
}

.jcc-secondary:hover {
  background: #15803d;
}

.jcc-container {
  position: relative;
  width: min(95vw, 900px);
  max-height: calc(100vh - 180px);
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.jcc-mapa {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 180px);
  display: block;
  background: #dbeafe;
}

.jcc-capa-clicks path {
  fill: rgba(255,255,255,0.001);
  stroke: transparent;
  cursor: pointer;
}

.jcc-capa-clicks path:hover {
  fill: rgba(59,130,246,0.22);
}

.jcc-correcte {
  fill: rgba(34,197,94,0.50) !important;
}

.jcc-incorrecte {
  fill: rgba(239,68,68,0.50) !important;
}

.jcc-desactivat {
  pointer-events: none;
}

.jcc-missatge {
  max-width: 900px;
  min-height: 24px;
  font-size: 17px;
  font-weight: bold;
  color: #374151;
  text-align: center;
  white-space: pre-wrap;
}

.jcc-resultat-final {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(17, 24, 39, 0.55);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.jcc-resultat-card {
  background: white;
  padding: 22px 26px;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
  text-align: center;
  max-width: 420px;
  width: min(100%, 420px);
}

.jcc-resultat-card h2 {
  margin: 0 0 10px;
  font-size: 28px;
  color: #111827;
}

.jcc-resum-final p {
  margin: 8px 0;
  font-size: 18px;
  color: #111827;
}


@media (max-width: 768px) {

  .jcc-app {
    padding: 8px;
    gap: 8px;
  }

  .jcc-info {
    font-size: 22px;
    padding: 8px 12px;
  }

  .jcc-pill {
    font-size: 14px;
    padding: 6px 10px;
  }

  .jcc-btn {
    font-size: 14px;
    padding: 8px 14px;
  }

  .jcc-container {
    width: 100%;
    max-height: calc(100vh - 140px);
  }

  .jcc-mapa {
    max-height: calc(100vh - 140px);
  }

  .jcc-resultat-card {
    width: 92%;
    padding: 18px;
  }

  .jcc-resultat-card h2 {
    font-size: 24px;
  }

  .jcc-resum-final p {
    font-size: 16px;
  }
}


.jcc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 10px;
}

.jcc-hud {
  flex-direction: column;
  align-items: stretch;
}

.jcc-info {
  width: 100%;
  font-size: 26px;
  line-height: 1.2;
}

.jcc-pill,
.jcc-btn {
  width: 100%;
  text-align: center;
}

.jcc-main {
  min-width: 0;
}

@media (max-width: 900px) {

  .jcc-app {
    grid-template-columns: 1fr;
  }

  .jcc-sidebar {
    position: static;
  }

  .jcc-hud {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .jcc-pill,
  .jcc-btn {
    width: auto;
  }

  .jcc-info {
    text-align: center;
  }
}
