/* Palworld Breeding Calculator widget — dark theme to match supercraft.host */

#pal-breeding-calc, .pal-breeding-calc {
  --pbc-accent: #ff6b4a;
  --pbc-accent-2: #ff9070;
  --pbc-text: #f1f5f9;
  --pbc-text-strong: #fff;
  --pbc-muted: #94a3b8;
  --pbc-border: #334155;
  --pbc-bg: #1e293b;
  --pbc-bg-alt: #0f172a;
  --pbc-bg-input: #0f172a;
  --pbc-radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--pbc-bg);
  color: var(--pbc-text);
  border: 1px solid var(--pbc-border);
  border-radius: var(--pbc-radius);
  padding: 24px 24px 20px;
  margin: 28px 0;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: none;
  display: block;
}

#pal-breeding-calc *, .pal-breeding-calc * {
  box-sizing: border-box;
}

.pbc-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--pbc-border);
}

.pbc-tab {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--pbc-muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 14px 12px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}

.pbc-tab--active {
  color: var(--pbc-accent);
  border-bottom-color: var(--pbc-accent);
}

.pbc-tab:focus-visible {
  outline: 2px solid var(--pbc-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.pbc-panel {
  margin-bottom: 14px;
}

.pbc-breed-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

@media (max-width: 520px) {
  .pbc-breed-body {
    grid-template-columns: 1fr;
  }
  .pbc-swap {
    justify-self: center;
    margin: -2px 0;
  }
}

.pbc-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pbc-picker-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--pbc-muted);
}

.pbc-select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 11px 14px;
  border: 1px solid var(--pbc-border);
  border-radius: 10px;
  background: var(--pbc-bg-input);
  color: var(--pbc-text-strong);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394a3b8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  min-height: 44px;
}

.pbc-select option {
  background: var(--pbc-bg-input);
  color: var(--pbc-text-strong);
}

.pbc-select:focus-visible {
  outline: 2px solid var(--pbc-accent);
  outline-offset: 1px;
}

/* Combobox / typeahead */
.pbc-combobox {
  position: relative;
  width: 100%;
}

.pbc-combobox-input {
  /* override the chevron — we use no select-dropdown arrow because it's an input */
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%2394a3b8' d='M21 21l-4.35-4.35M11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14z' stroke='%2394a3b8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: right 12px center;
  padding-right: 38px;
  cursor: text;
}

.pbc-combobox-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 4px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--pbc-bg);
  border: 1px solid var(--pbc-border);
  border-radius: 10px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.pbc-combobox-option {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--pbc-text);
  font-size: 0.94rem;
  user-select: none;
}

.pbc-combobox-option:hover,
.pbc-combobox-option--active {
  background: rgba(255, 107, 74, 0.16);
  color: var(--pbc-text-strong);
}

.pbc-combobox-option--current {
  color: var(--pbc-accent);
  font-weight: 600;
}

.pbc-combobox-more {
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--pbc-muted);
  font-style: italic;
}

.pbc-swap {
  background: var(--pbc-bg-alt);
  border: 1px solid var(--pbc-border);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 1.05rem;
  cursor: pointer;
  color: var(--pbc-muted);
  transition: background .15s, color .15s, border-color .15s;
}

.pbc-swap:hover, .pbc-swap:focus-visible {
  background: var(--pbc-accent);
  color: #fff;
  border-color: var(--pbc-accent);
  outline: 0;
}

.pbc-result {
  margin-top: 16px;
  min-height: 80px;
}

.pbc-result-card {
  background: linear-gradient(135deg, rgba(255, 107, 74, 0.16) 0%, rgba(255, 144, 112, 0.06) 100%);
  border: 1px solid rgba(255, 107, 74, 0.45);
  border-radius: 14px;
  padding: 26px 22px 22px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(255, 107, 74, 0.12), inset 0 1px 0 rgba(255,255,255,0.04);
}

.pbc-result-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pbc-muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.pbc-result-name {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--pbc-accent);
  margin: 0;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 14px rgba(255, 107, 74, 0.3);
}

.pbc-result-meta {
  margin-top: 10px;
}

.pbc-result-tag {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--pbc-muted);
  background: rgba(15, 23, 42, 0.5);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--pbc-border);
  font-variant-numeric: tabular-nums;
}

.pbc-result-tag--exception {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.4);
  font-weight: 600;
}

.pbc-result-deep-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--pbc-accent);
  text-decoration: underline;
}

.pbc-result-empty {
  margin: 0;
  padding: 18px;
  text-align: center;
  color: var(--pbc-muted);
  background: var(--pbc-bg-alt);
  border-radius: 10px;
}

.pbc-find-filter {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  margin: 6px 0 4px;
  border: 1px solid var(--pbc-border);
  border-radius: 10px;
  background: var(--pbc-bg-input);
  color: var(--pbc-text-strong);
  min-height: 42px;
  -webkit-appearance: none;
  appearance: none;
}

.pbc-find-filter::placeholder {
  color: var(--pbc-muted);
}

.pbc-find-filter:focus-visible {
  outline: 2px solid var(--pbc-accent);
  outline-offset: 1px;
  border-color: var(--pbc-accent);
}

.pbc-find-head {
  font-size: 0.92rem;
  color: var(--pbc-muted);
  margin: 14px 0 8px;
}

.pbc-find-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.pbc-find-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid var(--pbc-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--pbc-text);
  font-size: 0.92rem;
  background: var(--pbc-bg-alt);
  transition: border-color .12s, background .12s;
}

.pbc-find-row:hover {
  border-color: var(--pbc-accent);
  background: rgba(255, 107, 74, 0.1);
  color: var(--pbc-text-strong);
}

.pbc-find-x {
  color: var(--pbc-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.pbc-find-more {
  font-size: 0.85rem;
  color: var(--pbc-muted);
  margin: 8px 0 0;
}

.pbc-helpers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--pbc-border);
}

.pbc-share, .pbc-embed, .pbc-random {
  background: var(--pbc-bg-alt);
  border: 1px solid var(--pbc-border);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.88rem;
  color: var(--pbc-text);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.pbc-share:hover, .pbc-embed:hover, .pbc-random:hover {
  background: var(--pbc-accent);
  border-color: var(--pbc-accent);
  color: #fff;
}

.pbc-random {
  font-weight: 600;
}

.pbc-helper-link {
  color: var(--pbc-accent);
  font-weight: 600;
  text-decoration: none;
  margin-left: auto;
  font-size: 0.9rem;
}

.pbc-helper-link:hover {
  text-decoration: underline;
  color: var(--pbc-accent-2);
}

.pbc-cta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(135deg, var(--pbc-accent) 0%, var(--pbc-accent-2) 100%);
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 6px 18px rgba(255, 107, 74, 0.25);
}

.pbc-cta-text {
  font-size: 0.92rem;
  font-weight: 500;
  color: #fff;
}

.pbc-cta-btn {
  background: #fff;
  color: #c44426;
  font-weight: 700;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.pbc-cta-btn:hover {
  background: #fff0eb;
  color: #a83820;
}
