@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');
:root {
  color-scheme:dark;
  --bg:#101114;
  --surface:#18191e;
  --surface-raised:#202127;
  --line:#2c2d33;
  --ink:#f2f1ed;
  --muted:#96969f;
  --gold:#e8c58b;
  --green:#a4d9b5;
  --red:#e79a99;
  --c:#b6c2d1;
  --b:#8fbcdf;
  --a:#bba1e4;
  --s:#e8c58b;
  font-family:'DM Sans',sans-serif;
  font-synthesis:none
}

* {
  box-sizing:border-box
}
body {
  margin:0;
  background:radial-gradient(ellipse at 85% 0,rgba(185,145,78,.07),transparent 48%),var(--bg);
  color:var(--ink);
  font-size:16px;
  line-height:1.5
}
button,input,select {
  font:inherit
}
button {
  cursor:pointer
}
button:disabled {
  cursor:not-allowed
}
button,a,select {
  touch-action:manipulation
}
button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible {
  outline:2px solid var(--gold);
  outline-offset:4px
}
a {
  color:inherit
}
h1,h2,h3,p {
  margin:0
}
button {
  color:inherit
}
svg {
  flex-shrink:0
}
img {
  object-fit:contain
}
.app-shell {
  max-width:1240px;
  margin:auto;
  padding:0 42px
}
.site-header {
  height:90px;
  display:flex;
  align-items:center;
  gap:24px;
  border-bottom:1px solid var(--line)
}
.brand {
  display:flex;
  align-items:center;
  gap:11px;
  text-decoration:none;
  font:700 26px 'Space Grotesk',sans-serif;
  letter-spacing:-1.1px
}
.brand-mark {
  display:grid;
  place-items:center;
  flex:0 0 37px;
  border:1px solid #66553b;
  border-radius:11px;
  width:37px;
  height:37px;
  color:var(--gold);
  line-height:1;
  letter-spacing:0;
  background:#242018
}
.brand-mark svg {
  display:block
}
.brand-dot,.footer-brand>span:first-child {
  color:var(--gold)
}
.builder-bottom i {
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--green);
  display:inline-block
}
.intro {
  display:flex;
  justify-content:space-between;
  gap:30px;
  align-items:flex-end;
  padding:43px 0 30px
}
.eyebrow {
  font:600 12px 'DM Sans',sans-serif;
  letter-spacing:1.2px;
  color:var(--gold);
  margin-bottom:10px
}
h1 {
  font:500 clamp(34px,4.5vw,54px)/1.08 'Space Grotesk',sans-serif;
  letter-spacing:-2px
}
h1 span {
  color:#9b9ba3
}
.odds-panel {
  border:1px solid var(--line);
  border-radius:17px;
  background:linear-gradient(110deg,#1e2521 0%,#191b1d 38%,#1c1a1d 100%);
  padding:20px 26px 24px;
  margin-bottom:24px;
  position:relative;
  overflow:hidden
}
.section-kicker {
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:18px
}
.section-kicker h2 {
  font-size:14px;
  font-weight:500;
  color:#c5c7ca
}
.section-kicker>span {
  font-family:'Space Grotesk',sans-serif;
  font-size:14px;
  background:#ffffff0b;
  border:1px solid #ffffff0e;
  padding:2px 8px;
  border-radius:5px;
  color:#ddd
}
.stats-row {
  display:grid;
  grid-template-columns:1.25fr 1fr 1fr;
  gap:24px
}
.stat {
  display:flex;
  flex-direction:column;
  min-width:0;
  gap:5px;
  position:relative
}
.stat+.stat {
  border-left:1px solid #ffffff12;
  padding-left:26px
}
.stat-label {
  font-size:14px;
  letter-spacing:.2px;
  color:#c1c3c6;
  display:flex;
  gap:7px;
  align-items:center
}
.stat-label i {
  height:6px;
  width:6px;
  border-radius:50%;
  background:var(--muted)
}
.stat-success .stat-label i {
  background:var(--green)
}
.stat-major .stat-label i {
  background:var(--red)
}
.stat strong {
  font:500 clamp(24px,4vw,42px)/1.15 'Space Grotesk',sans-serif;
  letter-spacing:-1.4px;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere
}
.stat-success strong {
  color:var(--green)
}
.stat-major strong {
  color:var(--red)
}
.stat-caption {
  color:#83878b;
  font-size:14px
}
.warning-message {
  grid-column:1/-1;
  border-top:1px solid var(--line);
  padding-top:14px;
  font-size:14px;
  display:flex;
  align-items:center;
  gap:14px
}
.warning-message .button {
  padding:6px 12px;
  min-height:32px
}
.workspace {
  display:grid;
  grid-template-columns:minmax(300px,.88fr) minmax(0,1.25fr);
  gap:24px;
  align-items:start
}
.panel {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:17px;
  padding:26px
}
.panel-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  margin-bottom:23px
}
.panel-heading .eyebrow {
  color:var(--muted);
  margin-bottom:7px;
  font-size:12px
}
.panel-heading h2 {
  font:500 22px/1.2 'Space Grotesk',sans-serif;
  letter-spacing:-.65px
}
.tiny-tag {
  border:1px solid #3b3530;
  background:#25221e;
  border-radius:5px;
  color:var(--gold);
  font:500 12px 'Space Grotesk',sans-serif;
  letter-spacing:.6px;
  padding:5px 8px
}
.equipment-picker {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px
}
.equipment-card {
  border:1px solid var(--line);
  background:#1c1d22;
  border-radius:11px;
  padding:14px 8px 17px;
  position:relative;
  display:flex;
  align-items:center;
  flex-direction:column;
  gap:4px;
  transition:border-color .15s,background .15s,transform .15s;
  min-width:0
}
.equipment-card:hover {
  border-color:#6b5a41;
  transform:translateY(-2px)
}
.equipment-card.is-selected {
  border-color:#a18960;
  background:radial-gradient(ellipse at 50% 38%,#454030 0,transparent 70%),#25231e
}
.equipment-check {
  position:absolute;
  right:10px;
  top:8px;
  width:16px;
  height:16px;
  border:1px solid #696253;
  border-radius:50%;
  font-size:14px;
  line-height:15px;
  color:transparent
}
.is-selected .equipment-check {
  background:var(--gold);
  color:#231e16;
  border-color:var(--gold)
}
.item-art {
  height:105px;
  display:flex;
  align-items:center;
  justify-content:center
}
.item-art img {
  width:72px;
  height:72px;
  object-fit:contain;
  image-rendering:auto;
  filter:drop-shadow(0 7px 6px #0008)
}
.equipment-card strong {
  font-family:'Space Grotesk',sans-serif;
  font-size:15px;
  font-weight:500
}
.equipment-card>span:last-child {
  color:var(--muted);
  font-size:14px;
  letter-spacing:1.6px
}
.level-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:25px
}
.muted-label {
  color:#b8b9c3;
  font-size:14px;
  font-weight:600;
  letter-spacing:.8px
}
.level-heading p {
  margin-top:4px
}
.level-heading strong {
  font:500 30px 'Space Grotesk',sans-serif
}
.level-heading p>span {
  font-family:'Space Grotesk',sans-serif;
  color:#73747e;
  font-size:14px
}
.level-heading>span {
  font-size:14px;
  color:var(--gold)
}
.level-track {
  display:grid;
  grid-template-columns:repeat(8,1fr);
  gap:5px;
  margin:12px 0 24px
}
.level-track i {
  height:5px;
  background:#34343b;
  border-radius:2px
}
.level-track i.filled {
  background:var(--gold)
}
.material-heading {
  border-top:1px solid var(--line);
  padding-top:20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:14px
}
.material-heading h3 {
  font-size:14px;
  font-weight:500
}
.material-heading>span {
  font-size:14px;
  letter-spacing:1px;
  color:var(--muted)
}
.materials {
  display:flex;
  flex-direction:column;
  gap:16px
}
.material {
  display:flex;
  gap:12px;
  align-items:center
}
.material img {
  image-rendering:auto;
  flex-shrink:0
}
.material>div {
  display:flex;
  align-items:flex-start;
  flex-direction:column;
  flex:1;
  gap:2px;
  min-width:0
}
.material strong {
  font-size:16px;
  font-weight:600;
  white-space:nowrap
}
.material span {
  font-size:14px;
  line-height:1.45;
  color:#b8b9c3;
  text-align:left
}
.undo-button {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  width:100%;
  min-height:58px;
  padding:10px 15px;
  background:#28262a;
  border:1px solid #76654b;
  border-radius:10px;
  margin-top:22px;
  font-size:14px;
  font-weight:600
}
.undo-button>span:last-child {
  margin-left:auto;
  font-size:25px
}
.undo-button>span:first-of-type {
  margin-right:auto
}
.undo-button img {
  image-rendering:auto
}
.undo-button:disabled {
  opacity:.5
}
.undo-button:not(:disabled):hover {
  background:#2d2c32;
  border-color:#797064
}
.builder-toolbar {
  display:flex;
  gap:10px;
  margin-bottom:14px
}
.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:46px;
  padding:10px 15px;
  border-radius:8px;
  border:1px solid transparent;
  font-size:14px;
  font-weight:600;
  transition:background .15s,transform .15s
}
.button:active:not(:disabled) {
  transform:translateY(1px)
}
.button-primary {
  background:var(--gold);
  color:#29231a;
  box-shadow:0 2px 0 #aa8b55
}
.button-primary:hover {
  background:#f4d9ab
}
.button-secondary {
  background:#24252b;
  border-color:#38383f;
  color:#d9d9df
}
.button-secondary:hover {
  background:#303138
}
.button:disabled {
  opacity:.4
}
.button-secondary>span {
  color:var(--muted)
}
.builder-description {
  font-size:14px;
  line-height:1.7;
  color:var(--muted);
  margin-bottom:22px
}
.effect-list {
  display:flex;
  flex-direction:column;
  gap:10px
}
.effect-item {
  --grade:var(--c);
  display:grid;
  grid-template-columns:31px minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  border:1px solid var(--line);
  border-left:2px solid color-mix(in srgb,var(--grade) 60%,transparent);
  border-radius:8px;
  padding:16px 13px;
  min-height:85px;
  background:#1d1e23
}
.effect-item[data-grade="b"] {
  --grade:var(--b)
}
.effect-item[data-grade="a"] {
  --grade:var(--a)
}
.effect-item[data-grade="s"] {
  --grade:var(--s)
}
.grade-badge {
  display:flex;
  align-items:center;
  justify-content:center;
  height:31px;
  width:31px;
  border:1px solid color-mix(in srgb,var(--grade) 25%,transparent);
  border-radius:8px;
  background:color-mix(in srgb,var(--grade) 8%,transparent);
  color:var(--grade);
  font:500 15px 'Space Grotesk',sans-serif
}
.effect-name {
  font-size:16px;
  font-weight:500;
  line-height:1.45;
  display:block;
  overflow-wrap:anywhere
}
.effect-meta {
  display:flex;
  align-items:center;
  gap:7px;
  margin-top:7px;
  color:#b8b9c3;
  font-size:14px
}
.upgrade-pips {
  display:flex;
  gap:3px
}
.upgrade-pips i {
  display:block;
  width:13px;
  height:3px;
  background:#43434c;
  border-radius:2px
}
.upgrade-pips i.filled {
  background:var(--grade)
}
.upgrade-button {
  border:1px solid #44444d;
  border-radius:6px;
  background:#292a31;
  padding:7px 10px;
  min-height:44px;
  min-width:90px;
  font-size:14px;
  white-space:nowrap
}
.upgrade-button:not(:disabled):hover {
  border-color:var(--gold);
  color:var(--gold);
  background:#343029
}
.upgrade-button:disabled {
  border-color:transparent;
  background:#24242b;
  color:#666772
}
.effect-item.is-upgraded {
  background:color-mix(in srgb,var(--grade) 5%,#1d1e23)
}
.builder-bottom {
  margin-top:22px;
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  border-top:1px solid var(--line);
  padding-top:18px;
  font-size:14px;
  color:var(--muted)
}
.builder-bottom>span {
  flex:1 1 260px;
  display:flex;
  align-items:center;
  gap:7px
}
.builder-bottom i {
  background:var(--gold);
  width:4px;
  height:4px
}
.text-button {
  border:1px solid #6b5c45;
  border-radius:8px;
  background:#29251f;
  padding:10px 14px;
  min-height:46px;
  color:var(--gold);
  font-size:16px;
  font-weight:600;
  text-decoration:none;
  white-space:nowrap
}
.text-button:disabled {
  opacity:.5
}
.action-status {
  font-size:14px;
  line-height:1.6;
  margin-top:17px;
  color:#9e9fa8;
  min-height:32px
}
.how-it-works {
  margin:24px 0 32px;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  padding:16px 0;
  color:var(--muted);
  font-size:14px
}
.how-it-works summary {
  display:flex;
  justify-content:space-between;
  cursor:pointer;
  list-style:none;
  color:#c2c2ca
}
.how-it-works summary::-webkit-details-marker {
  display:none
}
.how-it-works summary span {
  color:var(--gold);
  font-size:17px;
  line-height:1
}
.how-it-works[open] summary span {
  transform:rotate(45deg)
}
.how-it-works>div {
  max-width:760px;
  padding-top:16px
}
.how-it-works p+p {
  margin-top:8px
}
footer {
  display:flex;
  align-items:center;
  gap:20px;
  justify-content:space-between;
  padding:0 0 30px;
  color:#787983;
  font-size:14px
}
.footer-brand {
  font:600 28px 'Space Grotesk',sans-serif;
  letter-spacing:-.7px;
  white-space:nowrap;
  color:var(--ink)
}
.footer-credit {
  font:500 17px 'DM Sans',sans-serif;
  letter-spacing:0;
  color:var(--muted);
  margin-left:7px
}
.footer-credit strong {
  font-weight:700;
  color:var(--gold)
}

.sr-only {
  position:absolute!important;
  clip:rect(0,0,0,0);
  clip-path:inset(50%);
  height:1px;
  width:1px;
  overflow:hidden;
  white-space:nowrap
}
.skip-link {
  position:fixed;
  left:20px;
  top:-60px;
  background:var(--gold);
  color:#111;
  padding:10px 20px;
  z-index:10
}
.skip-link:focus {
  top:10px
}
dialog {
  color:var(--ink);
  background:#1a1b20;
  border:1px solid #43434a;
  border-radius:16px;
  max-width:min(700px,calc(100% - 24px));
  width:700px;
  padding:28px;
  max-height:90dvh;
  box-shadow:0 24px 90px #0009
}
dialog::backdrop {
  background:#08090dd4;
  backdrop-filter:blur(6px)
}
.dialog-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px
}
.dialog-header h2 {
  font:500 25px 'Space Grotesk',sans-serif
}
.icon-button {
  background:#292a30;
  color:#a6a6af;
  border:1px solid #3b3c43;
  border-radius:7px;
  width:34px;
  height:34px;
  font-size:24px;
  line-height:1
}
.dialog-copy {
  font-size:14px;
  color:var(--muted);
  margin:12px 0 22px
}
.editor-grades {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px
}
.editor-grades fieldset {
  min-width:0;
  margin:0;
  padding:15px;
  border:1px solid #35363e;
  border-radius:9px
}
.editor-grades legend {
  padding:0 7px;
  color:var(--gold);
  font-size:14px
}
.count-control {
  display:flex;
  align-items:center;
  gap:12px;
  justify-content:space-between;
  margin-bottom:12px;
  font-size:14px;
  color:var(--muted)
}
select {
  color:var(--ink);
  background:#25262d;
  border:1px solid #43444d;
  border-radius:6px;
  padding:9px;
  font-size:14px;
  width:100%;
  min-height:38px
}
.count-control select {
  width:68px
}
.effect-options {
  display:flex;
  flex-direction:column;
  gap:9px
}
.dialog-actions {
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:24px;
  border-top:1px solid var(--line);
  padding-top:20px
}
.form-warning {
  color:var(--red);
  margin-top:15px;
  font-size:14px
}
[hidden] {
  display:none!important
}

@media(min-width:1300px) {
  .intro {
  padding-top:48px
}
.panel {
  padding:28px
}
.effect-item {
  min-height:90px
}

}

@media(max-width:900px) {
  .app-shell {
  padding:0 24px
}
.workspace {
  grid-template-columns:minmax(270px,.9fr) minmax(0,1.1fr);
  gap:16px
}
.panel {
  padding:20px
}
.effect-item {
  grid-template-columns:27px minmax(0,1fr);
  gap:10px;
  padding:12px
}
.grade-badge {
  width:27px;
  height:27px
}
.upgrade-button {
  grid-column:2;
  justify-self:start;
  min-width:85px
}
.builder-toolbar {
  flex-wrap:wrap
}
.builder-bottom {
  flex-wrap:wrap
}
.material>div {
  align-items:flex-start;
  flex-direction:column;
  gap:1px
}

}

@media(max-width:660px) {
  .app-shell {
  padding:0 16px
}
.site-header {
  height:72px;
  gap:15px
}
.brand {
  font-size:24px
}
.intro {
  padding:30px 0 24px
}
h1 {
  font-size:39px;
  letter-spacing:-1.6px
}
.odds-panel {
  padding:18px;
  margin-bottom:18px
}
.section-kicker {
  margin-bottom:18px
}
.stats-row {
  gap:12px;
  grid-template-columns:1.1fr 1fr 1fr
}
.stat+.stat {
  padding-left:12px
}
.stat strong {
  font-size:clamp(20px,5.8vw,27px);
  letter-spacing:-1px
}
.stat-label {
  font-size:14px
}
.stat-caption {
  display:none
}
.workspace {
  grid-template-columns:1fr;
  gap:18px
}
.equipment-picker {
  gap:12px
}
.equipment-card {
  padding:9px 10px 14px
}
.item-art {
  height:94px
}
.item-art img {
  width:68px;
  height:68px
}
.level-heading {
  margin-top:20px
}
.materials {
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:10px
}
.material {
  flex-direction:column;
  gap:5px;
  align-items:flex-start
}
.material>div {
  align-items:flex-start
}
.material span {
  font-size:14px;
  line-height:1.45;
  color:#b8b9c3;
  text-align:left
}
.material strong {
  font-size:16px;
  font-weight:600;
  white-space:nowrap
}
.undo-button {
  margin-top:18px
}
.builder-toolbar {
  flex-wrap:wrap
}
.effect-item {
  grid-template-columns:31px minmax(0,1fr) auto;
  padding:15px 11px;
  min-height:88px
}
.grade-badge {
  width:31px;
  height:31px
}
.upgrade-button {
  grid-column:auto;
  justify-self:stretch;
  min-width:65px;
  padding:7px
}
.effect-name {
  font-size:16px
}
.builder-description {
  font-size:14px
}
.builder-bottom {
  font-size:14px
}
.builder-bottom>span {
  font-size:14px
}
.action-status {
  min-height:16px
}
footer {
  flex-wrap:wrap;
  gap:12px;
  font-size:14px
}

.editor-grades {
  grid-template-columns:1fr
}
dialog {
  padding:20px
}
.dialog-header h2 {
  font-size:22px
}
.how-it-works {
  margin-bottom:24px
}

}

@media(max-width:360px) {
  .stat strong {
  font-size:23px
}
.stats-row {
  gap:8px
}
.stat+.stat {
  padding-left:8px
}
.effect-item {
  gap:8px
}
.upgrade-button {
  min-width:58px
}
.button {
  padding:9px 11px;
  font-size:14px
}

}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
  scroll-behavior:auto!important;
  transition:none!important;
  animation:none!important
}

}


/* Keep the next-attempt result visible while editing lower shell grades. */
.odds-panel { position: sticky; top: 12px; z-index: 3; box-shadow: 0 10px 30px #08090b66; }
#shell-builder, .effect-item { scroll-margin-top: 230px; }
@media(max-width:660px) { .odds-panel { top: 8px; } #shell-builder, .effect-item { scroll-margin-top: 160px; } }

/* Keep supporting text readable and let controls wrap on small screens. */
.action-status:empty { display:none; }
.text-button:not(:disabled):hover { background:#393126; border-color:var(--gold); }
@media(max-width:660px) {
  .stat-label { font-size:12px; }
  .material { min-width:0; }
  .material span { overflow-wrap:anywhere; }
}
@media(max-width:480px) {
  .effect-item { grid-template-columns:31px minmax(0,1fr); }
  .upgrade-button { grid-column:2; justify-self:start; min-width:100px; }
  .effect-meta { flex-wrap:wrap; }
}

.effect-group {
  display: grid;
  gap: 8px;
}
.effect-group + .effect-group { margin-top: 10px; }
.effect-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.add-effect, .remove-effect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  line-height: 1;
}
.add-effect { font-size: 22px; }
.remove-effect { font-size: 20px; }
.add-effect:hover:not(:disabled), .remove-effect:hover:not(:disabled) {
  border-color: var(--line);
  color: var(--gold);
  background: var(--surface-raised);
}
.add-effect:disabled, .remove-effect:disabled { opacity: .35; }
.editor-effect {
  display: flex;
  align-items: center;
  gap: 6px;
}
.editor-effect select { min-width: 0; }
.editor-add {
  margin-top: 8px;
  font-size: 13px;
}
.warning-message { color: var(--red); }
