:root {
  --bg: #f7f6f4;
  --card: #ffffff;
  --border: #e3e0db;
  --text: #1e1c1a;
  --muted: #8a857e;
  --accent: #d94f30;
  --accent-soft: #fbeae5;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Vazirmatn", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.app {
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 16px 120px;
  min-height: 100vh;
}

/* Header */
.head {
  text-align: center;
  margin-bottom: 22px;
}
.head h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
}
.head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 300;
}

/* List */
.list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Station card */
.station {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.station-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.station-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-box img { width: 100%; height: 100%; object-fit: cover; }
.icon-ph { font-size: 1.3rem; }

.play-btn {
  margin-inline-start: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, opacity 0.2s;
}
.play-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.play-btn:not(:disabled):active { transform: scale(0.9); }
.play-btn.playing { animation: pulse 1.6s ease-in-out infinite; }

.del-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.del-btn:hover { background: #fcecea; color: var(--accent); }

/* Fields */
.fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fafafa;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.field input:focus {
  border-color: var(--accent);
  background: #fff;
}

.site-link {
  align-self: flex-start;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.site-link:hover { text-decoration: underline; }

/* Add button */
.add {
  margin-top: 4px;
  padding: 14px;
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.add:hover { border-color: var(--accent); color: var(--accent); }

/* Now playing bar */
.bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}
.bar-name {
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-vol {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bar-vol input {
  width: 90px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

/* Footer */
.foot {
  text-align: center;
  padding: 24px 0 0;
}
.foot a {
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
  opacity: 0.7;
}
.foot a:hover { opacity: 1; text-decoration: underline; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,79,48,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(217,79,48,0); }
}