* {
  box-sizing: border-box;
}

:root {
  --background: #0b0b0b;
  --card: #141414;
  --border: #2a2a2a;
  --text: #f2f2f2;
  --muted: #999;
  --max-width: 1080px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
}

button {
  font: inherit;
  font-weight: 400;
}

.site-shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 48px 0 100px;
}

.level-list {
  display: grid;
  gap: 10px;
}

.level-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}

.level-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
}

.level-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.58);
}

.level-header {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 162px;
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.personal-rank,
.global-rank {
  font-weight: 400;
}

.personal-rank {
  font-size: clamp(1.55rem, 3vw, 2rem);
}

.global-rank {
  justify-self: end;
  color: #ddd;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
}

.global-rank.unranked {
  color: #999;
  font-size: 0.9rem;
}

.level-title-wrap {
  min-width: 0;
  text-align: center;
}

.level-name {
  display: block;
  overflow: hidden;
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  font-weight: 400;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  position: absolute;
  right: 14px;
  bottom: 9px;
  z-index: 2;
  color: #aaa;
  font-size: 1rem;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.level-card.open .chevron {
  transform: rotate(180deg);
}

.level-details-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.level-card.open .level-details-wrap {
  grid-template-rows: 1fr;
}

.level-details-inner {
  min-height: 0;
  overflow: hidden;
}

.level-details {
  margin: 0 12px 12px;
  padding: 16px;
  border: 1px solid #303030;
  border-radius: 6px;
  background: rgba(10, 10, 10, 0.92);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.detail-item {
  padding: 10px 12px;
  border: 1px solid #292929;
  border-radius: 5px;
  background: #151515;
}

.detail-label {
  display: block;
  margin-bottom: 5px;
  color: #808080;
  font-size: 0.65rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  display: block;
  color: #e8e8e8;
  font-size: 0.86rem;
  font-weight: 400;
}

.detail-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.level-note {
  margin: 0;
  color: #999;
  font-size: 0.8rem;
  line-height: 1.5;
}

.video-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid #333;
  border-radius: 5px;
  background: #181818;
  color: #eee;
  font-size: 0.75rem;
  font-weight: 400;
  text-decoration: none;
}

.video-link:hover {
  background: #202020;
}

.video-link.disabled {
  color: #777;
  pointer-events: none;
}

.status-message {
  margin: 24px 0 0;
  color: #777;
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 720px) {
  .site-shell {
    width: min(calc(100% - 20px), var(--max-width));
    padding-top: 28px;
  }

  .level-header {
    min-height: 144px;
    grid-template-columns: 62px 1fr 62px;
    gap: 8px;
    padding: 0 14px;
  }

  .personal-rank {
    font-size: 1.35rem;
  }

  .global-rank {
    font-size: 1rem;
  }

  .level-name {
    font-size: clamp(1rem, 5vw, 1.4rem);
  }

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

  .detail-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .video-link {
    justify-content: center;
  }
}
