:root {
  --navy-900: #010a13;
  --navy-800: #0a1428;
  --navy-700: #091428;
  --grey-800: #1e2328;
  --grey-700: #1e282d;
  --gold-900: #463714;
  --gold-700: #785a28;
  --gold-500: #c8aa6e;
  --gold-300: #f0e6d2;
  --gold-text: #cdbe91;
  --blue-700: #005a82;
  --blue-500: #0397ab;
  --blue-300: #0ac8b9;
  --muted: #a09b8c;
  --danger: #e84057;

  --font-display: "Cinzel", "Times New Roman", serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
    "Open Sans", "Helvetica Neue", sans-serif;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--gold-300);
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse at top, rgba(0, 90, 130, 0.25), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(120, 90, 40, 0.15), transparent 60%),
    var(--navy-900);
  background-attachment: fixed;
}

img {
  display: block;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: var(--gold-500);
}
a:hover {
  color: var(--gold-300);
}

:focus-visible {
  outline: 2px solid var(--blue-300);
  outline-offset: 2px;
}

/* ---------- Header / footer ---------- */

.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1rem;
}

.header-portrait {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--gold-500);
  box-shadow: 0 0 0 3px var(--navy-900), 0 0 0 4px var(--gold-700);
}

.header-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-text p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.patch-badge {
  margin-left: auto;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--gold-700);
  background: linear-gradient(180deg, var(--grey-800), var(--navy-900));
  color: var(--gold-text);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}
.site-footer p {
  margin: 0.4rem auto;
  max-width: 70ch;
}
.site-footer .legal {
  font-size: 0.7rem;
  opacity: 0.8;
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Results fill the right column; the combo settings and chart sit under Garen and the target */
@media (min-width: 1101px) {
  .results {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
  .combo-panel {
    grid-column: 1;
    grid-row: 2;
  }
  .chart-panel {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
  }
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chart-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .chart-panel {
    grid-column: auto;
  }
}

@media (max-width: 700px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    padding: 0 0.75rem;
  }
  .site-header {
    gap: 0.75rem;
    padding: 1rem 0.75rem 0.75rem;
  }
  .header-portrait {
    width: 44px;
    height: 44px;
  }
  .header-text {
    flex: 1;
    min-width: 0;
  }
  .header-text h1 {
    font-size: 1.15rem;
  }
  .header-text p {
    display: none;
  }
  .patch-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.55rem;
  }
}

/* ---------- Panels ---------- */

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.25rem;
  border: 1px solid var(--gold-700);
  background: linear-gradient(180deg, rgba(10, 20, 40, 0.95), rgba(1, 10, 19, 0.95));
  box-shadow: inset 0 0 0 1px rgba(200, 170, 110, 0.08), 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Hextech corner accents */
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.panel::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--gold-500);
  border-left: 2px solid var(--gold-500);
}
.panel::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--gold-500);
  border-right: 2px solid var(--gold-500);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding-bottom: 0.7rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-300);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, var(--gold-500), rgba(120, 90, 40, 0.3), transparent) 1;
}
.panel-title img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--gold-700);
}

/* ---------- Fields ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--gold-text);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.field-header > span,
.field-header > label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.field-header output {
  min-width: 2.5ch;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold-300);
  text-align: right;
}

.inline-icon {
  width: 20px;
  height: 20px;
  border-radius: 3px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
}

/* ---------- Buttons ---------- */

.btn,
.step-btn,
.chip,
.icon-btn {
  cursor: pointer;
  border: 1px solid var(--gold-700);
  background: linear-gradient(180deg, var(--grey-700), var(--grey-800));
  color: var(--gold-text);
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}
.btn:hover,
.step-btn:hover,
.chip:hover,
.icon-btn:hover {
  border-color: var(--gold-500);
  color: var(--gold-300);
  box-shadow: 0 0 8px rgba(200, 170, 110, 0.25);
}

.btn {
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.step-btn {
  flex: none;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  line-height: 1;
}

.chip {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 2px;
}
.chip[aria-pressed="true"] {
  border-color: var(--gold-500);
  background: linear-gradient(180deg, var(--gold-700), var(--gold-900));
  color: var(--gold-300);
}

.icon-btn {
  width: 32px;
  height: 32px;
  font-size: 1.3rem;
  line-height: 1;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.stepper input[type="range"] {
  flex: 1;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ---------- Range slider ---------- */

input[type="range"] {
  --fill: 0%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border: 1px solid var(--gold-900);
  background: linear-gradient(90deg, var(--gold-500) var(--fill), var(--grey-800) var(--fill));
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border: 1px solid var(--gold-900);
  background: linear-gradient(90deg, var(--gold-500) var(--fill), var(--grey-800) var(--fill));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -7px;
  border: 2px solid var(--gold-500);
  border-radius: 50%;
  background: var(--navy-900);
  box-shadow: 0 0 6px rgba(200, 170, 110, 0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid var(--gold-500);
  border-radius: 50%;
  background: var(--navy-900);
  box-shadow: 0 0 6px rgba(200, 170, 110, 0.5);
}

/* ---------- Number / search inputs ---------- */

.number-input,
#itemSearch {
  border: 1px solid var(--gold-700);
  background: var(--navy-900);
  color: var(--gold-300);
  font: inherit;
}
.number-input {
  width: 5.5rem;
  padding: 0.3rem 0.5rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  text-align: right;
}
.number-input:focus,
#itemSearch:focus {
  border-color: var(--gold-500);
  outline: none;
  box-shadow: 0 0 0 1px var(--gold-500);
}

/* ---------- Rank pips ---------- */

.rank-rows {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.rank-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  align-items: center;
  gap: 0.5rem;
}
.rank-name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-text);
}
.rank-name .inline-icon {
  width: 24px;
  height: 24px;
  border: 1px solid var(--gold-700);
}

.rank-pips {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 0.4rem;
}
.rank-pips button {
  height: 36px;
  padding: 0;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--gold-900);
  background: var(--navy-900);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 1.05rem;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.rank-pips button:hover {
  border-color: var(--gold-500);
  color: var(--gold-300);
}
.rank-pips button[aria-checked="true"] {
  border-color: var(--gold-500);
  background: linear-gradient(180deg, var(--gold-500), var(--gold-700));
  color: var(--navy-900);
  box-shadow: 0 0 10px rgba(200, 170, 110, 0.35);
}

/* ---------- Item slots ---------- */

.item-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 72px));
  gap: 0.5rem;
  padding: 0.5rem;
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--gold-700);
  background: rgba(1, 10, 19, 0.7);
}

.item-slot-wrap {
  position: relative;
}

.item-slot {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  cursor: pointer;
  border: 1px solid var(--gold-900);
  background: var(--navy-900);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.8);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.item-slot:hover {
  border-color: var(--gold-500);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.8), 0 0 8px rgba(200, 170, 110, 0.35);
}
.item-slot.filled {
  border-color: var(--gold-700);
}
.item-slot img {
  width: 100%;
  height: 100%;
}
.slot-plus {
  color: var(--gold-900);
  font-size: 1.6rem;
  transition: color 0.15s;
}
.item-slot:hover .slot-plus {
  color: var(--gold-500);
}

.slot-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  padding: 0;
  cursor: pointer;
  border: 1px solid var(--gold-700);
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--gold-text);
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}
.item-slot-wrap:hover .slot-remove,
.slot-remove:focus-visible {
  opacity: 1;
}
.slot-remove:hover {
  border-color: var(--danger);
  color: var(--danger);
}
@media (hover: none) {
  .slot-remove {
    opacity: 1;
  }
}

/* ---------- Target panel ---------- */

.dummy {
  height: 11rem;
  margin: 0 auto;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
}
@media (max-width: 700px) {
  .dummy {
    height: 7rem;
  }
}

.switch {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-track {
  position: relative;
  flex: none;
  width: 42px;
  height: 22px;
  border: 1px solid var(--gold-700);
  border-radius: 11px;
  background: var(--navy-900);
  transition: background 0.2s, border-color 0.2s;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}
.switch input:checked + .switch-track {
  border-color: var(--blue-300);
  background: var(--blue-700);
}
.switch input:checked + .switch-track::after {
  transform: translateX(20px);
  background: var(--blue-300);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--blue-300);
  outline-offset: 2px;
}
.switch-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

/* ---------- Combo panel ---------- */

.subheading {
  margin: 0;
  color: var(--gold-500);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.modifier-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(120, 90, 40, 0.35);
}

.modifier {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.modifier-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: calc(42px + 0.7rem);
}
.modifier-body .field-header output {
  font-size: 1.05rem;
}
.modifier > .hint {
  padding-left: calc(42px + 0.7rem);
}

/* ---------- Results ---------- */

.headline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.headline-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem;
  border: 1px solid var(--gold-900);
  background: linear-gradient(180deg, rgba(120, 90, 40, 0.18), transparent);
}
.headline-stat.nearest {
  border-color: rgba(10, 200, 185, 0.3);
  background: linear-gradient(180deg, rgba(3, 151, 171, 0.18), transparent);
}
.headline-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.headline-value {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold-300);
}
.headline-stat.nearest .headline-value {
  color: var(--blue-300);
}
.headline-stat.health {
  border-color: rgba(232, 64, 87, 0.35);
  background: linear-gradient(180deg, rgba(232, 64, 87, 0.14), transparent);
}
.headline-stat.health .headline-value {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.kill-badge {
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--danger);
  background: rgba(232, 64, 87, 0.2);
  color: #ff8a9a;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.health-bar {
  display: flex;
  height: 14px;
  overflow: hidden;
  border: 1px solid var(--gold-700);
  background: var(--navy-900);
}
.health-segment {
  transition: width 0.25s ease;
}
.health-segment + .health-segment {
  border-left: 1px solid var(--navy-900);
}
.health-segment.lost {
  background: repeating-linear-gradient(135deg, var(--grey-800) 0 4px, var(--navy-900) 4px 8px);
}
.health-segment.left {
  background: linear-gradient(180deg, #d9454f, #8c1c26);
}
.health-segment.dealt-q,
.swatch.swatch-q {
  border-color: var(--gold-500);
  background: linear-gradient(180deg, var(--gold-500), var(--gold-700));
}
.health-segment.dealt-e,
.swatch.swatch-e {
  border-color: var(--blue-300);
  background: linear-gradient(180deg, var(--blue-300), var(--blue-700));
}
.health-segment.dealt-r,
.swatch.swatch-r {
  border-color: var(--gold-300);
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
}

.combo-row dt {
  flex-wrap: wrap;
}
.tag {
  padding: 0 0.35rem;
  border: 1px solid var(--gold-700);
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
  font-weight: 400;
}

.results .subheading {
  padding-top: 0.9rem;
  border-top: 1px solid rgba(120, 90, 40, 0.35);
}

.result-rows {
  margin: 0;
}
.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(120, 90, 40, 0.3);
}
.result-row dt {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gold-text);
}
.result-row dd {
  display: flex;
  gap: 1rem;
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.result-row dd > span {
  min-width: 4.5em;
  text-align: right;
  white-space: nowrap;
}
.result-row .nearest-value {
  color: var(--blue-300);
}
.result-head {
  padding-top: 0;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.result-head dd {
  color: var(--muted);
  font-weight: 600;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--gold-900);
  background: rgba(1, 10, 19, 0.6);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
.stat img {
  width: 22px;
  height: 22px;
}

@media (max-width: 420px) {
  .headline {
    grid-template-columns: 1fr;
  }
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Per-spin chart ---------- */

.chart {
  display: flex;
  gap: 0.4rem;
  height: 200px;
  padding: 0.5rem 0.25rem 0;
  border-bottom: 1px solid var(--gold-700);
}
.bar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.bar-track {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 0.2rem;
}
.bar-value {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--gold-text);
  white-space: nowrap;
}
.bar-fill {
  width: 100%;
  max-width: 56px;
  height: var(--height);
  min-height: 2px;
  border: 1px solid var(--gold-500);
  border-bottom: none;
  background: linear-gradient(180deg, var(--gold-500), var(--gold-900));
  transition: height 0.25s ease;
}
.bar.shredded .bar-fill {
  border-color: var(--blue-300);
  background: linear-gradient(180deg, var(--blue-300), var(--blue-700));
}
.bar.shredded .bar-value {
  color: var(--blue-300);
}
.bar-label {
  padding: 0.3rem 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.chart-legend > span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.swatch {
  width: 12px;
  height: 12px;
  border: 1px solid var(--gold-500);
  background: linear-gradient(180deg, var(--gold-500), var(--gold-900));
}
.swatch.shredded {
  border-color: var(--blue-300);
  background: linear-gradient(180deg, var(--blue-300), var(--blue-700));
}

@media (max-width: 700px) {
  .chart {
    height: 160px;
    gap: 0.2rem;
  }
  .bar-value {
    font-size: 0.6rem;
  }
}

/* ---------- Item picker ---------- */

dialog {
  width: min(760px, calc(100% - 1.5rem));
  max-height: min(85vh, 760px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--gold-500);
  background: var(--navy-800);
  color: var(--gold-300);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}
dialog[open] {
  display: flex;
}
dialog::backdrop {
  background: rgba(1, 10, 19, 0.8);
}

.picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  min-height: 0;
  padding: 1.25rem;
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
}

.picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.picker-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#itemSearch {
  width: 100%;
  padding: 0.55rem 0.75rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.item-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  align-content: start;
  gap: 0.5rem;
  padding: 0.25rem;
  scrollbar-color: var(--gold-700) var(--navy-900);
  scrollbar-width: thin;
}

.item-tile {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  cursor: pointer;
  border: 1px solid var(--gold-900);
  background: var(--navy-900);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.item-tile img {
  width: 100%;
  height: 100%;
}
.item-tile:hover,
.item-tile:focus-visible {
  border-color: var(--gold-500);
  box-shadow: 0 0 10px rgba(200, 170, 110, 0.4);
  transform: translateY(-1px);
}
.item-tile.current {
  border-color: var(--blue-300);
  box-shadow: 0 0 10px rgba(10, 200, 185, 0.4);
}
.item-tile[aria-disabled="true"] {
  cursor: not-allowed;
  filter: grayscale(1) brightness(0.5);
}
.item-tile[aria-disabled="true"]:hover {
  transform: none;
  box-shadow: none;
}
.tile-gold {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 0 0.2rem;
  background: rgba(1, 10, 19, 0.85);
  color: var(--gold-500);
  font-size: 0.65rem;
  font-weight: 600;
}

.grid-empty {
  grid-column: 1 / -1;
  margin: 1rem 0;
  color: var(--muted);
  text-align: center;
}

.picker-footer {
  display: flex;
  justify-content: flex-end;
}
.picker-footer:has(> [hidden]:only-child) {
  display: none;
}

.item-tooltip {
  position: fixed;
  z-index: 10;
  width: 250px;
  padding: 0.75rem;
  border: 1px solid var(--gold-700);
  background: var(--navy-900);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  font-size: 0.85rem;
}
.tooltip-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gold-900);
}
.tooltip-head img {
  width: 40px;
  height: 40px;
  border: 1px solid var(--gold-700);
}
.tooltip-head strong {
  display: block;
  color: var(--gold-300);
}
.tooltip-gold {
  color: var(--gold-500);
  font-size: 0.8rem;
}
.tooltip-stats {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}
.tooltip-stats li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.1rem 0;
}
.tooltip-stats img {
  width: 16px;
  height: 16px;
}
.tooltip-warning {
  margin: 0.5rem 0 0;
  color: var(--danger);
  font-size: 0.8rem;
}

@media (max-width: 700px) {
  .picker {
    padding: 0.9rem;
  }
  .item-grid {
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  }
}

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