:root {
  --bg: #0f172a;
  --card: #111827;
  --muted: #94a3b8;
  --text: #e5e7eb;
  --brand: #22c55e;
  --brand-600: #16a34a;
  --ring: rgba(34, 197, 94, 0.35);
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial;
  background: linear-gradient(180deg, #0b1221, var(--bg));
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a {
  color: var(--brand);
  text-decoration: none;
}
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
h1 {
  font-size: clamp(20px, 3vw, 28px);
  margin: 0;
  letter-spacing: 0.3px;
}
.lang-switch {
  display: flex;
  gap: 8px;
  align-items: center;
}
.topmenu {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0b1221;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.page-title { font-size: 18px; margin: 0 0 8px; font-weight: 600; opacity: 0.95; }

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.grid-three {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 600px) {
  .grid {
    grid-template-columns: 2fr 1fr;
  }
  .grid-three {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
@media (max-width: 599px) {
  .grid-three {
    grid-template-columns: 1fr;
  }
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
select,
button,
input[type="range"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b1221;
  color: var(--text);
  outline: none;
}
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
select:focus,
button:focus,
input[type="range"]:focus {
  box-shadow: 0 0 0 3px var(--ring);
  border-color: var(--brand);
}
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.controls button {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b1221;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.06s ease;
}
.controls button:hover {
  border-color: var(--brand);
}
.controls button:active {
  transform: translateY(1px);
}
.play {
  background: var(--brand);
  color: #062b16;
  font-weight: 700;
}
.play:hover {
  background: var(--brand-600);
}
.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}
#nowPlaying {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.progress {
  margin-top: 12px;
}
.progress input[type="range"] {
  width: 100%;
}
.volume-control {
  margin-top: 12px;
}
.volume-control input[type="range"] {
  width: 100%;
}
footer {
  margin-top: auto;
  padding: 20px 24px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}


.sr-only{
  position:absolute!important;
  width:1px!important;height:1px!important;
  padding:0!important;margin:-1px!important;
  overflow:hidden!important;clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;border:0!important;
}





/* === Mobile polish (drop-in overrides) === */

/* 1) Fluid type + compact headings on phones */
h1#title { font-size: clamp(20px, 5vw, 28px); line-height: 1.2; }

/* 2) Ensure selects, labels, status wrap nicely (long Arabic text) */
label, #status, #nowPlaying { white-space: normal; }
#status, #nowPlaying { overflow-wrap: anywhere; }

/* 3) Control buttons: equal width, wrap on small screens, good tap targets */
.controls { display:flex; flex-wrap:wrap; gap:10px; }
.controls button { 
  flex: 1 1 32%;        /* three in a row on wider phones */
  min-width: 96px; 
  min-height: 44px;     /* touch size */
  line-height: 1.2;
}
@media (max-width: 480px){
  .controls button { flex: 1 1 100%; }  /* stack vertically on very small screens */
}

/* 4) Prevent container from feeling cramped on tiny devices */
@media (max-width: 480px){
  .container { padding: 16px; }
  .card { padding: 16px; }
}

/* 5) Make selects fully fluid and comfortable to tap */
select { width: 100%; min-height: 44px; }

/* 6) Language pills row: keep tidy; reverse order in RTL */
.lang-switch{ display:flex; gap:8px; flex-wrap:wrap; }
html[dir="rtl"] .lang-switch { flex-direction: row-reverse; }

/* 7) Prev/Play/Next order looks natural in RTL */
html[dir="rtl"] .controls { flex-direction: row-reverse; }

/* 8) Avoid layout shifts from very long Arabic strings */
.card, .controls, footer { min-width: 0; }

