#breeding-view {
  min-height: 100vh;
  padding: 24px clamp(16px, 3vw, 48px) 64px;
  color: #f1ead8;
  background:
    radial-gradient(circle at 50% 7%, #4d336033, transparent 28%),
    radial-gradient(circle at 12% 44%, #1f563733, transparent 30%),
    linear-gradient(145deg, #07130e, #0e1712 48%, #160f1c);
}

.breeding-shell { width: min(1640px, 100%); margin: 0 auto; }
.breeding-back { border-color: #a9946370; background: #07130ee8; color: #fff4d8; }
.breeding-back:hover { background: #223d2d; }

.breeding-heading {
  display: grid;
  grid-template-columns: 1fr minmax(285px, 390px);
  gap: 28px;
  align-items: end;
  margin: 4px 0 22px;
}

.breeding-heading .eyebrow,
#breeding-view .breeding-panel .eyebrow { color: #c0a96a; }
.breeding-heading h2 { margin: 0 0 8px; color: #fff7e3; font-family: Georgia, serif; font-size: clamp(2.4rem, 4vw, 4rem); }
.breeding-heading > div:first-child > p:last-child { max-width: 760px; margin: 0; color: #aebbb2; }

.breeding-law {
  padding: 15px 17px;
  border: 1px solid #a9946360;
  border-radius: 16px;
  background: #0b1711c9;
  box-shadow: 0 12px 30px #0005;
}

.breeding-law span,
.breeding-law strong,
.breeding-law small { display: block; }
.breeding-law span { margin-bottom: 5px; color: #bda968; font-size: .62rem; font-weight: 1000; letter-spacing: .11em; text-transform: uppercase; }
.breeding-law strong { color: #f1ead8; font-family: Georgia, serif; font-size: .95rem; line-height: 1.45; }
.breeding-law small { margin-top: 7px; color: #89988f; font-size: .68rem; line-height: 1.4; }

.breeding-ritual {
  position: relative;
  display: grid;
  grid-template-columns: minmax(270px, 1fr) minmax(310px, 430px) minmax(270px, 1fr);
  gap: clamp(16px, 2.3vw, 36px);
  align-items: center;
  min-height: 530px;
  overflow: hidden;
  padding: clamp(22px, 3vw, 45px);
  border: 1px solid #9f8c5d66;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 50%, #8f5fb32b 0 10%, transparent 28%),
    radial-gradient(circle at 50% 50%, transparent 0 35%, #b59b5c14 35.4% 35.8%, transparent 36.2%),
    linear-gradient(145deg, #0d1d16e8, #08110de8 50%, #191021e8);
  box-shadow: inset 0 0 90px #0008, 0 22px 65px #0007;
}

.breeding-ritual:before,
.breeding-ritual:after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
  border: 1px solid #aa8f5680;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.breeding-ritual:before { width: 430px; height: 430px; box-shadow: 0 0 40px #8b5eb533, inset 0 0 40px #8b5eb522; }
.breeding-ritual:after { width: 330px; height: 330px; border-style: dashed; animation: ritual-spin 45s linear infinite; }

.ritual-runes { position: absolute; z-index: 1; left: 50%; top: 50%; width: 390px; height: 390px; pointer-events: none; transform: translate(-50%, -50%); }
.ritual-runes i { position: absolute; color: #c5ae6d88; font-family: Georgia, serif; font-size: 1.15rem; font-style: normal; text-shadow: 0 0 12px #ab78d8; }
.ritual-runes i:nth-child(1) { left: 50%; top: 0; }
.ritual-runes i:nth-child(2) { right: 8%; top: 22%; }
.ritual-runes i:nth-child(3) { right: 8%; bottom: 22%; }
.ritual-runes i:nth-child(4) { left: 50%; bottom: 0; }
.ritual-runes i:nth-child(5) { left: 8%; bottom: 22%; }
.ritual-runes i:nth-child(6) { left: 8%; top: 22%; }

.ritual-parent,
.ritual-core { position: relative; z-index: 2; min-width: 0; }
.ritual-parent > p { margin: 0 0 9px; color: #bba462; text-align: center; font-size: .64rem; font-weight: 1000; letter-spacing: .14em; }

#breeding-view .parent-slot {
  display: grid;
  min-height: 390px;
  overflow: hidden;
  place-items: center;
  border: 1px solid #9d895c80;
  border-radius: 24px;
  background: linear-gradient(160deg, #15231cdb, #08110dda);
  padding: 14px;
  box-shadow: inset 0 0 55px #0008, 0 15px 35px #0005;
}

.parent-empty { display: grid; min-height: 330px; place-items: center; color: #74837a; text-align: center; }
.parent-empty-glyph { display: grid; width: 125px; height: 125px; place-items: center; margin: 0 auto 15px; border: 2px dashed #907e5570; border-radius: 50%; color: #a99463; font-family: Georgia, serif; font-size: 3rem; box-shadow: inset 0 0 25px #9a66dc20; }
.parent-empty strong,
.parent-empty span { display: block; }
.parent-empty strong { color: #c8c2af; font-family: Georgia, serif; }
.parent-empty span { max-width: 210px; margin-top: 5px; font-size: .72rem; line-height: 1.4; }

#breeding-view .parent-mini { width: 100%; color: #eae4d3; text-align: center; }
.parent-mini-art { height: 205px; overflow: hidden; }
#breeding-view .parent-mini-art img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 16px 12px #0009); }
.parent-mini h3 { margin: 6px 0 3px; color: #fff7e3; font-family: Georgia, serif; font-size: 1.45rem; }
.parent-mini-meta { margin: 0 0 12px; color: #91a098; font-size: .72rem; font-weight: 750; }
.parent-mini-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.parent-mini-metric { padding: 8px 4px; border: 1px solid #a8936050; border-radius: 10px; background: #0b1611c9; }
.parent-mini-metric span,
.parent-mini-metric strong { display: block; }
.parent-mini-metric span { color: #9d9274; font-size: .52rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.parent-mini-metric strong { margin-top: 2px; color: #eee4c9; font-size: .78rem; }
.parent-mini-genes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 7px; }
.parent-mini-genes span { padding: 6px 2px; border-radius: 8px; background: #2c2634a8; color: #cfc1df; font-size: .56rem; font-weight: 850; }

.ritual-core { display: flex; align-items: center; flex-direction: column; text-align: center; }
.ritual-sigil { position: relative; display: grid; width: 150px; height: 150px; place-items: center; margin-bottom: 13px; border: 1px solid #c3a76899; border-radius: 50%; background: radial-gradient(circle, #8d5ab74d, #0d1712 65%); box-shadow: 0 0 38px #8e5db65c, inset 0 0 28px #d2b86d2b; }
.ritual-sigil:before { content: ""; position: absolute; inset: 12px; border: 1px dashed #c3a76899; border-radius: 50%; animation: sigil-spin 18s linear infinite reverse; }
.ritual-sigil span { position: relative; font-size: 3.4rem; filter: drop-shadow(0 0 16px #bd85ec); }

#breeding-view .breeding-preview { width: 100%; min-height: 155px; margin: 0 0 13px; border: 1px solid #a994635c; border-radius: 15px; background: #07110dcc; padding: 13px; color: #a9b4ad; font-weight: 700; }
.breeding-preview > strong,
.breeding-preview > span { display: block; }
.breeding-preview > strong { margin-bottom: 5px; color: #f2e7ca; font-family: Georgia, serif; font-size: 1.05rem; }
.breeding-preview > span { font-size: .72rem; line-height: 1.45; }
.breeding-outcome-species { display: flex; justify-content: center; gap: 8px; margin-bottom: 9px; }
.breeding-outcome-species span { padding: 6px 9px; border-radius: 20px; background: #38294ae0; color: #e9dbf7; font-size: .68rem; font-weight: 900; }
.breeding-outcome-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
.breeding-outcome-metric { padding: 7px; border-radius: 9px; background: #14221b; }
.breeding-outcome-metric small,
.breeding-outcome-metric b { display: block; }
.breeding-outcome-metric small { color: #8f9c94; font-size: .54rem; text-transform: uppercase; }
.breeding-outcome-metric b { margin-top: 2px; color: #eaddbc; font-size: .7rem; }
.mutation-chances { display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.mutation-chances span { padding: 4px 7px; border-radius: 8px; background: #1d2b23; color: #aebbb2; font-size: .57rem; }
.mutation-chances .positive { color: #73c78e; }
.mutation-chances .negative { color: #e18a76; }
.mutation-chances .astrum { color: #c89bf1; }

.ritual-breed-button { width: min(250px, 100%); min-height: 48px; border: 1px solid #d0b66f; border-radius: 13px; background: linear-gradient(135deg, #735099, #51356f); color: #fff7e4; box-shadow: 0 8px 22px #0007, 0 0 20px #8e5db630; font-weight: 1000; cursor: pointer; }
.ritual-breed-button:not(:disabled):hover { filter: brightness(1.15); transform: translateY(-1px); }
.ritual-breed-button:disabled { opacity: .38; cursor: not-allowed; filter: grayscale(.5); }
.ritual-clear-button { margin-top: 7px; border: 0; background: transparent; color: #85938b; font-size: .68rem; font-weight: 850; cursor: pointer; }
.ritual-clear-button:hover { color: #d5cbb2; }

.breeding-panel { margin-top: 18px; border: 1px solid #9b875957; border-radius: 22px; background: #0b1712e8; padding: 20px; box-shadow: 0 16px 42px #0005; }
.breeding-panel-head,
#breeding-view .breeding-codex-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 15px; padding: 0; border: 0; }
.breeding-panel-head h3,
#breeding-view .breeding-codex-head h3 { margin: 0; color: #f3ecd9; font-family: Georgia, serif; font-size: 1.55rem; }
.breeding-panel-head > strong { color: #c2ad70; font-size: .78rem; }
.breeding-panel-head > span,
.breeding-codex-head p:last-child { margin: 4px 0 0; color: #84938a; font-size: .72rem; }

.breeding-toolbar { display: grid; grid-template-columns: minmax(200px, 1.4fr) repeat(3, minmax(135px, .8fr)) auto; gap: 9px; margin-bottom: 14px; padding: 11px; border: 1px solid #8f7d5550; border-radius: 15px; background: #07110d; }
.breeding-toolbar label { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.breeding-toolbar label > span { padding-left: 3px; color: #94886c; font-size: .57rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.breeding-toolbar input,
.breeding-toolbar select { width: 100%; min-width: 0; height: 40px; border: 1px solid #776a4c; border-radius: 10px; outline: 0; background: #15221b; color: #e8e1cf; padding: 0 10px; font: inherit; font-size: .76rem; font-weight: 750; }
.breeding-toolbar input:focus,
.breeding-toolbar select:focus { border-color: #9b72c2; box-shadow: 0 0 0 3px #9b72c222; }
.breeding-toolbar button { align-self: end; height: 40px; border: 1px solid #776a4c; border-radius: 10px; background: #202d25; color: #cfc7b3; padding: 0 12px; font-weight: 900; cursor: pointer; }

#breeding-view .breeding-creatures { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; max-height: 630px; overflow: auto; padding: 2px 5px 5px 2px; }
#breeding-view .breeding-pick { position: relative; display: grid; grid-template-columns: 90px 1fr; min-width: 0; min-height: 122px; gap: 10px; align-items: center; border: 1px solid #71644970; border-radius: 14px; background: linear-gradient(145deg, #14221a, #0b1510); padding: 10px; color: #eae3d2; text-align: left; cursor: pointer; }
#breeding-view .breeding-pick:hover { border-color: #a89561; background: #192a20; }
#breeding-view .breeding-pick.selected { border-color: #b78cda; background: linear-gradient(145deg, #2a1e35, #141a18); box-shadow: 0 0 18px #9d65c93d; }
#breeding-view .breeding-pick img { width: 90px; height: 96px; object-fit: contain; filter: drop-shadow(0 10px 7px #0008); }
.breeding-pick-copy { min-width: 0; }
.breeding-pick-copy strong { overflow: hidden; color: #fff5dd; font-family: Georgia, serif; font-size: .98rem; text-overflow: ellipsis; white-space: nowrap; }
.breeding-pick-copy small { margin-top: 3px; color: #8e9c93; font-size: .64rem; }
.breeding-pick-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin-top: 8px; }
.breeding-pick-stats span { padding: 5px 3px; border-radius: 7px; background: #263128; color: #c9bea3; text-align: center; font-size: .56rem; font-weight: 850; }
.breeding-parent-mark { position: absolute; z-index: 2; top: 7px; left: 7px; display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid #d1b5e7; border-radius: 50%; background: #674486; color: white; font-size: .62rem; font-weight: 1000; box-shadow: 0 4px 10px #0006; }
.breeding-list-empty { grid-column: 1 / -1; padding: 35px; border: 1px dashed #73674e; border-radius: 14px; color: #85938a; text-align: center; }

#breeding-view .egg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
#breeding-view .egg-card { position: relative; min-height: 235px; overflow: hidden; border: 1px solid #87744e70; border-radius: 18px; background: radial-gradient(circle at 50% 38%, #734c9136, transparent 30%), linear-gradient(150deg, #15231b, #080f0c); padding: 18px; color: #dcd5c4; text-align: center; box-shadow: inset 0 0 35px #0006; }
#breeding-view .egg-card:before { content: ""; position: absolute; inset: 10px; border: 1px dashed #8d79514d; border-radius: 14px; pointer-events: none; }
#breeding-view .egg-card.empty { display: grid; place-items: center; border-style: dashed; background: #09120e; color: #65736b; }
#breeding-view .egg-icon { position: relative; font-size: 5rem; }
#breeding-view .egg-card > strong,
#breeding-view .egg-timer,
#breeding-view .egg-card p,
#breeding-view .egg-card button { position: relative; }
#breeding-view .egg-card > strong { display: block; color: #f1e8d1; font-family: Georgia, serif; }
#breeding-view .egg-timer { margin: 8px; color: #b991dc; font-size: 1.15rem; }
#breeding-view .egg-card p { color: #87958d; font-size: .7rem; }
#breeding-view .egg-card .action { min-width: 120px; background: #674586; }
#breeding-view .egg-card.astrum { border-color: #9a68c5; box-shadow: inset 0 0 35px #7d4aa735, 0 0 20px #7d4aa72b; }
#breeding-view .egg-card.promising { border-color: #789c69; }
#breeding-view .egg-card.unstable { border-color: #a66e4c; }

#breeding-view .breeding-summary { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
#breeding-view .summary-pill { border: 1px solid #7668495c; background: #15221b; color: #d8cfba; }
#breeding-view .breeding-codex { display: grid; gap: 9px; margin-top: 0; }
#breeding-view .breeding-entry { display: grid; grid-template-columns: 82px 1fr auto; gap: 13px; align-items: center; border: 1px solid #7567495e; border-radius: 14px; background: linear-gradient(135deg, #132019, #0a130f); padding: 12px; }
#breeding-view .breeding-entry img { width: 82px; height: 82px; object-fit: contain; filter: drop-shadow(0 9px 7px #0008); }
#breeding-view .breeding-entry h4 { color: #f1e7ce; }
#breeding-view .breeding-entry p { color: #8f9d94; }
#breeding-view .breeding-score { color: #b88bdc; }
#breeding-view .breeding-score small { color: #817c70; }
#breeding-view .codex-empty { border-color: #756849; color: #87958d; }
#breeding-view .discovery-badge { background: #4b345f; color: #dcbef2; }

@keyframes ritual-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes sigil-spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .breeding-ritual { grid-template-columns: 1fr 280px 1fr; padding: 24px 18px; }
  .breeding-ritual:before { width: 360px; height: 360px; }
  .breeding-ritual:after { width: 280px; height: 280px; }
  .ritual-runes { width: 330px; height: 330px; }
  #breeding-view .parent-slot { min-height: 350px; }
  .parent-mini-art { height: 175px; }
  .breeding-toolbar { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .breeding-search { grid-column: span 2; }
}

@media (max-width: 760px) {
  #breeding-view { padding: 17px 10px 38px; }
  .breeding-heading { grid-template-columns: 1fr; gap: 16px; }
  .breeding-ritual { grid-template-columns: 1fr 1fr; min-height: 0; }
  .breeding-ritual:before,
  .breeding-ritual:after,
  .ritual-runes { display: none; }
  .ritual-core { grid-column: 1 / -1; grid-row: 2; }
  #breeding-view .parent-slot { min-height: 295px; padding: 9px; }
  .parent-mini-art { height: 145px; }
  .parent-mini h3 { font-size: 1.05rem; }
  .parent-mini-genes { grid-template-columns: repeat(2, 1fr); }
  .ritual-sigil { width: 115px; height: 115px; }
  .ritual-sigil span { font-size: 2.7rem; }
  #breeding-view .breeding-preview { min-height: 0; }
  .breeding-panel { padding: 13px; }
  .breeding-panel-head,
  #breeding-view .breeding-codex-head { align-items: flex-start; flex-direction: column; }
  .breeding-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .breeding-search { grid-column: span 2; }
  .breeding-toolbar button { grid-column: span 2; }
  #breeding-view .breeding-creatures { grid-template-columns: 1fr; max-height: 560px; }
  #breeding-view .egg-grid { grid-template-columns: 1fr; }
  #breeding-view .breeding-summary { justify-content: flex-start; }
  #breeding-view .breeding-entry { grid-template-columns: 64px 1fr; }
  #breeding-view .breeding-entry img { width: 64px; height: 64px; }
  #breeding-view .breeding-score { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 430px) {
  .breeding-ritual { grid-template-columns: 1fr; }
  .ritual-core { grid-column: 1; grid-row: 3; }
  #breeding-view .parent-slot { min-height: 250px; }
  .parent-mini-art { height: 120px; }
  .parent-mini-metrics { grid-template-columns: repeat(3, 1fr); }
}
