/**
 * Site overrides — loaded after the theme stylesheet.
 * Vendor CSS stays untouched so it can be replaced without losing these fixes.
 */

/* ---------- long-form content ---------- */
.game-content,
.description-content {
    line-height: 1.7;
    font-size: 15.5px;
}

.game-content p,
.game-content li,
.description-content p,
.description-content li {
    line-height: 1.7;
}

.game-content h2,
.description-content h2 {
    margin: 30px 0 12px;
    font-size: 24px;
    line-height: 1.3;
}

.game-content h3,
.description-content h3 {
    margin: 24px 0 10px;
    font-size: 19px;
    line-height: 1.35;
}

.game-content ul,
.game-content ol,
.description-content ul,
.description-content ol {
    margin: 14px 0 18px;
    padding-left: 24px;
}

.game-content li,
.description-content li {
    margin-bottom: 8px;
}

.game-content img,
.description-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.game-content a,
.description-content a,
.game-content a:hover,
.description-content a:hover,
.comment-form-box a:hover {
    text-decoration: none !important;
}

/* controls tables and any other table inside long-form content */
.game-content table,
.description-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0 24px;
    font-size: 15px;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.game-content thead th,
.description-content thead th {
    background: #f4f6fb;
    color: #1f2937;
    font-weight: 700;
    text-align: left;
}

.game-content th,
.game-content td,
.description-content th,
.description-content td {
    padding: 11px 14px;
    border: 1px solid #e6eaf2;
    vertical-align: top;
}

.game-content tbody tr:nth-child(even) td,
.description-content tbody tr:nth-child(even) td {
    background: #fafbfe;
}

.game-content tbody tr:hover td,
.description-content tbody tr:hover td {
    background: #f4f7ff;
}

.dark-content .game-content table,
.dark-content .description-content table {
    background: #fff;
    color: #1f2937;
}

@media (max-width: 767.98px) {
    /* tables fill the page width; cells wrap instead of scrolling sideways */
    .game-content table,
    .description-content table {
        display: table;
        width: 100% !important;
        table-layout: auto;
        white-space: normal;
    }

    .game-content th,
    .game-content td,
    .description-content th,
    .description-content td {
        white-space: normal;
        word-break: break-word;
        padding: 9px 10px;
        font-size: 14px;
    }
}

/* ---------- comments ---------- */
/* The stock block is a floating white card with its own shadows and a gradient
   button, which reads as a different product next to the game page. Flatten it
   to a section that inherits the theme. */
.comments-section {
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border-top: 1px solid rgba(0, 0, 0, 0.12) !important;
    margin-top: 24px !important;
    padding-top: 22px !important;
}

.comments-section .comments-title {
    margin-bottom: 14px !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: inherit !important;
}

.comment-form-box {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin-bottom: 16px !important;
}

.comment-form-box .form-control {
    background: #fff !important;
    border: 1px solid #e3e8f0 !important;
    border-radius: 10px !important;
    padding: 9px 12px !important;
    font-size: 14px !important;
    color: #1f2937 !important;
    box-shadow: none !important;
}

.comment-form-box .form-control:focus {
    border-color: #6c5ce7 !important;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15) !important;
}

.comment-form-box textarea.form-control {
    min-height: 84px !important;
}

.comment-form-box small {
    color: #6b7280 !important;
    font-size: 12px !important;
}

#comment-submit-btn {
    background: #6c5ce7 !important;
    border: 0 !important;
    border-radius: 10px !important;
    padding: 9px 18px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #fff !important;
    box-shadow: none !important;
    transform: none !important;
}

#comment-submit-btn:hover {
    background: #5b4dd1 !important;
    transform: none !important;
    box-shadow: none !important;
}

.comments-list .text-center {
    padding: 12px 0 !important;
}

/* ---------- responsive game grids ---------- */
/* The featured and "Recommend For You" panels sit in a narrower column than the
   rest of the page, so a fixed number of columns per breakpoint either wastes
   space or squeezes the cards. Let the browser fit as many cards as the panel
   width allows, with a minimum card size. */
.game-grid-auto > .row {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

.game-grid-auto > .row > [class*="col-"] {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.game-grid-auto .cr-item {
    width: 100%;
}

@media (max-width: 575.98px) {
    .game-grid-auto > .row {
        grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
        gap: 10px;
    }
}

/* ---------- static pages (about, contact, privacy, terms, copyright) ---------- */
/* The stock template wrapped the page in a coloured panel heading with a thick
   border. Plain page instead: title, then text. */
.static-page-body {
    margin-top: 16px;
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 28px 32px 34px;
}

.static-page-body,
.static-page-body .page-title,
.static-page-body .page-content,
.static-page-body .page-content h1,
.static-page-body .page-content h2,
.static-page-body .page-content h3,
.static-page-body .page-content p,
.static-page-body .page-content li,
.static-page-body .page-content strong {
    color: #1f2937;
}

.static-page-body .page-title {
    margin: 0 0 18px;
    padding-bottom: 14px;
    font-size: 30px;
    line-height: 1.22;
    font-weight: 800;
    border-bottom: 1px solid #eceff4;
}

.static-page-body .page-content {
    font-size: 15.5px;
}

.static-page-body .page-content h2 {
    margin-top: 26px;
}

.static-page-body .page-content h2:first-child {
    margin-top: 0;
}

@media (max-width: 767.98px) {
    .static-page-body {
        padding: 20px 18px 26px;
    }

    .static-page-body .page-title {
        font-size: 24px;
    }
}


/* ---------- footer at the bottom of short pages ---------- */
/* The footer is a direct child of <body>, and the page content sits in a
   .freegames wrapper, so a column flex layout pins the footer to the bottom and
   lets a short page fill the rest instead of leaving the footer mid-screen. */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body > .freegames {
    flex: 1 0 auto;
}

body > .block-footer {
    margin-top: auto !important;
    flex: 0 0 auto;
}

/* ---------- click to play ---------- */
.game-frame {
    position: relative;
    background: #000;
    overflow: hidden;
    /* the theme rounds .play-box by 9px; the play card is square */
    border-radius: 0 !important;
}

.game-frame > iframe {
    position: relative;
    z-index: 1;
}

.game-frame-cover {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.game-frame-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(3px) brightness(0.62);
    transform: scale(1.04);
}

.game-play-btn {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    border: 0;
    border-radius: 999px;
    background: #f6c344;
    color: #1b1b1b;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.game-play-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.game-play-btn .play-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #1b1b1b;
    font-size: 11px;
    line-height: 1;
    padding-left: 2px;
}

.game-frame.is-playing .game-frame-cover {
    display: none;
}

/* no inner padding at the bottom of the page block; the gap to the footer is
   a margin instead, so the page background shows between them */
.static-page-body {
    padding-bottom: 16px;
    margin-bottom: 28px;
}

/* nova-style static page container: same treatment as the pulse page block */
.games__content .text__area {
    padding-bottom: 16px;
    margin-bottom: 28px;
}

/* ---------- header logo ---------- */
/* the theme hard-codes 111x75 on the <img>; the logo is a 2:1 lockup, so keep
   its ratio instead of squashing it */
.dark-logo img {
    width: auto !important;
    height: 52px !important;
    max-width: 210px;
    object-fit: contain;
}

@media (max-width: 575.98px) {
    .dark-logo img {
        height: 40px !important;
        max-width: 150px;
    }
}

/* ---------- mobile: homepage description and game grid ---------- */
@media (max-width: 767.98px) {
    /* the description sat inside 16px container + 16px column + 15px panel padding */
    /* outer padding stays as the theme sets it; only the inner panel is tightened */
    .game-info .game-content,
    .game-info .description-content {
        font-size: 15px;
    }
}

/* section headings that sit on the light page background; the theme paints
   them white, which is invisible outside the dark panels */
.freegames-panel-heading h2,
.freegames-panel-heading span,
.recommended-panel-heading span,
.recommended-panel-heading h2 {
    color: #1f2937 !important;
}

/* mobile: strip the inner .game-detail padding, keep the panel padding */
@media (max-width: 767.98px) {
    .game-detail {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* the header ad now sits below the bar, so give it the page background */
.header-ad-below {
    background: #f1f1f1;
    padding-top: 6px;
    padding-bottom: 6px;
}

/* mobile header: logo centred in its box */
@media (max-width: 991.98px) {
    .dark-logo {
        display: flex;
        align-items: center;
        height: 50px;
    }

    .dark-logo img {
        display: block;
        height: 40px !important;
        width: auto;
    }
}

/* footer copyright sits on its own centred line */
.footer-copy {
    display: block;
    width: 100%;
    text-align: center !important;
}

.footer-copy small {
    color: rgba(255, 255, 255, 0.72);
}
