:root {
    --bg: #090d10;
    --panel: #12181d;
    --panel-2: #171f25;
    --line: #28323a;
    --text: #f4f7f5;
    --muted: #9aa8b2;
    --green: #c7ff19;
    --gold: #f5b73e;
    --danger: #ff5c7a;
    --ok: #32d583;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(199, 255, 25, .10), transparent 30%), var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }

.site-header {
    min-height: 72px;
    border-bottom: 1px solid #20272d;
    background: rgba(9, 13, 16, .94);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header-inner {
    width: min(1160px, calc(100% - 44px));
    min-height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand, .main-nav, .language { display: flex; align-items: center; gap: 18px; }

.brand { font-size: 20px; font-weight: 800; }

.brand-logo {
    display: block;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    background: #0d1216;
}

.main-nav a,
.profile-menu button {
    color: #d8e2e8;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
}

.profile-menu {
    position: relative;
    padding: 12px 0;
    margin: -12px 0;
}

.profile-menu button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    padding: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

.profile-menu button::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
}

.main-nav a.active,
.profile-menu button.active,
.profile-menu:hover button,
.profile-menu:focus-within button {
    color: var(--green);
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 170px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #11181d;
    box-shadow: 0 18px 34px rgba(0, 0, 0, .35);
    display: none;
    z-index: 40;
}

.profile-menu:hover .profile-dropdown,
.profile-menu:focus-within .profile-dropdown {
    display: grid;
    gap: 4px;
}

.profile-dropdown a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    white-space: nowrap;
}

.profile-dropdown a:hover,
.profile-dropdown a:focus {
    background: #182228;
    color: var(--green);
}

.nav-button, .language strong {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 9px 12px;
}

.language { color: var(--muted); font-weight: 700; }
.language strong { color: var(--green); margin-left: 4px; }

.page-shell {
    width: min(1160px, calc(100% - 44px));
    margin: 52px auto;
}

.hero-copy h1, .auth-layout h1, .dashboard-top h1 {
    font-size: clamp(42px, 7vw, 70px);
    line-height: .96;
    margin: 8px 0 22px;
    letter-spacing: 0;
}

.hero-copy p, .muted { color: var(--muted); line-height: 1.65; }

.eyebrow {
    margin: 0 0 14px;
    color: var(--green);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.button {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    font-weight: 900;
    cursor: pointer;
}

.button.primary {
    background: var(--green);
    color: #111806;
    border-color: var(--green);
}

.button.secondary { background: #182027; color: var(--text); }
.button.full { width: 100%; }

.panel, .providers-panel, .form-card, .balance-card, .action-card {
    background: rgba(18, 24, 29, .96);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.panel { margin-top: 60px; padding: 28px; }
.providers-panel { padding: 28px; overflow: hidden; }
.panel.no-margin { margin-top: 0; }

.provider-heading {
    margin-bottom: 22px;
}

.provider-marquee {
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

.provider-track {
    display: flex;
    gap: 16px;
    width: max-content;
    animation: providers-scroll 34s linear infinite;
}

.provider-marquee:hover .provider-track {
    animation-play-state: paused;
}

.provider-logo {
    width: 220px;
    height: 86px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius);
    background: #0d1216;
    display: grid;
    place-items: center;
    padding: 0;
    flex: 0 0 auto;
    overflow: hidden;
}

.provider-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

@keyframes providers-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 26px;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h2 { margin: 0; font-size: 28px; }

.text-link { color: var(--green); font-weight: 900; }

.provider-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -4px 0 24px;
}

.provider-filter a,
.pagination a {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #10171c;
    color: #d8e2e8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 900;
}

.provider-filter a:hover,
.provider-filter a.active,
.pagination a:hover,
.pagination a.active {
    border-color: var(--green);
    background: var(--green);
    color: #111806;
}

.provider-filter span {
    color: inherit;
    opacity: .72;
    font-size: 12px;
}

.game-search {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin: 0 0 24px;
}

.game-search label {
    margin: 0;
}

.game-search label span {
    color: var(--muted);
    font-size: 12px;
}

.game-search .button {
    min-height: 44px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    margin: 0;
    padding: 28px;
    text-align: center;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.game-grid.wide { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.game-card {
    min-height: 304px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #151b20;
    overflow: hidden;
    display: grid;
    grid-template-rows: 112px 126px 66px;
    position: relative;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.game-card.disabled { opacity: .58; }

.game-card:not(.disabled):hover {
    border-color: rgba(199, 255, 25, .6);
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .28);
    cursor: pointer;
}

.game-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    margin: 0;
}

.game-media {
    min-width: 0;
    padding: 14px 14px 6px;
}

.game-thumb {
    width: 100%;
    height: 92px;
    border-radius: 4px;
    display: grid;
    place-items: center;
    font-size: 38px;
    font-weight: 950;
    color: #fff;
    background: linear-gradient(135deg, #ff2f7d, #7b2cff 55%, #16c7ff);
}

.game-image {
    width: 100%;
    height: 92px;
    border-radius: 4px;
    object-fit: cover;
    display: block;
    background: #0d1216;
}

.tone-2 { background: linear-gradient(135deg, #6bffb8, #027a48 55%, #073b2c); }
.tone-3 { background: linear-gradient(135deg, #ffdd4a, #f97066 55%, #7a2e0e); }
.tone-4 { background: linear-gradient(135deg, #5eead4, #2563eb 55%, #1e1b4b); }
.tone-5 { background: linear-gradient(135deg, #f472b6, #ef4444 55%, #450a0a); }

.game-card-body {
    min-width: 0;
    display: grid;
    grid-template-rows: 18px 58px 24px;
    row-gap: 8px;
    padding: 14px 14px 0;
}

.game-provider {
    color: var(--green);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.game-title {
    font-size: 16px;
    line-height: 1.2;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.game-rtp {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
}

.game-card-actions {
    display: flex;
    align-items: start;
    justify-content: center;
    padding: 6px 14px 16px;
}
.game-card .game-play-button {
    color: #111806;
    background: var(--green);
    border-radius: var(--radius);
    font-weight: 900;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 116px;
    padding: 0 16px;
    position: relative;
    z-index: 2;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1fr 460px;
    gap: 44px;
    align-items: start;
}

.auth-layout.compact { grid-template-columns: 1fr 420px; }

.form-card { padding: 26px; }
.form-card h1 { font-size: 30px; margin-top: 0; }

label {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: #dce6eb;
    font-size: 13px;
    font-weight: 900;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #0d1216;
    color: var(--text);
    min-height: 44px;
    padding: 11px 12px;
    font: inherit;
}

textarea { resize: vertical; }
.split { display: grid; grid-template-columns: 1fr 135px; gap: 12px; }

.form-note { color: var(--muted); text-align: center; }
.form-note a { color: var(--green); font-weight: 900; }

.demo-box {
    display: grid;
    gap: 8px;
    margin-top: 26px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255,255,255,.03);
    color: var(--muted);
}

.demo-box strong { color: var(--text); }

.dashboard-top {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 20px;
    align-items: stretch;
}

.balance-card {
    padding: 28px;
    display: grid;
    align-content: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(199,255,25,.09), rgba(18,24,29,.96));
}

.balance-card span { color: var(--muted); font-weight: 800; }
.balance-card strong { font-size: 38px; color: var(--green); }
.balance-card.demo strong { color: var(--gold); }

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 26px;
}

.action-card { padding: 20px; display: grid; gap: 8px; }
.action-card strong { color: var(--green); font-size: 18px; }
.action-card span { color: var(--muted); }

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th, td {
    border-bottom: 1px solid var(--line);
    padding: 14px 12px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--green);
    font-size: 12px;
    text-transform: uppercase;
}

td { color: #dbe5eb; }
td a { color: #9ad7ff; }

.table-game-image {
    width: 96px;
    height: 52px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    display: block;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.status.enabled { background: rgba(50,213,131,.12); color: var(--ok); }
.status.disabled, .flash.error { background: rgba(255,92,122,.12); color: var(--danger); }
.status.pending { background: rgba(245,183,62,.14); color: var(--gold); }

.admin-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    align-items: start;
}

.flash {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 22px;
    padding: 14px 16px;
    background: rgba(50,213,131,.12);
    color: var(--ok);
    font-weight: 800;
    transition: opacity .28s ease, transform .28s ease, max-height .28s ease, margin .28s ease, padding .28s ease;
    overflow: hidden;
}

.flash.is-hiding {
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.site-footer {
    width: min(1160px, calc(100% - 44px));
    margin: 0 auto 34px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    font-size: 13px;
}

.footer-copy {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-links a {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: inline-grid;
    place-items: center;
    color: var(--muted);
    background: rgba(18, 24, 29, .8);
    transition: color .18s ease, border-color .18s ease, transform .18s ease;
}

.social-links a:hover {
    color: var(--green);
    border-color: rgba(199, 255, 25, .55);
    transform: translateY(-1px);
}

.social-links svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.discord-widget-panel[hidden] {
    display: none;
}

.discord-widget-panel {
    position: fixed;
    right: 32px;
    bottom: 96px;
    z-index: 79;
    width: min(350px, calc(100vw - 36px));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #1f2024;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .52);
}

.discord-widget {
    width: 100%;
    height: 500px;
    border: 0;
    display: block;
}

.discord-float-toggle {
    position: fixed;
    right: 32px;
    bottom: 28px;
    z-index: 80;
    width: 56px;
    height: 56px;
    border: 1px solid rgba(88, 101, 242, .75);
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #5865f2;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .38);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.discord-float-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 44px rgba(0, 0, 0, .46);
}

.discord-float-toggle[aria-expanded="true"] {
    background: var(--green);
    border-color: var(--green);
    color: #111806;
}

.discord-float-toggle svg {
    width: 25px;
    height: 25px;
    fill: currentColor;
}

.game-player-panel {
    margin-top: 0;
}

.player-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.game-frame-wrap {
    width: 100%;
    height: min(72vh, 760px);
    min-height: 560px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #000;
    overflow: hidden;
}

.game-frame-wrap:fullscreen,
.game-frame-wrap:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
}

.game-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
    display: block;
}

.external-game-launch {
    display: grid;
    grid-template-columns: minmax(180px, 320px) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .03);
    padding: 24px;
}

.external-game-launch img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: #000;
}

.external-game-launch h2 {
    margin: 0 0 10px;
}

.external-game-launch .button {
    margin-top: 14px;
}

@media (max-width: 980px) {
    .site-header-inner { width: min(100% - 44px, 1160px); padding: 16px 0; flex-wrap: wrap; gap: 14px; }
    .main-nav { order: 3; width: 100%; justify-content: flex-start; overflow: visible; padding-bottom: 4px; }
    .auth-layout, .auth-layout.compact, .dashboard-top, .admin-grid { grid-template-columns: 1fr; }
    .game-grid, .game-grid.wide, .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .page-shell { width: min(100% - 24px, 1160px); margin: 26px auto; }
    .site-header-inner { width: min(100% - 24px, 1160px); }
    .discord-widget-panel { right: 18px; bottom: 86px; width: calc(100vw - 36px); }
    .discord-widget { height: 440px; }
    .discord-float-toggle { right: 18px; bottom: 18px; }
    .panel, .providers-panel, .form-card { padding: 20px; }
    .hero-copy h1, .auth-layout h1, .dashboard-top h1 { font-size: 42px; }
    .provider-logo { width: 172px; height: 68px; }
    .game-search { grid-template-columns: 1fr; }
    .external-game-launch { grid-template-columns: 1fr; }
    .game-grid, .game-grid.wide, .quick-actions, .split { grid-template-columns: 1fr; }
    .section-head, .site-footer { flex-direction: column; align-items: flex-start; }
}
