:root {
    --primary-color: #4A148C;
    --accent-color: #00E5FF;
    --button-color: #FF6D00;
    --text-light: #F3E5F5;
    --card-bg: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #1a0033 0%, #4a148c 100%);
    color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    color: var(--accent-color);
    text-decoration: none;
    text-shadow: 2px 2px 0px #000;
}

.menu-toggle {
    display: none;
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}
.menu-toggle:hover { color: var(--accent-color); }

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--accent-color);
}

.hero {
    text-align: center;
    padding: 8rem 2rem;
    position: relative;
}

.hero h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero h1 span {
    color: var(--button-color);
}

.hero p {
    font-size: 1.5rem;
    max-width: 700px;
    margin: 0 auto 3rem;
    color: var(--text-light);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.2rem;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background-color: var(--button-color);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 109, 0, 0.4);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 4rem 10%;
}

.card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.card:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.15);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
}

.card h3 {
    font-family: 'Fredoka', sans-serif;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.about-section {
    padding: 5rem 10%;
    background: rgba(0, 0, 0, 0.2);
}

.section-title {
    text-align: center;
    font-family: 'Fredoka', sans-serif;
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 3rem;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.about-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 15px;
    border-left: 5px solid var(--button-color);
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease;
}

.about-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.about-card h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.about-card p {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.7;
}

.mission strong { color: var(--button-color); }
.mission em { color: var(--accent-color); font-style: normal; font-weight: bold; }

.supporter-list {
    list-style: none;
    margin-top: 1rem;
}

.supporter-list li {
    background: rgba(74, 20, 140, 0.5);
    margin-bottom: 0.5rem;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

footer {
    background: rgba(0, 0, 0, 0.4);
    text-align: center;
    padding: 3rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-links { margin-bottom: 1.5rem; }
.footer-links a {
    color: var(--text-light);
    margin: 0 15px;
    text-decoration: none;
    font-size: 0.9rem;
}
.footer-links a:hover { color: var(--button-color); }

.credits { font-size: 0.8rem; color: rgba(255,255,255,0.5); }

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: rgba(40, 0, 80, 0.95);
    padding: 0;
    border: 1px solid var(--accent-color);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.2);
    position: relative;
    text-align: center;
    overflow: hidden;
    animation: slideIn 0.4s ease;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 10px;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}
.close-btn:hover { color: var(--accent-color); }

.modal-header {
    background: linear-gradient(90deg, var(--primary-color), #2c0052);
    padding: 2rem 1rem;
    color: white;
}

.modal-header h2 { font-family: 'Fredoka', sans-serif; margin-bottom: 0.5rem; }

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    text-align: left;
    scrollbar-width: thin;
    scrollbar-color: var(--button-color) rgba(255, 255, 255, 0.1);
}

.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.1); }
.modal-body::-webkit-scrollbar-thumb { background-color: var(--button-color); border-radius: 4px; }

.modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: transparent;
    padding: 1rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    border: 2px solid;
    color: #fff;
    cursor: pointer;
}
.modal-btn:hover { transform: scale(1.03); }

.email-btn { border-color: var(--button-color); }
.email-btn:hover { background: var(--button-color); box-shadow: 0 0 20px var(--button-color); }

.linkedin-btn { border-color: #0077b5; }
.linkedin-btn:hover { background: #0077b5; box-shadow: 0 0 20px #0077b5; }

.privacy-content { max-width: 600px; }
.modal-body h3 {
    color: var(--accent-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-family: 'Fredoka', sans-serif;
}
.modal-body ul { margin-left: 20px; margin-bottom: 1rem; color: var(--text-light); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }


.game-hub {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    padding: 2rem 10%;
    max-width: 1200px;
    margin: 0 auto;
}

.game-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}
.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.2);
    border-color: var(--accent-color);
}

.card-image {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
}
.keloglan-bg { background: linear-gradient(45deg, #FF6D00, #FFab40); }
.hezarfen-bg { background: linear-gradient(45deg, #0288D1, #29B6F6); }
.karagoz-bg { background: linear-gradient(45deg, #D84315, #FF5722); }
.baris-bg { background: linear-gradient(45deg, #7B1FA2, #E040FB); }
.piri-bg { background: linear-gradient(45deg, #1A237E, #3949AB); }
.dede-bg { background: linear-gradient(45deg, #5D4037, #8D6E63); }
.hoca-bg { background: linear-gradient(45deg, #4A148C, #7c43bd); }

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.card-content h3 {
    font-family: 'Fredoka', sans-serif;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}
.card-content .desc {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 1.5rem;
    flex: 1;
}

.progress-area {
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    color: #aaa;
}
.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    height: 10px;
    border-radius: 5px;
    margin: 5px 0;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--button-color);
    transition: width 1s ease;
}

.play-btn {
    display: block;
    text-align: center;
    background: var(--accent-color);
    color: #000;
    text-decoration: none;
    padding: 10px;
    border-radius: 10px;
    font-weight: bold;
    transition: filter 0.3s;
    border: none;
    cursor: pointer;
}
.play-btn:hover { filter: brightness(1.2); }

.game-body {
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at center, #2c0052 0%, #1a0033 100%);
    color: white;
}

.game-header {
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem 2rem;
    border-bottom: 2px solid var(--accent-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.level-info { display: flex; align-items: center; gap: 15px; }
.level-badge {
    background: var(--button-color);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-family: 'Fredoka', sans-serif;
    box-shadow: 0 0 10px var(--button-color);
}
.game-title {
    font-family: 'Fredoka', sans-serif;
    color: var(--accent-color);
    margin: 0;
    text-shadow: 0 0 5px var(--accent-color);
}
.exit-btn {
    color: #ff5252 !important; border: 1px solid #ff5252; padding: 8px 15px; border-radius: 20px; transition: all 0.3s;
}
.exit-btn:hover { background: #ff5252; color: white !important; box-shadow: 0 0 15px #ff5252; }

.game-arena {
    flex: 1;
    display: flex;
    padding: 2rem;
    gap: 3rem;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
}

.grid-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 25px;
    border: 3px solid rgba(0, 229, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(5, 70px);
    grid-template-rows: repeat(5, 70px);
    gap: 8px;
}

.grid-cell {
    width: 70px; height: 70px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
    position: relative;
}

.keloglan, .elma, .agac { position: absolute; transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5)); }
.keloglan { z-index: 10; }
.elma { animation: pulse 1.5s infinite alternate; }

.control-panel {
    flex: 1; max-width: 450px;
    background: rgba(0, 0, 0, 0.4);
    padding: 2rem; border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex; flex-direction: column; gap: 1.5rem;
}
.control-panel h3 { font-family: 'Fredoka', sans-serif; color: var(--accent-color); margin-bottom: 0.5rem; }
.panel-hint { font-size: 0.9rem; color: #aaa; margin-bottom: 1rem; }

.command-palette { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmd-block {
    background: var(--primary-color); color: white; padding: 12px;
    border-radius: 10px; font-weight: bold; text-align: center;
    cursor: grab; box-shadow: 0 4px 0 #311b92; transition: all 0.1s;
    font-family: 'Fredoka', sans-serif; border: 2px solid rgba(255,255,255,0.2);
    user-select: none;
}
.cmd-block:active { cursor: grabbing; transform: translateY(4px); box-shadow: 0 0 0 #311b92; }
.cmd-up { background: #00C853; box-shadow: 0 4px 0 #008f3e; }
.cmd-down { background: #D50000; box-shadow: 0 4px 0 #9b0000; }
.cmd-left { background: #FF6D00; box-shadow: 0 4px 0 #c45400; }
.cmd-right { background: #2962FF; box-shadow: 0 4px 0 #0039cb; }

.drop-zone {
    background: rgba(255, 255, 255, 0.1); min-height: 80px;
    border-radius: 15px; border: 3px dashed rgba(255, 255, 255, 0.3);
    display: flex; flex-wrap: wrap; gap: 10px; padding: 15px;
    align-items: center; justify-content: flex-start;
    transition: all 0.3s;
}
.drop-zone.drag-over { background: rgba(0, 229, 255, 0.2); border-color: var(--accent-color); }
.drop-zone .placeholder { color: #888; width: 100%; text-align: center; pointer-events: none; }

.dropped-block {
    background: rgba(255,255,255,0.2); color: white;
    font-weight: bold; text-align: center; font-family: 'Fredoka', sans-serif;
    padding: 8px 15px; font-size: 0.9rem;
    border-radius: 8px; position: relative; animation: popIn 0.3s ease;
}
.dropped-block.cmd-up { background: #00C853; }
.dropped-block.cmd-down { background: #D50000; }
.dropped-block.cmd-left { background: #FF6D00; }
.dropped-block.cmd-right { background: #2962FF; }
.running-block { box-shadow: 0 0 15px var(--accent-color) !important; border: 2px solid var(--accent-color) !important; transform: scale(1.05); z-index: 10; }

.game-actions { margin-top: auto; display: flex; gap: 10px; }
.play-btn-effect { background: linear-gradient(45deg, #00C853, #00E676); font-size: 1.2rem; flex: 2; border: none; padding: 12px; border-radius: 10px; color: white; font-weight: bold; cursor: pointer; }
.stop-btn-effect { background: linear-gradient(45deg, #D50000, #FF1744); flex: 1; border: none; padding: 12px; border-radius: 10px; color: white; font-weight: bold; cursor: pointer; }
.play-btn-effect:disabled, .stop-btn-effect:disabled { opacity: 0.6; cursor: not-allowed; }

.game-message { text-align: center; font-weight: bold; min-height: 1.5rem; font-family: 'Fredoka', sans-serif; }

.game-modal { display: none; align-items: center; justify-content: center; backdrop-filter: blur(10px); }
.game-modal-content { background: rgba(20, 0, 40, 0.95); border: 2px solid; border-radius: 30px; max-width: 450px; text-align: center; box-shadow: 0 0 50px rgba(0,0,0,0.8); transform: scale(0.8); opacity: 0; transition: all 0.4s; }
.game-modal.active .game-modal-content { transform: scale(1); opacity: 1; }
.win-header { background: linear-gradient(90deg, #00C853, #00E676); border-color: #00C853; }
.lose-header { background: linear-gradient(90deg, #D50000, #FF1744); border-color: #D50000; }
.game-modal-body { padding: 3rem 2rem; }
.win-icon, .lose-icon { font-size: 5rem; display: block; margin-bottom: 1rem; }
.next-level-btn { background: #00C853; width: 100%; padding: 1.2rem; font-size: 1.3rem; border: none; }
.retry-btn { background: #D50000; width: 100%; padding: 1.2rem; font-size: 1.3rem; border: none; }

@media (max-width: 800px) {
    .game-arena { flex-direction: column; align-items: center; }
    .control-panel { width: 100%; }
    .grid-container { margin-bottom: 1rem; }
}

.final-modal-bg { background-color: rgba(0, 0, 0, 0.9) !important; backdrop-filter: blur(20px) !important; }
.final-content { max-width: 700px !important; background: linear-gradient(135deg, #FF6D00, #FFAB40) !important; border: 4px solid #FFF !important; overflow: visible !important; padding: 2rem !important; }
.final-scene-container { display: flex; align-items: center; justify-content: center; gap: 2rem; margin-bottom: 2rem; }
.final-keloglan-img { width: 250px; height: auto; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5)); animation: floatCharacter 3s ease-in-out infinite alternate; }
@keyframes floatCharacter { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-20px) rotate(2deg); } }
.speech-bubble-container { flex: 1; display: flex; justify-content: flex-start; }
.speech-bubble { background: #ffffff; color: #333; padding: 25px; border-radius: 30px; font-family: 'Fredoka', sans-serif; font-size: 1.3rem; line-height: 1.4; position: relative; border: 4px solid #333; box-shadow: 10px 10px 0 rgba(0,0,0,0.2); text-align: left; animation: popIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.3s both; }
.speech-bubble::after { content: ''; position: absolute; left: -30px; top: 40%; border-width: 15px 30px 15px 0; border-style: solid; border-color: transparent #ffffff transparent transparent; z-index: 2; }
.speech-bubble::before { content: ''; position: absolute; left: -38px; top: 38%; border-width: 17px 34px 17px 0; border-style: solid; border-color: transparent #333 transparent transparent; z-index: 1; }
.final-return-btn { background: #333 !important; border-color: #333 !important; font-size: 1.5rem !important; padding: 1.5rem !important; }

@media only screen and (max-width: 768px) {

    body { overflow-x: hidden; }
    .container, .hero, .features, .about-section, .game-hub, .tech-grid, .canvas-container {
        padding-left: 15px !important; padding-right: 15px !important; width: 100% !important; box-sizing: border-box !important;
    }

    header {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 15px !important;
        height: auto !important;
        background: rgba(0, 0, 0, 0.9) !important;
    }

    header .logo { margin: 0 !important; font-size: 1.6rem !important; }

    .menu-toggle {
        display: block !important;
        font-size: 2rem !important;
        padding: 5px;
        color: white;
    }

    nav { 
        display: none !important; 
        width: 100% !important;
        margin-top: 15px;
        border-top: 1px solid rgba(255,255,255,0.1);
        flex-basis: 100%;
    }

    nav.active {
        display: block !important;
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    nav ul {
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        padding-top: 10px !important;
    }

    nav ul li { width: 100% !important; text-align: center !important; }

    nav ul li a {
        display: block !important;
        padding: 12px !important;
        background: rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        font-size: 1.1rem !important;
    }

    .hero h1 { font-size: 2.2rem !important; line-height: 1.2 !important; }
    .cta-buttons { flex-direction: column !important; gap: 15px !important; }
    .btn { width: 100% !important; justify-content: center !important; }
    .features, .about-grid, .concept-grid, .skills-grid, .expectations-grid { grid-template-columns: 1fr !important; gap: 20px !important; }

    .game-hub { display: flex !important; flex-direction: column !important; padding: 1rem !important; gap: 20px !important; }
    .game-card { width: 100% !important; flex-direction: column !important; }
    .game-card .card-image { width: 100% !important; height: 120px !important; }
    .game-card .card-content { width: 100% !important; padding: 15px !important; text-align: center !important; }

    #drawingCanvas { width: 100% !important; height: auto !important; touch-action: none; }
    .tools { flex-wrap: wrap !important; gap: 8px !important; justify-content: center !important; }
    .color-picker { width: 30px !important; height: 30px !important; }
    .tool-btn { padding: 8px 12px !important; font-size: 0.8rem !important; flex-grow: 1; }
    .dict-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }

    .final-scene-container { flex-direction: column; }
    .final-keloglan-img { width: 180px; }
    .speech-bubble { font-size: 1.1rem; text-align: center; }
    .speech-bubble::after, .speech-bubble::before { left: 50%; top: -30px; transform: translateX(-50%) rotate(90deg); }

    footer { padding: 2rem 1rem !important; }
    .footer-links { flex-direction: column !important; gap: 15px !important; }
}