:root {
  --bg: #0b0d10;
  --panel: #12161b;
  --line: #304252;
  --text: #e8eef4;
  --soft: #a5b2bf;
  --accent: #d8b36b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Sans 3", system-ui, sans-serif;
}

main {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.scores-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

h1 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.05;
}

.back-link {
  color: #9fbbd3;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: #c6d7e7;
}

.lead {
  margin: 0 0 16px;
  color: var(--soft);
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 24, 30, 0.95), rgba(13, 18, 24, 0.95));
}

.file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #2a3744;
}

.file-item:last-child {
  border-bottom: 0;
}

.file-item-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.file-name {
  overflow-wrap: anywhere;
}

.file-icon {
  color: #89a3bc;
  flex-shrink: 0;
}

.file-link {
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.file-link:hover {
  color: #cfe1f1;
}

.file-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.file-open,
.file-download {
  text-decoration: none;
  border: 1px solid #405668;
  background: rgba(34, 48, 61, 0.55);
  color: #d5e4f2;
  font-size: 0.79rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 9px;
}

.file-open:hover,
.file-download:hover {
  background: rgba(58, 82, 104, 0.65);
  color: #edf5fc;
}

.file-meta {
  color: #8fa0b0;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.folder-tree {
  display: grid;
  gap: 8px;
}

.folder-node {
  border: 1px solid #2f4150;
  background: rgba(17, 23, 30, 0.9);
}

.folder-node > summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 12px;
  border-bottom: 1px solid #2a3744;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  color: #d7e3ef;
  font-weight: 600;
}

.folder-node > summary::after {
  content: "▸";
  margin-left: auto;
  color: #9cb4ca;
  font-size: 0.86rem;
  transition: transform 140ms ease;
}

.folder-node[open] > summary::after {
  transform: rotate(90deg);
}

.folder-node > summary::-webkit-details-marker {
  display: none;
}

.folder-node > .folder-content {
  padding: 8px 10px 10px;
}

.folder-node[data-level="1"] {
  margin-left: 14px;
}

.folder-node[data-level="2"] {
  margin-left: 24px;
}

.folder-node[data-level="3"] {
  margin-left: 34px;
}

.folder-icon {
  color: #d8b36b;
}

.empty-note {
  margin-top: 10px;
  color: var(--soft);
  font-size: 0.9rem;
}

.gate {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px;
}

.gate h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.gate p {
  margin: 0 0 10px;
  color: var(--soft);
}

.gate-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gate input {
  min-width: 230px;
  background: #0e1318;
  border: 1px solid #324454;
  color: var(--text);
  padding: 8px 10px;
}

.gate button {
  border: 1px solid #425a6f;
  background: rgba(34, 51, 67, 0.65);
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
}

.gate button:hover {
  background: rgba(55, 79, 101, 0.7);
}

.gate-error {
  margin-top: 8px;
  color: #f0b6b6;
  font-size: 0.86rem;
  min-height: 1.2em;
}

@media (max-width: 720px) {
  .file-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .file-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
