/* ==========================================================================
   Clash Royale site theme — visual override only
   Load last in <head>. Remove this file (and its link) to roll back.
   Design system: elevation over chrome, one accent, WCAG 2.2 AA.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap");

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
    --bg: #0b1530;
    --surface: #121e40;
    --surface-raised: #1a2a57;
    --border: #6280c4;
    --text: #f4f7ff;
    --text-muted: #b8c4e6;
    --accent: #ffc233;
    --on-accent: #1a1200;
    --focus: #ffffff;
    --danger: #f0716e;
    --radius-control: 8px;
    --radius-card: 12px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --divider: rgba(255, 255, 255, 0.08);
    --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --elev-0: none;
    --elev-1: var(--highlight), 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    --elev-2: var(--highlight), 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow: var(--elev-1);
    --accent-hover: #ffd24f;
    --surface-hover: #22366c;
    --ease: 200ms ease;
    --font: "Nunito", "Segoe UI", sans-serif;
    --text-sm: 14px;
    --text-md: 15px;
    --text-lg: 18px;
    --text-xl: 20px;

    --cr-navy: var(--bg);
    --cr-navy-2: var(--surface-raised);
    --cr-navy-3: var(--surface);
    --cr-royal: #5b8cff;
    --cr-royal-deep: #3d6fe0;
    --cr-gold: var(--accent);
    --cr-gold-deep: #e0a61c;
    --cr-gold-ink: var(--on-accent);
    --cr-red: var(--danger);
    --cr-elixir: #c13cff;
    --cr-elixir-deep: #8a2be2;
    --cr-text: var(--text);
    --cr-text-muted: var(--text-muted);
    --cr-text-dark: var(--on-accent);
    --cr-surface: var(--surface);
    --cr-surface-2: var(--surface-raised);
    --cr-border: var(--border);
    --cr-shadow: var(--shadow);
    --cr-radius: var(--radius-card);
    --cr-ease: var(--ease);
    --cr-display: var(--font);
    --cr-body: var(--font);
    --cr-bg: var(--bg);
    --cr-bg-grad: var(--bg);
    --cr-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 28 49'%3E%3Cg fill='none' stroke='%23182a58' stroke-width='0.7' stroke-opacity='0.9'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM13.99 32.25v15.5M28 24v15.5M0 24v15.5M14 24.5l13.99 8.25M14 24.5L0 32.75'/%3E%3C/g%3E%3C/svg%3E");
    --cr-pattern-size: 72px 126px;

    --sl-green: var(--accent);
    --sl-green-dark: var(--cr-gold-deep);
    --sl-mint: var(--cr-royal);
    --sl-cyan: #9ec4ff;
    --sl-yellow: var(--accent);
    --sl-bg-main: var(--bg);
    --sl-bg-soft: var(--surface);
    --sl-card-bg: var(--surface);
    --sl-text-main: var(--text);
    --sl-text-muted: var(--text-muted);
    --sl-border: var(--border);
    --sl-shadow: var(--shadow);
    --color-highlight: var(--text);
}

.dark,
html.dark,
:root[data-theme="dark"] {
    --bg: #081028;
    --surface: #101a38;
    --surface-raised: #17244c;
    --border: #6e8ad0;
    --text: #f6f8ff;
    --text-muted: #b8c4e6;
    --cr-bg: var(--bg);
    --sl-bg-main: var(--bg);
    --sl-bg-soft: var(--surface);
    --sl-card-bg: var(--surface);
    --sl-text-main: var(--text);
    --sl-text-muted: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body,
.min-h-screen {
    font-family: var(--font);
    font-size: var(--text-md);
    line-height: 1.5;
    background-color: var(--bg);
    /* background-image: var(--cr-pattern); */
    background-size: var(--cr-pattern-size);
    background-attachment: fixed;
    color: var(--text);
}

.dark .min-h-screen,
html.dark .min-h-screen,
.dark\:bg-gray-950:is(.dark *) {
    background-color: var(--bg);
    background-image: var(--cr-pattern);
    background-size: var(--cr-pattern-size);
    color: var(--text);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

header.xl\:hidden,
header.bg-white\/95,
.dark header.xl\:hidden,
header.dark\:bg-gray-900\/95 {
    background: var(--surface);
    border: none;
    border-bottom: 0;
    backdrop-filter: none;
    box-shadow: var(--elev-1);
}

footer.mt-auto,
footer.bg-gradient-to-b {
    background: var(--surface);
    border: none;
    border-top: 0;
    color: var(--text-muted);
}

.text_color_footer,
footer a.text_color_footer {
    color: var(--text-muted);
    font-weight: 600;
    font-size: var(--text-sm);
    text-shadow: none;
}

footer a.text_color_footer:hover {
    color: var(--text);
    text-shadow: none;
}

html {
    scrollbar-color: var(--surface-raised) var(--bg);
    scrollbar-width: thin;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 10px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: var(--surface-raised);
    border-radius: var(--radius-control);
}

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

/* --------------------------------------------------------------------------
   Sidebar + search
   -------------------------------------------------------------------------- */
.side-nav>div,
.nav-desktop>div,
.sidebar-mobile {
    background: var(--surface);
    border: none !important;
    box-shadow: var(--elev-1);
    color: var(--text);
}

.side-nav .btn-custom,
.sidebar-mobile .btn-custom,
.btn-custom {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 40px;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font);
    font-size: var(--text-md);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    border-radius: var(--radius-control);
    border: 0;
    background: transparent;
    color: var(--text);
    text-shadow: none;
    box-shadow: none;
    transition: background-color var(--ease), color var(--ease);
}

.side-nav .btn-custom img,
.sidebar-mobile .btn-custom img,
.btn-custom img {
    width: 20px !important;
    height: 20px !important;
    filter: grayscale(1) brightness(1.35) contrast(1.05);
    opacity: 0.92;
}

.side-nav .btn-custom .text_color,
.btn-custom .text_color,
.btn-custom span {
    color: var(--text);
    font-size: var(--text-md);
    font-weight: 500;
}

.btn-custom span.absolute.h-px {
    display: none;
}

@media (hover: hover) {

    .btn-custom:hover,
    .side-nav .btn-custom:hover,
    .sidebar-mobile .btn-custom:hover {
        transform: none;
        filter: none;
        background: var(--surface-raised);
        box-shadow: none;
    }
}

.btn-custom:active,
.side-nav .btn-custom:active {
    transform: none;
    box-shadow: none;
    background: var(--surface-raised);
}

.side-nav .btn-custom.active,
.sidebar-mobile .btn-custom.active,
.btn-custom.active {
    background: var(--surface-raised);
    color: var(--text);
    border: 0;
    box-shadow: none;
    text-shadow: none;
    font-weight: 700;
}

.side-nav .btn-custom.active::before,
.sidebar-mobile .btn-custom.active::before,
.btn-custom.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 3px;
    background: var(--accent);
}

.side-nav .btn-custom.active .text_color,
.btn-custom.active span {
    color: var(--text);
    font-weight: 700;
}

.side-nav .btn-custom.active img,
.btn-custom.active img {
    filter: grayscale(1) brightness(1.55);
    opacity: 1;
}

.input_search,
#search_txt {
    min-height: 40px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    font-family: var(--font);
    font-size: var(--text-md);
    box-shadow: none;
}

.input_search::placeholder,
#search_txt::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.input_search:focus,
#search_txt:focus,
.input_search:focus-visible,
#search_txt:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-color: var(--border);
    box-shadow: none;
}

#search_button,
.lucide-search {
    color: var(--text-muted);
}

.search__result_container {
    background: var(--surface-raised);
    border: none;
    box-shadow: var(--elev-2);
}

.search-results .game-item:hover,
.search-results a:hover {
    background: var(--surface);
    color: var(--text);
}

/* --------------------------------------------------------------------------
   Player + PLAY NOW
   -------------------------------------------------------------------------- */
.rounded-2xl.shadow-2xl {
    border: none;
    outline: none;
    border-radius: var(--radius-card);
    box-shadow: var(--elev-1);
}

.play-gate__bg {
    filter: blur(16px) brightness(0.32) saturate(1.05);
}

.play-gate::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(8, 16, 40, 0.42);
    z-index: 0;
    pointer-events: none;
}

.play-gate__cover {
    border: none;
    box-shadow: var(--elev-1);
}

.play-gate__btn {
    position: relative;
    overflow: hidden;
    min-height: 48px;
    padding: 12px 28px;
    font-family: var(--font);
    font-size: var(--text-lg);
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--on-accent);
    text-shadow: none;
    background: var(--accent);
    border: 0;
    border-radius: var(--radius-control);
    box-shadow: none;
    animation: none;
}

.play-gate__btn svg {
    color: var(--on-accent);
}

.play-gate__btn::after {
    display: none;
}

@media (hover: hover) {
    .play-gate__btn:hover {
        filter: brightness(1.06);
        transform: none;
        background: var(--accent-hover);
    }
}

.play-gate__btn:active {
    transform: none;
    box-shadow: none;
    animation: none;
    filter: brightness(0.96);
}

.play-gate__btn:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Player title bar
   -------------------------------------------------------------------------- */
.player-footer {
    background: var(--surface) !important;
    border: none !important;
    box-shadow: var(--elev-1);
}

.player-footer__left h1 {
    font-family: var(--font);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text);
    text-shadow: none;
}

.g-footer__button {
    min-width: 40px;
    min-height: 40px;
    background: transparent;
    border: 0;
    border-radius: var(--radius-control);
    box-shadow: none;
    color: var(--text-muted);
}

.g-footer__button .g-footer__button-title,
.g-footer__button-title_text {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

@media (hover: hover) {
    .g-footer__button:hover {
        transform: none;
        filter: none;
        background: var(--surface-raised);
        color: var(--text);
    }

    .g-footer__button:hover .g-footer__button-title_text {
        color: var(--text);
    }
}

.g-footer__button.active,
.g-footer__button.voted {
    background: transparent !important;
    color: var(--accent);
}

.g-footer__button.active .svg-icon__link,
.g-footer__button.voted .svg-icon__link {
    fill: var(--accent);
}

.svg-icon__link {
    fill: var(--text-muted);
}

.svg-icon__link:hover {
    filter: none;
    fill: var(--text);
}

.menu {
    min-width: 40px;
    min-height: 40px;
    background: var(--surface-raised);
    border: none;
    color: var(--text);
}

/* --------------------------------------------------------------------------
   Thumbnails + secondary actions
   -------------------------------------------------------------------------- */
.card-thumb,
.slide-card,
.category-card {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: none;
    transition: transform var(--ease), box-shadow var(--ease);
}

.card-thumb::after,
.slide-card::after {
    display: none;
}

.card-thumb .slide-card-img img,
.slide-card img,
.category-card img {
    transition: transform var(--ease);
}

@media (hover: hover) {

    .card-thumb:hover,
    .slide-card:hover,
    .category-card:hover {
        transform: scale(1.03);
        background: var(--surface-raised);
        box-shadow: var(--elev-2);
        border: none;
        filter: none;
    }

    .card-thumb:hover .slide-card-img img,
    .slide-card:hover img,
    .category-card:hover img {
        transform: none;
    }
}

.card-thumb-info {
    background: linear-gradient(to top, rgba(8, 16, 40, 0.92), transparent);
}

.card-thumb-title,
.slide-card-title,
.category-card-title {
    font-family: var(--font);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    letter-spacing: 0;
}

.view-more a.more,
.view-more a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
    font-family: var(--font);
    font-size: var(--text-md);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text);
    background: var(--surface-raised);
    border: none;
    border-radius: var(--radius-control);
    box-shadow: none;
    text-shadow: none;
}

@media (hover: hover) {
    .view-more a:hover {
        transform: none;
        filter: none;
        background: var(--surface-hover);
    }
}

.btn_up,
#button-gotop {
    min-width: 40px;
    min-height: 40px;
    background: var(--surface-raised);
    color: var(--text);
    border: none;
    box-shadow: var(--elev-1);
}

@media (hover: hover) {

    .btn_up:hover,
    #button-gotop:hover {
        transform: none;
        filter: none;
        background: var(--surface-hover);
    }
}

.ShowMore_button {
    font-size: var(--text-md);
    color: var(--text);
    text-shadow: none;
}

.ShowMore_button:hover {
    color: var(--accent);
}

.cat_item {
    background: var(--surface-raised);
    border: none;
    color: var(--text);
}

/* --------------------------------------------------------------------------
   Description + dialogs
   -------------------------------------------------------------------------- */
.content-inner,
.content-inner.dark\:bg-gray-800,
.content-inner.text-gray-600 {
    background: var(--surface);
    color: var(--text);
    border: none;
    box-shadow: var(--elev-1);
    padding: 32px;
}

.game-description {
    --gd-text: var(--text);
    --gd-muted: var(--text-muted);
    --gd-surface: var(--bg);
    --gd-surface-alt: var(--surface-raised);
    --gd-border: transparent;
    --gd-accent: var(--cr-royal);
    --gd-accent-2: var(--cr-royal);
    --gd-accent-ink: var(--text);
    --gd-focus: var(--focus);
    --gd-link: #9ec4ff;
    --gd-gold: var(--text);
    --gd-danger: var(--danger);
    --gd-danger-soft: rgba(240, 113, 110, 0.12);
    --gd-danger-line: rgba(240, 113, 110, 0.45);
    --gd-note-bg: rgba(26, 42, 87, 0.6);
    --gd-strategy-bg: var(--surface-raised);
    --gd-header-from: var(--surface-raised);
    --gd-header-to: var(--surface-raised);
    color: var(--text);
    font-size: var(--text-md);
}

.game-description h2,
.game-description.page-content h2 {
    font-family: var(--font);
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    text-shadow: none;
    border: none;
    border-left: none;
    background-image: none;
    margin-top: 32px;
    margin-bottom: 12px;
    padding: 0;
}

.game-description h2:first-child {
    margin-top: 0;
}

.game-description h3,
.game-description.page-content h3 {
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-left: none;
}

.game-description p,
.game-description li {
    color: var(--text);
    font-size: var(--text-md);
}

.game-description a {
    color: #9ec4ff;
}

.game-description .guide-box,
.game-description .faq-item,
.game-description .controls-table,
.game-description .strategy-block,
.game-description .strategy-block p,
.game-description .gd-note {
    background: transparent;
    border: none;
    box-shadow: none;
}

.game-description .faq-answer {
    padding-left: 0;
    border: none;
    border-left: none;
}

.game-description .faq-question::after {
    border: none;
    background: transparent;
    color: var(--text-muted);
}

.game-description .strategy-block p {
    max-width: 70ch;
    padding: 0;
    margin: 0 0 16px;
    line-height: 1.7;
    border-radius: 0;
}

.game-description .controls-row--head {
    background: var(--surface-raised);
    color: var(--text);
}

.game-description .controls-row {
    border: none;
    border-bottom: 1px solid var(--divider);
}

.game-description .controls-row:last-child {
    border-bottom: none;
}

.game-description .controls-cell,
.game-description .controls-cell[data-label="Control"] {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}

@media (min-width: 640px) {
    .game-description .controls-cell[data-label="Control"] {
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
    }

    .game-description .controls-row--head {
        background: var(--surface-raised);
        color: var(--text);
        text-transform: none;
        letter-spacing: 0;
        font-size: var(--text-sm);
    }
}

.game-description .tips-list,
.game-description .mistakes-list {
    list-style: none;
    display: block;
    margin: 8px 0 0;
    padding: 0;
    gap: 0;
}

.game-description .tips-list li,
.game-description .mistakes-list li {
    position: relative;
    margin: 0;
    padding: 12px 0 12px 28px;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--divider);
    font-size: var(--text-md);
    line-height: 1.6;
    color: var(--text);
    box-shadow: none;
    background: transparent;
}

.game-description .tips-list li:last-child,
.game-description .mistakes-list li:last-child {
    border-bottom: none;
}

.game-description .tips-list li:hover,
.game-description .mistakes-list li:hover {
    transform: none;
    box-shadow: none;
    background: transparent;
}

.game-description .tips-list li::before,
.game-description .mistakes-list li::before {
    position: absolute;
    left: 0;
    top: 14px;
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 0;
    background: none;
    font-size: 14px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.game-description .tips-list li::before {
    content: "✓";
    color: var(--accent);
}

.game-description .mistakes-list li::before {
    content: "✕";
    color: var(--danger);
}

.game-description .more-games-list a {
    color: #9ec4ff;
}

.comments-form-wrapper,
.comments-list-wrapper {
    background: var(--surface);
    border: none;
    box-shadow: var(--elev-1);
}

.comments-notice {
    border: none;
    border-left: none;
    background: var(--surface-raised);
}

.comments-submit {
    border: none;
    background: var(--accent);
    color: var(--on-accent);
}

.comments-input,
.comments-textarea {
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.blur_dialog,
.contact-popup {
    background: var(--surface-raised);
    border: none;
    box-shadow: var(--elev-2);
    color: var(--text);
}

.popup-heading,
.cat_item.popup-heading {
    background: var(--surface-raised);
    color: var(--text);
}

.popup-heading .title_contact,
.popup-heading strong,
.title_contact {
    color: var(--text);
    text-shadow: none;
    font-size: var(--text-md);
}

.popup-content {
    background: var(--surface);
    color: var(--text);
}

.popup-link-share--url {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
}

.popup-link-share--copy {
    color: var(--text);
    font-weight: 700;
}

.page_loading {
    background-color: rgba(8, 16, 40, 0.82);
}

.loader {
    border-color: var(--border);
    border-top-color: var(--accent);
}

.how-to-play-box {
    background: var(--surface);
    border: none;
    box-shadow: var(--elev-1);
}

.how-to-play-box h3 {
    color: var(--text);
}

.how-to-play-box ul li {
    color: var(--text-muted);
    font-size: var(--text-md);
}

.pagination .page-link {
    background: var(--surface-raised);
    border: none;
    color: var(--text);
    min-height: 40px;
}

.pagination .disabled .page-link {
    background: var(--surface-raised);
    color: var(--text);
}

.game-description .basket-battle-steps,
.content-inner .game-description.page-content ol.basket-battle-steps {
    display: block;
    grid-template-columns: none;
    gap: 0;
    padding-left: 0;
    margin: 0;
    list-style: none;
}

.game-description .basket-battle-steps li,
.content-inner .game-description.page-content ol.basket-battle-steps li {
    position: relative;
    display: block;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--divider);
    background: transparent;
    box-shadow: none;
    color: var(--text);
    padding: 12px 0 12px 32px;
    margin: 0;
    gap: 0;
    transform: none;
    transition: none;
}

.game-description .basket-battle-steps li::marker,
.content-inner .game-description.page-content ol.basket-battle-steps li::marker {
    color: var(--text);
}

.game-description .basket-battle-steps li:last-child,
.content-inner .game-description.page-content ol.basket-battle-steps li:last-child {
    border-bottom: none;
}

.game-description .basket-battle-steps li:hover,
.content-inner .game-description.page-content ol.basket-battle-steps li:hover {
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--divider);
    background: transparent;
    box-shadow: none;
    transform: none;
}

.game-description .basket-battle-steps li:last-child:hover,
.content-inner .game-description.page-content ol.basket-battle-steps li:last-child:hover {
    border-bottom: none;
}

.game-description .basket-battle-steps li::before,
.content-inner .game-description.page-content ol li::before {
    content: counter(gd-step) ".";
    position: absolute;
    left: 0;
    top: 12px;
    width: auto;
    height: auto;
    background: none;
    border: none;
    border-radius: 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
}

.content-inner .game-description.page-content .guide-box,
.content-inner .game-description.page-content .faq-item,
.content-inner .game-description.page-content .strategy-block p,
.content-inner .game-description.page-content .gd-note,
.content-inner .game-description.page-content .controls-table,
.content-inner .game-description.page-content h2,
.content-inner .game-description.page-content h3,
.content-inner .game-description.page-content .faq-answer {
    border: none;
    border-left: none;
    box-shadow: none;
}

.content-inner .game-description.page-content .guide-box {
    box-shadow: var(--elev-1);
}

.game-description.page-content .faq-item {
    border: none;
    border-bottom: 1px solid var(--divider);
    padding: 5px 0;
}

.game-description.page-content .faq-item:last-child {
    border-bottom: none;
}

.content-inner .game-description.page-content .guide-box:hover,
.content-inner .game-description.page-content .faq-item:hover {
    border: none;
    transform: none;
    box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }

    .card-thumb:hover,
    .slide-card:hover,
    .category-card:hover,
    .btn-custom:hover,
    .play-gate__btn:hover,
    .g-footer__button:hover {
        transform: none !important;
    }
}