/* WebGameVerse global styles
   Theme: orange + purple (space vibes)
   Mobile-first, SEO-friendly, responsive grid with min 3 games per row on mobile.
*/

:root {
    --bg-body: #060218;
    --bg-card: #120b2b;
    --bg-header: #1a0f3b;
    --bg-footer: #0a0615;
    --accent-orange: #ff7a1a;
    --accent-orange-soft: rgba(255, 122, 26, 0.15);
    --accent-purple: #8b5cf6;
    --accent-purple-soft: rgba(139, 92, 246, 0.24);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border-soft: rgba(148, 163, 184, 0.25);
    --radius-xl: 1.25rem;
    --radius-lg: 0.9rem;
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.55);
    --shadow-subtle: 0 8px 24px rgba(0, 0, 0, 0.4);
    --transition-fast: 0.18s ease-out;
    --transition-med: 0.25s ease-out;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body.theme-orchid {
    background: radial-gradient(circle at top, #20124d 0, #060218 55%, #020016 100%);
    color: var(--text-main);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

/* Footer kategori listesini yanlara yay */
.footer-columns ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.2rem;
}

.footer-columns li {
    flex: 0 0 calc(50% - 1.2rem);
    /* küçük ekranlarda 2 sütun */
}

/* Daha geniş ekranlarda 3 sütuna çıkaralım */
@media (min-width: 768px) {
    .footer-columns li {
        flex: 0 0 calc(33.333% - 1.2rem);
    }
}

/* Layout */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    /*backdrop-filter: blur(18px);*/
    background: linear-gradient(90deg, rgba(10, 6, 32, 0.94), rgba(36, 12, 60, 0.96));
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.4rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-wrap {
    flex-shrink: 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--text-main);
}

.logo-icon {
    font-size: 1.7rem;
    filter: drop-shadow(0 0 10px rgba(255, 122, 26, 0.7));
}

.logo-text {
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.95rem;
}

/* Navigation and search */

.nav-toggle {
    margin-left: auto;
    background: var(--accent-purple-soft);
    color: var(--accent-orange);
    border-radius: 999px;
    border: 1px solid var(--accent-purple);
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.main-nav {
    display: none;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.main-nav.is-open {
    display: flex;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-list a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.8rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.nav-list a:hover {
    background: var(--accent-purple-soft);
    border-color: var(--accent-purple);
    color: #fefce8;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    background: var(--accent-orange-soft);
    border-radius: 999px;
    border: 1px solid rgba(249, 115, 22, 0.6);
    color: #fed7aa;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    min-width: 220px;
    max-height: 360px;
    overflow-y: auto;
    background: #050313;
    border-radius: 0.8rem;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    padding: 0.5rem;
    display: none;
    z-index: 50;
}

.nav-dropdown-menu.show {
    display: block;
}

.nav-dropdown-menu li a {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 0.8rem;
    border-radius: 0.6rem;
}

/* Search */

.search-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.search-form input[type="search"] {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-main);
    min-width: 150px;
}

.search-form button {
    font-size: 0.8rem;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-purple));
    color: #111827;
    font-weight: 600;
}

/* Ad slots */

.ad-slot {
    max-width: 1200px;
    margin: 0.6rem auto;
    padding: 0.5rem;
    border-radius: 0.85rem;
    border: 1px dashed rgba(148, 163, 184, 0.3);
    background: radial-gradient(circle at top, rgba(26, 35, 126, 0.38), rgba(15, 23, 42, 0.8));
}

/* Main layout */

.site-main {
    max-width: 1200px;
    margin: 0.4rem auto 1.5rem auto;
    padding: 0 1rem 1.5rem 1rem;
}

/* Hero */

.hero {
    margin: 0.7rem 0 1rem;
}

.hero-inner {
    border-radius: 1.5rem;
    padding: 1.4rem 1.3rem;
    background: radial-gradient(circle at 0% 0%, rgba(249, 115, 22, 0.17), transparent 55%),
        radial-gradient(circle at 100% 0%, rgba(129, 140, 248, 0.2), transparent 55%),
        linear-gradient(135deg, #020617, #020016);
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: var(--shadow-soft);
}

.hero-inner h1 {
    margin: 0 0 0.3rem;
    font-size: 1.6rem;
}

.hero-inner p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Game grid & cards */

.game-section {
    margin-top: 1.3rem;
}

.section-header h2,
.section-header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
}

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

.game-grid {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}

/* Ensure at least 3 per row on very small devices */
@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.game-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(55, 65, 81, 0.58));
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
    border: 1px solid rgba(148, 163, 184, 0.35);
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.game-thumb-link {
    display: block;
    text-decoration: none;
}

.game-thumb {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
    background: radial-gradient(circle at 30% 0%, rgba(234, 179, 8, 0.18), rgba(15, 23, 42, 1));
}

.game-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-med);
}

.game-card:hover .game-thumb img {
    transform: scale(1.06);
}

.game-thumb-overlay {
    position: absolute;
    inset: 0;
    padding: 0.4rem;
    display: flex;
    align-items: flex-end;
    /* badge'leri altta göster */
    justify-content: flex-start;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.85), transparent 60%);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-med);
}

.game-card:hover .game-thumb-overlay {
    opacity: 1;
}

.game-thumb-overlay .game-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.game-card-body {
    padding: 0.55rem 0.5rem 0.6rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.game-badges {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.62rem;
    padding: 0.12rem 0.35rem;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-featured {
    background: var(--accent-orange-soft);
    border-color: rgba(249, 115, 22, 0.7);
    color: #fed7aa;
}

.badge-god {
    background: rgba(22, 163, 74, 0.15);
    border-color: rgba(34, 197, 94, 0.75);
    color: #bbf7d0;
}

.badge-mp {
    background: rgba(59, 130, 246, 0.18);
    /* mavi ton */
    border-color: rgba(59, 130, 246, 0.8);
    color: #bfdbfe;
}

.game-card-title {
    margin: 0.1rem 0 0;
    font-size: 0.8rem;
    line-height: 1.25;
}

.game-card-title a {
    color: #f9fafb;
    text-decoration: none;
}

.game-card-title a:hover {
    text-decoration: underline;
}

.game-card-desc {
    margin: 0.15rem 0 0;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Load more */

.load-more-wrap {
    margin-top: 0.9rem;
    text-align: center;
}

.load-more-btn {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #111827;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.load-more-btn[disabled],
.load-more-btn.is-loading {
    opacity: 0.7;
    cursor: default;
}

/* Game page */

/* Fullscreen button inside game frame */
.game-fullscreen-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 5;
    border: none;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    font-size: 0.85rem;
    cursor: pointer;
    background: radial-gradient(circle at 0 0, var(--accent-orange), var(--accent-purple));
    color: #0b1120;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.7);
    opacity: 0.0;
    transform: translateY(-4px);
    transition: opacity var(--transition-med), transform var(--transition-med);
}

/* Hover edince daha belirgin olsun */
.game-frame-container:hover .game-fullscreen-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Fullscreen modundayken container ve iframe tam ekranı doldursun */
.game-frame-container:fullscreen,
.game-frame-container:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
}

/* Fullscreen içindeki iframe %100 alan kaplasın */
.game-frame-container:fullscreen iframe,
.game-frame-container:-webkit-full-screen iframe {
    width: 100%;
    height: 100%;
}

/* Mobilde hover yok, her zaman az görünür olsun */
@media (max-width: 767px) {
    .game-fullscreen-btn {
        opacity: 0.85;
    }
}

.page-game {
    margin-top: 1rem;
}

.game-header {
    margin-bottom: 0.7rem;
}

.game-header h1 {
    margin: 0 0 0.2rem;
    font-size: 1.3rem;
}

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.game-meta-badges {
    display: flex;
    gap: 0.25rem;
}

.game-category a {
    color: #a5b4fc;
    text-decoration: none;
}

.game-category a:hover {
    text-decoration: underline;
}

.game-play-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

/* Üst reklam tüm satırı kaplasın */
.ad-slot-game-top {
    flex: 1 1 100%;
}

/* İFRAME SOLDA, GENİŞ ALAN */
.game-frame-container {
    position: relative;
    flex: 1 1 640px;
    min-width: 0;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: #020617;
    box-shadow: var(--shadow-soft);
}

/* Sağ taraftaki reklam */
.ad-slot-game-side {
    flex: 0 0 260px;
    max-width: 260px;
    min-height: 100px;
}

/* İFRAME'i RESPONSIVE YAP */
.game-frame-container iframe {
    display: block;
    width: 100% !important;
    /* width="..." gelse bile override */
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    /* istersen 4 / 3 yapabilirsin */
    border: none;
}

/* --- MOBİL PSEUDO-FULLSCREEN MODU --- */

html.game-mobile-fullscreen,
body.game-mobile-fullscreen {
    height: 100%;
    overflow: hidden;
    /* sayfa kaymasın */
}

/* Oyun container'ını ekranın üzerine sabitle */
.game-mobile-frame {
    position: fixed;
    inset: 0;
    z-index: 9999;
    margin: 0;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

/* Pseudo-fullscreen'de iframe tüm alanı kaplasın */
.game-mobile-frame iframe {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: auto;
}

/* Fullscreen modundayken header/footer ve ekstra blokları sakla */
.game-mobile-fullscreen .site-header,
.game-mobile-fullscreen .site-footer,
.game-mobile-fullscreen .ad-slot-game-top,
.game-mobile-fullscreen .ad-slot-game-side,
.game-mobile-fullscreen .game-details,
.game-mobile-fullscreen .game-more-section {
    display: none !important;
}

/* Fullscreen tuşu bu modda da görünür ve tıklanabilir kalsın */
.game-mobile-frame .game-fullscreen-btn {
    opacity: 0.9;
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 10000;
}


.game-details {
    margin-top: 0.8rem;
    border-radius: var(--radius-xl);
    padding: 0.9rem 0.9rem 1rem;
    background: radial-gradient(circle at 0% 0%, rgba(249, 115, 22, 0.13), transparent 55%),
        radial-gradient(circle at 100% 0%, rgba(129, 140, 248, 0.18), transparent 55%),
        #020617;
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.game-details h2,
.game-details h3 {
    margin-top: 0.2rem;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.game-details p,
.game-details ul {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* More games section */

.game-more-section {
    margin-top: 1rem;
}

/* Generic page section */

.page-section {
    margin-top: 1rem;
    border-radius: var(--radius-xl);
    padding: 1rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: var(--shadow-soft);
}

.page-section p,
.page-section li {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Footer */

.site-footer {
    background: var(--bg-footer);
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    padding: 1.2rem 1rem 1.4rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links h3 {
    margin: 0 0 0.3rem;
    font-size: 0.95rem;
}

.footer-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.4rem;
}

.footer-columns h4 {
    margin: 0 0 0.2rem;
    font-size: 0.85rem;
}

.footer-columns ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-columns li a {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
}

.footer-columns li a:hover {
    color: #e5e7eb;
    text-decoration: underline;
}

.footer-meta {
    margin-top: 0.8rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Admin styles */

.admin-body {
    background: #020617;
    color: var(--text-main);
    font-family: var(--font-main);
}

.admin-header {
    background: #020617;
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-header h1 {
    margin: 0;
    font-size: 1rem;
}

.admin-header nav a {
    color: #bfdbfe;
    margin-left: 0.7rem;
    font-size: 0.8rem;
    text-decoration: none;
}

.admin-main {
    max-width: 1100px;
    margin: 1rem auto;
    padding: 0 1rem 2rem;
}

.admin-section {
    background: rgba(15, 23, 42, 0.95);
    border-radius: var(--radius-xl);
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.admin-message {
    background: rgba(22, 163, 74, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.65);
    color: #bbf7d0;
    padding: 0.6rem 0.8rem;
    border-radius: 0.75rem;
    margin-bottom: 0.8rem;
    font-size: 0.82rem;
}

.admin-form label {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    margin-bottom: 0.1rem;
}

.admin-form input[type="text"],
.admin-form textarea,
.admin-form select,
.admin-login-wrapper input[type="password"],
.admin-login-wrapper input[type="text"] {
    width: 100%;
    padding: 0.45rem 0.55rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: #020617;
    color: var(--text-main);
    font-size: 0.8rem;
}

.admin-form button,
.admin-login-wrapper button {
    margin-top: 0.7rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-purple));
    color: #111827;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
}

.admin-checkboxes {
    margin-top: 0.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
}

.admin-image-field {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.3rem;
}

.admin-image-preview {
    width: 70px;
    height: 70px;
    border-radius: 0.6rem;
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, 0.6);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.admin-table th,
.admin-table td {
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 0.4rem;
    text-align: left;
}

.admin-table th {
    background: #020617;
}

.admin-thumb-small {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 0.4rem;
}

.admin-login-wrapper {
    max-width: 360px;
    margin: 4rem auto;
    padding: 1.2rem;
    background: rgba(15, 23, 42, 0.98);
    border-radius: 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: var(--shadow-soft);
}

.admin-login-wrapper h1 {
    margin-top: 0;
    font-size: 1.1rem;
}

.admin-error {
    font-size: 0.8rem;
    color: #fecaca;
    background: rgba(185, 28, 28, 0.35);
    border-radius: 0.6rem;
    padding: 0.4rem 0.6rem;
}

.admin-hint {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsive layout */

@media (min-width: 768px) {
    .header-inner {
        padding: 0.4rem 1.5rem;
    }

    .nav-toggle {
        display: none;
    }

    .main-nav {
        display: flex !important;
    }

    .site-main {
        padding: 0 1.5rem 2rem;
    }
}

@media (max-width: 767px) {
    .header-inner {
        align-items: center;
    }

    .search-form {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
        justify-content: space-between;
    }

    .search-form input[type="search"] {
        flex: 1 1 auto;
    }

    .search-form button {
        flex-shrink: 0;
    }

    .main-nav {
        flex-direction: column;
        align-items: flex-start;
        margin-top: 0.4rem;
    }

    .nav-list.nav-secondary {
        order: 2;
    }

    .game-play-wrapper {
        grid-template-columns: minmax(0, 1fr);
    }

    .ad-slot-game-side {
        min-height: 120px;
    }
}