body {
  margin: 0;
  padding: 24px;
  background: #101216;
  color: #f2f4f8;
  font-family: Arial, sans-serif;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

h1 {
  margin-top: 0;
  margin-bottom: 8px;
}

a {
  color: #9db0ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.credits {
  color: #9ca4b3;
  font-size: 12px;
  line-height: 1.5;
}

.credit-separator {
  margin: 0 8px;
  color: #5f6775;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
}

.header-link-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.language-toggle {
  display: flex;
  padding: 2px;
  background: #1b1e26;
  border: 1px solid #333;
  border-radius: 8px;
}

.language-btn,
.header-link {
  min-height: 34px;
  padding: 8px 11px;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 12px;
  line-height: 1.2;
}

.language-btn {
  border: none;
  background: transparent;
  color: #c8ced8;
}

.language-btn.is-active {
  background: #4c6fff;
  color: white;
}

.header-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid #333;
  background: #1b1e26;
  color: #f2f4f8;
  cursor: pointer;
  text-decoration: none;
}

.header-link:hover {
  text-decoration: none;
  border-color: #4c6fff;
}

h2 {
  margin-bottom: 12px;
}

.section {
  margin-top: 32px;
}

.last-updated {
  margin-top: 2px;
  color: #747d8c;
  font-size: 11px;
  line-height: 1.4;
}

.input-section {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

#beatmap-url {
  flex: 1;
  padding: 12px;
  background: #1b1e26;
  border: 1px solid #333;
  color: white;
  border-radius: 8px;
  font-size: 14px;
}

button {
  padding: 12px 18px;
  border: none;
  border-radius: 8px;
  background: #4c6fff;
  color: white;
  cursor: pointer;
  font-size: 14px;
}

button:hover {
  opacity: 0.9;
}

.options-layout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
}

.options-panel,
.extra-credits-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px;
  background: #151922;
  border: 1px solid #252b37;
  border-radius: 8px;
}

.extra-credits-panel {
  min-width: 460px;
  opacity: 0.78;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.extra-credits-panel[open],
.extra-credits-panel:hover,
.extra-credits-panel:focus-within {
  opacity: 1;
  border-color: #333b49;
}

.extra-credits-panel summary {
  color: #c8ced8;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
}

.options-title {
  color: #c8ced8;
  font-size: 12px;
  font-weight: bold;
}

.checkbox-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.options-panel .checkbox-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  color: #c8ced8;
  font-size: 13px;
}

.checkbox-option span {
  white-space: nowrap;
}

.select-option {
  display: grid;
  grid-template-columns: minmax(96px, max-content) 1fr;
  align-items: center;
  gap: 8px;
  color: #c8ced8;
  font-size: 13px;
}

.select-option span {
  white-space: nowrap;
}

.select-option select {
  width: 100%;
  min-width: 210px;
  min-height: 34px;
  padding: 7px 9px;
  background: #1b1e26;
  border: 1px solid #333b49;
  border-radius: 6px;
  color: #f2f4f8;
  font-size: 13px;
}

.checkbox-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #4c6fff;
}

.extra-credit-table {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.extra-credit-table-head,
.extra-credit-row {
  display: grid;
  grid-template-columns: 84px minmax(120px, 0.85fr) minmax(220px, 1.15fr);
  gap: 8px;
  align-items: center;
}

.extra-credit-table-head {
  color: #9ca4b3;
  font-size: 12px;
}

.extra-credit-row {
  color: #f2f4f8;
  font-size: 13px;
}

.extra-credit-type {
  font-weight: bold;
}

.extra-credit-row input {
  min-height: 32px;
  padding: 6px 8px;
  background: #1b1e26;
  border: 1px solid #333b49;
  border-radius: 6px;
  color: #f2f4f8;
  font-size: 13px;
  box-sizing: border-box;
}

#preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: #20262a;
  border: 1px solid #2b3237;
  border-radius: 8px;
}

.diff-preview-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  color: #d7dbe4;
  font-size: 13px;
  line-height: 1.35;
}

.diff-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.preview-diff-name {
  font-weight: bold;
}

.preview-mapper {
  color: #9fc8d9;
}

.preview-mapper-separator {
  color: #8f98a8;
}

textarea {
  width: 100%;
  height: 220px;
  resize: vertical;
  background: #1b1e26;
  color: white;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px;
  font-family: Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  box-sizing: border-box;
}

#status {
  color: #aaa;
  font-size: 14px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal.is-hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.72);
}

.modal-panel {
  position: relative;
  width: min(560px, 100%);
  padding: 18px 20px;
  background: #151922;
  border: 1px solid #303747;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

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

.modal-header h2 {
  margin: 0;
}

.modal-close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #333b49;
  border-radius: 6px;
  background: #1b1e26;
  color: #f2f4f8;
  font-size: 22px;
  line-height: 1;
}

.update-log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.update-log-list li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 6px 12px;
  color: #d7dbe4;
  font-size: 14px;
  line-height: 1.55;
}

.update-log-list time {
  color: #9ca4b3;
  font-variant-numeric: tabular-nums;
}

.request-credit {
  grid-column: 2;
  color: #9ca4b3;
  font-size: 12px;
}

.mode-section {
  width: 100%;
  margin-bottom: 18px;
}

.extra-credit-preview-section {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #2b3237;
}

.mode-title {
  margin: 8px 0 10px;
  color: #ddd;
  font-size: 15px;
  font-weight: bold;
}

.diff-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (max-width: 720px) {
  body {
    padding: 16px;
  }

  .app-header {
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .header-link-group {
    justify-content: flex-start;
  }

  .input-section,
  .options-layout,
  .options-panel,
  .extra-credits-panel {
    width: 100%;
  }

  .options-layout {
    flex-direction: column;
  }

  .select-option {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .select-option select {
    width: 100%;
  }

  .checkbox-option span {
    white-space: normal;
  }

  .input-section {
    flex-direction: column;
  }

  .input-section button,
  #copy-btn {
    width: 100%;
  }

  .update-log-list li {
    grid-template-columns: 1fr;
  }

  .request-credit {
    grid-column: 1;
  }

  .extra-credit-table-head {
    display: none;
  }

  .extra-credit-row {
    grid-template-columns: 1fr;
  }
}
