:root {
    --primary: #2D6BFF;
    --secondary: #1E3A8A;
    --accent: #F4B942;
    --background: #0A1022;
    --surface: #131F3F;
    --textPrimary: #EEF4FF;
    --textSecondary: #B5C2DE;
    --headingFont: 'Playfair Display', serif;
    --bodyFont: 'Lora', serif;
    --spacing-1: 0.5rem;
    --spacing-2: 1rem;
    --spacing-3: 1.5rem;
    --spacing-4: 2rem;
    --spacing-6: 3rem;
    --spacing-8: 4rem;
    --border-radius: 8px;
}

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

html, body {
    font-family: var(--bodyFont);
    color: var(--textPrimary);
    background-color: var(--background);
    line-height: 1.6;
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--headingFont);
    font-weight: 700;
    color: var(--textPrimary);
    margin-bottom: var(--spacing-2);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary);
}

.toploterij_container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-2);
}

.toploterij_bg_surface {
    background-color: var(--surface);
}

.toploterij_text_center {
    text-align: center;
}

.toploterij_mt_4 {
    margin-top: var(--spacing-4);
}

.toploterij_visually_hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Buttons */
.toploterij_btn_primary, .toploterij_btn_secondary, .toploterij_btn_large, .toploterij_btn_spin, .toploterij_btn_play {
    display: inline-block;
    font-family: var(--headingFont);
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.toploterij_btn_primary {
    background-color: var(--accent);
    color: var(--background);
    border: 2px solid var(--accent);
}

.toploterij_btn_primary:hover {
    background-color: transparent;
    color: var(--accent);
}

.toploterij_btn_secondary {
    background-color: transparent;
    color: var(--textPrimary);
    border: 2px solid var(--textSecondary);
}

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

.toploterij_btn_large {
    background-color: var(--primary);
    color: var(--textPrimary);
    padding: 1rem 2rem;
    font-size: 1.25rem;
}

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

/* Header */
.toploterij_header {
    background-color: var(--secondary);
    border-bottom: 2px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: var(--spacing-2) 0;
}

.toploterij_header_container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-2);
}

.toploterij_brand {
    font-family: var(--headingFont);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.toploterij_nav_list {
    list-style: none;
    display: flex;
    gap: var(--spacing-3);
}

.toploterij_nav_link {
    color: var(--textPrimary);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.toploterij_nav_link.toploterij_active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

.toploterij_auth_controls {
    display: flex;
    gap: var(--spacing-1);
}

.toploterij_burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.toploterij_burger_line {
    width: 25px;
    height: 3px;
    background-color: var(--accent);
    transition: 0.3s;
}

/* Gates / Modals */
.toploterij_gate_overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 16, 34, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.toploterij_hidden {
    display: none !important;
}

.toploterij_gate_modal {
    background: var(--surface);
    padding: var(--spacing-4);
    border: 2px solid var(--accent);
    text-align: center;
    max-width: 400px;
    width: 90%;
    border-radius: var(--border-radius);
    position: relative;
}

.toploterij_gate_modal h2 {
    color: var(--accent);
}

.toploterij_gate_modal p {
    margin-bottom: var(--spacing-3);
}

.toploterij_gate_modal button {
    margin: var(--spacing-1);
    width: calc(100% - 1rem);
}

.toploterij_modal_close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--textSecondary);
    cursor: pointer;
}

.toploterij_auth_form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.toploterij_input, .toploterij_textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--background);
    border: 1px solid var(--textSecondary);
    color: var(--textPrimary);
    font-family: var(--bodyFont);
}

/* Forms */
.toploterij_form_block {
    background: var(--surface);
    padding: var(--spacing-4);
    border-radius: var(--border-radius);
}

.toploterij_form_group {
    margin-bottom: var(--spacing-2);
}

.toploterij_form_group label {
    display: block;
    margin-bottom: var(--spacing-1);
    color: var(--accent);
}

/* Hero */
.toploterij_hero_split {
    display: flex;
    min-height: 70vh;
    background: var(--background);
    border-bottom: 2px solid var(--surface);
    position: relative;
}

.toploterij_hero_content {
    flex: 1;
    padding: var(--spacing-6) var(--spacing-4);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.toploterij_hero_trust_badge {
    display: inline-block;
    background: var(--surface);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: var(--spacing-3);
    border: 1px solid var(--accent);
    width: fit-content;
}

.toploterij_hero_title {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: var(--spacing-2);
}

.toploterij_hero_subtitle {
    font-size: 1.2rem;
    color: var(--textSecondary);
    margin-bottom: var(--spacing-4);
    max-width: 80%;
}

.toploterij_hero_visual {
    flex: 1;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-4);
}

.toploterij_hero_img {
    max-width: 100%;
    height: auto;
    border: 4px solid var(--accent);
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.toploterij_hero_ticker {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--secondary);
    color: var(--textPrimary);
    padding: 0.5rem 0;
    overflow: hidden;
    border-top: 1px solid var(--surface);
}

.toploterij_ticker_track {
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
}

.toploterij_ticker_track span {
    margin: 0 var(--spacing-2);
}

/* Content Blocks */
.toploterij_content_block {
    padding: var(--spacing-8) 0;
}

.toploterij_section_title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: var(--spacing-6);
    color: var(--accent);
}

/* Cards */
.toploterij_card_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-4);
}

.toploterij_card {
    background: var(--background);
    padding: var(--spacing-4);
    border: 1px solid var(--surface);
    border-radius: var(--border-radius);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.toploterij_card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-color: var(--accent);
}

.toploterij_card h3 {
    color: var(--primary);
    margin-bottom: var(--spacing-2);
}

/* Layouts */
.toploterij_grid_2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-6);
}

.toploterij_page_padding {
    padding: var(--spacing-6) 0;
}

.toploterij_page_title {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-4);
    border-bottom: 2px solid var(--surface);
    padding-bottom: var(--spacing-2);
}

.toploterij_longform_content h2 {
    color: var(--accent);
    margin-top: var(--spacing-4);
}

.toploterij_longform_content p {
    margin-bottom: var(--spacing-3);
}

/* FAQ Accordion */
.toploterij_faq_item {
    border-bottom: 1px solid var(--surface);
    margin-bottom: var(--spacing-2);
}

.toploterij_faq_trigger {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--textPrimary);
    font-family: var(--headingFont);
    font-size: 1.1rem;
    font-weight: bold;
    padding: var(--spacing-2) 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.toploterij_faq_trigger::after {
    content: '+';
    color: var(--accent);
}

.toploterij_faq_trigger[aria-expanded="true"]::after {
    content: '-';
}

.toploterij_faq_content {
    display: none;
    padding-bottom: var(--spacing-2);
    color: var(--textSecondary);
}

/* Info Panel */
.toploterij_info_panel {
    background: var(--surface);
    padding: var(--spacing-6);
    border-left: 4px solid var(--primary);
}

.toploterij_feature_list {
    list-style: none;
    margin-top: var(--spacing-3);
}

.toploterij_feature_list li {
    margin-bottom: var(--spacing-2);
    padding-left: 1.5rem;
    position: relative;
}

.toploterij_feature_list li::before {
    content: '⚙';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Economy Steps */
.toploterij_economy_steps {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-4);
}

.toploterij_step {
    flex: 1;
    text-align: center;
    background: var(--background);
    padding: var(--spacing-4);
    border: 1px solid var(--accent);
    position: relative;
}

.toploterij_step_num {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--background);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--headingFont);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Faction Buttons */
.toploterij_faction_grid {
    display: flex;
    justify-content: center;
    gap: var(--spacing-3);
    margin-top: var(--spacing-4);
}

.toploterij_faction_btn {
    background: var(--surface);
    border: 2px solid var(--textSecondary);
    color: var(--textPrimary);
    padding: 1rem 2rem;
    font-family: var(--headingFont);
    cursor: pointer;
    transition: all 0.3s;
}

.toploterij_faction_btn:hover, .toploterij_faction_btn.toploterij_active {
    border-color: var(--accent);
    color: var(--accent);
}

/* Companion Feature */
.toploterij_companion_view {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-4);
    background: var(--background);
    padding: var(--spacing-4);
    border: 1px dashed var(--accent);
}

.toploterij_companion_img_wrapper img {
    width: 100px;
    cursor: pointer;
    transition: transform 0.2s;
}

.toploterij_companion_img_wrapper img:active {
    transform: scale(0.9);
}

/* Lobby Layout */
.toploterij_lobby_layout {
    display: flex;
    gap: var(--spacing-4);
    padding: var(--spacing-6) var(--spacing-2);
    max-width: 1400px;
    margin: 0 auto;
}

.toploterij_sidebar_terminal {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.toploterij_wallet_panel {
    background: var(--surface);
    padding: var(--spacing-3);
    border: 2px solid var(--primary);
    text-align: center;
}

.toploterij_balance_display {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent);
    margin: var(--spacing-1) 0;
    font-family: var(--headingFont);
}

.toploterij_wallet_note {
    font-size: 0.8rem;
    color: var(--textSecondary);
}

.toploterij_payout_ticker, .toploterij_locations_menu {
    background: var(--surface);
    padding: var(--spacing-3);
}

.toploterij_ticker_list {
    list-style: none;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--primary);
}

.toploterij_loc_btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid var(--background);
    padding: var(--spacing-1) 0;
    color: var(--textSecondary);
    cursor: pointer;
}

.toploterij_loc_btn.toploterij_active, .toploterij_loc_btn:hover {
    color: var(--accent);
}

.toploterij_game_stage_area {
    flex: 1;
}

.toploterij_masonry_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-4);
}

/* Game Cards */
.toploterij_game_card, .toploterij_live_game_wrapper {
    background: var(--surface);
    border: 1px solid var(--secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.toploterij_live_game_wrapper {
    max-width: 600px;
    margin: 0 auto;
    border-color: var(--accent);
}

.toploterij_game_header {
    padding: var(--spacing-2);
    background: var(--background);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--secondary);
}

.toploterij_game_header h2, .toploterij_game_header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--textPrimary);
}

.toploterij_game_badge {
    background: var(--primary);
    color: var(--textPrimary);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.toploterij_home_balance {
    font-size: 0.9rem;
    color: var(--accent);
}

.toploterij_game_board {
    background: #000;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: var(--spacing-2);
}

.toploterij_game_stage {
    background: #000;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.toploterij_game_ui, .toploterij_game_controls {
    padding: var(--spacing-3);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.toploterij_bet_group, .toploterij_bet_selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toploterij_bet_select, .toploterij_bet_input {
    background: var(--background);
    color: var(--textPrimary);
    border: 1px solid var(--textSecondary);
    padding: 0.5rem;
}

.toploterij_btn_play, .toploterij_btn_spin {
    background: var(--accent);
    color: var(--background);
    border: none;
    padding: 1rem;
    font-size: 1.2rem;
}

.toploterij_btn_play:disabled, .toploterij_btn_spin:disabled {
    background: var(--textSecondary);
    cursor: not-allowed;
}

.toploterij_game_status, .toploterij_game_result {
    text-align: center;
    font-size: 0.9rem;
    color: var(--accent);
    min-height: 1.5rem;
}

.toploterij_game_history {
    padding: 0 var(--spacing-3) var(--spacing-3);
    border-top: 1px solid var(--secondary);
}

.toploterij_game_history h4 {
    margin-top: var(--spacing-2);
    font-size: 0.9rem;
    color: var(--textSecondary);
}

.toploterij_history_list {
    list-style: none;
    font-size: 0.8rem;
    display: flex;
    gap: var(--spacing-1);
}

/* Game Animations & Components */
.toploterij_wheel_container {
    position: relative;
    width: 200px;
    height: 200px;
}

.toploterij_wheel_img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 3.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.toploterij_wheel_pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 20px solid var(--accent);
    z-index: 10;
}

.toploterij_wheel_pointer_bottom {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 20px solid var(--primary);
    z-index: 10;
}

.toploterij_oxidized img {
    filter: sepia(0.8) hue-rotate(180deg);
}

.toploterij_slot_container {
    display: flex;
    gap: 10px;
    position: relative;
    background: var(--surface);
    padding: 10px;
    border: 2px solid #333;
}

.toploterij_payline {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(244, 185, 66, 0.6);
    transform: translateY(-50%);
    z-index: 5;
}

.toploterij_reel {
    width: 80px;
    height: 80px;
    background: var(--background);
    border: 1px solid var(--secondary);
    overflow: hidden;
}

.toploterij_reel img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.toploterij_spin_anim img {
    animation: toploterij_blur 0.2s infinite;
}

@keyframes toploterij_blur {
    0% { filter: blur(0); transform: translateY(0); }
    50% { filter: blur(4px); transform: translateY(10px); }
    100% { filter: blur(0); transform: translateY(0); }
}

.toploterij_cascade {
    flex-direction: column;
}

.toploterij_cascade .toploterij_payline {
    display: none;
}

/* Toast */
.toploterij_toast_container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toploterij_toast {
    background: var(--accent);
    color: var(--background);
    padding: 1rem;
    border-radius: 4px;
    font-weight: bold;
    animation: toploterij_fade_in 0.3s forwards;
}

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

/* Footer */
.toploterij_footer {
    background-color: var(--background);
    border-top: 4px solid var(--secondary);
    padding: var(--spacing-6) 0 var(--spacing-2);
    margin-top: auto;
}

.toploterij_footer_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-4);
}

.toploterij_footer h3 {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-2);
}

.toploterij_footer p, .toploterij_footer li {
    color: var(--textSecondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-1);
}

.toploterij_footer ul {
    list-style: none;
}

.toploterij_footer_responsible {
    border: 2px solid var(--secondary);
    padding: var(--spacing-2);
}

.toploterij_footer_partners {
    border-top: 1px solid var(--surface);
    padding: var(--spacing-4) 0;
    display: flex;
    justify-content: center;
}

.toploterij_partner_logos {
    display: flex;
    gap: var(--spacing-4);
    align-items: center;
}

.toploterij_partner_link {
    display: inline-block;
    padding: 10px;
    border-radius: 4px;
}

.toploterij_partner_light {
    background-color: #fff;
}

.toploterij_partner_dark {
    background-color: #333;
}

.toploterij_partner_link img {
    max-height: 40px;
    display: block;
}

.toploterij_footer_bottom {
    text-align: center;
    border-top: 1px solid var(--surface);
    padding-top: var(--spacing-2);
    font-size: 0.8rem;
}

/* Media Queries */
@media (max-width: 1024px) {
    .toploterij_hero_split {
        flex-direction: column;
    }
    .toploterij_hero_content {
        text-align: center;
        padding: var(--spacing-4) var(--spacing-2);
    }
    .toploterij_hero_subtitle {
        margin: 0 auto var(--spacing-4);
    }
    .toploterij_hero_trust_badge {
        margin: 0 auto var(--spacing-3);
    }
    .toploterij_lobby_layout {
        flex-direction: column;
    }
    .toploterij_sidebar_terminal {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .toploterij_wallet_panel, .toploterij_payout_ticker, .toploterij_locations_menu {
        flex: 1;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .toploterij_nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--secondary);
        padding: var(--spacing-2) 0;
    }
    .toploterij_nav.toploterij_open {
        display: block;
    }
    .toploterij_nav_list {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-2);
    }
    .toploterij_burger {
        display: flex;
    }
    .toploterij_auth_controls {
        display: none;
    }
    .toploterij_grid_2 {
        grid-template-columns: 1fr;
    }
    .toploterij_economy_steps {
        flex-direction: column;
    }
    .toploterij_hero_title {
        font-size: 2.2rem;
    }
    .toploterij_companion_view {
        flex-direction: column;
    }
}

@media (max-width: 360px) {
    .toploterij_hero_title {
        font-size: 1.8rem;
    }
    .toploterij_card_grid, .toploterij_masonry_grid {
        grid-template-columns: 1fr;
    }
    .toploterij_bet_group {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-1);
    }
}

/* footer-logo-contrast-guard */
a[href*="begambleaware.org"] img,
a[href*="begambleaware.org"] picture,
a[href*="begambleaware.org"] .partner-logo,
img[src*="gambleaware"],
img[alt*="BeGambleAware" i],
img[alt*="GambleAware" i] {
  background: #111111 !important;
  padding: 0.45rem 0.7rem !important;
  border-radius: 0.7rem !important;
  box-sizing: border-box !important;
}

a[href*="gamcare.org"] img,
a[href*="gamcare.org"] picture,
a[href*="gamcare.org"] .partner-logo,
img[src*="gamcare"],
img[alt*="GamCare" i] {
  background: #ffffff !important;
  padding: 0.45rem 0.7rem !important;
  border-radius: 0.7rem !important;
  box-sizing: border-box !important;
}

a[href*="begambleaware.org"],
a[href*="gamcare.org"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
