/* ============================================================================
 * SilentHeroes Core Quiz — sorting hat dla 8 jednostek WS (DARK card)
 * Wzór: ciemna karta wstawiona w jasną sekcję home (white-on-black inside).
 * ========================================================================= */

.sh-core-quiz,
.sh-info-kalkulator .sh-core-quiz {
  --core-card: #15181d;
  --core-card-soft: #1d2127;
  --core-card-hover: #232830;
  --core-border: rgba(255, 255, 255, 0.08);
  --core-border-strong: rgba(255, 255, 255, 0.18);
  --core-border-active: var(--sh-red, #cc1b1b);
  --core-text: #f5f5f5;
  --core-muted: #9ea1a8;
  --core-red: var(--sh-red, #cc1b1b);

  background: #15181d !important;
  color: #f5f5f5 !important;
  border-radius: 12px;
  padding: 32px 28px 28px;
  max-width: 1080px;
  margin: 24px auto 0;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  position: relative;
}

@media (max-width: 540px) {
  .sh-core-quiz { padding: 22px 16px 20px; border-radius: 10px; }
}

/* === Buckety (input zone) === */
.sh-core-quiz-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 760px) {
  .sh-core-quiz-grid { grid-template-columns: 1fr; gap: 10px; }
}

.sh-core-quiz .sh-core-bucket {
  background: #1d2127 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px;
  padding: 16px 18px 14px;
  margin: 0;
  min-width: 0;
  color: #f5f5f5;
}
.sh-core-quiz .sh-core-bucket-label {
  color: #f5f5f5 !important;
}

.sh-core-bucket-head {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 12px;
  padding: 0;
  float: none;
}
.sh-core-bucket-sub {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--core-red);
  font-weight: 600;
  order: -1;
}
.sh-core-bucket-label {
  font-family: var(--sh-font-display, 'Poppins', sans-serif);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.005em;
  color: var(--core-text);
}

.sh-core-bucket-levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (max-width: 540px) {
  .sh-core-bucket-levels { grid-template-columns: repeat(2, 1fr); }
}

.sh-core-quiz .sh-core-level {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  padding: 10px 10px;
  color: #f5f5f5;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  min-height: 56px;
  font-weight: 400;
}
.sh-core-quiz .sh-core-level-sub {
  text-align: center;
  display: block;
  width: 100%;
}
.sh-core-level:hover {
  background: var(--core-card-hover);
  border-color: var(--core-border-strong);
}
.sh-core-level:focus-visible {
  outline: 2px solid var(--core-red);
  outline-offset: 2px;
}
.sh-core-level.is-selected {
  background: rgba(204, 27, 27, 0.14);
  border-color: var(--core-red);
  box-shadow: 0 0 0 1px var(--core-red);
}
.sh-core-quiz .sh-core-level-sub {
  font-size: 12px;
  color: #c9ccd2;
  line-height: 1.35;
  font-weight: 500;
}
.sh-core-quiz .sh-core-level.is-selected .sh-core-level-sub {
  color: #fff;
  font-weight: 600;
}

/* === Akcje === */
.sh-core-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.sh-core-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.sh-core-reset {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--core-muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px 4px;
  font-family: inherit;
}
.sh-core-reset:hover { color: var(--core-text); }

/* === Wynik: 8 jednostek z paskami === */
.sh-core-result {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--core-border);
}
.sh-core-result-head { margin-bottom: 18px; }
.sh-core-result-head .sh-kicker {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--core-red);
  margin-bottom: 4px;
  font-weight: 600;
}
.sh-core-result-title {
  margin: 0;
  font-family: var(--sh-font-display, 'Poppins', sans-serif);
  font-weight: 700;
  font-size: 22px;
  color: var(--core-text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.sh-core-podium {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 760px) {
  .sh-core-podium { grid-template-columns: repeat(3, 1fr); }
}

.sh-core-podium-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--core-card-soft);
  border: 1px solid var(--core-border);
  border-radius: 10px;
  opacity: 0;
  transform: translateY(8px);
  animation: shCoreFadeUp 0.45s ease forwards;
  text-decoration: none;
  color: var(--core-text);
  position: relative;
  overflow: hidden;
}
.sh-core-podium-item:hover {
  background: var(--core-card-hover);
  transform: translateY(-1px);
  border-color: var(--core-border-strong);
}
.sh-core-podium-item.is-top {
  border-color: var(--core-red);
  box-shadow: 0 0 0 1px var(--core-red), 0 4px 20px rgba(204, 27, 27, 0.18);
}
@keyframes shCoreFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.sh-core-podium-logo {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  padding: 4px;
}
.sh-core-podium-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.sh-core-podium-name {
  font-family: var(--sh-font-display, 'Poppins', sans-serif);
  font-weight: 700;
  font-size: 14px;
  color: var(--core-text);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sh-core-podium-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--sh-font-display, 'Poppins', sans-serif);
  font-weight: 700;
  font-size: 18px;
  color: var(--core-text);
  line-height: 1;
  margin-top: 2px;
}
.sh-core-podium-score-max {
  font-weight: 400;
  font-size: 11px;
  color: var(--core-muted);
}
.sh-core-podium-bar {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  margin-top: 6px;
  overflow: hidden;
}
.sh-core-podium-bar-fill {
  display: block;
  height: 100%;
  background: var(--core-red);
  border-radius: 2px;
  transform-origin: left;
  animation: shCoreBarGrow 0.7s ease forwards;
  width: 0;
}
@keyframes shCoreBarGrow {
  from { width: 0; }
}

/* CTA hero pod paskami */
.sh-core-hero-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 18px;
  background: transparent;
  border: 1px solid var(--core-red);
  border-radius: 10px;
  margin-bottom: 14px;
}
@media (max-width: 640px) {
  .sh-core-hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
}
.sh-core-hero-cta-text {
  flex: 1;
  min-width: 0;
}
.sh-core-hero-cta-kicker {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--core-red);
  font-weight: 600;
  margin-bottom: 2px;
}
.sh-core-hero-cta-title {
  font-family: var(--sh-font-display, 'Poppins', sans-serif);
  font-weight: 700;
  font-size: 17px;
  color: var(--core-text);
  line-height: 1.2;
}
.sh-core-hero-cta-btn {
  background: var(--core-red);
  color: #fff !important;
  text-decoration: none;
  padding: 11px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.15s ease;
  max-width: 100%;
  text-align: center;
  box-sizing: border-box;
}
.sh-core-hero-cta-btn:hover { background: #a01515; }
@media (max-width: 640px) {
  .sh-core-hero-cta-btn {
    white-space: normal;
    width: 100%;
    line-height: 1.35;
    padding: 13px 14px;
    font-size: 12.5px;
  }
}

.sh-core-disclaimer {
  font-size: 11px;
  line-height: 1.5;
  color: var(--core-muted);
  margin: 14px 0 0 0;
  font-style: italic;
}

/* === Divider + siatka kart skrótów do hubów === */
.sh-core-units-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 36px 0 14px 0;
  color: #6b6f76;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
}
.sh-core-units-divider::before,
.sh-core-units-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.10);
}

.sh-core-units-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 6px;
}
@media (max-width: 900px) {
  .sh-core-units-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .sh-core-units-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

.sh-core-unit-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
  height: 84px;
  color: #111;
  overflow: hidden;
}
.sh-core-unit-card:hover {
  border-color: #cc1b1b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(204, 27, 27, 0.12);
}
.sh-core-unit-logo {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 4px;
}
.sh-core-unit-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.sh-core-unit-tier {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #cc1b1b;
  line-height: 1.3;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sh-core-unit-name {
  font-family: var(--sh-font-display, 'Poppins', sans-serif);
  font-weight: 700;
  font-size: 13.5px;
  color: #111;
  line-height: 1.3;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.sh-core-unit-cta {
  font-size: 11px;
  color: #6b6f76;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}
.sh-core-unit-card:hover .sh-core-unit-cta { color: #cc1b1b; }

/* Mobile: vertical layout — logo nad metadanymi, wycentrowane + uppercase */
@media (max-width: 540px) {
  .sh-core-unit-card {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: auto;
    min-height: 110px;
    gap: 10px;
    padding: 14px 12px;
    text-align: center;
  }
  .sh-core-unit-logo {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }
  .sh-core-unit-meta {
    width: 100%;
    align-items: center;
    text-align: center;
  }
  .sh-core-unit-tier {
    font-size: 9.5px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
    text-align: center;
  }
  .sh-core-unit-name {
    font-size: 13px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
    text-align: center;
  }
  .sh-core-unit-cta { display: none; }
}
