/* Estilos Premium para #RetoECG - Homescreen y Multiplayer */
@import url('fonts.css');

:root {
    --bg-gradient: linear-gradient(135deg, #09090e 0%, #14142b 100%);
    --primary: #dd5865;
    --primary-hover: #f1727e;
    --primary-glow: rgba(221, 88, 101, 0.4);
    --secondary: #4488ff;
    --secondary-hover: #66a3ff;
    --secondary-glow: rgba(68, 136, 255, 0.4);
    --accent: #f2b115;
    --accent-glow: rgba(242, 177, 21, 0.3);
    --text-main: #ffffff;
    --text-muted: #a0aec0;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --card-hover-border: rgba(255, 255, 255, 0.25);
    --success: #00e676;
    --error: #ff1744;
}

body {
    background-color: #09090e;
    background-image: 
        linear-gradient(135deg, rgba(9,9,14,0.88) 0%, rgba(20,20,43,0.88) 100%),
        url('../../ecg.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Background grid removed — using background image instead */

/* ECG Line Animation */
.ecg-line-container {
    position: relative;
    width: 180px;
    height: 80px;
    margin-bottom: 20px;
}
.ecg-svg {
    width: 100%;
    height: 100%;
    stroke: var(--primary);
    stroke-width: 3;
    fill: none;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawECG 4s linear infinite;
    filter: drop-shadow(0 0 8px var(--primary));
}

@keyframes drawECG {
    0% { stroke-dashoffset: 1000; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -1000; }
}

/* Typography styling */
h1.title-glow {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(to right, #ffffff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(221, 88, 101, 0.2);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
    text-align: center;
    max-width: 450px;
    line-height: 1.6;
}

/* Glassmorphism Cards */
.glass-card {
    max-width: 480px;
    width: 92%;
    box-sizing: border-box;
    margin: 60px auto 120px auto;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    text-align: center;
}

/* Buttons */
.btn-premium {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(221, 88, 101, 0.6);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: var(--secondary);
    box-shadow: 0 4px 15px var(--secondary-glow);
}
.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(68, 136, 255, 0.6);
    color: white;
    text-decoration: none;
}

.btn-back {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
}
.btn-back:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

/* Inputs and Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}
.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px var(--secondary-glow);
}

/* Code Display for Lobby */
.code-display-box {
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed var(--accent);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}
.room-code {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 5px;
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent-glow);
    margin: 0;
    user-select: all;
}

.share-link-input {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 6px;
    word-break: break-all;
    user-select: all;
    cursor: pointer;
    border: 1px solid var(--card-border);
    margin-top: 10px;
}

/* Rhythm selection layout */
.rhythm-list-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}
/* Scrollbar */
.rhythm-list-container::-webkit-scrollbar {
    width: 8px;
}
.rhythm-list-container::-webkit-scrollbar-track {
    background: transparent;
}
.rhythm-list-container::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}
.rhythm-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--card-hover-border);
}

.rhythm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.rhythm-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--card-border);
}
.rhythm-item.selected {
    background: var(--secondary-glow);
    border-color: var(--secondary);
}

/* ECG Trazado y Opciones en Desafío */
.ecg-display-img {
    width: 100%;
    border-radius: 12px;
    border: 2px solid var(--card-border);
    background-color: #000;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    margin-bottom: 20px;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

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

.option-btn {
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.option-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--card-hover-border);
}
.option-btn.correct {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: #000 !important;
    font-weight: bold;
}
.option-btn.incorrect {
    background: var(--error) !important;
    border-color: var(--error) !important;
    color: #fff !important;
}

/* Header & Status Indicator */
.lobby-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 15px;
}
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-muted);
}
.status-dot.active {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 1.5s infinite;
}
.status-dot.waiting {
    background-color: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

/* Timer Circular / Progress Bar */
.timer-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}
.progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    width: 100%;
    background: var(--accent);
    transition: width 1s linear;
}

/* Round counter & Score board */
.scoreboard {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.score-player {
    font-weight: 600;
}
.score-val {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: bold;
}

/* Landing Page Specific styling — matched to RetoRCP */
.landing-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px auto;
    background: rgba(221, 88, 101, 0.1);
    border: 1px solid var(--primary-glow);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.landing-logo img {
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
}

.landing-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #ffffff 0%, #ccd1e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-subtitle {
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 25px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

/* Footer / Ad styling */
.footer-text {
    margin-top: 30px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
