@keyframes hgsFadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.hgs-app {
  background: var(--card, #15211b);
  border: 1px solid rgba(223, 177, 82, 0.28);
  border-radius: var(--radius, 14px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48);
  overflow: hidden;
  color: var(--text, #f3efe6);
}
.hgs-ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(90deg, #0d1511 0%, #14221a 100%);
  color: #f3efe6;
  border-bottom: 1px solid rgba(223, 177, 82, 0.34);
}
.hgs-ribbon-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.hgs-phase-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(223, 177, 82, 0.16);
  border: 1px solid rgba(223, 177, 82, 0.42);
  color: var(--accent, #dfb152);
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hgs-phase-title {
  font-weight: 700;
  font-size: 15px;
}
.hgs-counters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--muted, #9eb0a4);
}
.hgs-counter-pill strong {
  color: var(--accent, #dfb152);
}
.hgs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: #101813;
  border-bottom: 1px solid rgba(214, 228, 217, 0.1);
}
.hgs-field-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text, #f3efe6);
}
.hgs-field-group label {
  font-weight: 600;
  color: var(--muted, #9eb0a4);
  font-size: 12px;
}
.hgs-select,
.hgs-input,
.hgs-textarea {
  font: inherit;
  font-size: 14px;
  color: var(--text, #f3efe6);
  background: #1b2a22;
  border: 1px solid rgba(214, 228, 217, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 40px;
}
.hgs-textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}
.hgs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.hgs-btn:active { transform: scale(0.98); }
.hgs-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.hgs-btn-primary { background: var(--primary, #2d7d52); color: #ffffff; }
.hgs-btn-primary:hover:not(:disabled) { background: #226441; }
.hgs-btn-accent { background: var(--accent, #dfb152); color: #0b110e; font-weight: 700; }
.hgs-btn-accent:hover:not(:disabled) { background: #ecc46e; }
.hgs-btn-outline { background: rgba(255, 255, 255, 0.04); color: var(--text, #f3efe6); border-color: rgba(214, 228, 217, 0.18); }
.hgs-btn-outline:hover:not(:disabled) { background: rgba(255, 255, 255, 0.09); border-color: rgba(223, 177, 82, 0.45); }
.hgs-btn-sm { min-height: 34px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.hgs-status-line {
  padding: 8px 20px;
  background: rgba(45, 125, 82, 0.22);
  border-bottom: 1px solid rgba(45, 125, 82, 0.4);
  color: #b7ebd0;
  font-size: 13px;
  font-weight: 600;
}
.hgs-panel {
  padding: 16px 20px;
  background: #0f1712;
  border-bottom: 1px solid rgba(214, 228, 217, 0.1);
}
.hgs-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.hgs-option-box {
  background: #15211b;
  border: 1px solid rgba(214, 228, 217, 0.12);
  border-radius: 10px;
  padding: 14px;
}
.hgs-box-title {
  margin: 0 0 10px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent, #dfb152);
}
.hgs-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-top: 8px;
  cursor: pointer;
}
.hgs-seed-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.hgs-seed-row .hgs-input {
  flex: 1 1 130px;
  min-width: 0;
  font-family: var(--font-mono, monospace);
}
.hgs-custom-builder {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.hgs-custom-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}
.hgs-custom-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #1b2a22;
  border: 1px solid rgba(214, 228, 217, 0.12);
  border-radius: 8px;
  font-size: 13px;
}
.hgs-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(45, 125, 82, 0.25);
  color: #b7ebd0;
  margin-right: 6px;
}
.hgs-tag-fatal {
  background: rgba(217, 83, 79, 0.22);
  color: #f7b7b5;
}
.hgs-tag-arena {
  background: rgba(223, 177, 82, 0.2);
  color: var(--accent, #dfb152);
}
.hgs-districts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding: 20px;
}
.hgs-district-card {
  background: #101813;
  border: 1px solid rgba(214, 228, 217, 0.12);
  border-radius: 12px;
  padding: 12px;
}
.hgs-district-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent, #dfb152);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hgs-tribute-row {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: #18251e;
  border: 1px solid rgba(214, 228, 217, 0.1);
  border-radius: 10px;
}
.hgs-tribute-row + .hgs-tribute-row { margin-top: 8px; }
.hgs-avatar-btn {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(223, 177, 82, 0.35);
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  cursor: pointer;
}
.hgs-avatar-btn:hover { border-color: var(--accent, #dfb152); }
.hgs-avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hgs-tribute-fields { display: grid; gap: 6px; min-width: 0; }
.hgs-tribute-fields input {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  min-height: 34px;
  font-size: 14px;
  color: var(--text, #f3efe6);
  background: #0f1712;
  border: 1px solid rgba(214, 228, 217, 0.16);
  border-radius: 6px;
}
.hgs-tribute-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hgs-tribute-meta select {
  padding: 3px 6px;
  font-size: 12px;
  border: 1px solid rgba(214, 228, 217, 0.16);
  border-radius: 6px;
  background: #0f1712;
  color: var(--muted, #9eb0a4);
}
.hgs-clear-img {
  background: none;
  border: none;
  padding: 2px 4px;
  font-size: 12px;
  color: #f7b7b5;
  cursor: pointer;
  text-decoration: underline;
}
.hgs-arena-body { padding: 20px; }
.hgs-phase-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}
.hgs-phase-heading {
  margin: 0;
  font-family: var(--font-display, "Cinzel", Georgia, serif);
  font-size: 26px;
  line-height: 1.2;
  color: var(--text, #f3efe6);
}
.hgs-events-list { display: grid; gap: 10px; }
.hgs-event-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(214, 228, 217, 0.12);
  background: #1a2820;
  animation: hgsFadeUp 0.22s ease-out;
}
.hgs-event-card.is-fatal {
  background: rgba(217, 83, 79, 0.12);
  border-color: rgba(217, 83, 79, 0.38);
}
.hgs-event-card.is-arena {
  background: rgba(223, 177, 82, 0.1);
  border-color: rgba(223, 177, 82, 0.34);
}
.hgs-event-avatars { display: flex; align-items: center; gap: 8px; }
.hgs-mini-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  border: 2px solid rgba(243, 239, 230, 0.5);
}
.hgs-mini-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hgs-mini-avatar.is-fallen { filter: grayscale(100%); border-color: #d9534f; opacity: 0.72; }
.hgs-event-copy { flex: 1 1 240px; font-size: 15px; line-height: 1.5; color: var(--text, #f3efe6); }
.hgs-roster-drawer {
  margin-top: 20px;
  padding: 16px;
  background: #101813;
  border: 1px solid rgba(214, 228, 217, 0.12);
  border-radius: 12px;
}
.hgs-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.hgs-status-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #18251e;
  border: 1px solid rgba(214, 228, 217, 0.12);
  border-radius: 10px;
  font-size: 13px;
}
.hgs-status-chip.is-dead { opacity: 0.52; }
.hgs-victor-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 20px;
  align-items: center;
  padding: 24px;
  background: radial-gradient(circle at 88% 20%, rgba(223, 177, 82, 0.16), transparent 50%), linear-gradient(135deg, #101914 0%, #192b21 100%);
  color: #ffffff;
  border: 1.5px solid var(--accent, #dfb152);
  border-radius: 14px;
  margin-bottom: 20px;
}
.hgs-victor-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 3px solid var(--accent, #dfb152);
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  background: #2d7d52;
}
.hgs-victor-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hgs-victor-kicker {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, #dfb152);
}
.hgs-victor-name {
  margin: 4px 0 6px;
  font-family: var(--font-display, "Cinzel", Georgia, serif);
  font-size: 34px;
  line-height: 1.15;
  color: #ffffff;
}
.hgs-victor-stats { display: flex; flex-wrap: wrap; gap: 12px; font-size: 14px; color: #dbe5da; }
.hgs-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(214, 228, 217, 0.14);
  border-radius: 12px;
  margin-top: 12px;
}
.hgs-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.hgs-table th, .hgs-table td { padding: 10px 12px; border-bottom: 1px solid rgba(214, 228, 217, 0.1); }
.hgs-table th {
  background: #101813;
  color: var(--accent, #dfb152);
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hgs-log-details {
  margin-top: 20px;
  border: 1px solid rgba(214, 228, 217, 0.14);
  border-radius: 12px;
  padding: 14px 16px;
  background: #101813;
}
.hgs-log-details summary { cursor: pointer; font-weight: 700; color: var(--accent, #dfb152); }
.hgs-log-phase { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(214, 228, 217, 0.1); }
.hgs-log-phase-title { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: var(--accent, #dfb152); }
.hgs-log-phase ul { margin: 0; padding-left: 20px; font-size: 14px; color: var(--muted, #9eb0a4); }
.hgs-hint { font-size: 13px; color: var(--muted, #9eb0a4); margin: 6px 0 0; }
@media (max-width: 640px) {
  .hgs-toolbar { padding: 12px; }
  .hgs-toolbar .hgs-btn-primary { width: 100%; }
  .hgs-custom-builder, .hgs-districts-grid { grid-template-columns: 1fr; }
  .hgs-districts-grid { padding: 12px; }
  .hgs-victor-card { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .hgs-victor-stats { justify-content: center; }
}