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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    padding: 20px;
    padding-bottom: 40px;
}

.header { text-align: center; margin-bottom: 25px; }
.header h1 {
    font-size: 2.5rem;
    color: #e94560;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 10px;
}
.header p { font-size: 1.1rem; color: #a0a0a0; }

.status-bar {
    background: rgba(255,255,255,0.1);
    border-radius: 50px;
    padding: 14px 25px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    max-width: 500px;
    width: 100%;
    justify-content: center;
    text-align: center;
}

.status-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #666;
    transition: all 0.3s;
    flex-shrink: 0;
}

.status-dot.playing {
    background: #00ff88;
    box-shadow: 0 0 15px #00ff88;
    animation: pulse 1.5s infinite;
}

.status-dot.loading {
    background: #ffb347;
    box-shadow: 0 0 15px #ffb347;
    animation: pulse 0.8s infinite;
}

.status-dot.error {
    background: #ff4444;
    box-shadow: 0 0 15px #ff4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.stations-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    width: 100%;
    max-width: 500px;
}

.station-btn {
    background: linear-gradient(145deg, #0f3460 0%, #16213e 100%);
    border: 3px solid #e94560;
    border-radius: 20px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    color: white;
    text-align: left;
    font-family: inherit;
}

/* Distintivo visual para radios deportivas */
.station-btn.sport {
    border-color: #00c853;
    background: linear-gradient(145deg, #0a3d2a 0%, #16213e 100%);
}

.station-btn.sport:hover:not(:disabled) {
    box-shadow: 0 10px 30px rgba(0, 200, 83, 0.3);
}

.station-btn.sport.active {
    background: linear-gradient(145deg, #00c853 0%, #009639 100%);
    border-color: #5cff8a;
    box-shadow: 0 0 30px rgba(0, 200, 83, 0.5);
}

.station-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(233, 69, 96, 0.3);
}

.station-btn.active {
    background: linear-gradient(145deg, #e94560 0%, #c23a51 100%);
    border-color: #ff6b6b;
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.5);
}

.station-btn.loading {
    background: linear-gradient(145deg, #ffb347 0%, #d4923b 100%);
    border-color: #ffd280;
}

.station-btn.error-state {
    border-color: #ff4444;
    opacity: 0.85;
}

.station-btn.active .station-icon,
.station-btn.loading .station-icon {
    animation: spin 3s linear infinite;
}

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

.station-icon {
    font-size: 2.5rem;
    min-width: 50px;
    text-align: center;
}

.station-info { flex: 1; min-width: 0; }
.station-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 3px;
}
.station-desc { font-size: 0.9rem; color: #a0a0a0; }
.station-btn.active .station-desc,
.station-btn.loading .station-desc {
    color: rgba(255,255,255,0.9);
}

.playing-indicator {
    display: none;
    gap: 4px;
    align-items: flex-end;
    height: 30px;
}

.station-btn.active .playing-indicator { display: flex; }
.station-btn.loading .loading-spinner { display: block; }

.loading-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.bar {
    width: 5px;
    background: white;
    border-radius: 3px;
    animation: equalizer 0.5s ease-in-out infinite alternate;
}

.bar:nth-child(1) { height: 10px; animation-delay: 0s; }
.bar:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.bar:nth-child(3) { height: 15px; animation-delay: 0.2s; }
.bar:nth-child(4) { height: 25px; animation-delay: 0.3s; }

@keyframes equalizer {
    0% { height: 5px; }
    100% { height: 28px; }
}

.volume-section {
    margin-top: 25px;
    width: 100%;
    max-width: 500px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    padding: 20px;
}

.volume-label {
    font-size: 1.1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-slider {
    width: 100%;
    height: 14px;
    border-radius: 10px;
    background: #0f3460;
    outline: none;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e94560;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

.volume-slider::-moz-range-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e94560;
    cursor: pointer;
    border: none;
}

.volume-value {
    text-align: center;
    font-size: 1.3rem;
    margin-top: 8px;
    color: #e94560;
    font-weight: bold;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 500px;
    margin-top: 15px;
}

.action-btn {
    padding: 16px;
    border-radius: 15px;
    font-size: 1.05rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    font-weight: 600;
}

.stop-btn {
    background: #333;
    border: 2px solid #666;
}
.stop-btn:hover { background: #444; border-color: #999; }

.reload-btn {
    background: #0f3460;
    border: 2px solid #1e5b8e;
}
.reload-btn:hover { background: #16487a; border-color: #2a78b4; }
.reload-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.install-banner {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #e94560;
    color: white;
    padding: 16px 28px;
    border-radius: 15px;
    font-size: 1.05rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    border: none;
    font-family: inherit;
}

/* Banner de actualización disponible (aparece arriba) */
.update-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #00c853 0%, #009639 100%);
    color: white;
    padding: 14px 20px;
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-family: inherit;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: slideDown 0.4s ease-out;
}

.update-banner.show {
    display: flex;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.update-banner-text {
    flex: 1;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.update-banner-text-icon {
    font-size: 1.4rem;
    animation: spin-slow 2s linear infinite;
}

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

.update-banner-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.update-btn {
    background: white;
    color: #009639;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.update-btn:active {
    transform: scale(0.95);
}

.update-btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.4);
}

/* Cuando el banner está visible, empujar el contenido hacia abajo */
body.has-update-banner {
    padding-top: 80px;
}

@media (min-width: 768px) {
    .stations-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-contrast: high) {
    .station-btn { border-width: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ============================================================
   SLEEP TIMER — Pegar al final de css/radioweb.css
   ============================================================ */

.timer-section {
    margin: 0 15px 15px;
    position: relative;
}

.timer-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2a2a4a 0%, #1f1f3a 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.timer-btn:active {
    transform: scale(0.98);
}

.timer-btn.active {
    background: linear-gradient(135deg, #1e6b3a 0%, #15522c 100%);
    border-color: #2ecc71;
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.25);
}

.timer-btn.fading {
    background: linear-gradient(135deg, #8b6914 0%, #6b4f0f 100%);
    border-color: #f39c12;
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(243, 156, 18, 0.3); }
    50% { box-shadow: 0 0 16px rgba(243, 156, 18, 0.7); }
}

.timer-icon {
    font-size: 18px;
}

.timer-countdown {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Menú desplegable */
.timer-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

.timer-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.timer-menu-option {
    display: block;
    width: 100%;
    padding: 14px 18px;
    background: transparent;
    color: #fff;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.timer-menu-option:last-child {
    border-bottom: none;
}

.timer-menu-option:active {
    background: rgba(255, 255, 255, 0.08);
}

.timer-menu-option.cancel {
    background: rgba(231, 76, 60, 0.15);
    color: #ff7766;
    font-weight: 600;
}

.timer-menu-option.cancel:active {
    background: rgba(231, 76, 60, 0.3);
}

/* Backdrop para cerrar el menú tocando afuera */
.timer-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 99;
    display: none;
}

.timer-backdrop.show {
    display: block;
}