:root {
    --primary-color: #4facfe;
    --secondary-color: #00f2fe;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #fff;
    --dark-overlay: rgba(0, 0, 0, 0.6);
    --bg-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    background-attachment: scroll;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
    body {
        background-attachment: fixed;
    }
}

/* Sticky Header */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(30, 60, 114, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.back-btn {
    text-decoration: none;
    color: white;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-5px);
}

.site-logo {
    font-size: 1.2rem;
    font-weight: 800;
    background: linear-gradient(to right, #4facfe, #00f2fe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(79, 172, 254, 0.3);
}

/* Main Container */
.main-container {
    flex: 1;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Game Area */
.game-wrapper {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    /* Placeholder height */
    position: relative;
    overflow: hidden;
}

.game-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.game-placeholder h2 {
    margin-bottom: 10px;
}

/* Side/Bottom Bar - Other Games */
.other-games-panel {
    margin-bottom: 40px;
}

.panel-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.games-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) rgba(255, 255, 255, 0.1);
}

.games-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.games-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.games-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.game-card {
    flex: 0 0 120px;
    /* Width of each card */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.game-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.game-icon {
    font-size: 2rem;
}

.game-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* SEO Content Area */
.seo-content {
    background: white;
    /* Changed to white for better readability of long text */
    color: #333;
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.seo-content h2,
.seo-content h3 {
    color: #1e3c72;
}

.seo-content p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
}

.seo-content ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.seo-content li {
    margin-bottom: 10px;
    color: #555;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .seo-content {
        padding: 15px;
    }

    .game-card {
        flex: 0 0 100px;
    }

    .game-wrapper {
        min-height: 400px;
        padding: 10px;
    }
}

/* New Navigation Panel Styles */
.glass-panel {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2048 Game Styles */
.game-area-2048 {
    width: 320px;
    margin: 0 auto;
    font-family: 'Clear Sans', sans-serif;
    color: #776e65;
}

.game-area-2048 .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.game-area-2048 .title {
    font-size: 40px;
    font-weight: bold;
    color: #776e65;
    margin: 0;
}

.game-area-2048 .score-box {
    background: #bbada0;
    padding: 5px 15px;
    border-radius: 6px;
    text-align: center;
    color: white;
}

.game-area-2048 .score-title {
    display: block;
    text-transform: uppercase;
    font-size: 11px;
    color: #eee4da;
}

.game-area-2048 .score-val {
    display: block;
    font-size: 20px;
    font-weight: bold;
}

.game-container {
    width: 320px;
    height: 320px;
    background: #bbada0;
    border-radius: 6px;
    position: relative;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    box-sizing: border-box;
}

.tile {
    width: 67.5px;
    height: 67.5px;
    background: #cdc1b4;
    border-radius: 3px;
    font-size: 30px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #776e65;
}

/* Tile Colors */
.tile.x2 {
    background: #eee4da;
}

.tile.x4 {
    background: #ede0c8;
}

.tile.x8 {
    background: #f2b179;
    color: #f9f6f2;
}

.tile.x16 {
    background: #f59563;
    color: #f9f6f2;
}

.tile.x32 {
    background: #f67c5f;
    color: #f9f6f2;
}

.tile.x64 {
    background: #f65e3b;
    color: #f9f6f2;
}

.tile.x128 {
    background: #edcf72;
    color: #f9f6f2;
    font-size: 25px;
}

.tile.x256 {
    background: #edcc61;
    color: #f9f6f2;
    font-size: 25px;
}

.tile.x512 {
    background: #edc850;
    color: #f9f6f2;
    font-size: 25px;
}

.tile.x1024 {
    background: #edc53f;
    color: #f9f6f2;
    font-size: 20px;
}

.tile.x2048 {
    background: #edc22e;
    color: #f9f6f2;
    font-size: 20px;
}

.instructions {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #eee4da;
    line-height: 1.5;
}

.mobile-controls {
    display: none;
    /* JS ile mobilde açılabilir veya daima açık tutulabilir */
    margin-top: 20px;
    justify-content: center;
    gap: 10px;
}

.d-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.d-btn:active {
    background: rgba(255, 255, 255, 0.4);
}

.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(238, 228, 218, 0.73);
    z-index: 100;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
}

.game-over h2 {
    font-size: 40px;
    font-weight: bold;
    color: #776e65;
    margin-bottom: 20px;
}

.btn-restart {
    background: #8f7a66;
    color: #f9f6f2;
    padding: 10px 20px;
    border: none;
    border-radius: 3px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
}

@keyframes pop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@media (max-width: 500px) {

    .game-area-2048,
    .game-container {
        width: 280px;
        height: 280px;
    }

    .tile {
        width: 57.5px;
        height: 57.5px;
        font-size: 24px;
    }

    .mobile-controls {
        display: flex;
        flex-wrap: wrap;
        width: 180px;
        margin: 20px auto;
    }

    .btn-up {
        width: 100%;
        order: 1;
        margin-bottom: 5px;
    }

    .btn-left {
        order: 2;
        margin-right: 5px;
    }

    .btn-right {
        order: 3;
    }

    .btn-down {
        width: 100%;
        order: 4;
        margin-top: 5px;
    }
}

/* Memory Game Styles */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 0 auto;
    width: 100%;
}

.card {
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
    transform-style: preserve-3d;
    transform: scale(1);
    transition: transform 0.5s;
    -webkit-tap-highlight-color: transparent;
}

.card:active {
    transform: scale(0.95);
}

.card.flip {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    font-size: 2.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-front {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
}

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