:root {
    font-family: Inter, system-ui, sans-serif;
    color: #f8fafc;
    background: #05070a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(
            circle at top,
            #162033,
            #05070a 48%
        );
}

button,
input,
select {
    font: inherit;
}

button {
    width: 100%;
    padding: 13px 18px;
    border: 0;
    border-radius: 11px;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
    background: #2563eb;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

button.success {
    margin-top: 10px;
    background: #15803d;
}

button.secondary {
    margin-top: 10px;
    background: #1e293b;
}

input,
select {
    width: 100%;
    margin-top: 6px;
    padding: 12px;
    border: 1px solid #334155;
    border-radius: 10px;
    color: #ffffff;
    background: #070b12;
}

h1,
h2 {
    margin-top: 0;
}

.landing,
.room {
    max-width: 1320px;
    margin: auto;
    padding: 48px 20px;
}

.eyebrow {
    color: #60a5fa;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
}

.landing h1 {
    margin: 0.2em 0;
    font-size: clamp(2.5rem, 7vw, 5rem);
}

.grid,
.layout {
    display: grid;
    gap: 20px;
}

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

.layout {
    grid-template-columns:
        minmax(0, 2.4fr)
        minmax(290px, 1fr);
}

.panel {
    padding: 20px;
    border: 1px solid #253047;
    border-radius: 18px;
    background: #0d121b;
}

.panel label {
    display: block;
    margin: 12px 0;
}

.top {
    position: sticky;
    top: 0;
    z-index: 10;

    display: flex;
    justify-content: space-between;

    padding: 18px 24px;
    border-bottom: 1px solid #1e293b;

    background: rgba(7, 10, 16, 0.94);
    backdrop-filter: blur(12px);
}

.top a {
    color: #ffffff;
    font-weight: 900;
    text-decoration: none;
}

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.race-meta {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 8px;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.pill {
    padding: 8px 12px;
    border: 1px solid #334155;
    border-radius: 99px;
}

.rarity {
    padding: 5px 8px;
    border: 1px solid #475569;
    border-radius: 99px;
    color: #ffffff;
}

.rarity[data-rarity="uncommon"] {
    color: #86efac;
    border-color: #22c55e;
}

.rarity[data-rarity="rare"] {
    color: #7dd3fc;
    border-color: #0ea5e9;
}

.rarity[data-rarity="epic"] {
    color: #d8b4fe;
    border-color: #a855f7;
}

.rarity[data-rarity="legendary"] {
    color: #fdba74;
    border-color: #f97316;
}

.rarity[data-rarity="mythic"] {
    color: #fda4af;
    border-color: #f43f5e;
    box-shadow: 0 0 18px rgba(244, 63, 94, 0.35);
}

.race {
    position: relative;
}

canvas {
    display: block;
    width: 100%;
    height: auto;

    border: 1px solid #334155;
    border-radius: 18px;

    background: #0f172a;
}

.countdown {
    position: absolute;
    inset: 0;

    display: grid;
    place-items: center;

    border-radius: 18px;
    color: #ffffff;
    font-size: clamp(6rem, 18vw, 13rem);
    font-weight: 1000;

    background: rgba(0, 0, 0, 0.35);
    text-shadow:
        0 0 25px #2563eb,
        0 0 65px #2563eb;
}

aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.player {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 10px;

    padding: 10px 0;
    border-bottom: 1px solid #1e293b;
}

.player small {
    grid-column: 1 / 3;
    color: #94a3b8;
}

.muted {
    color: #94a3b8;
    font-size: 0.87rem;
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

ol {
    padding-left: 24px;
}

ol li {
    padding: 4px 0;
}

@media (max-width: 800px) {
    .grid,
    .layout {
        grid-template-columns: 1fr;
    }

    .top {
        font-size: 0.8rem;
    }

    .landing,
    .room {
        padding: 24px 12px;
    }
}


/* ARKON BETTING EXPERIENCE V1 */

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-title-row h2 {
    margin: 0;
}

.bets-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    transition:
        border-color 180ms ease,
        background 180ms ease,
        color 180ms ease;
}

.bets-counter.complete {
    border-color: rgba(34, 197, 94, 0.65);
    background: rgba(34, 197, 94, 0.14);
    color: #4ade80;
}

.host-bets-panel {
    grid-column: 1 / -1;
}

.host-bets-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.host-bets-summary > div {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
}

.host-bets-summary span {
    display: block;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.56);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.host-bets-summary strong {
    font-size: 20px;
}

.host-bets-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 13px;
}

.host-bets-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 13px;
}

.host-bets-table th,
.host-bets-table td {
    padding: 12px 13px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.host-bets-table th {
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.54);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.host-bets-table tbody tr:last-child td {
    border-bottom: 0;
}

.host-bets-table tbody tr {
    transition: background 160ms ease;
}

.host-bets-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.035);
}

.host-bets-table tr.player-waiting {
    opacity: 0.63;
}

.host-bets-table tr.bet-won {
    background: rgba(34, 197, 94, 0.09);
}

.host-bets-table tr.bet-lost {
    background: rgba(239, 68, 68, 0.07);
}

.host-bets-empty {
    padding: 25px !important;
    color: rgba(255, 255, 255, 0.48);
    text-align: center !important;
}

.waiting-badge {
    display: inline-flex;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.bet-result-label {
    display: block;
    margin-top: 5px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.62);
}

.host-bet-picks,
.confirmed-bet-picks,
.result-popup-detail > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
}

.bet-marble {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.bet-marble-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: var(--marble-color);
    box-shadow: 0 0 8px var(--marble-color);
}

.pick-separator {
    color: rgba(255, 255, 255, 0.35);
}

.confirmed-bet {
    text-align: center;
    animation: confirmedBetEnter 300ms ease both;
}

@keyframes confirmedBetEnter {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.confirmed-bet-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin: 2px auto 13px;
    border: 1px solid rgba(59, 130, 246, 0.55);
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.13);
    color: #60a5fa;
    font-size: 28px;
    font-weight: 900;
}

.confirmed-bet-check.win {
    border-color: rgba(34, 197, 94, 0.58);
    background: rgba(34, 197, 94, 0.13);
    color: #4ade80;
}

.confirmed-bet-check.lose {
    border-color: rgba(239, 68, 68, 0.58);
    background: rgba(239, 68, 68, 0.13);
    color: #f87171;
}

.confirmed-bet-title {
    margin-bottom: 9px;
    color: #60a5fa;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.13em;
}

.confirmed-bet-title.win {
    color: #4ade80;
}

.confirmed-bet-title.lose {
    color: #f87171;
}

.confirmed-bet-type {
    font-size: 21px;
    font-weight: 900;
}

.confirmed-bet-picks {
    justify-content: center;
    min-height: 25px;
    margin: 10px 0 17px;
}

.confirmed-bet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    text-align: left;
}

.confirmed-bet-grid > div {
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.035);
}

.confirmed-bet-grid span {
    display: block;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.confirmed-bet-grid strong {
    font-size: 14px;
}

.result-popup {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(9px);
    opacity: 0;
    transition: opacity 240ms ease;
}

.result-popup.visible {
    opacity: 1;
}

.result-popup.hidden {
    display: none;
}

.result-popup-card {
    position: relative;
    width: min(440px, 100%);
    padding: 46px 30px 34px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 24px;
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(255, 255, 255, 0.08),
            transparent 46%
        ),
        #090b10;
    text-align: center;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72);
    transform: translateY(20px) scale(0.94);
    transition: transform 300ms cubic-bezier(.2, .9, .25, 1.15);
}

.result-popup.visible .result-popup-card {
    transform: translateY(0) scale(1);
}

.result-popup-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
}

.result-popup-card.win::before {
    background: #22c55e;
    box-shadow: 0 0 28px rgba(34, 197, 94, 0.9);
}

.result-popup-card.lose::before {
    background: #ef4444;
    box-shadow: 0 0 28px rgba(239, 68, 68, 0.9);
}

.result-popup-close {
    position: absolute;
    top: 13px;
    right: 13px;
    width: 34px;
    height: 34px;
    min-height: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(255, 255, 255, 0.65);
    font-size: 22px;
    line-height: 1;
}

.result-popup-title {
    font-size: clamp(52px, 15vw, 90px);
    font-weight: 1000;
    line-height: 0.95;
    letter-spacing: -0.055em;
}

.result-popup-card.win .result-popup-title,
.result-popup-card.win .result-popup-amount {
    color: #4ade80;
    text-shadow: 0 0 28px rgba(34, 197, 94, 0.36);
}

.result-popup-card.lose .result-popup-title,
.result-popup-card.lose .result-popup-amount {
    color: #f87171;
    text-shadow: 0 0 28px rgba(239, 68, 68, 0.32);
}

.result-popup-amount {
    margin-top: 18px;
    font-size: 31px;
    font-weight: 900;
}

.result-popup-label {
    margin-top: 28px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.result-popup-balance {
    margin-top: 5px;
    font-size: 35px;
    font-weight: 900;
}

.result-popup-detail {
    margin-top: 23px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.67);
    font-size: 13px;
}

.result-popup-detail > div {
    justify-content: center;
}

@media (max-width: 720px) {
    .host-bets-summary {
        grid-template-columns: 1fr;
    }

    .confirmed-bet-grid {
        grid-template-columns: 1fr;
    }

    .result-popup-card {
        padding: 40px 22px 29px;
        border-radius: 19px;
    }
}
