:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: #0d0f12;
  color: #d8dde6;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #0d0f12;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, #15191e 0, #0d0f12 220px),
    #0d0f12;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.toolbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(240px, 1.25fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 10px max(18px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid #2a3441;
  background: rgba(16, 19, 23, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #7d2d29;
  background: #b9443d;
  color: white;
  font: 800 21px Georgia, serif;
  transform: skew(-5deg);
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  color: #f2f4f8;
  font-size: 15px;
}

.brand small {
  margin-top: 3px;
  color: #8b93a1;
  font-size: 12px;
}

.live-pick {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 56px;
  padding: 6px 12px;
  border-left: 3px solid #d8a840;
  background: #171c21;
}

.live-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #303944;
  background: #11151a;
}

.live-icon img {
  display: none;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.live-icon img.visible {
  display: block;
}

.live-copy {
  min-width: 0;
}

.live-copy span,
.live-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-copy span {
  color: #8b93a1;
  font-size: 11px;
  text-transform: uppercase;
}

.live-copy strong {
  margin-top: 4px;
  color: #f4e2a5;
  font-size: 14px;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.draft-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #f4f6f8;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.draft-link:hover {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.08);
}

.volume-control {
  display: grid;
  gap: 4px;
  width: 100px;
  color: #8b93a1;
  font-size: 11px;
}

.volume-control input {
  width: 100%;
  accent-color: #d8a840;
}

.icon-button,
.roll-button {
  height: 40px;
  border: 1px solid #3b4653;
  border-radius: 4px;
  color: #edf0f5;
  cursor: pointer;
}

.icon-button {
  width: 40px;
  padding: 0;
  background: #1b222a;
  font-size: 22px;
}

.roll-button {
  min-width: 104px;
  padding: 0 20px;
  border-color: #8a332f;
  background: #b9443d;
  font-weight: 750;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: #26303a;
}

.roll-button:hover,
.roll-button:focus-visible {
  background: #cc5149;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid #ffd26a;
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

.categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}

.category {
  min-width: 0;
  padding-top: 11px;
  border-top: 3px solid var(--accent);
}

.category-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  margin: 0 0 8px;
}

.category-heading h2 {
  margin: 0;
  color: #edf0f5;
  font-size: 15px;
  text-transform: uppercase;
}

.category-heading span {
  color: #6f7885;
  font-size: 11px;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  grid-auto-rows: 72px;
  gap: 5px;
}

.item-cell {
  position: relative;
  display: grid;
  min-width: 0;
  height: 72px;
  place-items: center;
  overflow: hidden;
  border: 2px solid #2a3441;
  border-radius: 3px;
  background: #141a21;
  transition: border-color 90ms ease, background 90ms ease, transform 90ms ease, box-shadow 90ms ease;
}

.item-cell img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  filter: saturate(0.92);
}

.item-cell::after {
  position: absolute;
  right: 4px;
  bottom: 3px;
  min-width: 16px;
  padding: 1px 3px;
  border-radius: 2px;
  background: rgba(5, 7, 9, 0.76);
  color: #aeb5bf;
  content: attr(data-tier);
  font-size: 9px;
  text-align: center;
}

.item-cell.highlighted {
  z-index: 2;
  border-color: #ffd26a;
  background: #2a2316;
  box-shadow: 0 0 0 2px rgba(255, 210, 106, 0.24), 0 0 20px rgba(255, 210, 106, 0.16);
  transform: translateY(-1px);
}

.item-cell.highlighted.dimmed {
  border-color: #665b3d;
  box-shadow: none;
}

.item-cell.selected {
  z-index: 3;
  border-color: #1ccf74;
  background: #0d2a1a;
  box-shadow: 0 0 0 2px rgba(28, 207, 116, 0.2), 0 0 22px rgba(28, 207, 116, 0.18);
}

.boot-roulette {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 3px solid #65c68a;
}

.boot-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.boot-heading span {
  display: block;
  margin-bottom: 3px;
  color: #65c68a;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.boot-heading h2 {
  margin: 0;
  color: #edf0f5;
  font-size: 17px;
  text-transform: uppercase;
}

.boot-roll-button {
  min-width: 150px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid #32875a;
  border-radius: 4px;
  background: #19633d;
  color: #edf0f5;
  cursor: pointer;
  font-weight: 750;
}

.boot-roll-button:hover,
.boot-roll-button:focus-visible {
  background: #20794b;
}

.boot-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(58px, 112px));
  grid-auto-rows: 82px;
  gap: 7px;
}

.boot-grid .item-cell {
  height: 82px;
}

.boot-grid .item-cell img {
  width: 70px;
  height: 70px;
}

.boot-grid .item-cell::after {
  content: none;
}

.result-dialog {
  width: min(390px, calc(100vw - 30px));
  padding: 24px 24px 22px;
  overflow: visible;
  border: 1px solid #4b5867;
  border-top: 4px solid #1ccf74;
  border-radius: 6px;
  background: #12171c;
  color: #edf0f5;
  text-align: center;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.68);
}

.result-dialog::backdrop {
  background: rgba(4, 6, 8, 0.68);
  backdrop-filter: blur(4px);
}

.dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8b93a1;
  cursor: pointer;
  font-size: 26px;
}

.result-kicker {
  display: block;
  color: #60dda0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.result-image {
  display: block;
  width: min(240px, 66vw);
  height: min(240px, 66vw);
  margin: 16px auto;
  object-fit: contain;
}

.result-dialog h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 21px;
}

.result-dialog p {
  margin: 7px 0 0;
  color: #8b93a1;
  font-size: 13px;
}

@media (max-width: 820px) {
  .toolbar {
    position: relative;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 10px 14px 12px;
  }

  .live-pick {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .volume-control {
    display: none;
  }

  .categories {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .brand-mark {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 13px;
  }

  .controls {
    gap: 6px;
  }

  .roll-button {
    min-width: 88px;
    padding: 0 14px;
  }

  main {
    width: calc(100% - 20px);
    padding-top: 16px;
  }

  .item-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 68px;
    gap: 4px;
  }

  .item-cell {
    height: 68px;
  }

  .item-cell img {
    width: 56px;
    height: 56px;
  }

  .boot-heading {
    align-items: flex-end;
  }

  .boot-roll-button {
    min-width: 132px;
    padding: 0 12px;
    font-size: 13px;
  }

  .boot-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 66px;
    gap: 4px;
  }

  .boot-grid .item-cell {
    height: 66px;
  }

  .boot-grid .item-cell img {
    width: 54px;
    height: 54px;
  }
}

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