:root {
  --ink: #e9f5ed;
  --muted: #91a99f;
  --gold: #e4bb67;
  --deep: #061510;
  --line: rgba(151, 218, 186, .2);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: radial-gradient(circle at 15% 5%, #0c503c55, transparent 32%), radial-gradient(circle at 90% 30%, #70601622, transparent 30%), linear-gradient(#061813, #04110e);
  font-family: Inter, system-ui, sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
}
body.modal-open { overflow: hidden; }

.ambient { position: fixed; pointer-events: none; border-radius: 50%; filter: blur(80px); opacity: .2; }
.ambient-one { width: 380px; height: 380px; left: -160px; top: 15%; background: #1ca67d; }
.ambient-two { width: 420px; height: 420px; right: -190px; bottom: -120px; background: #96712a; }

.shared-header {
  position: relative;
  z-index: 2;
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; color: #e6d6a4; text-decoration: none; font: 700 13px Cinzel, serif; letter-spacing: .14em; }
.brand small { color: #84a895; font: 500 8px Inter, sans-serif; letter-spacing: .28em; }
.brand-mark { width: 43px; height: 48px; display: grid; place-items: center; color: #071510; background: linear-gradient(145deg, #76ebbd, #1a8b6e); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); font: 700 14px Cinzel, serif; }
.planner-link { border-bottom: 1px solid var(--gold); padding: 10px 2px; color: #dbece4; text-decoration: none; text-transform: uppercase; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.planner-link:hover, .planner-link:focus-visible { color: var(--gold); outline: none; }

main { position: relative; z-index: 1; width: min(1220px, calc(100% - 48px)); margin: 18px auto 70px; }
.shared-build, .invalid-build { border: 1px solid rgba(228, 187, 103, .4); padding: clamp(30px, 5vw, 66px); background: linear-gradient(125deg, rgba(7, 36, 27, .95), rgba(23, 37, 25, .94)); box-shadow: 0 25px 90px rgba(0, 0, 0, .28); }
.build-heading { position: relative; text-align: center; margin-bottom: 42px; }
.section-kicker { color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .32em; }
h1 { margin: 14px 0 12px; font: 500 clamp(38px, 6vw, 72px)/1.05 Cinzel, serif; }
.build-heading p, .invalid-build p { margin: 0 auto; max-width: 650px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.randomized-badge { position: absolute; right: 0; top: 0; border: 1px solid var(--gold); padding: 10px 13px; color: #f0ce83; background: rgba(228, 187, 103, .09); text-transform: uppercase; font-size: 8px; font-weight: 800; letter-spacing: .16em; }

.build-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.build-grid.relic-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.shared-pick { position: relative; min-width: 0; min-height: 260px; padding: 22px 14px 18px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; text-align: center; border: 1px solid var(--line); background: rgba(5, 32, 24, .76); }
.shared-pick.god-pick { border-color: rgba(228, 187, 103, .52); background: rgba(57, 49, 24, .68); }
.shared-pick .pick-label { color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.shared-pick img { width: 108px; height: 108px; margin: 18px 0 14px; object-fit: contain; filter: drop-shadow(0 9px 15px #020c09); }
.shared-pick h2 { margin: 0; overflow-wrap: anywhere; font: 600 16px/1.25 Cinzel, serif; }
.shared-pick .pick-detail { margin-top: auto; padding-top: 16px; color: #82aa98; font-size: 8px; font-weight: 700; line-height: 1.5; letter-spacing: .09em; text-transform: uppercase; }
.shared-pick.path-chaos .pick-label, .shared-pick.path-chaos .pick-detail { color: #ff655e; }
.shared-pick.path-order .pick-label, .shared-pick.path-order .pick-detail { color: #71b7ff; }
.shared-pick.path-balance .pick-label, .shared-pick.path-balance .pick-detail { color: #58e6b1; }
.pick-info { position: absolute; z-index: 2; top: 11px; right: 11px; width: 27px; height: 27px; border: 1px solid #406f5d; border-radius: 50%; display: grid; place-items: center; color: #99c8b5; background: rgba(5, 27, 21, .82); font: 600 11px Georgia, serif; cursor: pointer; transition: .18s; }
.pick-info:hover, .pick-info:focus-visible { border-color: #f0cb7a; color: #102018; background: #e4bb67; box-shadow: 0 5px 16px rgba(228, 187, 103, .35); transform: translateY(-2px) scale(1.08); outline: none; }

.bonus-card { position: relative; width: min(720px, 100%); margin: 22px auto 0; padding: 18px 56px 18px 26px; display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 20px; border: 1px solid rgba(228, 187, 103, .65); background: rgba(73, 60, 26, .62); }
.bonus-card[hidden] { display: none !important; }
.bonus-card img { width: 70px; height: 70px; object-fit: contain; }
.bonus-card span { display: block; color: var(--gold); font-size: 8px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.bonus-card h2 { margin: 6px 0 0; font: 600 22px Cinzel, serif; }

dialog { width: min(620px, calc(100% - 28px)); max-height: calc(100vh - 32px); border: 1px solid #547866; padding: 46px; overflow: auto; color: var(--ink); background: #0a2019; box-shadow: 0 25px 90px #000; scrollbar-width: thin; scrollbar-color: #b99146 #071812; }
dialog::backdrop { background: rgba(1, 9, 7, .82); backdrop-filter: blur(7px); }
dialog::-webkit-scrollbar { width: 11px; }
dialog::-webkit-scrollbar-track { border-left: 1px solid rgba(84, 230, 180, .16); background: #071812; }
dialog::-webkit-scrollbar-thumb { min-height: 48px; border: 2px solid #071812; border-radius: 999px; background: linear-gradient(180deg, #e4bb67, #8f692f); }
.dialog-close { position: absolute; right: 14px; top: 10px; border: 0; padding: 4px 8px; color: #9ab1a7; background: none; font-size: 28px; cursor: pointer; }
.dialog-close:hover, .dialog-close:focus-visible { color: var(--gold); outline: none; }
.dialog-icon { display: block; width: 112px; height: 102px; margin: 0 0 22px; object-fit: contain; filter: drop-shadow(0 8px 14px #020c09); }
dialog h2 { margin: 8px 0 22px; font: 600 34px Cinzel, serif; }
.dialog-text { color: #b5c9c0; font-size: 14px; line-height: 1.7; }
.dialog-text h3 { margin: 24px 0 8px; color: var(--gold); font: 700 9px Inter, sans-serif; letter-spacing: .2em; text-transform: uppercase; }
.dialog-text p { position: relative; margin: 12px 0; padding-left: 17px; }
.dialog-text p::before { content: ""; position: absolute; left: 0; top: 9px; width: 5px; height: 5px; background: var(--gold); transform: rotate(45deg); }

.build-actions { margin-top: 42px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.build-actions button, .build-actions a, .primary-action { min-width: 210px; border: 1px solid #bd9955; padding: 16px 24px; color: #102018; background: linear-gradient(135deg, #e4c175, #a67b34); text-align: center; text-decoration: none; text-transform: uppercase; font-size: 10px; font-weight: 800; letter-spacing: .13em; cursor: pointer; transition: .2s; }
.build-actions a { color: #d8c58f; background: transparent; }
.build-actions button:hover, .build-actions button:focus-visible, .build-actions a:hover, .build-actions a:focus-visible, .primary-action:hover, .primary-action:focus-visible { border-color: #f0ce83; box-shadow: 0 9px 24px rgba(228, 187, 103, .2); transform: translateY(-2px); outline: none; }

.invalid-build { max-width: 800px; margin: 80px auto; text-align: center; }
.invalid-build h1 { font-size: clamp(34px, 5vw, 56px); }
.invalid-build .primary-action { display: inline-block; margin-top: 24px; }
#toast { position: fixed; z-index: 10; bottom: 25px; left: 50%; padding: 13px 22px; color: #102018; background: var(--gold); font-size: 12px; font-weight: 700; transform: translate(-50%, 100px); transition: .35s; }
#toast.show { transform: translate(-50%, 0); }

@media (max-width: 1040px) {
  .build-grid.relic-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shared-header, main { width: min(100% - 28px, 1220px); }
  .shared-header { padding-top: 16px; }
  .planner-link { font-size: 7px; }
  .shared-build { padding: 32px 18px; }
  .randomized-badge { position: static; display: inline-block; margin-top: 18px; }
  .build-grid, .build-grid.relic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shared-pick { min-height: 230px; }
  .shared-pick img { width: 92px; height: 92px; }
  dialog { padding: 38px 27px; }
}
@media (max-width: 460px) {
  .brand { font-size: 10px; }
  .brand-mark { width: 36px; height: 40px; }
  .planner-link { max-width: 100px; text-align: right; line-height: 1.5; }
  .build-grid, .build-grid.relic-grid { grid-template-columns: 1fr; }
  .shared-pick { min-height: 205px; }
  .bonus-card { grid-template-columns: 58px 1fr; padding: 16px; }
  .bonus-card img { width: 58px; height: 58px; }
  .build-actions > * { width: 100%; }
}
