/* ============================================
   LekSync Web Receiver — Player UI
   Extends /assets/css/site.css
   ============================================ */

.receiver-wrap {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.receiver-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow), 0 0 0 1px rgba(229,9,20,0.12), 0 30px 80px rgba(229,9,20,0.18);
    width: 100%;
    max-width: 440px;
    padding: 40px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: cardIn 0.7s cubic-bezier(.2,.9,.3,1.4);
}
.receiver-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(229,9,20,0.15), transparent 60%);
    pointer-events: none;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.receiver-card .badge-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(229,9,20,0.12);
    border: 1px solid rgba(229,9,20,0.4);
    color: #FF8A95;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.pill.gold { background: rgba(255,215,0,0.12); border-color: rgba(255,215,0,0.4); color: var(--gold); }

.receiver-card h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    position: relative;
}
.receiver-card .subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
    position: relative;
}

.passcode-display {
    display: inline-block;
    background: rgba(229,9,20,0.1);
    border: 1px dashed rgba(229,9,20,0.5);
    color: var(--red-light);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 3px;
    padding: 10px 18px;
    border-radius: 10px;
    margin: 8px 0 18px;
    position: relative;
}

/* Name input */
.entry-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}
.entry-form input[type="text"] {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    padding: 14px 18px;
    font-family: var(--font);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.entry-form input[type="text"]::placeholder { color: var(--text-dim); }
.entry-form input[type="text"]:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(229,9,20,0.18);
}
.entry-form button {
    background: var(--red);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 8px 22px rgba(229,9,20,0.4);
    font-family: var(--font);
}
.entry-form button:hover {
    background: var(--red-light);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(229,9,20,0.55);
}
.entry-form button:active { transform: translateY(0); }

.audio-only-note {
    margin-top: 20px;
    padding: 14px 16px;
    background: rgba(255,215,0,0.08);
    border: 1px solid rgba(255,215,0,0.25);
    border-radius: 12px;
    color: var(--gold);
    font-size: 12.5px;
    line-height: 1.6;
    position: relative;
}

/* Status while connecting */
.status-card {
    padding: 20px 0;
    position: relative;
}
.status-icon {
    font-size: 48px;
    margin-bottom: 14px;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}
.status-text {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Player card (shown when connected) */
.player-card { position: relative; }

.album-art-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 28px;
}
.album-art-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 20px 50px rgba(229,9,20,0.35), 0 0 0 8px rgba(255,255,255,0.04);
    animation: spinArt 18s linear infinite;
    background: var(--bg-soft);
}
.album-art-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bg);
    border: 4px solid #1A1F2A;
    box-shadow: 0 0 0 3px rgba(229,9,20,0.4);
    pointer-events: none;
}
@keyframes spinArt {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.track-info { margin-bottom: 22px; }
.track-title {
    font-size: 20px;
    font-weight: 800;
    color: white;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.track-artist {
    color: var(--text-muted);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Progress bar */
.progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 8px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--red), #FF6B7A);
    border-radius: 100px;
    width: 0%;
    transition: width 0.4s ease;
    box-shadow: 0 0 12px rgba(229,9,20,0.6);
}
.time-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    margin-bottom: 22px;
}

.host-info {
    color: var(--text-muted);
    font-size: 13px;
    padding: 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    margin-bottom: 18px;
}
.host-info span { color: white; font-weight: 700; }

.disconnect-btn {
    width: 100%;
    background: transparent;
    color: var(--red-light);
    border: 1.5px solid rgba(229,9,20,0.4);
    border-radius: 12px;
    padding: 14px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
}
.disconnect-btn:hover {
    background: rgba(229,9,20,0.12);
    border-color: var(--red);
}

.install-cta-small {
    text-align: center;
    margin-top: 24px;
    color: var(--text-dim);
    font-size: 12px;
}
.install-cta-small a {
    color: var(--gold);
    font-weight: 600;
    text-decoration: none;
}
.install-cta-small a:hover { text-decoration: underline; }

/* ============================================
   Volume controls (music + host mic)
   ============================================ */
.volume-controls {
    margin: 8px 0 22px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.vol-row {
    display: grid;
    grid-template-columns: 24px 70px 1fr 44px;
    align-items: center;
    gap: 10px;
}
.vol-icon {
    font-size: 16px;
    line-height: 1;
    text-align: center;
}
.vol-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.2px;
    text-align: left;
}
.vol-row input[type="range"] {
    width: 100%;
    height: 4px;
    accent-color: var(--red, #E50914);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.vol-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--red, #E50914);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(229, 9, 20, 0.6);
    cursor: pointer;
    border: 2px solid #fff;
}
.vol-row input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--red, #E50914);
    border-radius: 50%;
    border: 2px solid #fff;
    cursor: pointer;
}
.vol-value {
    font-size: 11px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    text-align: right;
    font-weight: 600;
}

/* Mic-live badge next to host name */
.mic-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: rgba(229, 9, 20, 0.18);
    border: 1px solid rgba(229, 9, 20, 0.5);
    color: #FF8A95;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    animation: micPulse 1.6s ease-in-out infinite;
}
@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229, 9, 20, 0.35); }
    50%      { box-shadow: 0 0 0 5px rgba(229, 9, 20, 0); }
}

/* ============================================
   Install promo (shown when PWA installable)
   ============================================ */
.install-promo {
    margin: 18px 0 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.14), rgba(255, 215, 0, 0.08));
    border: 1px solid rgba(229, 9, 20, 0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    animation: cardIn 0.5s ease;
}
.install-promo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.install-promo-text strong {
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}
.install-promo-text span {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}
.install-btn {
    background: var(--red, #E50914);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font);
    box-shadow: 0 6px 18px rgba(229, 9, 20, 0.35);
    transition: transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}
.install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(229, 9, 20, 0.5);
}
.install-btn:active { transform: translateY(0); }

/* ============================================
   iOS "Add to Home Screen" instruction sheet
   ============================================ */
.ios-install-sheet {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.ios-install-inner {
    background: linear-gradient(180deg, var(--bg-card, #15171f) 0%, var(--bg-soft, #0f1117) 100%);
    border: 1px solid rgba(229, 9, 20, 0.3);
    border-radius: 20px;
    padding: 22px 22px 26px;
    max-width: 420px;
    width: 100%;
    color: #fff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.3s cubic-bezier(.2, .9, .3, 1.4);
}
@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.ios-install-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.ios-install-head strong {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
}
#iosInstallClose {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
}
.ios-install-sheet ol {
    margin: 0 0 14px;
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.7;
}
.ios-install-sheet ol li { margin-bottom: 4px; }
.ios-icon-share {
    display: inline-block;
    padding: 0 3px;
}
.ios-install-hint {
    margin: 10px 0 0;
    padding: 10px 12px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 10px;
    color: var(--gold, #FFD700);
    font-size: 12px;
    line-height: 1.5;
}

/* ============================================
   Standalone (installed) PWA — safe-area insets
   ============================================ */
@media all and (display-mode: standalone) {
    .receiver-wrap {
        padding-top: calc(20px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        padding-left: calc(20px + env(safe-area-inset-left, 0px));
        padding-right: calc(20px + env(safe-area-inset-right, 0px));
    }
    /* In standalone mode the site's top nav is visual noise — hide it so
       the receiver fills the window like a native app. */
    .nav { display: none; }
    body { background: var(--bg, #0B0D12); }
}
@media all and (display-mode: minimal-ui) {
    .nav { display: none; }
}

/* Smaller screens — tighten vol-row grid */
@media (max-width: 380px) {
    .vol-row {
        grid-template-columns: 20px 60px 1fr 40px;
        gap: 8px;
    }
    .vol-label { font-size: 12px; }
}
