.term {
  border-bottom: 1px dotted var(--accent-gold);
  cursor: help;
  position: relative;
}

.term-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--bg-panel);
  border: 1px solid var(--accent-gold);
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
  font-size: 0.8rem;
  color: var(--text-main);
  white-space: normal;
  width: 220px;
  z-index: 20;
  margin-bottom: 6px;
}

.term-tooltip.visible { display: block; }


.level-jump-links {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin: var(--space-md) 0 var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-hair);
  border-radius: 6px;
  background: var(--bg-panel);
}
.level-jump-links a { color: var(--accent-gold); }

@media (max-width: 600px) {
  .level-jump-links {
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 600px) {
  .term-tooltip {
    box-sizing: border-box !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 12px 12px 0 0;
    padding: 1.2rem;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 -6px 24px rgba(0,0,0,0.5);
    z-index: 200;
    border: 1px solid var(--accent-gold);
    border-bottom: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .term-tooltip.visible {
    display: block;
    animation: slideUpSheet 0.25s ease;
  }

  @keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .term-tooltip::after {
    content: 'Tap anywhere to close';
    display: block;
    margin-top: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
  }
}
