input[type="radio"] {
    display: none;
}

/* --- POPUP / MODAL PELIKOODILLE --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 14, 0.85);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover { 
    color: var(--accent-primary); 
}

/* --- HERO KARUSELLI (#WRAP) - KOKO NÄYTÖN ETUNÄKYMÄ --- */
#wrap {
    position: relative;
    width: 100%;
    min-height: 85vh;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bgr-dark);
}

#carousel_container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SLIDET TÄYTTÄVÄT KOKO PINTA-ALAN KANSSA TAUSTAKUVAN */
#wrap .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px) scale(0.98);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.6s;
    padding: 80px 20px 40px;
    box-sizing: border-box;
    text-align: center;
    background: linear-gradient(180deg, rgba(18, 18, 22, 0.55) 0%, var(--bgr-dark) 100%), 
                url("https://cnt.viihdetta.fi/kuvat/bgr-all.jpg") center/cover no-repeat;
}

#wrap .slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ILMAVA HERO CONTENT (ILMAN LAATIKKOTAUSTAA) */
.hero-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 auto;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* GLASS CARD MODALEILLE JA ERILLISKORTEILLE */
.glass-card {
    background: var(--bgr-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 40px 35px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card.wide-card {
    max-width: 900px;
}

.glass-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5), 0 0 25px var(--accent-glow);
}

/* HERO TYPOGRAFIA JA PAINIKKEET */
.hero-badge, .badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: rgba(255, 204, 0, 0.12);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    margin-bottom: 20px;
    box-shadow: 0 0 15px var(--accent-glow);
}

.hero-title {
    font-size: clamp(2.5rem, 5.5vw, 4.2rem);
    font-weight: 900;
    line-height: 1.1;
    margin: 0 0 18px 0;
    color: var(--text-primary);
    letter-spacing: -1.5px;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.hero-title span {
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-glow);
}

.hero-text {
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 680px;
    margin: 0 0 32px 0;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 38px;
    font-size: 1.05rem;
    font-weight: 800;
    border-radius: 9999px;
    color: #000000;
    background: var(--accent-primary);
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 30px var(--accent-glow);
    transition: all 0.3s ease;
}

.btn-hero:hover {
    background: var(--accent-soft);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 15px 35px var(--accent-glow);
}

.input-glow-group {
    width: 100%;
    max-width: 380px;
}

.input-glow-group input[type="number"] {
    width: 100%;
    height: 58px;
    border-radius: 14px;
    background: var(--bgr-dark);
    border: 1.5px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.input-glow-group input[type="number"]:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* KARUSELLIN NAVIGOINTI */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 1.4rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.carousel-nav:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(255, 204, 0, 0.1);
    transform: translateY(-50%) scale(1.08);
}

.prev-btn { left: 30px; }
.next-btn { right: 30px; }

.carousel-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-subtle);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    width: 32px;
    border-radius: 10px;
    background: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* --- AVOIMET PELIT -OSIO --- */
.main-section {
    padding: 90px 20px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-header h3 {
    font-size: clamp(2.2rem, 4.5vw, 3rem);
    font-weight: 800;
    margin: 12px 0 8px 0;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

#tapahtumalista_wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Tyylikäs ilmoitus, kun ei ole aktiivisia tapahtumia */
.no-events-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 55px 30px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.no-events-card .icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.7;
}

/* Moderni ja tyylikäs tapahtumakortti */
.tapahtuma-kortti {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 22px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.tapahtuma-kortti:hover {
    border-color: var(--accent-primary);
    background: rgba(255, 204, 0, 0.04);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
}

.tapahtuma-info h4 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 4px 0;
}

.tapahtuma-info p {
    font-size: 0.95rem;
    margin: 0;
    color: var(--text-secondary);
}

.btn-liity {
    background: var(--accent-primary);
    color: #000000;
    padding: 12px 26px;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-liity:hover {
    background: var(--accent-soft);
    transform: scale(1.05);
}

/* --- FOOTER (KOKO LEVEYS, MONISARAKKEINEN) --- */
#site_footer {
    width: 100%;
    background: #08080a;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 70px 20px 35px;
    box-sizing: border-box;
    margin-top: 60px;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

.footer-brand {
    max-width: 320px;
}

.footer-logo { 
    height: 36px; 
    margin-bottom: 16px; 
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.footer-nav h4,
.footer-info h4 { 
    color: var(--accent-primary); 
    margin: 0 0 18px 0; 
    font-size: 1.1rem; 
    letter-spacing: 0.5px;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.footer-bottom { 
    max-width: 1100px;
    margin: 50px auto 0; 
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4); 
    font-size: 0.85rem; 
    text-align: center; 
}

.link-hover { 
    color: var(--text-secondary); 
    text-decoration: none; 
    transition: color 0.2s ease;
}

.link-hover:hover { 
    color: var(--accent-primary); 
    text-decoration: underline; 
}

/* SPINNERI */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-subtle);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media screen and (max-width: 768px) {
    .carousel-nav { display: none; }
    .hero-title { font-size: 2.1rem; }
    .glass-card { padding: 30px 20px; }
    .tapahtuma-kortti { flex-direction: column; align-items: flex-start; gap: 15px; }
    .footer-container { 
        flex-direction: column; 
        gap: 35px; 
        text-align: center; 
        align-items: center;
    }
}