.gd-page {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 86px 0 110px;
}

.gd-hero {
  display: grid;
  gap: 18px;
  margin-bottom: 34px;
}

.gd-hero h1 {
  max-width: min(100%, 1120px);
  margin: 0;
  font-size: clamp(52px, 7.2vw, 104px);
  line-height: 0.9;
  letter-spacing: 0;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.gd-hero .lede {
  margin: 0;
  color: var(--muted);
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 800;
}

.gd-shell {
  display: grid;
  gap: 24px;
}

.gd-editor-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.gd-panel,
.gd-list-panel,
.gd-public-tools {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.gd-panel,
.gd-public-tools {
  padding: 28px;
}

.gd-panel-head,
.gd-list-head,
.gd-public-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.gd-panel-head {
  margin-bottom: 22px;
}

.gd-panel-head h2,
.gd-list-head h2 {
  margin: 0;
  font-size: 34px;
  line-height: 0.95;
}

.gd-panel-head p,
.gd-list-head p,
.gd-public-tools p,
.gd-empty,
.gd-loading,
.gd-error {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.gd-form {
  display: grid;
  gap: 16px;
}

.gd-form label,
.gd-progress-row label,
.gd-public-tools label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gd-form input,
.gd-form select,
.gd-public-tools input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-solid), transparent 18%);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

.gd-form input:focus,
.gd-form select:focus,
.gd-public-tools input:focus {
  border-color: color-mix(in srgb, var(--accent), var(--line) 25%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent), transparent 84%);
}

.gd-field-note {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

.gd-progress-block {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.gd-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.gd-progress-head strong {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gd-progress-rows {
  display: grid;
  gap: 10px;
}

.gd-progress-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 10px;
  align-items: end;
}

.gd-icon-button,
.gd-text-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--text);
  font-weight: 900;
}

.gd-icon-button {
  width: 42px;
  height: 42px;
}

.gd-text-button {
  min-height: 42px;
  padding: 0 16px;
}

.gd-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
}

.gd-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.gd-list-panel {
  overflow: hidden;
}

.gd-list-head {
  padding: 26px 28px;
  border-bottom: 1px solid var(--line);
}

.gd-public-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.gd-level-list {
  display: grid;
}

.gd-level-card {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 152px;
  padding: 22px;
  border-bottom: 1px dashed var(--line-strong);
  background: color-mix(in srgb, var(--surface-solid), transparent 34%);
}

.gd-level-card:last-child {
  border-bottom: 0;
}

.gd-level-card[draggable="true"] {
  cursor: grab;
}

.gd-level-card.is-dragging {
  opacity: 0.54;
}

.gd-level-card-link {
  color: inherit;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.gd-level-card-link:hover {
  border-color: color-mix(in srgb, var(--accent), var(--line) 25%);
  background: color-mix(in srgb, var(--accent), transparent 92%);
  transform: translateY(-1px);
}

.gd-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent), transparent 72%), color-mix(in srgb, var(--accent-2), transparent 74%));
}

.gd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gd-thumb span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--surface-solid);
  font-size: 34px;
  font-weight: 950;
}

.gd-level-main {
  min-width: 0;
}

.gd-level-title {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
}

.gd-level-title strong {
  font-size: clamp(26px, 4vw, 40px);
  line-height: 0.95;
}

.gd-rank {
  color: var(--accent);
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 950;
}

.gd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.gd-current-rank {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.gd-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gd-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gd-public-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.gd-public-tools {
  position: sticky;
  top: 118px;
  display: grid;
}

.gd-public-tools h2 {
  margin: 0;
  font-size: 28px;
}

.gd-time-actions {
  display: grid;
  gap: 10px;
}

.gd-detail-panel,
.gd-progress-table-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.gd-detail-panel {
  display: grid;
  gap: 24px;
  padding: 28px;
}

.gd-detail-head {
  display: grid;
  gap: 14px;
  text-align: center;
}

.gd-detail-head h2 {
  margin: 0;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.9;
}

.gd-detail-meta {
  justify-content: center;
  margin-top: 0;
}

.gd-player {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
  aspect-ratio: 16 / 9;
}

.gd-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.gd-player a {
  display: grid;
  height: 100%;
  place-items: center;
  color: #fff;
  font-weight: 900;
}

.gd-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.gd-detail-stats div {
  display: grid;
  gap: 5px;
  min-height: 82px;
  align-content: center;
  padding: 16px;
  background: var(--surface-solid);
  text-align: center;
}

.gd-detail-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gd-detail-stats strong {
  font-size: 18px;
}

.gd-progress-table {
  width: 100%;
  border-collapse: collapse;
}

.gd-progress-table th,
.gd-progress-table td {
  padding: 16px 18px;
  border-top: 1px dashed var(--line-strong);
  text-align: left;
}

.gd-progress-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gd-progress-table td {
  font-weight: 800;
}

.gd-position-table tbody tr.is-added td {
  background: color-mix(in srgb, var(--accent-2), transparent 86%);
}

.gd-position-table tbody tr.is-up td {
  background: color-mix(in srgb, var(--green), transparent 88%);
}

.gd-position-table tbody tr.is-down td {
  background: color-mix(in srgb, var(--danger), transparent 88%);
}

.gd-progress-table a {
  color: var(--accent);
}

.gd-empty,
.gd-loading,
.gd-error {
  padding: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  text-align: center;
}

.gd-error strong {
  display: block;
  color: var(--text);
  font-size: 34px;
  line-height: 1;
}

.gd-error span {
  display: block;
  margin-top: 10px;
}

@media (max-width: 980px) {
  .gd-page {
    width: min(100% - 28px, 760px);
    padding: 54px 0 80px;
  }

  .gd-editor-grid,
  .gd-public-layout {
    grid-template-columns: 1fr;
  }

  .gd-public-tools {
    position: static;
    order: -1;
  }

  .gd-level-card {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .gd-card-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }

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

@media (max-width: 640px) {
  .gd-hero h1 {
    font-size: clamp(44px, 14vw, 72px);
  }

  .gd-panel,
  .gd-public-tools {
    padding: 20px;
  }

  .gd-list-head,
  .gd-public-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .gd-level-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .gd-detail-panel {
    padding: 18px;
  }

  .gd-detail-head {
    text-align: left;
  }

  .gd-detail-meta {
    justify-content: flex-start;
  }

  .gd-detail-stats {
    grid-template-columns: 1fr;
  }

  .gd-progress-table {
    display: block;
    overflow-x: auto;
  }

  .gd-progress-row {
    grid-template-columns: 1fr;
  }

  .gd-icon-button {
    width: 100%;
  }
}
