/* games.css - Games page */

/* ========================================
   HERO
======================================= */
.games-hero-bg {
    background:
        radial-gradient(circle at 20% 30%, rgba(79, 70, 229, 0.55), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.35), transparent 45%),
        linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #312e81 100%);
}

/* Aetheria gameplay clip fills the header; the gradient above shows while it loads */
.games-hero-bg video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* The wizard is always in the middle of the game screen, so show a bit more of the top
       of the clip; that puts him below the heading instead of hidden behind it */
    object-position: center 15%;
}

/* ========================================
   LIBRARY
======================================= */
.games-section {
    padding: 5rem 0 2rem;
}

/* Two cards across, so the library is kept narrow and centred on the page */
.games-section .container {
    max-width: 840px;
}

.games-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.4rem;
    border-bottom: 1px solid #e2e8f0;
}

.games-head h2 {
    font-size: 2.6rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.games-sub {
    margin-top: 0.4rem;
    color: #666;
    font-size: 1.1rem;
}

.games-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

.games-free {
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.85rem;
    font-weight: 700;
}

.games-count {
    flex-shrink: 0;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Genre filters */
.games-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.games-filters[hidden] {
    display: none;
}

.games-filters button {
    padding: 0.55rem 1.15rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.games-filters button:hover {
    border-color: #93c5fd;
    color: #2563eb;
}

.games-filters button.active {
    background: #111;
    border-color: #111;
    color: #ffffff;
}

/* ========================================
   GAME CARDS
======================================= */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.8rem;
}

.game-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.06);
    transition: transform 0.45s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.45s ease, border-color 0.45s ease;
}

.game-card[hidden] {
    display: none;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.12);
    border-color: rgba(59, 130, 246, 0.2);
}

.game-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0f172a;
}

.game-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.7s ease;
}

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

.game-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.game-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.6rem 1.6rem 1.8rem;
}

.game-body h3 {
    margin-bottom: 0.6rem;
    color: #1e293b;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.game-body p {
    color: #475569;
    font-size: 0.98rem;
    line-height: 1.65;
}

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.1rem;
    list-style: none;
}

.game-meta li {
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Pinned to the bottom so buttons line up across a row */
.game-actions {
    margin-top: auto;
    padding-top: 1.4rem;
}

.game-btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.25);
    transition: all 0.3s ease;
}

.game-btn:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
    box-shadow: 0 16px 35px rgba(37, 99, 235, 0.35);
    color: #ffffff;
}

/* Downloads use the dark button so they stand apart from in-browser games */
.game-btn.game-btn-alt {
    background: #111;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.game-btn.game-btn-alt:hover {
    background: #333;
}

/* Wide card across the whole row: details on the left, gameplay video on the right */
.game-card.game-feature {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.game-feature .game-demo {
    order: 2;
}

/* Background matches the green edge of the Snake clip, so the space above and below it blends in */
.game-demo {
    position: relative;
    min-height: 360px;
    background: #6acb9c;
}


.game-demo video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.demo-sound-btn {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.demo-sound-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.demo-sound-btn svg {
    width: 22px;
    height: 22px;
}

/* Placeholder slots */
.game-card.is-soon {
    border-style: dashed;
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: none;
}

.game-card.is-soon:hover {
    transform: none;
    box-shadow: none;
}

.game-card.is-soon .game-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.game-card.is-soon .game-thumb svg {
    width: 64px;
    height: 64px;
    color: rgba(255, 255, 255, 0.35);
    stroke-width: 1.5;
}

.game-card.is-soon .game-tag {
    background: rgba(255, 255, 255, 0.14);
}

.game-card.is-soon h3 {
    color: #64748b;
}

.game-card.is-soon p {
    color: #94a3b8;
}

/* ========================================
   PLAYER OVERLAY
======================================= */
.game-player {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.game-player[hidden] {
    display: none;
}

.game-player-box {
    display: flex;
    flex-direction: column;
    width: min(1100px, 100%);
    height: min(760px, 100%);
    border-radius: 20px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.game-player-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem 0.8rem 1.4rem;
    background: #111827;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.game-player-bar h3 {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
}

.game-player-actions {
    display: flex;
    gap: 0.4rem;
}

.game-player-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.25s ease;
}

.game-player-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.game-player-actions svg {
    width: 20px;
    height: 20px;
}

.game-player iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: #000;
}

/* ========================================
   FEEDBACK
======================================= */
.feedback-section {
    padding: 1rem 0 5rem;
}

.feedback-section .container {
    max-width: 840px;
}

.feedback-form,
.feedback-admin {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 2rem;
    padding: 1.6rem;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.06);
}

.feedback-admin {
    padding: 1rem 1.2rem;
    border-radius: 16px;
    background: #f8fafc;
    box-shadow: none;
}

.feedback-admin[hidden],
.feedback-admin [hidden],
.feedback-section [hidden] {
    display: none;
}

.feedback-admin-login,
.feedback-admin-in {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    color: #475569;
    font-size: 0.95rem;
}

.feedback-admin-in span {
    flex: 1;
}

.feedback-section input,
.feedback-section textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #1e293b;
    font: inherit;
    font-size: 1rem;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.feedback-admin-login input {
    flex: 1;
    width: auto;
    min-width: 180px;
    background: #ffffff;
}

.feedback-section textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.6;
}

.feedback-section input:focus,
.feedback-section textarea:focus {
    outline: none;
    border-color: #93c5fd;
    background: #ffffff;
}

/* Spam trap, kept off screen */
.feedback-trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.feedback-form-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.feedback-note {
    color: #94a3b8;
    font-size: 0.85rem;
}

.feedback-form .game-btn {
    flex-shrink: 0;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

.feedback-form .game-btn:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.feedback-status {
    color: #047857;
    font-size: 0.92rem;
    font-weight: 600;
}

.feedback-status:empty {
    display: none;
}

.feedback-status.is-error {
    color: #dc2626;
}

.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    list-style: none;
}

.feedback-item {
    padding: 1.3rem 1.5rem;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
}

.feedback-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.8rem;
    margin-bottom: 0.5rem;
}

.feedback-meta strong {
    color: #1e293b;
    font-size: 1rem;
    font-weight: 800;
}

.feedback-meta time {
    color: #94a3b8;
    font-size: 0.82rem;
}

.feedback-text {
    color: #475569;
    font-size: 0.98rem;
    line-height: 1.65;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.feedback-reply {
    margin-top: 1rem;
    padding: 0.9rem 1.1rem;
    border-left: 3px solid #4f46e5;
    border-radius: 0 12px 12px 0;
    background: #eef2ff;
}

.feedback-reply-label {
    display: block;
    margin-bottom: 0.3rem;
    color: #4338ca;
    font-size: 0.8rem;
    font-weight: 800;
}

.feedback-reply-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
}

.feedback-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.feedback-small-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.feedback-small-btn:hover {
    border-color: #93c5fd;
    color: #2563eb;
}

.feedback-small-btn.feedback-delete:hover {
    border-color: #fca5a5;
    color: #dc2626;
}

.feedback-empty {
    padding: 2rem 1rem;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    color: #94a3b8;
    text-align: center;
}

.feedback-more {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.7rem 1.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
}

.feedback-more:hover {
    border-color: #93c5fd;
    color: #2563eb;
}

/* ========================================
   RESPONSIVE
======================================= */
@media (max-width: 768px) {
    .games-section {
        padding: 3.5rem 0 1rem;
    }

    .feedback-section {
        padding: 0.5rem 0 3.5rem;
    }

    .feedback-form {
        padding: 1.2rem;
        border-radius: 20px;
    }

    .feedback-form-foot {
        flex-direction: column;
        align-items: stretch;
    }

    .feedback-item {
        padding: 1.1rem 1.2rem;
    }

    .games-head h2 {
        font-size: 2rem;
    }

    .games-sub {
        font-size: 1rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Video on top, details underneath */
    .game-card.game-feature {
        grid-template-columns: 1fr;
    }

    .game-feature .game-demo {
        order: 0;
    }

    /* Size the video panel to the clip's own shape */
    .game-demo {
        min-height: 0;
        aspect-ratio: 688 / 720;
    }

    .game-player {
        padding: 0;
    }

    .game-player-box {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .games-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .game-body {
        padding: 1.4rem 1.3rem 1.5rem;
    }

    .game-btn {
        display: block;
        text-align: center;
    }
}
