.qmadaqesh-online {
    --mq-bg: #f6f2e8;
    --mq-ink: #161f2b;
    --mq-muted: #607084;
    --mq-table: #0f513f;
    --mq-gold: #b8872d;
    --mq-red: #b4232e;
    min-height: 100vh;
    padding: 22px 14px 34px;
    color: var(--mq-ink);
    background:
        radial-gradient(circle at 10% 0%, rgba(184, 135, 45, .22), transparent 28%),
        linear-gradient(135deg, #fbf7ed 0%, #eef6f2 50%, #edf2f8 100%);
}

.qmadaqesh-online-stage {
    width: min(760px, 100%);
    margin: 0 auto;
}

.qmadaqesh-online .qonline-setup,
.qmadaqesh-online .qonline-wait-room {
    width: min(620px, 100%);
    max-width: 620px;
    color: var(--mq-ink);
}

.qmadaqesh-online .qonline-section,
.qmadaqesh-online .qonline-wait-room,
.qmadaqesh-online .qonline-myname,
.qmadaqesh-online .qonline-accordion,
.qmadaqesh-online .qonline-play-now {
    border-radius: 8px;
    background: rgba(255, 255, 255, .95);
    border-color: rgba(22, 31, 43, .14);
    box-shadow: 0 16px 44px rgba(22, 31, 43, .10);
}

.qmadaqesh-online .qonline-btn--primary {
    background: var(--mq-table);
    border-color: var(--mq-table);
    color: #fff;
}

.qmadaqesh-online .qonline-btn--primary:hover {
    background: #0b3f32;
    border-color: #0b3f32;
    color: #fff;
}

.qmadaqesh-online .qonline-btn--danger {
    background: var(--mq-red);
    border-color: var(--mq-red);
    color: #fff;
}

.qmadaqesh-online .qonline-input {
    background: #fff;
    border-color: rgba(22, 31, 43, .18);
    color: var(--mq-ink);
}

.qmadaqesh-loader,
.qmadaqesh-panel {
    width: min(520px, 100%);
    margin: 72px auto 0;
    padding: 24px;
    border: 1px solid rgba(22, 31, 43, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 16px 44px rgba(22, 31, 43, .10);
    text-align: center;
}

.qmadaqesh-loader__icon,
.qmadaqesh-panel__icon {
    font-size: 44px;
}

.qmadaqesh-game {
    display: grid;
    gap: 14px;
}

.qmadaqesh-top,
.qmadaqesh-mycard,
.qmadaqesh-table,
.qmadaqesh-result,
.qmadaqesh-reveal,
.qmadaqesh-action {
    border: 1px solid rgba(22, 31, 43, .13);
    border-radius: 8px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 16px 44px rgba(22, 31, 43, .10);
}

.qmadaqesh-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
}

.qmadaqesh-kicker {
    display: block;
    color: var(--mq-muted);
    font-size: .9rem;
    margin-bottom: 3px;
}

.qmadaqesh-top h1 {
    margin: 0;
    font-size: clamp(1.8rem, 9vw, 3rem);
    line-height: 1;
    letter-spacing: 0;
}

.qmadaqesh-balance {
    min-width: 96px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #10251f;
    color: #fff;
    text-align: center;
}

.qmadaqesh-balance span {
    display: block;
    color: rgba(255, 255, 255, .72);
    font-size: .78rem;
}

.qmadaqesh-balance b {
    display: block;
    font-size: 1.65rem;
    line-height: 1.1;
}

.qmadaqesh-mycard {
    padding: 14px;
    background: linear-gradient(135deg, #0f513f, #163b52);
    color: #fff;
}

.qmadaqesh-mycard__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, .88);
}

.qmadaqesh-mycard__head b {
    color: #f8df9d;
}

.qmadaqesh-hand,
.qmadaqesh-reveal__cards {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.qmadaqesh-card {
    width: clamp(72px, 26vw, 104px);
    aspect-ratio: 5 / 7;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(22, 31, 43, .14);
    color: #111827;
    font-weight: 900;
    font-size: clamp(1.5rem, 9vw, 2.35rem);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}

.qmadaqesh-card.is-red {
    color: var(--mq-red);
}

.qmadaqesh-table {
    padding: 14px;
}

.qmadaqesh-table__meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.qmadaqesh-table__meta span {
    min-width: 0;
    padding: 9px;
    border-radius: 8px;
    background: #f2f6f4;
    color: var(--mq-muted);
    text-align: center;
    font-size: .82rem;
}

.qmadaqesh-table__meta b {
    display: block;
    color: var(--mq-ink);
    font-size: 1rem;
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.qmadaqesh-players {
    display: grid;
    gap: 8px;
}

.qmadaqesh-player {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 9px 10px;
    border: 1px solid rgba(22, 31, 43, .10);
    border-radius: 8px;
    background: #fff;
}

.qmadaqesh-player span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qmadaqesh-player b {
    color: var(--mq-table);
    font-size: 1.1rem;
}

.qmadaqesh-player em {
    padding: 4px 7px;
    border-radius: 999px;
    background: #eef5f2;
    color: var(--mq-table);
    font-style: normal;
    font-size: .72rem;
    white-space: nowrap;
}

.qmadaqesh-player.is-turn {
    border-color: rgba(184, 135, 45, .55);
    box-shadow: inset 0 0 0 1px rgba(184, 135, 45, .28);
}

.qmadaqesh-player.is-boss {
    background: #fff8e8;
}

.qmadaqesh-player.is-left {
    opacity: .55;
}

.qmadaqesh-action {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.qmadaqesh-action label {
    color: var(--mq-muted);
    font-weight: 700;
}

.qmadaqesh-action--split {
    grid-template-columns: 1fr 1fr;
}

.qmadaqesh-action--wait {
    color: var(--mq-muted);
    text-align: center;
}

.qmadaqesh-offers {
    display: grid;
    gap: 8px;
}

.qmadaqesh-offer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(92px, 120px);
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    background: #f7fafc;
    border: 1px solid rgba(22, 31, 43, .10);
}

.qmadaqesh-offer-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mq-ink);
    font-weight: 800;
}

.qmadaqesh-offer-total {
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff8e8;
    color: #7c4a03;
    font-weight: 800;
    line-height: 1.7;
}

.qmadaqesh-result {
    padding: 14px;
    background: #fff8e8;
}

.qmadaqesh-result h2,
.qmadaqesh-result p {
    margin: 0 0 8px;
}

.qmadaqesh-reveal {
    padding: 14px;
}

.qmadaqesh-reveal h2 {
    margin: 0 0 12px;
    font-size: 1.15rem;
}

.qmadaqesh-reveal__row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid rgba(22, 31, 43, .10);
}

.qmadaqesh-reveal__row:first-of-type {
    border-top: 0;
}

.qmadaqesh-reveal__row small {
    display: block;
    color: var(--mq-muted);
}

.qmadaqesh-reveal__row .qmadaqesh-card {
    width: 42px;
    font-size: 1rem;
    box-shadow: none;
}

.qmadaqesh-reveal__row.is-winner b {
    color: var(--mq-gold);
}

@media (max-width: 560px) {
    .qmadaqesh-top {
        align-items: stretch;
    }
    .qmadaqesh-table__meta {
        grid-template-columns: 1fr;
    }
    .qmadaqesh-action--split,
    .qmadaqesh-reveal__row {
        grid-template-columns: 1fr;
    }
}
