@import url("https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;700&display=swap");
@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://fonts.gstatic.com/s/pressstart2p/v15/e3t4euO8T-267oIAQAu6jDQyK0nS.ttf") format("truetype");
}

:root {
  --bg: #000;
  --off-text: #8f8f8f;
  --on-text: #00f048;
  --pure-white: #ffffff;
  --counter-blue: #7745ff;
  --panel: #111;
  --panel-light: #999;
  --focus: #fff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: #111;
  font-family: system-ui, sans-serif;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
  position: relative;
  z-index: 10;
}

.page {
  display: grid;
  place-items: center;
}

.launch-button {
  min-width: 14rem;
  min-height: 3rem;
  border: 3px solid #fff;
  background: #8cf52f;
  color: #000;
  font-weight: 700;
}

.tracker-page {
  width: 945px;
  height: 625px;
  min-height: 625px;
  overflow: hidden;
  background: var(--bg);
}

.tracker-shell {
  width: 945px;
  height: 625px;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.tracker-workspace {
  width: 925px;
  height: 600px;
  display: grid;
  grid-template-columns: 600px 300px;
  column-gap: 25px;
  align-items: start;
}

.tracker {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--bg);
}

.top-layout {
  position: relative;
  display: flex;
  width: 600px;
  height: 440px;
  overflow: hidden;
  z-index: 1;
}

.left-layout {
  position: relative;
  width: 160px;
  height: 440px;
  flex: 0 0 160px;
  overflow: hidden;
  background: var(--bg);
}

.grid-layout {
  display: grid;
  grid-template-columns: repeat(5, 88px);
  grid-template-rows: repeat(5, 88px);
  width: 440px;
  height: 440px;
  flex: 0 0 440px;
  background: var(--bg);
}

.layout-box,
.grid-cell {
  display: block;
}

.layout-box.is-off,
.grid-cell.is-off {
  opacity: 0.35;
  filter: grayscale(1);
}

.left-top {
  position: absolute;
  left: 0;
  top: 0;
  width: 160px;
  height: 140px;
  background: #e60000;
}

.left-gt {
  position: absolute;
  left: 0;
  top: 140px;
  width: 160px;
  height: 44px;
  background: #36d6df;
}

.left-row {
  position: absolute;
  left: 0;
  width: 160px;
  height: calc((440px - 140px - 44px) / 3);
}

.left-row-one {
  top: 184px;
  background: #1f54df;
}

.left-row-two {
  top: calc(184px + ((440px - 140px - 44px) / 3));
  background: #36d6df;
}

.left-row-three {
  top: calc(184px + (((440px - 140px - 44px) / 3) * 2));
  background: #1f54df;
}

.grid-cell {
  width: 88px;
  height: 88px;
  background: transparent;
}

.grid-cell:nth-child(even) {
  background: transparent;
}

/* Bottom dungeon layout */
.bottom-layout {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 84px);
  column-gap: 2px;
  width: 600px;
  height: 160px;
  background: var(--bg);
  z-index: 2;
}

.bottom-dungeon {
  position: relative;
  width: 84px;
  height: 160px;
  overflow: hidden;
  background: var(--bg);
}

.bottom-dungeon + .bottom-dungeon::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #2a2a2a;
  pointer-events: none;
  z-index: 3;
}

.bottom-dungeon button {
  position: absolute;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--bg);
  color: var(--off-text);
  font-family: "Press Start 2P", system-ui, sans-serif;
  line-height: 1;
}

.bottom-dungeon button.is-on {
  color: var(--on-text);
}

.dungeon-name {
  left: 0;
  top: 0;
  width: 84px;
  height: 40px;
  font-size: 24px;
  letter-spacing: -2px;
}

.prize {
  left: 0;
  top: 40px;
  width: 84px;
  height: 40px;
  color: #000;
  font-family: system-ui, sans-serif;
  font-size: 12px;
}

.prize-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--panel-light);
  color: #000;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.35;
  filter: grayscale(1);
}

.prize.is-on .prize-icon {
  opacity: 1;
  filter: none;
}

.item-count {
  left: 0;
  top: 80px;
  width: 42px;
  height: 40px;
  font-size: 18px;
  z-index: 1;
}

.big-key {
  left: 42px;
  top: 84px;
  width: 32px;
  height: 32px;
  z-index: 2;
  color: #000;
  font-family: system-ui, sans-serif;
  font-size: 10px;
}

.big-key::before {
  content: "32x32";
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--panel-light);
  color: #000;
  opacity: 0.35;
  filter: grayscale(1);
}

.big-key.is-on::before {
  opacity: 1;
  filter: none;
}

.key-count {
  left: 0;
  top: 120px;
  width: 84px;
  height: 40px;
  font-size: 24px;
  z-index: 1;
}


.item-count,
.key-count {
  color: var(--pure-white);
  opacity: 1;
  filter: none;
}

.item-count {
  background: var(--counter-blue);
  transition:
    background-color 120ms linear,
    color 120ms linear;
}

.item-count.is-zero,
.key-count.is-zero {
  color: var(--off-text);
}

.item-count.is-zero {
  background: #000000;
}

.prize-icon {
  position: relative;
}

.prize-icon.prize-image {
  background:
    linear-gradient(135deg, #d8d8d8, #888888);
  color: #000;
  font-size: 11px;
  font-weight: 700;
}


/* Left horizontal dungeon rows */
.left-dungeon-row {
  position: absolute;
  left: 0;
  width: 160px;
  height: calc((440px - 140px - 44px) / 3);
  overflow: hidden;
  background: var(--bg);
}

.left-dungeon-row.left-row-one {
  top: 184px;
}

.left-dungeon-row.left-row-two {
  top: calc(184px + ((440px - 140px - 44px) / 3));
}

.left-dungeon-row.left-row-three {
  top: calc(184px + (((440px - 140px - 44px) / 3) * 2));
}

.left-dungeon-row button {
  position: absolute;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--bg);
  color: var(--off-text);
  font-family: "Press Start 2P", system-ui, sans-serif;
  line-height: 1;
}

.left-dungeon-row button.is-on {
  color: var(--on-text);
}

.left-dungeon-row .dungeon-name {
  left: 0;
  top: 0;
  width: 80px;
  height: 42px;
  font-size: 24px;
  letter-spacing: -2px;
}

.left-dungeon-row .prize {
  left: 20px;
  top: 42px;
  width: 40px;
  height: 40px;
}

.left-dungeon-row .item-count {
  left: 80px;
  top: 0;
  width: 40px;
  height: 42px;
  font-size: 18px;
}

.left-dungeon-row .big-key {
  left: 120px;
  top: 5px;
  width: 32px;
  height: 32px;
}

.left-dungeon-row .key-count {
  left: 80px;
  top: 42px;
  width: 80px;
  height: 40px;
  font-size: 24px;
}

.left-dungeon-row .prize-icon {
  width: 40px;
  height: 40px;
}


/* GT dungeon row */
.gt-dungeon-row {
  position: absolute;
  left: 0;
  top: 140px;
  width: 160px;
  height: 44px;
  display: grid;
  grid-template-columns: 80px 40px 40px;
  grid-template-rows: 44px;
  overflow: hidden;
  background: var(--bg);
}

.gt-dungeon-row button {
  position: static;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--off-text);
  font-family: "Press Start 2P", system-ui, sans-serif;
  line-height: 1;
}

.gt-dungeon-row button.is-on {
  color: var(--on-text);
}

.gt-dungeon-row .dungeon-name {
  width: 80px;
  height: 44px;
  font-size: 24px;
  letter-spacing: -2px;
}

.gt-dungeon-row .item-count {
  width: 40px;
  height: 44px;
  font-size: 18px;
}

.gt-dungeon-row .big-key-cell {
  position: relative;
  width: 40px;
  height: 44px;
  background: var(--bg);
}

.gt-dungeon-row .big-key {
  position: absolute;
  left: 4px;
  top: 6px;
  width: 32px;
  height: 32px;
}

.gt-dungeon-row .big-key::before {
  content: "";
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: transparent;
  background-image: url("assets/bigkey.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  color: transparent;
  opacity: 0.35;
  filter: grayscale(1);
}

.gt-dungeon-row .big-key.is-on::before {
  opacity: 1;
  filter: none;
}

.gt-dungeon-row .key-count {
  width: 40px;
  height: 44px;
  font-size: 22px;
}

/* Override the old left-gt button styles now that this is a section */
.left-gt.gt-dungeon-row {
  background: var(--bg);
}


/* GT row correction: four real sections */
.gt-dungeon-row {
  grid-template-columns: 48px 40px 32px 40px;
}

.gt-dungeon-row .dungeon-name {
  width: 48px;
  height: 44px;
  font-size: 18px;
  letter-spacing: -1px;
}

.gt-dungeon-row .item-count {
  width: 40px;
  height: 44px;
}

.gt-dungeon-row .big-key-cell {
  width: 32px;
  height: 44px;
}

.gt-dungeon-row .big-key {
  left: 0;
  top: 6px;
  width: 32px;
  height: 32px;
}

.gt-dungeon-row .key-count {
  width: 40px;
  height: 44px;
}


/* Top-left layered item panel */
.top-item-panel {
  position: absolute;
  left: 0;
  top: 0;
  width: 160px;
  height: 140px;
  overflow: hidden;
  background: var(--bg);
}

.top-item-panel button {
  position: absolute;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.top-item-panel .top-main-item {
  left: 16px;
  top: 6px;
  width: 128px;
  height: 128px;
}

.top-item-panel .top-main-icon {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  background: var(--panel-light);
  color: #000;
  font: 700 14px/1 system-ui, sans-serif;
}

.top-item-panel .top-small-item {
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  z-index: 4;
}

.top-item-panel .top-small-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--panel-light);
  color: #000;
  font: 700 9px/1 system-ui, sans-serif;
  opacity: 0.45;
  filter: grayscale(1);
}

.top-item-panel .top-small-item.is-active .top-small-icon {
  opacity: 0.72;
}

.top-item-panel .top-right-item {
  right: 0;
  top: 0;
  width: 64px;
  height: 64px;
  z-index: 3;
}

.top-item-panel .top-right-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  background: var(--panel-light);
  color: #000;
  font: 700 12px/1 system-ui, sans-serif;
}

.top-item-panel .top-right-item.is-off .top-right-icon {
  display: none;
}

.top-item-panel .top-shield-item {
  left: 15px;
  bottom: 6px;
  width: 64px;
  height: 64px;
  z-index: 6;
}

.top-item-panel .top-shield-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  background: var(--panel-light);
}

.top-item-panel .top-shield-item.is-off .top-shield-icon {
  display: none;
}

.top-item-panel .moon-pearl-item {
  right: 0;
  bottom: 0;
  width: 48px;
  height: 48px;
  z-index: 5;
}

.top-item-panel .moon-pearl-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--panel-light);
  color: #000;
  font: 700 12px/1 system-ui, sans-serif;
  opacity: 0.35;
  filter: grayscale(1);
}

.top-item-panel .moon-pearl-item.is-on .moon-pearl-icon {
  opacity: 1;
  filter: none;
}


/* Main item grid cleanup */
.grid-layout {
  background: #000;
  gap: 0;
}

.grid-cell {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  background: transparent;
}

.grid-cell::before {
  content: none;
}

.grid-cell:nth-child(even) {
  background: transparent;
}

.grid-item-icon {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  background: #7fc4ff;
  color: #000;
  font: 700 14px/1 system-ui, sans-serif;
  opacity: 0.35;
  filter: grayscale(1);
  transition:
    opacity 120ms linear,
    filter 120ms linear,
    transform 120ms linear;
}

.grid-cell.is-on .grid-item-icon {
  opacity: 1;
  filter: none;
}


/* Medallion requirement overlays for row 2, columns 3-5 */
.grid-medallion {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 80px;
  height: 28px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1;
  z-index: 2;
}

.grid-medallion.is-empty {
  background: transparent;
}


/* Row 4, box 1 split into four independent 40x40 items */
.grid-cell.has-mini-grid .grid-item-icon {
  display: none;
}

.grid-mini-box {
  display: grid;
  grid-template-columns: repeat(2, 40px);
  grid-template-rows: repeat(2, 40px);
  gap: 0;
  width: 80px;
  height: 80px;
  z-index: 1;
}

.grid-mini-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: #7fc4ff;
  color: #000;
  font: 700 10px/1 system-ui, sans-serif;
  opacity: 0.35;
  filter: grayscale(1);
}

.grid-mini-item.is-on {
  opacity: 1;
  filter: none;
}


/* Final row HC/AT split cells */
.grid-cell.has-hc-at-text,
.grid-cell.has-hc-at-keys {
  display: grid;
  place-items: center;
}

.grid-cell.has-hc-at-text .grid-item-icon,
.grid-cell.has-hc-at-keys .grid-item-icon {
  display: none;
}

.hc-at-grid,
.hc-at-key-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 44px);
  grid-template-rows: repeat(2, 44px);
  width: 88px;
  height: 88px;
  z-index: 1;
}

.hc-at-grid::before,
.hc-at-key-grid::before {
  content: "";
  position: absolute;
  left: 0;
  top: 44px;
  right: 0;
  height: 1px;
  background: #2a2a2a;
  pointer-events: none;
  z-index: 2;
}

.hc-at-cell,
.hc-at-key-cell {
  position: static;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: #000;
  color: var(--off-text);
  font-family: "Press Start 2P", system-ui, sans-serif;
  line-height: 1;
}

.hc-at-name {
  font-size: 16px;
  letter-spacing: -1px;
}

.hc-at-count {
  font-size: 16px;
  color: #ffffff;
  background: var(--counter-blue);
}

.hc-at-count.is-zero {
  color: var(--off-text);
  background: #000;
}

.hc-at-big-key {
  font: 700 9px/1 system-ui, sans-serif;
}

.hc-at-big-key::before {
  content: "32x32";
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--panel-light);
  color: #000;
  opacity: 0.35;
  filter: grayscale(1);
}

.hc-at-big-key.is-on::before {
  opacity: 1;
  filter: none;
}

.hc-at-name.is-on {
  color: var(--on-text);
}

.hc-at-key-count {
  color: #ffffff;
  font-size: 18px;
}

.hc-at-key-count.is-zero {
  color: var(--off-text);
}

.hc-at-empty {
  pointer-events: none;
}

.nonkeys-hc-grid {
  display: grid;
  grid-template-rows: repeat(2, 44px);
  width: 88px;
  height: 88px;
  z-index: 1;
}

.nonkeys-hc-grid .hc-at-cell {
  width: 88px;
  height: 44px;
}

.tracker-mode-nonkeysanity .bottom-dungeon .item-count,
.tracker-mode-nonkeysanity .left-dungeon-row .item-count,
.tracker-mode-nonkeysanity .gt-dungeon-row .item-count {
  display: none;
}

.tracker-mode-nonkeysanity .bottom-dungeon .big-key {
  left: 26px;
  top: 84px;
}

.tracker-mode-nonkeysanity .left-dungeon-row .big-key {
  left: 104px;
  top: 5px;
}

.tracker-mode-nonkeysanity .left-dungeon-row.left-row-three .key-count {
  height: 36px;
  font-size: 22px;
}

.tracker-mode-nonkeysanity .gt-dungeon-row {
  grid-template-columns: 48px 40px 72px;
}

.tracker-mode-nonkeysanity .gt-dungeon-row .big-key-cell {
  width: 40px;
}

.tracker-mode-nonkeysanity .gt-dungeon-row .big-key {
  left: 4px;
}

.tracker-mode-nonkeysanity .gt-dungeon-row .key-count {
  width: 72px;
}

/* Real image integration */
img {
  display: block;
  max-width: 100%;
}

.grid-item-icon,
.grid-mini-item,
.top-main-icon,
.top-small-icon,
.top-right-icon,
.top-shield-icon,
.moon-pearl-icon,
.prize-icon {
  background: transparent !important;
  color: inherit;
}

.grid-item-icon img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.grid-mini-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.top-main-icon img {
  width: 128px;
  height: 128px;
  object-fit: contain;
}

.top-small-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.top-right-icon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.top-shield-icon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.moon-pearl-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.prize-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.grid-cell.is-on .grid-item-icon,
.grid-mini-item.is-on,
.top-right-item:not(.is-off) .top-right-icon,
.top-shield-item:not(.is-off) .top-shield-icon,
.moon-pearl-item.is-on .moon-pearl-icon,
.prize.is-on .prize-icon {
  opacity: 1;
  filter: none;
}

.grid-cell:not(.is-on) .grid-item-icon,
.grid-mini-item:not(.is-on),
.top-right-item.is-off .top-right-icon,
.top-shield-item.is-off .top-shield-icon,
.moon-pearl-item:not(.is-on) .moon-pearl-icon,
.prize:not(.is-on) .prize-icon {
  opacity: 0.35;
  filter: grayscale(1);
}

.top-small-icon.is-heart-zero,
.top-small-icon.is-heart-zero img {
  opacity: 0.45;
  filter: grayscale(1);
}

.top-small-icon:not(.is-heart-zero),
.top-small-icon:not(.is-heart-zero) img {
  opacity: 0.75;
  filter: none;
}

.top-right-item.is-off .top-right-icon {
  display: none;
}

.top-shield-item.is-off .top-shield-icon {
  display: none;
}

.big-key::before,
.hc-at-big-key::before {
  content: "";
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: transparent;
  background-image: url("assets/bigkey.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  color: transparent;
  opacity: 0.35;
  filter: grayscale(1);
}

.big-key.is-on::before,
.hc-at-big-key.is-on::before {
  opacity: 1;
  filter: none;
}

.prize-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  color: #ffffff;
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 24px;
  line-height: 1;
  opacity: 1;
  filter: none;
}

.prize-icon.is-question {
  color: #ffffff;
}

.prize.is-on .prize-icon.is-question,
.prize:not(.is-on) .prize-icon.is-question {
  opacity: 1;
  filter: none;
}


/* Targeted polish pass */
.item-count,
.key-count,
.hc-at-count,
.hc-at-key-count,
.gt-dungeon-row .item-count,
.gt-dungeon-row .key-count,
.left-dungeon-row .item-count,
.left-dungeon-row .key-count,
.bottom-dungeon .item-count,
.bottom-dungeon .key-count {
  color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
  background: transparent !important;
  background-color: transparent !important;
}

.item-count.is-zero,
.key-count.is-zero,
.hc-at-count.is-zero,
.hc-at-key-count.is-zero {
  color: #ffffff !important;
  background: transparent !important;
  background-color: transparent !important;
}

.left-dungeon-row,
.left-dungeon-row.left-row-one,
.left-dungeon-row.left-row-two,
.left-dungeon-row.left-row-three {
  background: #000000 !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.left-dungeon-row::before,
.left-dungeon-row::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 1px;
  display: block !important;
  background: #2a2a2a;
  pointer-events: none;
  z-index: 5;
}

.left-dungeon-row.left-row-one::after {
  content: none;
  display: none !important;
}

.top-item-panel .top-right-item {
  top: 10px !important;
  right: 15px !important;
}

.prize-icon.is-question {
  font-family: "Pixelify Sans", system-ui, sans-serif !important;
  font-size: 30px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
}


/* Hard fix: heart counter must never be transparent */
.top-small-item,
.top-small-item *,
.top-small-item .top-small-icon,
.top-small-item .top-small-icon img,
.top-small-item img,
.top-small-item img.is-off {
  opacity: 1 !important;
}

.top-small-item .top-small-icon,
.top-small-item .top-small-icon img,
.top-small-item img {
  filter: none !important;
}

/* QUsb2Snes controls */
.tracker-page {
  height: 690px;
  min-height: 690px;
}

.tracker-shell {
  width: 945px;
  height: 690px;
  grid-template-rows: 600px auto;
  align-content: center;
  gap: 8px;
}

.autotrack-panel {
  width: 925px;
  min-height: 48px;
  padding: 4px 0 0;
  background: #000;
  color: #fff;
  font-family: system-ui, sans-serif;
}

.autotrack-controls {
  display: flex;
  align-items: end;
  gap: 6px;
}

.autotrack-button {
  position: static;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid #555;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.autotrack-button:hover {
  background: #1b1b1b;
}

.autotrack-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.autotrack-status {
  margin: 4px 0 0;
  color: #aaa;
  font-size: 9px;
  line-height: 1.2;
}

.autotrack-status.is-connected {
  color: #63ff82;
}

.autotrack-status.is-error {
  color: #ff6868;
}

.autotrack-status.is-connecting {
  color: #ffd166;
}

.map-tracker {
  position: relative;
  width: 300px;
  height: 600px;
  overflow: hidden;
  background: #000;
}

.map-tracker-image {
  display: block;
  width: 300px;
  height: 600px;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.map-pin-layer {
  position: absolute;
  inset: 0;
}

.map-pin {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid #101010;
  border-radius: 50%;
  background: #35ff68;
  box-shadow: 0 0 0 1px #fff, 0 2px 4px rgb(0 0 0 / 0.75);
  transform: translate(-50%, -50%);
}

.map-pin[data-state="checked"] {
  background: transparent;
  border-color: #222;
  box-shadow: none;
  opacity: 1;
}

.map-pin:hover,
.map-pin:focus-visible {
  z-index: 5;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.map-hover-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  display: grid;
  align-items: center;
  padding: 3px 6px;
  overflow: hidden;
  background: rgb(119 69 255 / 0.62);
  color: #fff;
  font: 400 11px/1 "Press Start 2P", system-ui, sans-serif;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}


/* Settings launcher */
.launcher-page {
  min-height: 100svh;
  display: block;
  background: #000;
  color: #fff;
  font-family: "Press Start 2P", system-ui, sans-serif;
}

.settings-shell {
  width: min(1100px, calc(100vw - 32px));
  margin: 16px auto 28px;
}

.settings-panel {
  display: grid;
  gap: 16px;
}

.settings-card {
  border: 3px solid #fff;
  background: #080808;
  padding: 16px;
}

.settings-card-main {
  min-height: 620px;
}

.settings-header-row {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.settings-card h1,
.settings-card h2,
.settings-card summary {
  margin: 0 0 14px;
  color: #fff;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -1px;
}

.settings-card h1 {
  font-size: 18px;
}

.settings-card h2 {
  margin-top: 18px;
  font-size: 15px;
}

.settings-card summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.settings-card summary span {
  margin-left: 12px;
  color: #9f78ff;
  font: 10px/1 system-ui, sans-serif;
}

.next-race {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 12px/1.2 system-ui, sans-serif;
}

.preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.preset-grid-compact {
  max-width: 520px;
}

.preset-button,
.launch-tracker-button {
  min-height: 38px;
  border: 4px solid #7745ff;
  background: #101010;
  color: #fff;
  padding: 0 14px;
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.1;
  text-transform: uppercase;
}

.preset-button:hover,
.preset-button:focus-visible,
.launch-tracker-button:hover,
.launch-tracker-button:focus-visible,
.preset-button.is-selected {
  border-color: #35ff68;
  outline: 0;
}

.preset-button-small {
  min-height: 38px;
}

.preset-button-wide {
  min-width: 250px;
}

.mode-row,
.import-row,
.connection-row,
.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

select,
input[type="text"],
input[type="url"] {
  min-height: 40px;
  border: 3px solid #fff;
  background: #111;
  color: #fff;
  padding: 0 10px;
  font: 14px/1 system-ui, sans-serif;
}

select {
  min-width: 275px;
}

input[type="url"] {
  width: min(275px, 100%);
}

.display-settings {
  padding: 18px;
}

.display-settings h2 {
  margin-top: 0;
}

.setting-row,
.inline-options,
.connection-row,
.remember-row {
  margin-top: 16px;
}

.inline-options {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border: 0;
  padding: 0;
}

.inline-options legend {
  padding: 0;
  margin-right: 4px;
  font-size: 12px;
}

.inline-options label,
.connection-row label,
.setting-row label,
.remember-row,
.import-row span {
  color: #fff;
  font: 12px/1.2 system-ui, sans-serif;
}

.inline-options input,
.remember-row input {
  accent-color: #7745ff;
}

.connection-row input {
  width: 280px;
  margin-left: 8px;
}

.launch-tracker-button {
  justify-self: center;
  min-width: 390px;
  min-height: 76px;
  border-color: #35ff68;
  font-size: 25px;
  letter-spacing: 1px;
}

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


/* Simple mode launcher */
.launcher-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: #000;
  color: #fff;
  font-family: "Press Start 2P", system-ui, sans-serif;
}

.simple-launcher {
  width: min(760px, calc(100vw - 32px));
}

.simple-launcher-card {
  border: 3px solid #fff;
  background: #080808;
  padding: 24px;
}

.simple-launcher h1 {
  margin: 0 0 24px;
  font-size: 22px;
  line-height: 1.2;
}

.mode-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border: 0;
  padding: 0;
  margin: 0;
}

.mode-picker legend {
  width: 100%;
  margin: 0 0 8px;
  font-size: 15px;
}

.mode-button,
.launch-tracker-button {
  min-height: 42px;
  border: 4px solid #7745ff;
  background: #101010;
  color: #fff;
  padding: 0 16px;
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.1;
  text-transform: uppercase;
  cursor: pointer;
}

.mode-button.is-selected,
.mode-button:hover,
.mode-button:focus-visible,
.launch-tracker-button:hover,
.launch-tracker-button:focus-visible {
  border-color: #35ff68;
  outline: 0;
}

.connection-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 24px 0;
}

.connection-settings label {
  display: grid;
  gap: 6px;
  color: #fff;
  font: 12px/1.2 system-ui, sans-serif;
}

.connection-settings input {
  width: 220px;
  min-height: 40px;
  border: 3px solid #fff;
  background: #111;
  color: #fff;
  padding: 0 10px;
  font: 14px/1 system-ui, sans-serif;
}

.launch-tracker-button {
  display: block;
  min-width: 360px;
  min-height: 76px;
  margin: 12px auto 0;
  border-color: #35ff68;
  font-size: 24px;
}


/* Counter text colors are applied inline by script.js */
.key-count,
.hc-at-key-count {
  color: inherit;
}


/* Keep key counters visible while allowing script.js to choose white or green */
.key-count,
.left-key-count,
.bottom-key-count,
.hc-at-key-count {
  color: inherit !important;
  opacity: 1 !important;
}


.prize-icon img[src$="map.png"] {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
