:root {
    --bg-color: #0d0f26;
    --text-primary: #fdf2f8;
    --text-secondary: #fbcfe8;
    --accent: #ec4899;
    --accent-hover: #db2777;
    --pink-light: #fce7f3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    /* Prevent scrolling, sections cover full screen */
}

/* Base Section Style */
section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

section.active-section {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
}

section.hidden-section {
    opacity: 0;
    transform: translateY(20px);
}

/* --- HERO SECTION (Flower Field) --- */
#hero {
    background: radial-gradient(circle at center, #1b3a1b 0%, #000000 100%);
}

#flowerCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    pointer-events: none;
    /* Let clicks pass to canvas initially, except button */
}

.glow-text {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    color: var(--pink-light);
    text-shadow: 0 0 10px rgba(236, 72, 153, 0.5), 0 0 20px rgba(236, 72, 153, 0.3);
    margin-bottom: 1rem;
    animation: float 4s ease-in-out infinite;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.instruction {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 2rem;
    font-style: italic;
}

.primary-btn {
    pointer-events: all;
    background: linear-gradient(45deg, var(--accent), var(--accent-hover));
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(236, 72, 153, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    font-weight: 600;
}

.primary-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 15px 25px rgba(236, 72, 153, 0.4);
}

/* Floating Music Toggle Button */
.music-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.music-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.music-toggle-btn.muted {
    opacity: 0.5;
}

/* --- VAULT & ROOMS GAME SECTION --- */
#game {
    background: linear-gradient(to bottom, #1e1b4b, #312e81, #000000);
}

.room {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    text-align: center;
}

.room.active-room {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
    z-index: 10;
}

.room.hidden-room {
    opacity: 0;
    transform: scale(0.9);
}

/* Vault Room Styles */
#vaultRoom h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    color: var(--pink-light);
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.vault-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.lock-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(236, 72, 153, 0.5));
}

.password-inputs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.password-inputs input {
    width: 70px;
    height: 70px;
    font-size: 2rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--accent);
    color: white;
    border-radius: 10px;
    font-family: monospace;
    transition: all 0.3s;
}

.password-inputs input.year-input {
    width: 120px;
}

.password-dot {
    font-size: 3rem;
    color: var(--accent);
    font-weight: bold;
    margin-top: -15px;
}

.password-inputs input.solved {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.2);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.5);
}

.lock-btn {
    width: 100%;
}

.error-msg {
    color: #f87171;
    margin-top: 10px;
    font-weight: bold;
    min-height: 20px;
}

.doors-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.door-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 25px;
    border-radius: 15px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.door-btn:hover {
    background: rgba(236, 72, 153, 0.2);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.door-btn.solved-door {
    background: rgba(74, 222, 128, 0.1);
    border-color: #4ade80;
    color: #4ade80;
    pointer-events: none;
    /* Odalara tekrar girilmesin */
    opacity: 0.7;
}

.back-btn {
    margin-top: 30px;
    background: none;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Room 1: Simon Says */
.simon-board {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 30px 0;
    max-width: 300px;
    transition: all 0.5s ease;
}

.simon-board.hell-mode-board {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    max-width: 500px;
}

.simon-btn {
    aspect-ratio: 1 / 1;
    border-radius: 15px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.1s, transform 0.1s;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    min-width: 50px;
    min-height: 50px;
}

.simon-btn.active {
    opacity: 1;
    transform: scale(0.90);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.hell-btn {
    display: none;
}

.simon-board.hell-mode-board .hell-btn {
    display: block;
}

/* Simon Colors */
.simon-color-1 {
    background-color: #ef4444;
}

/* Red */
.simon-color-2 {
    background-color: #3b82f6;
}

/* Blue */
.simon-color-3 {
    background-color: #22c55e;
}

/* Green */
.simon-color-4 {
    background-color: #eab308;
}

/* Yellow */
.simon-color-5 {
    background-color: #a855f7;
}

/* Purple */
.simon-color-6 {
    background-color: #ec4899;
}

/* Pink */
.simon-color-7 {
    background-color: #06b6d4;
}

/* Cyan */
.simon-color-8 {
    background-color: #f97316;
}

/* Orange */

#simonMessage {
    font-size: 1.2rem;
    margin-top: 15px;
    min-height: 25px;
    transition: color 0.3s;
}

/* Hell Mode Effects */
@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

#room1.hell-mode-active {
    background: radial-gradient(circle, #7f1d1d 0%, #450a0a 100%);
    animation: shake 0.3s infinite;
}

#room1.hell-mode-active h3,
#room1.hell-mode-active p {
    color: #fca5a5;
    text-shadow: 0 0 10px #b91c1c;
}

/* Room 2: Fotoğraf Hafıza Kartları */
.memory-room {
    background: radial-gradient(circle, #2e1065 0%, #000000 100%);
}

.memory-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 20px 0;
    width: 90%;
    max-width: 400px;
    perspective: 1000px;
}

.memory-card {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    cursor: pointer;
    border-radius: 10px;
}

/* Dönüş Yapacak İç Kisim */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

/* Dönüş Sınıfı */
.memory-card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* Eşleşme Durumu */
.memory-card.matched .card-inner {
    transform: rotateY(180deg) !important;
}

.memory-card.matched {
    opacity: 0.9 !important;
    cursor: default !important;
    pointer-events: none !important;
}

/* Eşleşen Karta Yeşil Parlama */
.memory-card.matched .card-inner::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    box-shadow: 0 0 20px #4ade80, inset 0 0 20px #4ade80;
    z-index: 10;
    pointer-events: none;
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    overflow: hidden;
}

.card-front {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.card-front::after {
    content: "💝";
}

.card-back {
    background-color: #fff;
    transform: rotateY(180deg);
    border: 2px solid #fff;
}

.card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.memory-msg {
    min-height: 25px;
    margin-top: 15px;
    font-size: 1.2rem;
    font-weight: bold;
}

/* --- Oda 3: Hobiler Kaçış Odası --- */
.hobbies-room {
    background: radial-gradient(circle, #312e81 0%, #000000 100%);
}

.hobbies-scatter-area {
    position: relative;
    width: 100%;
    height: 250px;
    margin: 20px 0;
    /* İkonlar absolute olarak bu alanın içine dağılacak */
}

/* Her Bir Hobi İkonunun Ortak Özelliği */
.hobby-item {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    width: 70px;
    height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    user-select: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.hobby-item:hover,
.hobby-item.active {
    transform: scale(1.1) rotate(5deg) !important;
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent);
    box-shadow: 0 5px 15px rgba(236, 72, 153, 0.6);
    z-index: 5;
}

.hobby-name {
    font-size: 0.6rem;
    color: white;
    margin-top: 5px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

/* --- İKONLARIN RASTGELE KONUMLARI --- */
.pos-1 {
    top: 10%;
    left: 10%;
    transform: rotate(-10deg);
}

.pos-2 {
    top: 70%;
    left: 20%;
    transform: rotate(15deg);
}

.pos-3 {
    top: 30%;
    left: 70%;
    transform: rotate(20deg);
}

.pos-4 {
    top: 75%;
    left: 60%;
    transform: rotate(-5deg);
}

.pos-5 {
    top: 40%;
    left: 40%;
    transform: scale(1.1);
}

.hobby-special {
    animation: pulse 2s infinite;
}

/* --- MİNİ KASA --- */
.mini-vault-center {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.mini-vault-center h4 {
    margin-top: 0;
    color: #fce7f3;
}

/* --- Alt Odalar Ortak Görünüm --- */
.sub-room {
    background: radial-gradient(circle, #0f172a 0%, #000 100%);
}

.mini-inputs input {
    width: 150px;
    height: 50px;
    font-size: 1.5rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--text-secondary);
    color: white;
    border-radius: 10px;
    letter-spacing: 5px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.mini-inputs input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
    outline: none;
}

/* --- MESSAGE SECTION --- */
#message {
    background: radial-gradient(circle at center, #4c1d95 0%, #000000 100%);
}

#confettiCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.envelope {
    position: relative;
    width: 300px;
    height: 200px;
    background-color: #fce7f3;
    border-radius: 10px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 5;
    transition: transform 0.4s ease;
}

.envelope:hover {
    transform: scale(1.02);
}

.envelope::before {
    content: "Zarfı Açmak İçin Dokun 💌";
    position: absolute;
    bottom: -40px;
    font-size: 0.9rem;
    color: var(--pink-light);
    white-space: nowrap;
    animation: pulse 2s infinite;
}

.envelope.open::before {
    display: none;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-top: 100px solid #fbcfe8;
    transform-origin: top;
    transition: transform 0.5s ease-in-out;
    z-index: 3;
}

.envelope-body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 150px solid #f9a8d4;
    border-right: 150px solid #f9a8d4;
    border-bottom: 100px solid #f472b6;
    border-radius: 0 0 10px 10px;
    z-index: 2;
}

.letter {
    position: absolute;
    bottom: 10px;
    width: 280px;
    height: auto;
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: bottom 0.8s ease-in-out, transform 0.8s ease-in-out;
    z-index: 1;
    color: #333;
    text-align: left;
}

.letter h2 {
    font-family: 'Dancing Script', cursive;
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.letter p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.letter .sign {
    font-family: 'Dancing Script', cursive;
    text-align: right;
    font-size: 1.4rem;
    color: var(--accent-hover);
}

/* Open Envelope State */
.envelope.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 0;
}

.envelope.open .letter {
    bottom: 80px;
    transform: translateY(-50px) scale(1.2);
    z-index: 10;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .glow-text {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
        padding: 0 15px;
    }

    #vaultRoom h2 {
        font-size: 1.8rem;
        padding: 0 10px;
    }

    .vault-container {
        padding: 20px 15px;
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    .password-inputs input {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .password-inputs input.year-input {
        width: 90px;
    }

    .password-dot {
        font-size: 2rem;
        margin-top: -10px;
    }

    .doors-container {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    .door-btn {
        width: 100%;
        padding: 12px 15px;
        font-size: 1rem;
    }

    .simon-board {
        gap: 10px;
        max-width: 260px;
    }
    
    .simon-board.hell-mode-board {
        gap: 3px;
        max-width: 300px;
    }

    .card-front, .card-back {
        font-size: 1.5rem;
    }

    .hobby-item {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .pos-1 { top: 5%; left: 5%; }
    .pos-2 { top: 65%; left: 5%; }
    .pos-3 { top: 20%; left: 75%; }
    .pos-4 { top: 70%; left: 70%; }
    .pos-5 { top: 35%; left: 35%; }

    .mini-inputs input {
        width: 120px;
        height: 40px;
        font-size: 1.2rem;
        letter-spacing: 3px;
    }

    .room-content {
        padding: 0 15px;
        text-align: center;
    }
    
    .room-content h3 {
        font-size: 1.5rem;
    }
    
    #tadc-game-area button {
        width: 48% !important; /* overrides inline styles */
        padding: 10px 5px;
        font-size: 0.9rem;
    }

    .game-ui h2 {
        font-size: 1.8rem;
    }

    .envelope {
        width: 260px;
        height: 180px;
    }

    .envelope-flap {
        border-left-width: 130px;
        border-right-width: 130px;
        border-top-width: 90px;
    }

    .envelope-body {
        border-left-width: 130px;
        border-right-width: 130px;
        border-bottom-width: 90px;
    }

    .letter {
        width: 240px;
        padding: 15px;
    }
    
    .letter h2 {
        font-size: 1.5rem;
    }
    
    .letter p {
        font-size: 0.85rem;
    }
    
    .question-box {
        width: 90%;
        margin-left: auto;
        margin-right: auto;
        padding: 15px;
    }
}

/* Sub-Room Background Video */
.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.25;
    /* Dimmed so text is readable */
    pointer-events: none;
    /* Ignore clicks */
}

/* Telefonla dikey/farklı çekilmiş videolar ekrana sığsın ve aşırı zoom yapmasın diye */
.bg-video.contain-video {
    object-fit: fill; /* Yana doğru esnemesi ve tüm ekranı doldurması için */
    width: 100vw;
    height: 100vh;
}

/* Ensure content sits above the video */
.room-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1.5s ease-in-out; /* Fade efekti için yavaş geçiş */
}

/* Video Oynarken Arayüzü Gizlemek İçin */
.room-content.fade-out {
    opacity: 0;
    pointer-events: none; /* Tıklanamaz olsun */
}