:root {
    --primary-color: #979e91;
    --secondary-color: #27ae60;
    --gold-color: #f1c40f;
    --card-bg: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: #0f382c;
    min-height: 100%;
    scrollbar-gutter: stable; /* Megakadályozza a jobbra ugrást modal nyitáskor */
}

body {
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(135deg, #1b4d3e, #0f382c, #245c48);
    background-attachment: fixed; /* Így görgetésnél és modalnál sem csúszik el a színátmenet */
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* --- EGYSÉGES SZÉLESSÉG A BANNERNEK, BEVEZETŐNEK ÉS A RÁCSNAK --- */
.banner-container, 
.mystery-intro-section,
.container {
    max-width: 900px;
    width: 100%;
}

.banner-container {
    margin-bottom: 20px;
    text-align: center;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    border: 3px solid var(--gold-color);
}

.banner-img {
    width: 100%;
    height: auto;
    display: block;
}

.banner-desktop {
    display: block;
}
.banner-mobile {
    display: none;
}

@media (max-width: 768px) {
    .banner-desktop {
        display: none;
    }
    .banner-mobile {
        display: block;
    }
}

.header {
    text-align: center;
    margin-bottom: 15px;
}

.header p {
    font-size: 1rem;
    color: #f5f6fa;
}

/* ---- NYOMOZÓS BEVEZETŐ SZEKCIÓ ---- */
.mystery-intro-section {
    margin: 0 auto;
    padding: 20px 0 10px 0;
    color: #f4efe6;
    font-family: 'Lora', Georgia, serif;
}

/* Főcím */
.mystery-main-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    color: #f7f1e3;
    letter-spacing: 2px;
    margin: 0 0 30px 0;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

/* Kétoszlopos elrendezés */
.mystery-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
    align-items: stretch;
}

.mystery-card {
    border-radius: 14px;
    padding: 28px 26px;
    position: relative;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* Bal oldali pergamen kártya */
.parchment-card {
    background: linear-gradient(145deg, #fbf7ee 0%, #f1e8d6 100%);
    color: #2c241b;
    border: 2px solid #d4af37;
}

/* Dekoratív belső sarokkeretek a pergamenen */
.corner-decor {
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: rgba(184, 146, 58, 0.45);
    border-style: solid;
    pointer-events: none;
}
.corner-decor.top-left { top: 10px; left: 10px; border-width: 2px 0 0 2px; }
.corner-decor.top-right { top: 10px; right: 10px; border-width: 2px 2px 0 0; }
.corner-decor.bottom-left { bottom: 10px; left: 10px; border-width: 0 0 2px 2px; }
.corner-decor.bottom-right { bottom: 10px; right: 10px; border-width: 0 2px 2px 0; }

/* Jobb oldali sötét kártya */
.dark-card {
    background: linear-gradient(160deg, #113526 0%, #0b261b 100%);
    border: 1px solid rgba(212, 175, 55, 0.35);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Kártya fejlécek */
.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.icon-badge {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.icon-badge svg {
    width: 20px;
    height: 20px;
}

.red-badge {
    background-color: #7c1d24;
    color: #fff;
    box-shadow: 0 3px 8px rgba(124, 29, 36, 0.35);
}

.dark-gold-badge {
    background-color: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: #e2be53;
}

.eyebrow-text {
    display: block;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 3px;
}
.red-text { color: #8b232a; }
.gold-text { color: #d4af37; }

.card-title {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
}
.dark-title { color: #1f1a14; }
.light-title { color: #f7f1e3; }

/* Pergamen szövegtörzs */
.parchment-body p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 13px 0;
    color: #362d23;
}
.parchment-body .good-luck-text {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1rem;
    color: #1f1a14;
    margin-top: 18px;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Számozott nyomozói tanácsok */
.detective-tips-list {
    list-style: none;
    padding: 0;
    margin: 0 0 18px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detective-tips-list li {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 11px 14px;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    font-size: 0.91rem;
    line-height: 1.45;
    color: #ece6d8;
}

.tip-num {
    width: 23px;
    height: 23px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid #d4af37;
    color: #e8c65b;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Bordó tipp kiemelő doboz */
.tip-callout-box {
    background: linear-gradient(135deg, rgba(122, 26, 34, 0.55) 0%, rgba(88, 17, 23, 0.7) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    padding: 13px 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.sparkle-icon {
    color: #e8c65b;
    font-size: 1rem;
    line-height: 1.4;
}
.tip-callout-box p {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.5;
    color: #f4efe6;
}
.tip-callout-box strong {
    color: #f3d26b;
}

/* ---- NYOMOZÓI SEGÉDANYAGOK DOBOZ ---- */
.resources-box {
    background: linear-gradient(180deg, rgba(14, 46, 33, 0.9) 0%, rgba(10, 35, 25, 0.95) 100%);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 14px;
    padding: 24px 25px 28px 25px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    margin-bottom: 40px;
}

.decorative-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}
.decorative-divider span {
    width: 35px;
    height: 1px;
    background: rgba(212, 175, 55, 0.5);
}
.decorative-divider i {
    font-style: normal;
    color: #d4af37;
    font-size: 0.75rem;
}

.resources-title {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #f7f1e3;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 22px 0;
}

.resources-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.resource-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    padding: 15px 24px;
    border-radius: 12px;
    flex: 1 1 300px;
    max-width: 380px;
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.resource-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.06);
}

/* Bordó gomb */
.btn-red {
    background: linear-gradient(135deg, #8b1e26 0%, #631218 100%);
    border: 1.5px solid #d4af37;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    color: #ffffff;
}
.btn-red .btn-icon-circle {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #f7f1e3;
}
.btn-red .btn-sub-label {
    color: rgba(255, 255, 255, 0.85);
}

/* Arany gomb */
.btn-gold {
    background: linear-gradient(135deg, #e7c555 0%, #c89d28 100%);
    border: 1.5px solid #fff2b2;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    color: #241907;
}
.btn-gold .btn-icon-circle {
    background: rgba(36, 25, 7, 0.1);
    border: 1px solid rgba(36, 25, 7, 0.25);
    color: #241907;
}
.btn-gold .btn-sub-label {
    color: rgba(36, 25, 7, 0.85);
}

.btn-icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.btn-icon-circle svg {
    width: 19px;
    height: 19px;
}

.btn-text-group {
    display: flex;
    flex-direction: column;
}

.btn-main-label {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.btn-sub-label {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ---- KALENDÁRIUM FELETTI FELVEZETŐ ---- */
.calendar-intro-header {
    text-align: center;
    margin-bottom: 12px;
}

.date-pill {
    display: inline-block;
    background: rgba(14, 48, 34, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: #e6c665;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 0.76rem;
    letter-spacing: 1.5px;
    padding: 6px 18px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.calendar-section-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #f7f1e3;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.calendar-section-subtitle {
    font-family: 'Lora', serif;
    font-size: 0.98rem;
    color: #d8d2c5;
    margin: 0 auto;
    max-width: 600px;
}

/* ---- MEGLÉVŐ KALENDÁRIUM RÁCS ---- */
.container {
    margin-bottom: 40px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 20px;
    padding: 10px;
}

.door {
    aspect-ratio: 1;
    background: var(--primary-color);
    border-radius: 15px;
    text-decoration: none;
    color: white;
    box-shadow: 0 8px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 4px solid var(--gold-color);
}
.door.openable{
  background-color:goldenrod;
}
.door.openable:hover {
    transform: translateY(-5px) scale(1.03);
}

.door.locked {
    background: #546e7a;
    border-color: #78909c;
    opacity: 0.85;
}

/* --- MOBILON FELCSÚSZÁS JAVÍTÁSA --- */
.door-inner {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
}

/* A doboz elülső részének igazítása mobilos és asztali nézetben is */
.door-front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    padding: 5px;
    box-sizing: border-box;
}

/* A nap számának stílusa, hogy mindig jól látszódjon */
.day-number {
    font-family: 'Fredoka One', cursive, sans-serif;
    font-size: 1.5rem;
    z-index: 2;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    margin-bottom: 2px;
}

/* A doboz kép méretarányos igazítása */
.box-image {
    width: 100%;
    max-height: 80px;
    object-fit: contain;
    z-index: 1;
}

.door.locked .day-number {
    color: #cfd8dc;
}

/* MODAL STÍLUSOK */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #fff;
    color: #2c3e50;
    padding: 30px;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 88vh;
    max-height: 88dvh;
    overflow-y: auto;
    margin: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    position: relative;
    text-align: left;
    border: 5px solid var(--secondary-color);
    animation: scaleUp 0.3s ease;
}

.modal-content h2,
.modal-content .caption,
.modal-footer {
    text-align: center;
}

.modal-body img {
    display: block;
    margin: 0 auto;
}

.modal-content h2 {
    font-family: 'Fredoka One', cursive;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2rem;
}

.modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 15px;
}

.modal-body p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    text-decoration: none;
    color: #7f8c8d;
    font-weight: bold;
    transition: color 0.2s;
}

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

.modal-footer {
    margin-top: 25px;
}

.btn-back {
    background: var(--secondary-color);
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.2s;
    display: inline-block;
}

.btn-back:hover {
    background: #219653;
}

.error-box h2 {
    color: #e74c3c;
}

body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}

.modal-overlay {
    overscroll-behavior: contain;
}

footer {
    text-align: center;
    margin-top: auto;
    color: #ecf0f1;
    font-size: 0.9rem;
    padding: 20px 0;
}

/* Animációk */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

/* Reszponzivitás */
@media (max-width: 850px) {
    .mystery-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .mystery-main-title {
        font-size: 1.35rem;
        letter-spacing: 1px;
        margin-bottom: 22px;
    }
    .mystery-card {
        padding: 22px 18px;
    }
    .resource-btn {
        max-width: 100%;
        flex: 1 1 100%;
    }
    .calendar-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    .day-number {
      font-size: 1.2rem;
    }
    .box-image {
        width: 80%;
        max-height: 60px;
    }
}