:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 32rem),
    linear-gradient(180deg, #f7fbff 0%, #eaf3ff 45%, #f8fbff 100%);
  color: #081632;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
  word-break: keep-all;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  box-shadow: none;
}

[v-cloak] {
  display: none;
}

.op-shell {
  min-height: 100vh;
}

.op-card {
  border: 1px solid rgba(147, 197, 253, 0.55);
  background: rgba(255, 255, 255, 0.92);
}

.op-topbar {
  background: rgba(8, 22, 50, 0.97);
}

.op-input {
  width: 100%;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.75rem 0.875rem;
  color: #0f172a;
  outline: none;
}

.op-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.op-btn {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  padding: 0.65rem 1rem;
  font-weight: 800;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.op-btn:active {
  transform: translateY(1px);
}

.op-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.op-btn-primary {
  background: #2563eb;
  color: #fff;
}

.op-btn-primary:hover {
  background: #1d4ed8;
}

.op-btn-secondary {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
}

.op-btn-secondary:hover {
  background: #dbeafe;
}

.op-btn-danger {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.op-btn-danger:hover {
  background: #ffe4e6;
}

.op-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.op-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #93c5fd #eaf3ff;
}

.rank-editor-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(12rem, 1.45fr) minmax(9rem, 0.95fr) minmax(9rem, 0.95fr) 7rem minmax(10rem, 0.9fr);
  gap: 1rem;
  align-items: end;
}

.rank-move-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.rank-move-button {
  min-height: 3.125rem;
  padding: 0;
  font-size: 1.25rem;
}

.rank-field {
  display: block;
  min-width: 0;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 900;
}

.rank-field .op-input {
  margin-top: 0.375rem;
  height: 3.125rem;
  font-size: 1rem;
  font-weight: 900;
}

.rank-toggle {
  display: flex;
  min-height: 3.125rem;
  align-items: center;
  gap: 0.625rem;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 900;
}

.rank-toggle input {
  width: 1.25rem;
  height: 1.25rem;
}

.rank-song-button {
  width: 100%;
  min-height: 3.125rem;
}

.admin-song-header {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-song-filters {
  display: grid;
  gap: 0.75rem;
  align-items: end;
}

.admin-song-field {
  display: block;
  min-width: 0;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 900;
}

.admin-song-field .op-input {
  height: 3rem;
  margin-top: 0.5rem;
  font-weight: 800;
}

.admin-song-refresh {
  height: 3rem;
  align-self: end;
}

.admin-song-bulkbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.admin-song-chips,
.admin-song-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-song-chips {
  align-items: center;
  color: #1e40af;
  font-size: 0.875rem;
  font-weight: 900;
}

.admin-song-small-button {
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.admin-song-list {
  max-height: min(30rem, calc(100vh - 18rem));
}

.recent-record-list {
  max-height: min(26rem, calc(100vh - 16rem));
}

.tier-ranking-scroll {
  max-height: min(24rem, calc(100vh - 14rem));
  overflow-y: auto;
}

.season-rule-panel {
  overflow: hidden;
}

.season-rule-row {
  min-width: 0;
}

@media (max-width: 768px) {
  .op-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .season-rule-stats {
    grid-template-columns: 1fr;
  }

  .season-rule-row {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 640px) {
  .admin-song-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .admin-song-bulkbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .admin-song-actions {
    justify-content: flex-end;
  }
}

@media (min-width: 1024px) {
  .admin-song-header {
    grid-template-columns: minmax(13rem, 0.8fr) minmax(0, 3.2fr);
    align-items: start;
  }

  .admin-song-filters {
    width: 100%;
    grid-template-columns:
      minmax(7rem, 0.8fr)
      minmax(13rem, 1.55fr)
      minmax(12rem, 1.35fr)
      minmax(7.5rem, 0.85fr)
      minmax(7.5rem, 0.85fr)
      4.5rem;
  }
}

@media (max-width: 1180px) {
  .rank-editor-row {
    grid-template-columns: 7.5rem 1fr 1fr;
  }

  .rank-toggle,
  .rank-song-button {
    align-self: end;
  }
}

@media (max-width: 768px) {
  .rank-editor-row {
    grid-template-columns: 1fr;
  }

  .rank-move-controls {
    width: 9rem;
  }
}
