/* =========================================================
   TÀI XỈU - TXXD
========================================================= */

:root {
    color-scheme: dark;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    color: var(--color-text);
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(245, 196, 81, 0.08),
            transparent 35%
        ),
        #080806;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.tai-xiu-app {
    min-height: 100vh;
    overflow-x: hidden;
}

.game-container {
    width: min(calc(100% - 32px), 1500px);
    margin: 0 auto;
}

/* =========================================================
   THANH THÔNG BÁO
========================================================= */

.game-notice {
    border-bottom: 1px solid rgba(245, 196, 81, 0.12);
    background: rgba(18, 16, 10, 0.96);
}

.game-notice__content {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 42px;
}

.game-notice__content p {
    color: var(--color-text-soft);
    font-size: 13px;
}

.game-server-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding: 6px 11px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-pill);
    color: var(--color-text-soft);
    background: rgba(255, 255, 255, 0.04);
    font-size: 12px;
    white-space: nowrap;
}

.game-server-status__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-warning);
    box-shadow: 0 0 12px currentColor;
}

.game-server-status--online .game-server-status__dot {
    background: var(--color-success);
}

.game-server-status--offline .game-server-status__dot {
    background: var(--color-danger);
}

/* =========================================================
   HEADER
========================================================= */

.game-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(245, 196, 81, 0.12);
    background: rgba(8, 8, 6, 0.93);
    backdrop-filter: blur(18px);
}

.game-header__content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
    min-height: 76px;
}

.game-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.game-brand__mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: var(--color-text-dark);
    background: var(--gradient-primary);
    border-radius: 14px;
    box-shadow: var(--shadow-primary);
    font-size: 24px;
    font-weight: 900;
}

.game-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.game-brand__text strong {
    color: var(--color-primary-light);
    font-size: 22px;
    letter-spacing: 0.08em;
}

.game-brand__text small {
    margin-top: 5px;
    color: var(--color-text-muted);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.game-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.game-navigation a,
.game-navigation button {
    padding: 10px 14px;
    color: var(--color-text-soft);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    transition:
        color var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast);
}

.game-navigation a:hover,
.game-navigation button:hover {
    color: var(--color-primary-light);
    border-color: var(--color-border);
    background: rgba(245, 196, 81, 0.07);
}

.game-account {
    display: flex;
    align-items: center;
    gap: 11px;
}

.game-account__avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    color: var(--color-text-dark);
    background: var(--gradient-primary);
    border-radius: 50%;
    box-shadow: var(--shadow-primary);
    font-weight: 900;
    text-transform: uppercase;
}

.game-account__information {
    display: flex;
    min-width: 110px;
    flex-direction: column;
    line-height: 1.2;
}

.game-account__information strong {
    max-width: 150px;
    overflow: hidden;
    color: var(--color-text);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-account__information span {
    margin-top: 3px;
    color: var(--color-primary-light);
    font-size: 12px;
    font-weight: 700;
}

.game-home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 15px;
    color: var(--color-primary-light);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-pill);
    background: rgba(245, 196, 81, 0.05);
    font-size: 13px;
    font-weight: 700;
    transition:
        color var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast);
}

.game-home-button:hover {
    color: var(--color-text-dark);
    border-color: var(--color-primary);
    background: var(--gradient-primary);
}

/* =========================================================
   LAYOUT CHÍNH
========================================================= */

.game-main {
    padding: 28px 0 42px;
}

.game-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 280px;
    align-items: start;
    gap: 20px;
}

.game-sidebar {
    display: grid;
    gap: 18px;
}

.game-panel {
    overflow: hidden;
    padding: 18px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-large);
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(245, 196, 81, 0.07),
            transparent 45%
        ),
        rgba(18, 17, 13, 0.95);
    box-shadow: var(--shadow-medium);
}

.game-panel--warning {
    border-color: rgba(245, 196, 81, 0.28);
    background:
        linear-gradient(
            135deg,
            rgba(245, 196, 81, 0.09),
            rgba(255, 255, 255, 0.025)
        );
}

.game-panel--warning strong {
    display: block;
    margin-bottom: 8px;
    color: var(--color-primary-light);
}

.game-panel--warning p {
    color: var(--color-text-soft);
    font-size: 13px;
    line-height: 1.65;
}

.game-panel__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.game-panel__heading span {
    display: block;
    margin-bottom: 3px;
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.game-panel__heading h2 {
    font-size: 18px;
}

.game-panel__action {
    padding: 7px 11px;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.035);
    font-size: 12px;
    transition:
        color var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast);
}

.game-panel__action:hover {
    color: var(--color-danger);
    border-color: rgba(255, 95, 104, 0.35);
    background: rgba(255, 95, 104, 0.08);
}

/* =========================================================
   LỊCH SỬ
========================================================= */

.recent-results {
    display: grid;
    gap: 10px;
}

.recent-result-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.025);
}

.recent-result-item__badge {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.recent-result-item--tai .recent-result-item__badge {
    color: #1b1200;
    background: linear-gradient(135deg, #ffd970, #d99700);
}

.recent-result-item--xiu .recent-result-item__badge {
    color: #ffffff;
    background: linear-gradient(135deg, #4f93ff, #2453a6);
}

.recent-result-item--triple .recent-result-item__badge {
    color: #ffffff;
    background: linear-gradient(135deg, #ff5f68, #a11d24);
}

.recent-result-item__content {
    min-width: 0;
}

.recent-result-item__content strong {
    display: block;
    margin-bottom: 3px;
    font-size: 14px;
}

.recent-result-item__content span {
    color: var(--color-text-muted);
    font-size: 12px;
}

.recent-result-item__sum {
    color: var(--color-primary-light);
    font-size: 18px;
    font-weight: 900;
}

.empty-state {
    padding: 22px 12px;
    color: var(--color-text-muted);
    border: 1px dashed var(--color-border-light);
    border-radius: var(--radius-medium);
    text-align: center;
    font-size: 13px;
}

.game-statistics {
    display: grid;
    gap: 10px;
}

.game-statistic {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.025);
}

.game-statistic span {
    color: var(--color-text-soft);
    font-size: 13px;
}

.game-statistic strong {
    color: var(--color-primary-light);
    font-size: 18px;
}

/* =========================================================
   BÀN CHƠI
========================================================= */

.game-table-section {
    min-width: 0;
}

.game-table {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border: 1px solid rgba(245, 196, 81, 0.24);
    border-radius: 28px;
    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(245, 196, 81, 0.12),
            transparent 30%
        ),
        linear-gradient(
            145deg,
            rgba(32, 28, 16, 0.98),
            rgba(10, 10, 8, 0.98)
        );
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.48),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.game-table::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 80px,
            rgba(255, 255, 255, 0.008) 81px
        );
}

.game-table > * {
    position: relative;
    z-index: 1;
}

.game-table__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.round-information span {
    display: block;
    margin-bottom: 3px;
    color: var(--color-text-muted);
    font-size: 12px;
}

.round-information strong {
    color: var(--color-primary-light);
    font-size: 18px;
}

.round-status {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 800;
}

.round-status--waiting {
    color: var(--color-warning);
    background: rgba(245, 196, 81, 0.07);
}

.round-status--betting {
    color: var(--color-success);
    border-color: rgba(55, 214, 122, 0.3);
    background: rgba(55, 214, 122, 0.08);
}

.round-status--locked {
    color: var(--color-danger);
    border-color: rgba(255, 95, 104, 0.3);
    background: rgba(255, 95, 104, 0.08);
}

.round-status--result {
    color: #8db8ff;
    border-color: rgba(84, 169, 255, 0.3);
    background: rgba(84, 169, 255, 0.08);
}

/* =========================================================
   ĐẾM NGƯỢC
========================================================= */

.countdown-area {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin: 22px 0 14px;
    text-align: center;
}

.countdown-area__label {
    color: var(--color-text-muted);
    font-size: 13px;
}

.countdown-area strong {
    min-width: 60px;
    color: var(--color-primary-light);
    font-size: 54px;
    line-height: 1;
    text-shadow: 0 0 25px rgba(245, 196, 81, 0.4);
}

.countdown-area__unit {
    color: var(--color-text-soft);
    font-size: 13px;
}

/* =========================================================
   SÂN XÚC XẮC
========================================================= */

.dice-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 310px;
    margin-bottom: 22px;
}

.dice-stage__glow {
    position: absolute;
    width: 340px;
    height: 240px;
    border-radius: 50%;
    background: rgba(245, 196, 81, 0.12);
    filter: blur(60px);
}

.dice-bowl {
    position: relative;
    display: grid;
    place-items: center;
    width: min(100%, 390px);
    aspect-ratio: 1.65 / 1;
    border: 2px solid rgba(245, 196, 81, 0.32);
    border-radius: 50%;
    background:
        radial-gradient(
            circle at 50% 40%,
            #302814,
            #14120c 64%,
            #080806 100%
        );
    box-shadow:
        inset 0 0 45px rgba(245, 196, 81, 0.12),
        0 25px 50px rgba(0, 0, 0, 0.45);
}

.dice-bowl::after {
    position: absolute;
    inset: 14px;
    content: "";
    border: 1px solid rgba(245, 196, 81, 0.16);
    border-radius: 50%;
}

.dice-bowl__cover {
    position: absolute;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 76%;
    height: 82%;
    color: rgba(245, 196, 81, 0.6);
    border: 1px solid rgba(245, 196, 81, 0.22);
    border-radius: 50%;
    background:
        radial-gradient(
            circle at 50% 30%,
            #312815,
            #14110b 68%,
            #080806
        );
    box-shadow:
        0 24px 50px rgba(0, 0, 0, 0.55),
        inset 0 0 40px rgba(245, 196, 81, 0.08);
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 0.16em;
    transition:
        opacity 450ms ease,
        transform 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dice-bowl.is-open .dice-bowl__cover {
    pointer-events: none;
    opacity: 0;
    transform:
        translateY(-80px)
        rotate(-7deg)
        scale(0.9);
}

.dice-container {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.dice {
    position: relative;
    width: 74px;
    height: 74px;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #dadada
        );
    box-shadow:
        0 13px 24px rgba(0, 0, 0, 0.38),
        inset 0 -5px 8px rgba(0, 0, 0, 0.12);
}

.dice.is-rolling {
    animation: dice-roll 700ms ease-in-out infinite;
}

.dice-dot {
    position: absolute;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #17130a;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.25);
}

.dice-dot--top-left {
    top: 14px;
    left: 14px;
}

.dice-dot--top-right {
    top: 14px;
    right: 14px;
}

.dice-dot--middle-left {
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
}

.dice-dot--center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.dice-dot--middle-right {
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
}

.dice-dot--bottom-left {
    bottom: 14px;
    left: 14px;
}

.dice-dot--bottom-right {
    right: 14px;
    bottom: 14px;
}

.round-result {
    position: absolute;
    right: 18px;
    bottom: 12px;
    display: grid;
    min-width: 112px;
    place-items: center;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: rgba(10, 10, 8, 0.9);
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(10px);
}

.round-result span {
    color: var(--color-text-muted);
    font-size: 11px;
    text-transform: uppercase;
}

.round-result strong {
    margin: 3px 0;
    color: var(--color-primary-light);
    font-size: 28px;
}

.round-result em {
    color: var(--color-text);
    font-size: 14px;
    font-style: normal;
    font-weight: 800;
}

/* =========================================================
   CỬA TÀI XỈU
========================================================= */

.bet-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.bet-option {
    position: relative;
    overflow: hidden;
    padding: 20px;
    color: var(--color-text);
    border: 1px solid var(--color-border-light);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.025);
    text-align: left;
    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast),
        box-shadow var(--transition-fast);
}

.bet-option::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.bet-option--tai::before {
    background:
        radial-gradient(
            circle at 15% 0%,
            rgba(245, 196, 81, 0.18),
            transparent 45%
        );
}

.bet-option--xiu::before {
    background:
        radial-gradient(
            circle at 15% 0%,
            rgba(84, 169, 255, 0.18),
            transparent 45%
        );
}

.bet-option:hover {
    transform: translateY(-3px);
}

.bet-option:hover::before,
.bet-option.is-selected::before {
    opacity: 1;
}

.bet-option--tai:hover,
.bet-option--tai.is-selected {
    border-color: rgba(245, 196, 81, 0.55);
    box-shadow: 0 15px 35px rgba(245, 196, 81, 0.12);
}

.bet-option--xiu:hover,
.bet-option--xiu.is-selected {
    border-color: rgba(84, 169, 255, 0.55);
    box-shadow: 0 15px 35px rgba(84, 169, 255, 0.12);
}

.bet-option > * {
    position: relative;
    z-index: 1;
}

.bet-option__label {
    display: block;
    margin-bottom: 4px;
    color: var(--color-primary-light);
    font-size: 30px;
    font-weight: 900;
    text-transform: uppercase;
}

.bet-option--xiu .bet-option__label {
    color: #8db8ff;
}

.bet-option > strong {
    display: block;
    margin-bottom: 6px;
    font-size: 18px;
}

.bet-option > small {
    color: var(--color-text-muted);
    font-size: 12px;
}

.bet-option__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border-light);
}

.bet-option__total span {
    color: var(--color-text-soft);
    font-size: 12px;
}

.bet-option__total strong {
    color: var(--color-primary-light);
    font-size: 20px;
}

/* =========================================================
   ĐIỀU KHIỂN LỰA CHỌN
========================================================= */

.bet-control {
    display: grid;
    grid-template-columns:
        minmax(120px, 0.8fr)
        minmax(140px, 0.8fr)
        minmax(260px, 1.6fr);
    align-items: end;
    gap: 14px;
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--color-border-light);
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.25);
}

.selected-bet {
    display: flex;
    min-height: 48px;
    flex-direction: column;
    justify-content: center;
}

.selected-bet span {
    color: var(--color-text-muted);
    font-size: 12px;
}

.selected-bet strong {
    margin-top: 4px;
    color: var(--color-primary-light);
    font-size: 18px;
}

.bet-amount {
    display: grid;
    gap: 7px;
}

.bet-amount label {
    color: var(--color-text-soft);
    font-size: 12px;
    font-weight: 700;
}

.bet-amount input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    color: var(--color-text);
    outline: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.05);
    font-weight: 800;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.bet-amount input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(245, 196, 81, 0.1);
}

.quick-bet-buttons {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
}

.quick-bet-buttons button {
    min-height: 40px;
    padding: 0 7px;
    color: var(--color-text-soft);
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 12px;
    font-weight: 800;
    transition:
        color var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast);
}

.quick-bet-buttons button:hover {
    color: var(--color-primary-light);
    border-color: var(--color-border-strong);
    background: rgba(245, 196, 81, 0.09);
}

.confirm-bet-button,
.cancel-bet-button {
    min-height: 48px;
    border-radius: var(--radius-pill);
    font-weight: 900;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        opacity var(--transition-fast);
}

.confirm-bet-button {
    grid-column: 1 / span 2;
    color: var(--color-text-dark);
    border: 1px solid transparent;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-primary);
}

.confirm-bet-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-strong);
}

.cancel-bet-button {
    color: var(--color-danger);
    border: 1px solid rgba(255, 95, 104, 0.3);
    background: rgba(255, 95, 104, 0.07);
}

.cancel-bet-button:not(:disabled):hover {
    transform: translateY(-2px);
    background: rgba(255, 95, 104, 0.15);
}

.game-message {
    margin-top: 14px;
    padding: 12px 15px;
    color: var(--color-text-soft);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.025);
    text-align: center;
    font-size: 13px;
}

.game-message--success {
    color: var(--color-success);
    border-color: rgba(55, 214, 122, 0.3);
    background: rgba(55, 214, 122, 0.07);
}

.game-message--error {
    color: var(--color-danger);
    border-color: rgba(255, 95, 104, 0.3);
    background: rgba(255, 95, 104, 0.07);
}

/* =========================================================
   THÔNG TIN NGƯỜI CHƠI
========================================================= */

.player-session {
    display: grid;
    gap: 10px;
}

.player-session__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.player-session__row:last-child {
    border-bottom: 0;
}

.player-session__row span {
    color: var(--color-text-soft);
    font-size: 13px;
}

.player-session__row strong {
    max-width: 130px;
    overflow: hidden;
    color: var(--color-primary-light);
    font-size: 13px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-transactions {
    display: grid;
    gap: 10px;
}

.player-transaction {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 11px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.025);
}

.player-transaction strong {
    font-size: 13px;
}

.player-transaction span {
    color: var(--color-text-muted);
    font-size: 11px;
}

.player-transaction__amount {
    align-self: center;
    font-size: 14px;
    font-weight: 900;
}

.player-transaction__amount--positive {
    color: var(--color-success);
}

.player-transaction__amount--negative {
    color: var(--color-danger);
}

/* =========================================================
   MODAL LUẬT CHƠI
========================================================= */

.game-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition:
        opacity var(--transition-normal),
        visibility var(--transition-normal);
}

.game-modal.is-open {
    visibility: visible;
    opacity: 1;
}

.game-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.game-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 560px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 34px;
    border: 1px solid var(--color-border);
    border-radius: 24px;
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(245, 196, 81, 0.14),
            transparent 35%
        ),
        rgba(17, 16, 12, 0.98);
    box-shadow: var(--shadow-large);
    transform: translateY(20px) scale(0.98);
    transition: transform var(--transition-normal);
}

.game-modal.is-open .game-modal__dialog {
    transform: translateY(0) scale(1);
}

.game-modal__close {
    position: absolute;
    top: 13px;
    right: 15px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--color-text-muted);
    border-radius: 50%;
    background: transparent;
    font-size: 26px;
}

.game-modal__close:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.07);
}

.game-modal__header {
    margin-bottom: 24px;
    text-align: center;
}

.game-modal__header > span {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 14px;
    color: var(--color-text-dark);
    background: var(--gradient-primary);
    border-radius: 18px;
    box-shadow: var(--shadow-primary);
    font-size: 30px;
}

.game-modal__header h2 {
    font-size: 28px;
}

.rules-content {
    display: grid;
    gap: 16px;
}

.rules-content section {
    padding: 16px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.025);
}

.rules-content h3 {
    margin-bottom: 7px;
    color: var(--color-primary-light);
    font-size: 16px;
}

.rules-content p {
    color: var(--color-text-soft);
    font-size: 14px;
    line-height: 1.7;
}

/* =========================================================
   TOAST
========================================================= */

.game-toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 150;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100% - 40px));
}

.game-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 17px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-medium);
    background: rgba(20, 19, 14, 0.97);
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(14px);
    animation: game-toast-enter 220ms ease both;
}

.game-toast__icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: rgba(245, 196, 81, 0.12);
    font-weight: 900;
}

.game-toast__content strong {
    display: block;
    margin-bottom: 3px;
}

.game-toast__content p {
    color: var(--color-text-soft);
    font-size: 13px;
}

.game-toast--success {
    border-color: rgba(55, 214, 122, 0.34);
}

.game-toast--error {
    border-color: rgba(255, 95, 104, 0.4);
}

/* =========================================================
   ANIMATION
========================================================= */

@keyframes dice-roll {
    0% {
        transform: rotate(0deg) translateY(0);
    }

    25% {
        transform: rotate(90deg) translateY(-8px);
    }

    50% {
        transform: rotate(180deg) translateY(0);
    }

    75% {
        transform: rotate(270deg) translateY(-6px);
    }

    100% {
        transform: rotate(360deg) translateY(0);
    }
}

@keyframes game-toast-enter {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1260px) {
    .game-layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .game-sidebar--right {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .game-header__content {
        grid-template-columns: auto 1fr;
    }

    .game-navigation {
        display: none;
    }

    .game-account {
        justify-self: end;
    }

    .game-layout {
        grid-template-columns: 1fr;
    }

    .game-sidebar--left,
    .game-sidebar--right {
        grid-column: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .game-table-section {
        order: -1;
    }

    .bet-control {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-bet-buttons {
        grid-column: 1 / -1;
    }

    .confirm-bet-button {
        grid-column: auto;
    }
}

@media (max-width: 720px) {
    .game-container {
        width: min(calc(100% - 20px), 1500px);
    }

    .game-notice__content {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding: 9px 0;
    }

    .game-server-status {
        margin-left: 0;
    }

    .game-header__content {
        min-height: 68px;
        gap: 12px;
    }

    .game-brand__text {
        display: none;
    }

    .game-account__information {
        min-width: 0;
    }

    .game-account__information strong {
        max-width: 90px;
    }

    .game-home-button {
        display: none;
    }

    .game-table {
        padding: 16px;
        border-radius: 20px;
    }

    .countdown-area strong {
        font-size: 44px;
    }

    .dice-stage {
        min-height: 250px;
    }

    .dice {
        width: 60px;
        height: 60px;
        border-radius: 13px;
    }

    .dice-dot {
        width: 10px;
        height: 10px;
    }

    .dice-dot--top-left,
    .dice-dot--middle-left,
    .dice-dot--bottom-left {
        left: 11px;
    }

    .dice-dot--top-right,
    .dice-dot--middle-right,
    .dice-dot--bottom-right {
        right: 11px;
    }

    .dice-dot--top-left,
    .dice-dot--top-right {
        top: 11px;
    }

    .dice-dot--bottom-left,
    .dice-dot--bottom-right {
        bottom: 11px;
    }

    .bet-options {
        grid-template-columns: 1fr;
    }

    .bet-control {
        grid-template-columns: 1fr;
    }

    .quick-bet-buttons {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .confirm-bet-button,
    .cancel-bet-button {
        grid-column: auto;
    }

    .game-sidebar--left,
    .game-sidebar--right {
        grid-template-columns: 1fr;
    }

    .round-result {
        right: 6px;
        bottom: 0;
        min-width: 92px;
    }
}

@media (max-width: 480px) {
    .game-account__avatar {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .game-account__information span {
        font-size: 11px;
    }

    .game-table__top {
        align-items: flex-start;
        flex-direction: column;
    }

    .dice-container {
        gap: 9px;
    }

    .dice {
        width: 54px;
        height: 54px;
    }

    .dice-dot {
        width: 9px;
        height: 9px;
    }

    .bet-option {
        padding: 17px;
    }

    .game-modal__dialog {
        padding: 30px 18px 22px;
    }

    .game-toast-container {
        right: 12px;
        bottom: 12px;
        width: calc(100% - 24px);
    }
}