:root {
    --bg: #051411;
    --panel: rgba(13, 45, 39, .88);
    --ink: #ffffff;
    --muted: rgba(255, 255, 255, .62);
    --line: rgba(255, 193, 7, .18);
    --accent: #ff9800;
    --accent-dark: #ffc107;
    --danger: #b83232;
    --gold: #ffc107;
    --dark-green: #0a241f;
    --panel-green: #0d2d27;
    --vibrant-orange: #ff9800;
    --accent-purple: #7d2ae8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 193, 7, .10), transparent 34%),
        radial-gradient(circle at 90% 15%, rgba(125, 42, 232, .18), transparent 30%),
        linear-gradient(135deg, #051411 0%, #0a241f 45%, #07141d 100%);
    background-attachment: fixed;
    color: var(--ink);
    font-family: 'Inter', 'Segoe UI', Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

a {
    color: var(--gold);
    text-decoration: none;
}

.topbar {
    align-items: center;
    background: #1f2a2c;
    color: #fff;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 28px;
}

.brand {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.nav a,
.link-button {
    color: #fff;
    font-weight: 700;
}

.link-button {
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.shell {
    margin: 0 auto;
    max-width: 1120px;
    padding: 30px 20px 60px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
}

.narrow {
    margin: 36px auto;
    max-width: 460px;
}

.grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.game-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 220px;
    overflow: hidden;
}

.game-art {
    align-items: center;
    background: linear-gradient(135deg, #0b7a75, #253237 58%, #c28b16);
    color: #fff;
    display: flex;
    font-size: 34px;
    font-weight: 800;
    height: 120px;
    justify-content: center;
}

.game-body {
    padding: 16px;
}

.muted {
    color: var(--muted);
}

.balance {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: #fff;
    padding: 6px 12px;
}

.notification-bell {
    align-items: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    display: inline-flex;
    gap: 6px;
    padding: 6px 10px;
}

.notification-bell strong {
    background: #c28b16;
    border-radius: 999px;
    color: #1f2a2c;
    min-width: 22px;
    padding: 1px 7px;
    text-align: center;
}

.notification-bell.has-unread {
    background: rgba(194, 139, 22, .22);
}

.form-row {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

input,
select,
textarea {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 193, 7, .22);
    border-radius: 12px;
    color: #fff;
    font: inherit;
    min-height: 44px;
    padding: 10px 12px;
    width: 100%;
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, .38);
}

textarea {
    min-height: 130px;
    resize: vertical;
}

.editor-permission-box {
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 193, 7, .16);
    border-radius: 14px;
    padding: 14px;
}

.permission-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.permission-check {
    align-items: flex-start;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 193, 7, .14);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    display: flex;
    gap: 10px;
    padding: 11px;
}

.permission-check input {
    flex: 0 0 auto;
    min-height: auto;
    margin-top: 3px;
    width: auto;
}

.permission-check strong {
    display: block;
    font-size: 13px;
}

.permission-check small {
    color: rgba(255, 255, 255, .55);
    display: block;
    font-size: 11px;
    line-height: 1.35;
    margin-top: 3px;
}

.button {
    align-items: center;
    background: linear-gradient(90deg, #ff6d00 0%, #ffb300 100%);
    border: 0;
    border-radius: 999px;
    color: #07141d;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
}

.button:hover {
    background: #ffeb3b;
    box-shadow: 0 0 20px rgba(255, 235, 59, .5);
}

.button.disabled {
    background: #8a969b;
    cursor: not-allowed;
}

.button.secondary {
    background: #334045;
}

.button.small {
    min-height: 36px;
    padding: 7px 10px;
}

.button.danger {
    background: var(--danger);
}

.flash {
    border-radius: 6px;
    font-weight: 700;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.flash.ok {
    background: #e2f5ec;
    color: #11613b;
}

.flash.error {
    background: #fae4e4;
    color: var(--danger);
}

.slot-stage {
    align-items: center;
    background: #253237;
    border-radius: 8px;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(72px, 1fr));
    margin: 18px 0;
    padding: 18px;
}

.reel {
    align-items: center;
    aspect-ratio: 1 / 1;
    background: #fff;
    border: 3px solid var(--gold);
    border-radius: 8px;
    color: #1f2a2c;
    display: flex;
    font-size: 28px;
    font-weight: 900;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    text-align: center;
}

.round-result {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
}

.stat {
    background: #eef6f5;
    border-radius: 6px;
    color: #144845;
    font-weight: 800;
    padding: 10px 12px;
}

.big-stat {
    color: var(--accent-dark);
    font-size: 34px;
    font-weight: 900;
}

.table-wrap {
    margin-top: 18px;
    overflow-x: auto;
}

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

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

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

.inline-form {
    display: contents;
}

.slot-stage-wide {
    grid-template-columns: repeat(5, minmax(64px, 1fr));
}

.market-layout {
    align-items: stretch;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) 300px;
    margin-top: 18px;
}

.chart-panel canvas {
    border-radius: 8px;
    display: block;
    height: auto;
    margin-top: 16px;
    max-width: 100%;
    width: 100%;
}

.market-price {
    color: var(--accent-dark);
    font-size: 38px;
    font-weight: 900;
}

.trade-panel {
    align-self: start;
}

.trade-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
}

.button.up {
    background: #0b7a75;
}

.button.down {
    background: #b83232;
}

.pnl-up {
    background: #e2f5ec;
    color: #08723e;
    font-weight: 900;
}

.pnl-down {
    background: #fae4e4;
    color: #b83232;
    font-weight: 900;
}

.admin-action {
    display: grid;
    gap: 8px;
    min-width: 220px;
}

.hidden {
    display: none !important;
}

.quick-actions,
.form-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stacked-form {
    display: grid;
    gap: 12px;
}

.detail-list {
    display: grid;
    gap: 8px 14px;
    grid-template-columns: 130px minmax(0, 1fr);
    margin: 0;
}

.detail-list dt {
    color: var(--muted);
    font-weight: 800;
}

.detail-list dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.profile-grid,
.admin-detail-grid,
.message-layout {
    margin-top: 18px;
}

.table-toolbar {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(220px, 1fr) 160px 140px auto;
}

.stat-line {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
}

.stat-line strong {
    color: var(--accent-dark);
    font-size: 22px;
}

.live-card {
    min-height: 220px;
}

.live-list {
    display: grid;
    gap: 8px;
}

.live-user {
    background: #eef6f5;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    cursor: pointer;
    display: grid;
    gap: 3px;
    padding: 10px;
    text-align: left;
}

.live-user span {
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.user-table-panel td:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.user-detail-panel h3,
.message-detail-panel h3 {
    margin-bottom: 8px;
}

.compact-table table {
    min-width: 680px;
}

.message-body {
    background: #eef6f5;
    border: 1px solid var(--line);
    border-radius: 6px;
    margin-top: 12px;
    overflow-wrap: anywhere;
    padding: 14px;
    white-space: pre-wrap;
}

.notification-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(31, 42, 44, .20);
    max-height: 420px;
    overflow: auto;
    position: fixed;
    right: 18px;
    top: 76px;
    width: min(360px, calc(100vw - 32px));
    z-index: 30;
}

.notification-head {
    border-bottom: 1px solid var(--line);
    font-weight: 900;
    padding: 12px 14px;
}

.notification-item {
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    display: grid;
    gap: 3px;
    padding: 12px 14px;
}

.notification-item.unread {
    background: #eef6f5;
}

.notification-item span,
.notification-item small,
.notification-empty {
    color: var(--muted);
}

.notification-empty {
    padding: 14px;
}

.notification-toast {
    background: #1f2a2c;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    bottom: 18px;
    box-shadow: 0 18px 45px rgba(31, 42, 44, .28);
    color: #fff;
    display: grid;
    gap: 4px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 14px 16px;
    position: fixed;
    right: 18px;
    z-index: 35;
}

.notification-toast span {
    color: rgba(255, 255, 255, .78);
}

.position-board {
    margin-top: 18px;
}

.tab-bar {
    background: #eef3f2;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
    padding: 6px;
}

.tab-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-weight: 900;
    justify-content: space-between;
    min-height: 46px;
    padding: 10px 14px;
}

.tab-button.active {
    background: #fff;
    box-shadow: 0 1px 5px rgba(31, 42, 44, .12);
    color: var(--accent-dark);
}

.tab-button strong {
    background: rgba(11, 122, 117, .12);
    border-radius: 999px;
    color: var(--accent-dark);
    min-width: 32px;
    padding: 3px 8px;
    text-align: center;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.position-head {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 8px;
}

.position-head h2 {
    margin: 0;
}

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

.page-button {
    background: #eef6f5;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--accent-dark);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    min-height: 34px;
    padding: 6px 10px;
}

.page-button.active {
    background: var(--accent);
    color: #fff;
}

.page-button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

@media (max-width: 700px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 14px 18px;
    }

    .shell {
        padding: 20px 14px 44px;
    }

    .market-layout {
        grid-template-columns: 1fr;
    }

    .table-toolbar {
        grid-template-columns: 1fr;
    }

    .detail-list {
        grid-template-columns: 1fr;
    }

    .notification-panel {
        right: 14px;
        top: 112px;
    }
}

body {
    background: linear-gradient(135deg, #0a231e 0%, #123d33 50%, #1a2e29 100%);
    background-attachment: fixed;
}

.ricco-header {
    align-items: center;
    background: rgba(10, 35, 30, .92);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    display: flex;
    justify-content: space-between;
    min-height: 70px;
    padding: 15px 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-small {
    background: linear-gradient(to right, #ffcc00, #ff6b00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #ffcc00;
    font-size: 24px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
    z-index: 1001;
}

.menu-toggle {
    background: transparent;
    border: 0;
    cursor: pointer;
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    z-index: 1001;
}

.menu-toggle span {
    background: #ffcc00;
    display: block;
    height: 3px;
    transition: .3s;
    width: 30px;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.nav-links {
    align-items: center;
    display: flex;
    gap: 16px;
}

.nav-links a,
.profile-toggle,
.profile-menu button {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.nav-links a {
    align-items: center;
    display: inline-flex;
    gap: 7px;
    transition: .25s;
}

.nav-links a:hover {
    color: #ffcc00;
}

.auth-link {
    border-radius: 999px;
    min-height: 38px;
    padding: 8px 13px;
}

.login-link {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
}

.register-link {
    background: linear-gradient(135deg, #ffcc00, #ff6b00);
    color: #15231f !important;
}

.profile-dropdown {
    position: relative;
}

.profile-toggle {
    align-items: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
}

.profile-toggle strong {
    background: #ff6b00;
    border-radius: 999px;
    color: #fff;
    min-width: 22px;
    padding: 1px 7px;
    text-align: center;
}

.profile-toggle .fa-chevron-down {
    font-size: 10px;
    transition: transform .25s;
}

.profile-toggle.active .fa-chevron-down {
    transform: rotate(180deg);
}

.profile-menu {
    background: #140f26;
    border: 2px solid #7d2ae8;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .8);
    min-width: 230px;
    opacity: 0;
    padding: 10px;
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    transform: translateY(12px);
    transition: .25s;
    visibility: hidden;
}

.profile-menu.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.profile-menu a,
.profile-menu button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    min-height: 40px;
    padding: 10px 12px;
    text-align: left;
    width: 100%;
}

.profile-menu a:hover,
.profile-menu button:hover {
    background: rgba(125, 42, 232, .18);
    color: #fff;
}

.chat-btn {
    align-items: center;
    background: #7d2ae8;
    border-radius: 50%;
    bottom: 30px;
    box-shadow: 0 8px 20px rgba(125, 42, 232, .4);
    color: #fff;
    display: flex;
    font-size: 24px;
    height: 60px;
    justify-content: center;
    position: fixed;
    right: 30px;
    text-decoration: none;
    transition: .3s;
    width: 60px;
    z-index: 2000;
}

.chat-btn:hover {
    background: #8b3eff;
    box-shadow: 0 12px 25px rgba(125, 42, 232, .6);
    color: #fff;
    transform: scale(1.1);
}

.chat-btn::after {
    background: #ff3b3b;
    border: 2px solid #0c0819;
    border-radius: 50%;
    content: "";
    height: 12px;
    position: absolute;
    right: 5px;
    top: 5px;
    width: 12px;
}

.shell > .round-result h1 {
    color: #fff;
}

.shell > .round-result .stat {
    border: 1px solid rgba(255, 255, 255, .16);
}

@media (max-width: 1024px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        align-items: stretch;
        background: #0a231e;
        box-shadow: -10px 0 30px rgba(0, 0, 0, .5);
        flex-direction: column;
        height: 100vh;
        justify-content: center;
        padding: 84px 26px 30px;
        position: fixed;
        right: -100%;
        top: 0;
        transition: .35s;
        width: min(76vw, 340px);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a,
    .profile-toggle {
        font-size: 18px;
        justify-content: flex-start;
    }

    .profile-menu {
        border-width: 1px;
        box-shadow: none;
        margin-top: 8px;
        position: static;
        transform: none;
        width: 100%;
    }
}

.rcb-auth-screen {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 170px);
    padding: 28px 0;
}

.rcb-auth-card {
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 193, 7, .18), transparent 34%),
        linear-gradient(180deg, rgba(13, 45, 39, .96), rgba(7, 20, 29, .96));
    border: 1px solid rgba(255, 193, 7, .26);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .42);
    max-width: 460px;
    overflow: hidden;
    padding: 30px;
    position: relative;
    width: min(100%, 460px);
}

.rcb-auth-card::before {
    background: linear-gradient(90deg, #ff6d00, #ffc107, #7d2ae8);
    content: "";
    height: 3px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.rcb-auth-brand {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.rcb-auth-brand img {
    height: 46px;
    max-width: 190px;
    object-fit: contain;
}

.rcb-auth-brand span {
    background: rgba(255, 193, 7, .12);
    border: 1px solid rgba(255, 193, 7, .28);
    border-radius: 999px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .02em;
    padding: 8px 12px;
    text-transform: uppercase;
    white-space: nowrap;
}

.rcb-auth-card h1 {
    color: #fff;
    font-size: 30px;
    line-height: 1.15;
    margin: 0 0 8px;
}

.rcb-auth-copy {
    color: rgba(255, 255, 255, .62);
    margin: 0 0 24px;
}

.rcb-auth-form {
    display: grid;
    gap: 14px;
}

.rcb-auth-form .form-row {
    margin: 0;
}

.rcb-auth-form label {
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
    font-weight: 800;
}

.rcb-input-wrap {
    align-items: center;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 193, 7, .24);
    border-radius: 14px;
    display: flex;
    gap: 12px;
    min-height: 52px;
    padding: 0 15px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.rcb-input-wrap:focus-within {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 193, 7, .75);
    box-shadow: 0 0 0 4px rgba(255, 193, 7, .10);
}

.rcb-input-wrap i {
    color: var(--gold);
    flex: 0 0 auto;
}

.rcb-input-wrap input {
    background: transparent;
    border: 0;
    border-radius: 0;
    min-height: 50px;
    padding: 0;
}

.rcb-input-wrap input:focus {
    outline: 0;
}

.rcb-auth-submit {
    gap: 9px;
    margin-top: 6px;
    min-height: 52px;
    width: 100%;
}

.rcb-auth-switch {
    color: rgba(255, 255, 255, .62);
    margin: 18px 0 0;
    text-align: center;
}

.rcb-auth-switch a {
    color: var(--gold);
    font-weight: 900;
}

.rcb-auth-switch a:hover {
    color: #ffeb3b;
}

.flash {
    border: 1px solid transparent;
    border-radius: 14px;
    margin-left: auto;
    margin-right: auto;
    max-width: 460px;
}

.flash.ok {
    background: rgba(34, 197, 94, .12);
    border-color: rgba(34, 197, 94, .35);
    color: #7dffb2;
}

.flash.error {
    background: rgba(255, 59, 59, .12);
    border-color: rgba(255, 59, 59, .35);
    color: #ffb7b7;
}

@media (max-width: 560px) {
    .rcb-auth-screen {
        min-height: calc(100vh - 130px);
        padding: 18px 0;
    }

    .rcb-auth-card {
        border-radius: 18px;
        padding: 24px 18px;
    }

    .rcb-auth-brand {
        align-items: flex-start;
        flex-direction: column;
    }

    .rcb-auth-card h1 {
        font-size: 26px;
    }
}
