:root {
  --bg: #0f111a;
  --bg-elevated: #181b28;
  --bg-card: #1f2335;
  --bg-card-hover: #272c42;
  --border: #2e344e;
  --text: #f3f4f8;
  --text-muted: #9aa2bf;
  --accent: #7c5cff;
  --accent-hover: #6946ff;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
  padding-bottom: 3rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.hidden {
  display: none !important;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 17, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem 0.65rem;
}

.header-top {
  max-width: 820px;
  margin: 0 auto 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mic-icon {
  font-size: 1.65rem;
  background: var(--accent-soft);
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 255, 0.35);
}

.brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-open {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-open .dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-closed {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-closed .dot {
  background: var(--warning);
}

/* Inputs & Search */
.singer-bar,
.search-controls {
  max-width: 820px;
  margin: 0 auto 0.55rem;
}

.search-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1 1 230px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  font-size: 0.95rem;
  pointer-events: none;
  opacity: 0.75;
}

.input-with-icon input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.62rem 2.2rem 0.62rem 2.25rem;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-with-icon input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.clear-btn {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
}

.filter-pills {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.18rem;
  gap: 0.15rem;
}

.pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.42rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pill.active {
  background: var(--accent);
  color: #fff;
}

/* Alphabet Bar */
.alpha-bar {
  max-width: 820px;
  margin: 0.35rem auto 0;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scrollbar-width: none;
}

.alpha-bar::-webkit-scrollbar {
  display: none;
}

.alpha-btn {
  flex: 0 0 auto;
  min-width: 30px;
  height: 28px;
  padding: 0 0.45rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.alpha-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Main list */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
}

.closed-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
}

.results-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.song-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.song-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
  cursor: pointer;
}

.song-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(124, 92, 255, 0.45);
}

.song-info {
  min-width: 0;
  flex: 1;
}

.song-title {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-artist {
  font-size: 0.84rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

.request-btn {
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 0.5rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.request-btn:hover {
  background: var(--accent-hover);
}

.request-btn:disabled {
  background: #353b54;
  color: #7d85a3;
  cursor: not-allowed;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.empty-state h3 {
  color: var(--text);
  margin-bottom: 0.35rem;
}

/* Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.page-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-primary,
.btn-secondary {
  border-radius: 10px;
  padding: 0.6rem 1.05rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:disabled,
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 7, 12, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-header h2 {
  font-size: 1.1rem;
}

.icon-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.25rem;
}

.selected-song-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.modal-song-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.modal-song-artist {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.15rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.req {
  color: var(--danger);
}

.form-group input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.68rem 0.85rem;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent);
}

.key-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem;
}

.stepper-btn {
  width: 38px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}

.key-display {
  font-size: 0.9rem;
  font-weight: 600;
}

.modal-error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.84rem;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: #16a34a;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
