/* ---------- Menu tools ---------- */

.menu-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.menu-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: #6e807d;
  background: #f4eee2;
  border: 1px solid #e8ddca;
  font-size: 10px;
  font-weight: 900;
  transition: transform 0.16s ease, background 0.16s ease;
}

.menu-tool:hover {
  transform: translateY(-1px);
  background: #eaf7f2;
  color: #367d78;
}

.menu-tool small {
  color: #c07919;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Combo speed ---------- */

.combo-speed {
  padding: 2px 5px;
  border-radius: 999px;
  color: #a85d0c;
  background: rgba(255, 255, 255, 0.48);
  font-size: 8.5px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ---------- Pause ---------- */

.pause-overlay {
  z-index: 20;
}

.pause-card {
  width: min(88vw, 390px);
  text-align: center;
}

.pause-actions {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.pause-actions .soft-btn {
  width: 100%;
}

.pause-note {
  margin: 12px 0 0;
  color: #a08876;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.text-btn {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  color: #b06a75;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}

.text-btn:hover {
  background: #fff0ee;
}

/* ---------- Settings ---------- */

.settings-overlay {
  z-index: 24;
}

.settings-card {
  width: min(calc(100vw - 32px), 520px);
  text-align: left;
}

.settings-card h2 {
  text-align: center;
}

.settings-group {
  margin-top: 15px;
  padding: 12px 13px;
  border-radius: 17px;
  background: #fff8ec;
  border: 1px solid #f1e3d0;
}

.settings-group h3 {
  margin: 0 0 6px;
  color: #5c6f6b;
  font-size: 12px;
  font-weight: 900;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #6e807d;
  font-size: 11px;
  font-weight: 800;
}

.settings-row output {
  color: #b57811;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.volume-range {
  width: 100%;
  margin: 9px 0 13px;
  accent-color: #2f9fa1;
}

.settings-select {
  min-height: 32px;
  max-width: 168px;
  padding: 0 9px;
  border-radius: 9px;
  color: #5c6f6b;
  background: #fffdf7;
  border: 1px solid #e6d7c3;
  font-size: 10px;
  font-weight: 700;
}

.settings-hint {
  margin: 7px 0 0;
  color: #a08876;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.5;
}

.settings-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.settings-actions .soft-btn {
  min-height: 36px;
  padding: 0 5px;
  font-size: 9.5px;
}

.danger-btn {
  color: #b85765;
  background: #fff0ee;
  border-color: #f2d4d3;
}

.danger-btn.is-armed {
  color: #fffdf7;
  background: #d86878;
  border-color: #c85263;
}

.save-status {
  min-height: 13px;
  margin: 7px 1px 0;
  color: #a08876;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
}

.save-status.is-error {
  color: #cf6070;
}

.save-status.is-success {
  color: #2d9b80;
}

/* ---------- Local leaderboard ---------- */

.board-overlay {
  z-index: 21;
}

.board-card {
  width: min(calc(100vw - 32px), 520px);
  text-align: left;
}

.board-card h2 {
  text-align: center;
}

.board-hint {
  margin: 5px 0 10px;
  color: #a08876;
  text-align: center;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.5;
}

.board-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f2eadb;
  border: 1px solid #ece0cc;
}

.board-tabs button {
  min-height: 32px;
  border-radius: 999px;
  color: #8a7a69;
  font-size: 10px;
  font-weight: 900;
  transition: background 0.16s ease, color 0.16s ease;
}

.board-tabs button.is-active {
  color: #2f7f7a;
  background: #fffdf7;
  box-shadow: 0 3px 10px rgba(64, 92, 88, 0.12);
}

.board-list {
  display: grid;
  gap: 6px;
  max-height: min(48vh, 340px);
  margin: 10px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  scrollbar-width: none;
}

.board-list::-webkit-scrollbar {
  display: none;
}

.board-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 13px;
  background: #fffaf0;
  border: 1px solid #f2e5d2;
}

.board-rank {
  width: 24px;
  flex: none;
  color: #a08876;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.board-row:nth-child(1) .board-rank {
  color: #c28a17;
  font-size: 18px;
}

.board-row:nth-child(2) .board-rank {
  color: #7d929b;
  font-size: 16px;
}

.board-row:nth-child(3) .board-rank {
  color: #b0714b;
  font-size: 15px;
}

.board-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.board-score {
  color: #405b57;
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.board-meta {
  overflow: hidden;
  color: #a08876;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-empty {
  margin: 18px 0 4px;
  padding: 20px 10px;
  border-radius: 14px;
  background: #f5f0e5;
  color: #a08876;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.6;
}

/* ---------- Fish dex ---------- */

.dex-overlay {
  z-index: 22;
}

.dex-card {
  width: min(calc(100vw - 32px), 780px);
  text-align: left;
}

.dex-card h2 {
  text-align: center;
}

.dex-progress {
  margin: 5px 0 6px;
  color: #8f7b68;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.dex-progress strong {
  color: #c07919;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.dex-badge {
  width: fit-content;
  margin: 0 auto 8px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #9a6711;
  background: linear-gradient(145deg, #fff3b2, #ffd76f);
  border: 1px solid #f0c75a;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 7px;
}

.dex-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 7px 6px 8px;
  border-radius: 14px;
  background: #fffaf0;
  border: 1px solid #f2e5d2;
}

.dex-item.is-locked {
  background: #eef4f1;
  border-color: #dbe7e2;
}

.dex-preview {
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 42%, rgba(146, 229, 220, 0.3), transparent 66%),
    #eaf8f4;
}

.dex-item.is-locked .dex-preview {
  background: #e3efeb;
}

.dex-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.dex-name {
  max-width: 100%;
  margin-top: 4px;
  overflow: hidden;
  color: #4f6562;
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dex-type {
  margin-top: 1px;
  color: #9aaba6;
  font-size: 7.5px;
  font-weight: 700;
}

.dex-meta {
  margin-top: 2px;
  color: #c07919;
  font-size: 10.5px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.dex-date {
  max-width: 100%;
  margin-top: 1px;
  color: #a9b6b1;
  text-align: center;
  font-size: 7px;
  font-weight: 600;
  line-height: 1.3;
}

.dex-item.is-locked .dex-name,
.dex-item.is-locked .dex-meta {
  color: #8fa39d;
}

.dex-hint {
  margin: 10px 0 0;
  color: #a08876;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
}

/* ---------- Result extras ---------- */

.result-extra {
  min-height: 14px;
  margin: 2px auto 6px;
  color: #a08876;
  text-align: center;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.45;
}

/* ---------- Motion preference ---------- */

html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  .menu-tool {
    min-height: 28px;
    padding: 0 10px;
    font-size: 9.5px;
  }

  .dex-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-card {
    width: min(calc(100vw - 32px), 460px);
  }

  .settings-actions {
    gap: 5px;
  }

  .settings-select {
    max-width: 142px;
  }

  .pause-card {
    width: min(90vw, 360px);
  }

  .board-row {
    padding: 8px 9px;
  }

  .board-score {
    font-size: 15px;
  }
}

@media (max-height: 520px) {
  .settings-group {
    margin-top: 9px;
    padding: 9px 11px;
  }

  .volume-range {
    margin: 6px 0 9px;
  }

  .dex-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .dex-preview {
    max-height: 58px;
  }

  .pause-actions {
    margin-top: 10px;
    gap: 5px;
  }

  .pause-note {
    display: none;
  }

  .board-hint {
    display: none;
  }

  .board-tabs {
    margin-top: 5px;
  }

  .board-tabs button {
    min-height: 28px;
  }

  .board-list {
    margin-top: 6px;
    max-height: 46vh;
  }

  .board-row {
    padding: 5px 8px;
  }

  .board-empty {
    margin-top: 8px;
    padding: 10px;
  }
}
