/* DoodleGames Styles */

:root {
    --bg: #0f0f0f;
    --bg-card: #1a1a1a;
    --text: #f5f5f5;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --border: #2a2a2a;
    --accent: #22c55e
}

.light {
    --bg: #fafafa;
    --bg-card: #fff;
    --text: #171717;
    --text-secondary: #525252;
    --text-tertiary: #a3a3a3;
    --border: #e5e5e5
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(15, 15, 15, .85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px
}

.light .header {
    background: rgba(250, 250, 250, .85)
}

.logo {
    height: 36px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.5rem
}

.logo svg {
    height: 36px;
    width: 36px
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px
}

.search-box {
    position: relative;
    width: 280px
}

.search-box input {
    width: 100%;
    height: 40px;
    padding: 0 16px 0 44px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: .875rem;
    outline: none
}

.search-box input:focus {
    border-color: var(--primary)
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-secondary)
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center
}

.theme-toggle:hover {
    transform: scale(1.05)
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text)
}

.sun-icon {
    display: none
}

.moon-icon {
    display: block
}

.lang-switch {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden
}

.lang-switch a {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: .875rem;
    font-weight: 500
}

.lang-switch a.active {
    background: var(--primary);
    color: #fff
}

.lang-switch a:hover:not(.active) {
    color: var(--text)
}

main {
    padding-top: 88px;
    padding-bottom: 48px
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px
}

.game-hero {
    max-width: 1000px;
    margin: 0 auto 32px
}

.iframe-container {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border)
}

.fullscreen-btn {
    position: absolute;
    right: 16px;
    top: 16px;
    padding: 10px 14px;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .2s, border-color .2s
}

.fullscreen-btn.visible {
    opacity: 1;
    pointer-events: auto
}

.fullscreen-btn:hover {
    transform: scale(1.05);
    border-color: var(--primary)
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    cursor: pointer;
    transition: opacity .3s
}

.play-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('img/google-snake-game.webp');
    background-size: cover;
    background-position: center;
    filter: blur(12px) brightness(.7);
    transform: scale(1.05);
    z-index: 0;
}

.play-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1;
}

.play-overlay>* {
    position: relative;
    z-index: 2;
}

.play-overlay.hidden {
    opacity: 0;
    pointer-events: none
}

.play-overlay-other-games {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    cursor: pointer;
    transition: opacity .3s
}

.play-overlay-other-games::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1;
}

.play-overlay-other-games>* {
    position: relative;
    z-index: 2;
}

.play-overlay-other-games.hidden {
    opacity: 0;
    pointer-events: none
}

.play-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 48px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'Rajdhani', sans-serif;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(99, 102, 241, .35)
}

.play-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05)
}

.play-btn svg {
    width: 28px;
    height: 28px
}

.game-iframe {
    width: 100%;
    height: 100%;
    border: none
}

.game-info {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

.list-margin {
    margin-left: 20px;
}

.description p {
    margin-bottom: 5px;
}

.description h2 {
    color: #4660BC;
}

.game-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -.02em
}

.game-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border)
}

.play-count {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: .875rem;
    color: var(--text-secondary)
}

.play-count svg {
    width: 16px;
    height: 16px
}

.rating-container {
    display: flex;
    align-items: center;
    gap: 8px
}

.stars {
    display: flex;
    gap: 2px
}

.stars svg {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    cursor: pointer
}

.stars svg.filled {
    color: #fbbf24
}

.stars svg:hover,
.stars svg.hovered {
    color: #fbbf24
}

.rating-text {
    font-size: .875rem;
    color: var(--text-secondary)
}

.share-buttons {
    display: flex;
    gap: 8px;
    margin-left: auto
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center
}

.share-btn:hover {
    transform: scale(1.1);
    border-color: var(--primary)
}

.share-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text)
}

.description {
    padding: 32px 0
}

.description-short {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 800px
}

.description-long {
    color: var(--text-secondary);
    line-height: 1.8
}

.description-long p {
    margin-bottom: 16px
}

.embed-section {
    padding: 24px 0;
    border-top: 1px solid var(--border)
}

.embed-section h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px
}

.embed-container {
    position: relative
}

.embed-textarea {
    width: 100%;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: monospace;
    font-size: .875rem;
    resize: none;
    outline: none
}

.embed-textarea:focus {
    border-color: var(--primary)
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 8px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer
}

.copy-btn:hover {
    background: var(--primary-hover)
}

.section-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.875rem;
    font-weight: 600;
}

.related-games {
    margin-bottom: 20px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px
}

@media(max-width:1024px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:640px) {
    .games-grid {
        grid-template-columns: 1fr
    }
    .search-box {
        width: 200px
    }
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden
}

.game-card:hover {
    transform: scale(1.03)
}

.game-card a {
    text-decoration: none;
    color: inherit
}

.game-card-thumb {
    aspect-ratio: 4/3;
    background: var(--border);
    overflow: hidden
}

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

.game-card-content {
    padding: 16px
}

.game-card-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.comments-section {
    padding: 48px 0;
    border-top: 1px solid var(--border)
}

.comments-section h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px
}

#disqus_thread {
    min-height: 200px
}

footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 48px 24px 24px
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px
}

@media(max-width:768px) {
    .footer-content {
        grid-template-columns: 1fr
    }
}

.footer-section h4 {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    margin-bottom: 16px
}

.footer-section p,
.footer-section a {
    color: var(--text-secondary);
    font-size: .875rem;
    text-decoration: none;
    line-height: 1.8
}

.footer-section a:hover {
    color: var(--primary)
}

.footer-lang {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 8px
}

.footer-bottom {
    max-width: 1400px;
    margin: 32px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-tertiary);
    font-size: .875rem
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    z-index: 200
}

.skip-link:focus {
    left: 0
}


/* Games list specific */

.page-header {
    margin-bottom: 32px
}

.page-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem
}

.search-results-info {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: none
}

.search-results-info.visible {
    display: block
}

.search-results-info span {
    font-weight: 600;
    color: var(--primary)
}

.game-card.hidden {
    display: none
}

.game-card-category {
    font-size: .75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: .05em
}

.no-results {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
    display: none
}

.no-results.visible {
    display: block
}

.no-results svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    color: var(--text-tertiary)
}

.no-results h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--text)
}


/* Smooth scrolling */

html {
    scroll-behavior: smooth;
}

.faq-item details {
    border: 1px solid #e3e3e3;
    border-radius: 6px;
    padding: .6rem .9rem;
    margin: .6rem 0;
    background: #fff;
    color: #0f0f0f;
}

.faq-item summary {
    cursor: pointer;
    outline: none;
}

.faq-answer {
    padding-top: .5rem;
    color: #222;
    line-height: 1.5;
}

.faq-answer small {
    color: #666;
}


/* Focus styles for accessibility */

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}


/* Selection styling */

::selection {
    background: var(--primary);
    color: #fff;
}


/* Scrollbar styling */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}


/* Header animations */

.header {
    transition: background-color 0.3s ease;
}


/* Logo hover effect */

.logo:hover svg {
    transform: rotate(10deg);
    transition: transform 0.3s ease;
}

.logo svg {
    transition: transform 0.3s ease;
}


/* Search input animations */

.search-box input {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}


/* Button hover animations */

.theme-toggle,
.share-btn {
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}


/* Play button pulse animation */

@keyframes pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
    }
}

.play-btn {
    animation: pulse 2s infinite;
}

.play-btn:hover {
    animation: none;
}


/* Game card animations */

.game-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.game-card-thumb img {
    transition: transform 0.3s ease;
}

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


/* Star rating button styles */

.star-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.star-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}


/* Star rating hover effects */

.stars svg,
.star-btn svg {
    transition: color 0.15s ease, transform 0.15s ease;
}

.star-btn:hover svg {
    transform: scale(1.2);
}


/* Copy button feedback */

.copy-btn.copied {
    background: var(--accent);
}


/* Embed textarea */

.embed-textarea {
    transition: border-color 0.2s ease;
}


/* Footer link underline animation */

.footer-section a {
    position: relative;
}

.footer-section a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.footer-section a:hover::after {
    width: 100%;
}


/* Language switch hover */

.footer-lang {
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.footer-lang:hover {
    border-color: var(--primary);
}


/* Iframe loading state */

.iframe-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, var(--bg-card) 25%, transparent 25%), linear-gradient(-45deg, var(--bg-card) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--bg-card) 75%), linear-gradient(-45deg, transparent 75%, var(--bg-card) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    opacity: 0.5;
    z-index: -1;
}


/* Page transitions */

main {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Game grid stagger animation */

.games-grid .game-card {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.games-grid .game-card:nth-child(1) {
    animation-delay: 0.05s;
}

.games-grid .game-card:nth-child(2) {
    animation-delay: 0.1s;
}

.games-grid .game-card:nth-child(3) {
    animation-delay: 0.15s;
}

.games-grid .game-card:nth-child(4) {
    animation-delay: 0.2s;
}

.games-grid .game-card:nth-child(5) {
    animation-delay: 0.25s;
}

.games-grid .game-card:nth-child(6) {
    animation-delay: 0.3s;
}

.games-grid .game-card:nth-child(7) {
    animation-delay: 0.35s;
}

.games-grid .game-card:nth-child(8) {
    animation-delay: 0.4s;
}

.games-grid .game-card:nth-child(9) {
    animation-delay: 0.45s;
}

.games-grid .game-card:nth-child(10) {
    animation-delay: 0.5s;
}

.games-grid .game-card:nth-child(11) {
    animation-delay: 0.55s;
}

.games-grid .game-card:nth-child(12) {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Responsive adjustments */

@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }
    .logo span {
        display: none;
    }
    .header-right {
        gap: 12px;
    }
    .game-title {
        font-size: 2rem;
    }
    .game-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    .share-buttons {
        margin-left: 0;
        margin-top: 8px;
    }
    .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .search-box {
        display: none;
    }
    .play-btn {
        padding: 16px 32px;
        font-size: 1.125rem;
    }
    .description-short {
        font-size: 1rem;
    }
}


/* Print styles */

@media print {
    .header,
    .play-overlay,
    .share-buttons,
    .embed-section,
    .comments-section,
    footer {
        display: none !important;
    }
    main {
        padding-top: 0;
    }
    .game-card {
        break-inside: avoid;
    }
}


/* Reduced motion preferences */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}
