/* =========================================================
   w2gr.io — لوحة الألوان والخطوط (design tokens)
   bg:        #0b0c10   خلفية أساسية، أسود مائل للأزرق الداكن
   bg-2:      #14161c   طبقة الضباب/البطاقات
   ink:       #ece7dd   نص أساسي دافئ
   ink-dim:   #8b8d98   نص ثانوي
   ember:     #cf7a3e   لون الإبراز (كلمات مركّز عليها) — دفء شمعة
   steel:     #3c4a5e   لون ثانوي (حواف القرص / شريط التقدم)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Aref+Ruqaa:wght@400;700&family=Cairo:wght@300;400;600;700&display=swap');

:root {
    --bg: #0b0c10;
    --bg-2: #14161c;
    --ink: #ece7dd;
    --ink-dim: #8b8d98;
    --ember: #cf7a3e;
    --ember-soft: rgba(207, 122, 62, 0.35);
    --steel: #3c4a5e;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Cairo', sans-serif;
    overflow-x: hidden;
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* ---------- طبقة الضباب الخلفية ---------- */

#fog-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.55;
    pointer-events: none;
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,0.75) 100%);
}

/* ---------- الحاوية الرئيسية ---------- */

.stage {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 560px;
    padding: 40px 20px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.site-eyebrow {
    letter-spacing: 4px;
    font-size: 11px;
    color: var(--ink-dim);
    text-transform: uppercase;
    margin-bottom: 28px;
    opacity: 0.7;
}

/* ---------- القرص الدوّار ---------- */

.disc-wrap {
    position: relative;
    width: 190px;
    height: 190px;
    margin-bottom: 34px;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.6));
}

.disc {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at center, var(--steel) 0%, #1a1e26 70%, #0d0f14 100%);
    padding: 10px;
    animation: spin 9s linear infinite;
    animation-play-state: paused;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.04), inset 0 0 30px rgba(0,0,0,0.6);
}

.disc.spinning { animation-play-state: running; }

.disc img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    filter: saturate(0.85) contrast(1.05);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---------- عناصر التحكم بالمشغل ---------- */

.player {
    width: 100%;
    max-width: 380px;
    margin-bottom: 18px;
}

.seek-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    direction: ltr;
}

.time-label {
    font-size: 11px;
    color: var(--ink-dim);
    min-width: 34px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

#seek {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    min-width: 0;
    height: 18px;
    border-radius: 9px;
    background: linear-gradient(
        to right,
        var(--ember) 0%,
        var(--ember) var(--progress, 0%),
        rgba(255,255,255,0.12) var(--progress, 0%),
        rgba(255,255,255,0.12) 100%
    ) center / 100% 3px no-repeat;
    outline: none;
    cursor: pointer;
    direction: ltr;
    touch-action: pan-y;
}
#seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--ember);
    box-shadow: 0 0 8px var(--ember-soft);
    cursor: pointer;
}
#seek::-webkit-slider-runnable-track {
    height: 18px;
    background: transparent;
}
#seek::-moz-range-track {
    height: 3px;
    border-radius: 3px;
    background: rgba(255,255,255,0.12);
}
#seek::-moz-range-progress {
    height: 3px;
    border-radius: 3px;
    background: var(--ember);
}
#seek::-moz-range-thumb {
    width: 12px; height: 12px;
    border: none;
    border-radius: 50%;
    background: var(--ember);
    cursor: pointer;
}
#seek:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(207,122,62,0.22), 0 0 8px var(--ember-soft);
}
#seek:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 4px rgba(207,122,62,0.22), 0 0 8px var(--ember-soft);
}
#seek:disabled {
    cursor: wait;
    opacity: 0.45;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
}

.ctrl-btn {
    background: none;
    border: none;
    color: var(--ink);
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.2s, transform 0.2s;
    padding: 6px;
}
.ctrl-btn:hover { opacity: 1; transform: scale(1.06); }
.ctrl-btn svg { width: 20px; height: 20px; display: block; }

#play-btn {
    width: 58px; height: 58px;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--ember), #a85a2b);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 22px rgba(207,122,62,0.35);
    opacity: 1;
}
#play-btn svg { width: 22px; height: 22px; fill: #14161c; }
#play-btn:hover { transform: scale(1.04); }

#stop-btn svg { fill: none; stroke: currentColor; stroke-width: 1.6; }

/* ---------- الإعجابات ---------- */

.like-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 28px;
}

.like-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 15px;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 999px;
    background: rgba(20,22,28,0.68);
    color: var(--ink-dim);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.2s, border-color 0.2s, color 0.2s, background 0.2s;
}

.like-btn:hover {
    transform: translateY(-1px);
    color: var(--ink);
    border-color: rgba(207,122,62,0.35);
}

.like-btn:focus-visible {
    outline: 2px solid var(--ember);
    outline-offset: 3px;
}

.like-btn.busy {
    pointer-events: none;
    opacity: 0.7;
}

.like-btn.liked {
    color: var(--ink);
    border-color: rgba(207,122,62,0.4);
    background: rgba(207,122,62,0.1);
    cursor: default;
}

.heart-icon {
    width: 18px;
    height: 18px;
    fill: transparent;
    stroke: currentColor;
    stroke-width: 1.7;
    transition: fill 0.2s, stroke 0.2s, transform 0.25s cubic-bezier(.2,.8,.2,1.3);
}

.like-btn.liked .heart-icon {
    fill: var(--ember);
    stroke: var(--ember);
    transform: scale(1.08);
}

.like-btn.pulse .heart-icon {
    animation: heart-pop 0.45s ease;
}

.like-count {
    min-width: 22px;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

@keyframes heart-pop {
    0% { transform: scale(1); }
    45% { transform: scale(1.38); }
    100% { transform: scale(1.08); }
}

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

/* ---------- كلمات الأغنية ---------- */

.lyrics-wrap {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 220px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%);
}

#lyrics-track {
    position: absolute;
    width: 100%;
    top: 0;
    text-align: center;
    transition: transform 0.6s cubic-bezier(.22,.68,0,1.01);
}

.lyric-line {
    font-family: 'Aref Ruqaa', serif;
    font-size: 22px;
    line-height: 2.6;
    color: var(--ink-dim);
    opacity: 0.28;
    filter: blur(2px);
    transform: scale(0.94);
    transition: all 0.6s cubic-bezier(.22,.68,0,1.01);
    padding: 0 14px;
}

.lyric-line.active {
    color: var(--ink);
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
    font-size: 25px;
}

.lyric-line .hl {
    color: var(--ember);
    text-shadow: 0 0 18px var(--ember-soft);
}

.lyrics-placeholder-note {
    text-align: center;
    font-size: 12px;
    color: var(--ink-dim);
    opacity: 0.55;
    margin-top: 6px;
    max-width: 400px;
}

/* ---------- زر لوحة الأدمن (مخفي بصرياً وصغير) ---------- */

.footer-note {
    margin-top: auto;
    padding-top: 30px;
    font-size: 11px;
    color: var(--ink-dim);
    opacity: 0.35;
}

@media (max-width: 420px) {
    .disc-wrap { width: 150px; height: 150px; }
    .lyric-line { font-size: 19px; }
    .lyric-line.active { font-size: 21px; }
}

/* أدوات مساعدة قياس التوقيت (dev helper) — انظر main.js */
#sync-helper {
    position: fixed;
    bottom: 10px;
    left: 10px;
    right: 10px;
    max-width: 480px;
    margin: 0 auto;
    background: rgba(20,22,28,0.92);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 14px;
    font-family: monospace;
    font-size: 11px;
    color: #9be89b;
    z-index: 50;
    max-height: 140px;
    overflow-y: auto;
    display: none;
    direction: ltr;
    text-align: left;
}
#sync-helper.visible { display: block; }

/* عند تفعيل keepPrevious يظهر السطران معاً بتباعد أقرب ثم يختفيان معاً عند السطر التالي. */
.lyric-line.paired-active {
    line-height: 2.05;
}
