.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gacha-hero {
  position: relative;
  min-height: 490px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
  background: #0a1e34;
}
.gacha-hero::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(5, 21, 39, .24);
  content: "";
}
.gacha-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.gacha-hero-content {
  position: relative;
  z-index: 2;
  padding-block: 64px;
}
.gacha-breadcrumbs { color: #d9e9f4; }
.gacha-breadcrumbs a { color: inherit; }
.gacha-hero .eyebrow { color: #63e6be; }
.gacha-hero h1 {
  max-width: 660px;
  margin: 8px 0 18px;
  font-size: clamp(44px, 7vw, 78px);
  line-height: 1.02;
  text-shadow: 0 3px 14px rgba(0,0,0,.35);
}
.gacha-hero p:not(.eyebrow) {
  max-width: 560px;
  margin: 0 0 26px;
  font-size: 18px;
  font-weight: 750;
}

.simulator-band { padding: 70px 0 78px; background: #f4f8fa; }
.simulator-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 470px);
  align-items: end;
  gap: 36px;
  margin-bottom: 34px;
}
.simulator-heading h2, .guide-grid h2 {
  margin: 0;
  font-size: clamp(30px, 4.5vw, 48px);
  line-height: 1.2;
}
.simulator-heading > p { margin: 0; color: var(--ink-soft); }
.simulator-layout {
  display: grid;
  grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.control-panel {
  position: sticky;
  top: 88px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #cad8df;
  border-top: 6px solid var(--mint);
  border-radius: 6px;
  box-shadow: 0 14px 34px rgba(19,43,55,.08);
}
.control-section { padding: 24px; }
.control-section + .control-section { border-top: 1px solid #d9e3e7; }
.control-section h3 { margin: 3px 0 18px; font-size: 21px; line-height: 1.3; }
.step-label { color: var(--mint-dark); font-size: 11px; font-weight: 950; }
.field-label { display: block; margin-bottom: 7px; color: #30434d; font-size: 13px; font-weight: 900; }
.number-field {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 2px solid #78909c;
  background: #fff;
}
.number-field:focus-within { border-color: #11856c; outline: 3px solid rgba(99,230,190,.28); }
.number-field input {
  min-width: 0;
  width: 100%;
  height: 54px;
  padding: 6px 10px 6px 14px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 28px;
  font-weight: 950;
}
.number-field > span { padding: 0 14px 0 4px; font-size: 17px; font-weight: 900; }
.field-help { margin: 7px 0 12px; color: #63757e; font-size: 12px; }
.segment-control { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #b8c8cf; }
.segment-control button {
  min-width: 0;
  min-height: 38px;
  padding: 6px 2px;
  border: 0;
  border-right: 1px solid #b8c8cf;
  background: #f5f8f9;
  color: #324750;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.segment-control button:last-child { border-right: 0; }
.segment-control button:hover { background: #e7f6f1; }
.segment-control button.selected { background: #12333d; color: #fff; }
.paired-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compact-field {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  border: 1px solid #9eb0b8;
  background: #fff;
}
.compact-field:focus-within { border-color: #11856c; outline: 2px solid rgba(99,230,190,.28); }
.compact-field input { width: 100%; min-width: 0; padding: 8px 4px 8px 10px; border: 0; outline: 0; font-weight: 900; }
.compact-field b { padding-right: 9px; font-size: 12px; }
.confidence-presets { margin-top: 12px; }
.validation-message { min-height: 21px; margin: 0; padding: 0 24px; color: #b8322b; font-size: 12px; font-weight: 800; }
.calculate-button {
  width: calc(100% - 48px);
  min-height: 52px;
  margin: 8px 24px 24px;
  border: 2px solid var(--ink);
  background: var(--yellow);
  color: var(--ink);
  font-weight: 950;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}
.calculate-button:hover { transform: translate(1px,1px); box-shadow: 2px 2px 0 var(--ink); }

.result-panel { min-width: 0; }
.result-spotlight {
  min-height: 240px;
  display: grid;
  grid-template-columns: 190px minmax(0,1fr);
  align-items: center;
  gap: 34px;
  padding: 28px 34px;
  color: #fff;
  background: #102d38;
  border-left: 8px solid var(--mint);
}
.probability-ring {
  --probability: 228deg;
  width: 170px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--yellow) 0 var(--probability), #284a54 var(--probability) 360deg);
}
.probability-ring::before {
  width: 126px;
  aspect-ratio: 1;
  grid-area: 1 / 1;
  border-radius: 50%;
  background: #102d38;
  content: "";
}
.probability-ring span { position: relative; grid-area: 1 / 1; color: #fff; font-size: 22px; font-weight: 950; }
.result-kicker { margin: 0; color: var(--mint); font-size: 13px; font-weight: 950; }
.result-spotlight h3 { margin: 2px 0 8px; color: var(--yellow); font-size: clamp(44px, 7vw, 72px); line-height: 1; }
.result-spotlight p:not(.result-kicker):not(.condition-line) { margin: 0; font-size: 16px; }
.condition-line { display: inline-block; margin: 15px 0 0; padding: 4px 8px; background: #fff; color: #12333d; font-size: 12px; font-weight: 900; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin: 16px 0 28px; border: 1px solid #d0dde2; background: #fff; }
.summary-grid section { min-width: 0; padding: 18px 15px; border-right: 1px solid #d0dde2; }
.summary-grid section:last-child { border-right: 0; }
.summary-grid span, .summary-grid small { display: block; }
.summary-grid span { color: #526872; font-size: 12px; font-weight: 900; }
.summary-grid strong { display: block; margin: 3px 0 5px; color: #0f6f5b; font-size: clamp(20px, 3vw, 27px); line-height: 1.15; }
.summary-grid small { color: #72838a; font-size: 10px; line-height: 1.5; }

.result-section { margin-top: 22px; padding: 26px; border: 1px solid #ccd9de; border-radius: 6px; background: #fff; }
.result-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.result-section-heading > div { display: flex; align-items: center; gap: 10px; }
.result-section-heading h3 { margin: 0; font-size: 22px; }
.result-section-heading p { margin: 0; color: #61757e; font-size: 12px; font-weight: 800; }
.result-number { min-width: 34px; height: 28px; display: grid; place-items: center; background: var(--yellow); border: 1px solid var(--ink); font-size: 11px; font-weight: 950; }
.needed-draws-row { display: grid; grid-template-columns: minmax(210px,.7fr) minmax(0,1fr); align-items: center; gap: 24px; padding: 20px; background: #ecf8f4; border-left: 5px solid #39b98f; }
.needed-draws-row strong { display: block; color: #0b6653; font-size: clamp(38px,6vw,58px); line-height: 1; }
.needed-draws-row span { display: block; margin-top: 7px; color: #48656b; font-size: 12px; font-weight: 900; }
.needed-draws-row p { margin: 0; }
.confidence-list { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); margin-top: 16px; border: 1px solid #d5e0e4; }
.confidence-item { min-width: 0; padding: 12px 8px; border-right: 1px solid #d5e0e4; text-align: center; }
.confidence-item:last-child { border-right: 0; }
.confidence-item span, .confidence-item strong { display: block; }
.confidence-item span { color: #637780; font-size: 11px; font-weight: 850; }
.confidence-item strong { margin-top: 2px; font-size: 18px; }

.distribution-table-wrap { width: 100%; overflow-x: auto; }
.distribution-table { width: 100%; min-width: 580px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.distribution-table th, .distribution-table td { padding: 11px 10px; border-bottom: 1px solid #dce4e7; text-align: right; }
.distribution-table th { background: #edf4f5; color: #536871; font-size: 11px; }
.distribution-table th:first-child, .distribution-table td:first-child { text-align: left; font-weight: 900; }
.distribution-table td { font-size: 13px; }
.distribution-table td:nth-child(2) { color: #0c705b; font-weight: 900; }
.probability-bar { width: 150px; height: 8px; background: #dce7e9; }
.probability-bar i { display: block; width: var(--bar-width); height: 100%; background: var(--mint-dark); }
.calculation-note { margin: 18px 0 0; padding: 15px 17px; border-left: 5px solid var(--yellow); background: #fff8dc; color: #53646b; font-size: 12px; }

.guide-grid { display: grid; grid-template-columns: minmax(240px,.7fr) minmax(0,1fr); gap: 60px; align-items: start; }
.guide-points { border-top: 2px solid var(--ink); }
.guide-points section { display: grid; grid-template-columns: 160px 1fr; gap: 22px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.guide-points strong { color: #0c705b; }
.guide-points p { margin: 0; }

@media (max-width: 920px) {
  .simulator-layout { grid-template-columns: 1fr; }
  .control-panel { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .control-section.reverse-controls { grid-column: 1 / -1; }
  .control-section:nth-child(2) { border-top: 0; border-left: 1px solid #d9e3e7; }
  .validation-message, .calculate-button { grid-column: 1 / -1; }
  .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .summary-grid section:nth-child(2) { border-right: 0; }
  .summary-grid section:nth-child(-n+2) { border-bottom: 1px solid #d0dde2; }
  .confidence-list { grid-template-columns: repeat(5,minmax(82px,1fr)); overflow-x: auto; }
}

@media (max-width: 700px) {
  .gacha-hero { min-height: 470px; align-items: flex-end; }
  .gacha-hero::after { background: rgba(5,21,39,.55); }
  .gacha-hero-image { object-position: 68% center; }
  .gacha-hero-content { padding-block: 42px; }
  .gacha-hero h1 { font-size: 46px; }
  .gacha-hero p:not(.eyebrow) { max-width: 330px; font-size: 15px; }
  .simulator-band { padding: 48px 0 56px; }
  .simulator-heading { grid-template-columns: 1fr; gap: 14px; }
  .control-panel { display: block; }
  .control-section:nth-child(2) { border-top: 1px solid #d9e3e7; border-left: 0; }
  .result-spotlight { grid-template-columns: 120px minmax(0,1fr); gap: 18px; padding: 24px 18px; }
  .probability-ring { width: 116px; }
  .probability-ring::before { width: 84px; }
  .probability-ring span { font-size: 16px; }
  .result-spotlight h3 { font-size: 40px; }
  .result-spotlight p:not(.result-kicker):not(.condition-line) { font-size: 13px; }
  .needed-draws-row { grid-template-columns: 1fr; gap: 12px; }
  .distribution-table { min-width: 0; table-layout: fixed; }
  .distribution-table th, .distribution-table td { padding-inline: 7px; }
  .distribution-table th:nth-child(1), .distribution-table td:nth-child(1) { width: 24%; }
  .distribution-table th:nth-child(2), .distribution-table td:nth-child(2),
  .distribution-table th:nth-child(3), .distribution-table td:nth-child(3) { width: 38%; }
  .distribution-table th:nth-child(4), .distribution-table td:nth-child(4) { display: none; }
  .guide-grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 440px) {
  .gacha-hero { min-height: 440px; }
  .gacha-hero h1 { font-size: 40px; }
  .simulator-heading h2 { font-size: 31px; }
  .control-section { padding: 20px 18px; }
  .validation-message { padding-inline: 18px; }
  .calculate-button { width: calc(100% - 36px); margin-inline: 18px; }
  .result-spotlight { min-height: 0; grid-template-columns: 1fr; text-align: center; }
  .probability-ring { justify-self: center; }
  .condition-line { margin-top: 10px; }
  .summary-grid strong { font-size: 21px; }
  .summary-grid section { padding: 15px 11px; }
  .result-section { padding: 20px 14px; }
  .result-section-heading { align-items: flex-start; }
  .needed-draws-row { padding: 17px; }
  .confidence-list { grid-template-columns: repeat(5,76px); }
  .guide-points section { grid-template-columns: 1fr; gap: 4px; }
}
