.hd-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.hd-mode-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.hd-mode-btn {
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
}
.hd-mode-btn[aria-pressed="true"] {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}
.hd-mode-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.hd-play-actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.hd-canvas {
  max-width: 100%;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 3px var(--color-border);
  background: #6fb7e0;
  touch-action: none;
}

/* ---------- Pre-match screens (menu / character select / bracket) ---------- */
.hd-screen {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}
.hd-screen h2 {
  font-size: 1.1rem;
  margin: 0;
  text-align: center;
}
.hd-screen p.hd-screen__hint {
  color: var(--color-text-soft);
  font-size: 0.88rem;
  text-align: center;
  margin: -6px 0 0;
}

.hd-group {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hd-group__label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-soft);
}
.hd-toggle-row { display: flex; gap: 8px; flex-wrap: wrap; }
.hd-toggle-btn {
  flex: 1 1 auto;
  border: 2px solid var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-text);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 90px;
}
.hd-toggle-btn[aria-pressed="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-accent);
}
.hd-toggle-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.hd-char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  width: 100%;
}
.hd-char-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-align: center;
  color: var(--color-text);
}
.hd-char-card:hover { border-color: var(--color-primary); }
.hd-char-card--selected { border-color: var(--color-primary); background: rgba(79, 216, 224, 0.12); }
.hd-char-card__portrait {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 900; color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35);
}
.hd-char-card__name { font-weight: 800; font-size: 0.9rem; }
.hd-char-card__ability { font-size: 0.7rem; font-weight: 700; color: var(--color-primary); }
.hd-char-card__desc { font-size: 0.72rem; color: var(--color-text-soft); line-height: 1.35; }
.hd-char-card__skin {
  margin-top: 2px;
  font-size: 0.66rem;
  font-weight: 800;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--color-bg-alt);
  color: var(--color-text-soft);
  cursor: pointer;
}
.hd-char-card__skin[aria-pressed="true"] { background: #7a5c00; color: #ffd54f; border-color: #ffd54f; }

.hd-bracket {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.hd-bracket__round {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
  font-size: 0.88rem;
}
.hd-bracket__round--current { border-color: var(--color-primary); }
.hd-bracket__round--done { color: var(--color-text-soft); }
.hd-bracket__vs { color: var(--color-text-soft); font-weight: 600; }
.hd-bracket__winner { color: var(--color-success); }

.hd-trophy { font-size: 3rem; text-align: center; }

.hd-btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
