/* Round Provably Fair modal — Spribe-style round verification */
#round-fairness-modal.modal {
    position: fixed;
    inset: 0;
    top: 0 !important;
    left: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: transparent;
    box-sizing: border-box;
    z-index: 5020;
}

#round-fairness-modal .round-fairness-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 0;
}

#round-fairness-modal .round-fairness-scroll {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px 16px 24px;
    box-sizing: border-box;
}

#round-fairness-modal .round-fairness-dialog {
    display: block;
    width: 100%;
    max-width: 800px;
    min-width: 0;
    margin: 28px auto 0;
    pointer-events: none;
}

#round-fairness-modal .round-fairness-content {
    background: #1b1c1d;
    padding: 0;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    border-radius: 12px;
    overflow: hidden;
}

#round-fairness-modal {
    --modal-header-border-bottom: #242424;
    --round-fairness-field-bg: #17181b;
    --round-fairness-padding-x: 40px;
    --round-fairness-padding-y: 20px;
    --round-fairness-section-gap: 20px;
    --round-fairness-field-padding-y: 10px;
    --round-fairness-field-padding-x: 12px;
    --round-fairness-head-gap: 12px;
    --round-fairness-header-padding-x: 10px;
}

#round-fairness-modal .round-fairness-header {
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    background: #2c2d30;
    border-bottom: 1px solid var(--modal-header-border-bottom, #242424);
    border-radius: 8px 8px 0 0;
    padding: 0 var(--round-fairness-header-padding-x, 10px) !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    gap: 8px;
    line-height: 14px;
    font-size: 14px;
    font-weight: 400 !important;
    font-family: Inter, sans-serif;
    -webkit-font-smoothing: antialiased;
    user-select: text;
    box-sizing: border-box;
}

#round-fairness-modal .round-fairness-header-main {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
    flex: 1;
    line-height: 14px;
    font-size: 14px;
    font-weight: 400;
}

#round-fairness-modal .round-fairness-header .round-fairness-round-label,
#round-fairness-modal .round-fairness-header .round-fairness-round-id,
#round-fairness-modal .round-fairness-header .round-fairness-time {
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 400 !important;
    line-height: 14px;
    color: #fff;
    text-transform: none;
    letter-spacing: normal;
}

#round-fairness-modal .round-fairness-round-label {
    margin-right: -4px;
}

#round-fairness-modal .round-fairness-result-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0 7px;
    min-height: 20px;
    border-radius: 10px;
    font-family: Inter, sans-serif;
    font-size: 12px;
    font-weight: 700 !important;
    line-height: 14px;
    color: #34b4ff;
    background: rgba(0, 0, 0, 0.35);
}

#round-fairness-modal .modal-header .close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #97a4ae;
    font-size: 20px;
    line-height: 1;
    font-weight: 300;
    opacity: 1;
    cursor: pointer;
    -webkit-font-smoothing: antialiased;
}

#round-fairness-modal .modal-header .close span {
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
}

#round-fairness-modal .round-fairness-body {
    padding: var(--round-fairness-padding-y, 20px) var(--round-fairness-padding-x, 40px);
    flex: 1;
    font-family: Inter, sans-serif;
    font-size: 14px;
    line-height: 14px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

#round-fairness-modal .round-fairness-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

#round-fairness-modal .round-fairness-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--round-fairness-head-gap, 12px);
    width: 100%;
}

#round-fairness-modal .round-fairness-section-head .server-icon,
#round-fairness-modal .round-fairness-section-head .client-icon {
    flex-shrink: 0;
    margin-top: 0;
}

#round-fairness-modal .round-fairness-hash-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: block;
}

#round-fairness-modal .round-fairness-section-titles {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#round-fairness-modal .round-fairness-section-title {
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #fff;
    line-height: 14px;
}

#round-fairness-modal .round-fairness-section-subtitle {
    font-family: Inter, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #9ea0a3;
    line-height: 14px;
    margin-top: 0;
}

#round-fairness-modal .round-fairness-value-box,
#round-fairness-modal .round-fairness-value-box-scroll,
#round-fairness-modal .round-fairness-player-seed,
#round-fairness-modal .round-fairness-result-values span {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
    cursor: text;
}

#round-fairness-modal .round-fairness-value-box {
    background: var(--round-fairness-field-bg, #17181b);
    border-radius: 8px;
    padding: var(--round-fairness-field-padding-y, 10px) var(--round-fairness-field-padding-x, 12px);
    font-family: Inter, sans-serif;
    font-size: 14px;
    line-height: 14px;
    font-weight: 400;
    color: #fff;
    word-break: normal;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    width: 100%;
}

#round-fairness-modal .round-fairness-value-box--hash {
    padding: 0;
    overflow: hidden;
    max-width: 100%;
}

#round-fairness-modal .round-fairness-value-box--hash .round-fairness-value-box-scroll {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: var(--round-fairness-field-padding-y, 10px) var(--round-fairness-field-padding-x, 12px);
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    word-break: normal;
    font-family: Inter, sans-serif;
    font-size: 14px;
    line-height: 14px;
    font-weight: 400;
    color: #fff;
    -webkit-overflow-scrolling: touch;
}

#round-fairness-modal .round-fairness-section--client-seed {
    padding-top: var(--round-fairness-section-gap, 20px);
}

#round-fairness-modal .round-fairness-section--client-seed .round-fairness-section-head {
    margin-bottom: var(--round-fairness-head-gap, 12px);
}

#round-fairness-modal .round-fairness-section--client-seed .round-fairness-section-subtitle {
    color: #9a9a9a;
}

#round-fairness-modal .round-fairness-players {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

#round-fairness-modal .round-fairness-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--round-fairness-field-bg, #17181b);
    border-radius: 8px;
    padding: var(--round-fairness-field-padding-y, 10px) var(--round-fairness-field-padding-x, 12px);
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
}

#round-fairness-modal .round-fairness-player-start {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 240px;
    min-width: 200px;
    max-width: 280px;
}

#round-fairness-modal .round-fairness-player-end {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 0;
    min-width: 0;
    justify-content: flex-start;
}

#round-fairness-modal .round-fairness-player-index {
    font-family: Inter, sans-serif;
    font-size: 14px;
    line-height: 14px;
    font-weight: 400;
    color: #9a9a9a;
    white-space: nowrap;
    flex: 0 0 72px;
}

#round-fairness-modal .round-fairness-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    flex-shrink: 0;
}

#round-fairness-modal .round-fairness-player-name {
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 14px;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

#round-fairness-modal .round-fairness-player-seed-label {
    font-family: Inter, sans-serif;
    font-size: 14px;
    line-height: 14px;
    font-weight: 400;
    color: #9a9a9a;
    white-space: nowrap;
    flex: 0 0 auto;
}

#round-fairness-modal .round-fairness-player-seed {
    font-family: Inter, sans-serif;
    font-size: 14px;
    line-height: 14px;
    font-weight: 400;
    color: #fff;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
    #round-fairness-modal .round-fairness-player {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    #round-fairness-modal .round-fairness-player-start {
        flex: 1 1 auto;
        max-width: none;
        min-width: 0;
    }

    #round-fairness-modal .round-fairness-player-end {
        width: 100%;
    }
}

#round-fairness-modal .round-fairness-section--hash {
    padding-top: var(--round-fairness-section-gap, 20px);
}

#round-fairness-modal .round-fairness-section--hash .round-fairness-section-head {
    margin-bottom: var(--round-fairness-head-gap, 12px);
}

#round-fairness-modal .round-fairness-section--hash .round-fairness-section-subtitle {
    color: #9a9a9a;
}

#round-fairness-modal .round-fairness-result-details {
    width: 100%;
    margin-top: var(--round-fairness-head-gap, 12px);
}

#round-fairness-modal .round-fairness-result-labels,
#round-fairness-modal .round-fairness-result-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

#round-fairness-modal .round-fairness-result-labels {
    margin-bottom: 6px;
    padding: 0 16px;
    box-sizing: border-box;
    font-family: Inter, sans-serif;
    font-size: 12px;
    line-height: 14px;
    font-weight: 400;
    color: #9a9a9a;
}

#round-fairness-modal .round-fairness-result-labels span {
    display: block;
    text-align: center;
    white-space: nowrap;
}

#round-fairness-modal .round-fairness-result-values {
    background: var(--round-fairness-field-bg, #17181b);
    border-radius: 8px;
    padding: 14px 16px;
    font-family: Inter, sans-serif;
    font-size: 14px;
    line-height: 14px;
    font-weight: 400;
    color: #fff;
    align-items: center;
}

#round-fairness-modal .round-fairness-result-values span {
    display: block;
    text-align: center;
    white-space: nowrap;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#round-fairness-modal .round-fairness-result-labels span:nth-child(3),
#round-fairness-modal .round-fairness-result-values span:nth-child(3) {
    margin-left: auto;
    margin-right: auto;
    width: max-content;
    max-width: 100%;
}

#round-fairness-modal .round-fairness-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: var(--round-fairness-padding-y, 20px) var(--round-fairness-padding-x, 40px);
    background: #252628;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #868b8d;
}

#round-fairness-modal .round-fairness-footer .link {
    color: #e30c32;
    text-decoration: none;
    font-weight: 500;
}

#round-fairness-modal .round-fairness-footer .link:hover {
    text-decoration: underline;
}

/* Clickable round history pills */
#last-counters p,
.round-history-dropdown .dropdown-content p {
    cursor: pointer;
}

@media (max-width: 640px) {
    #round-fairness-modal {
        --round-fairness-padding-x: 16px;
        --round-fairness-padding-y: 16px;
        --round-fairness-section-gap: 16px;
    }

    #round-fairness-modal .round-fairness-scroll {
        padding: 8px 10px 16px;
    }

    #round-fairness-modal .round-fairness-dialog {
        margin-top: 12px;
        max-width: calc(100vw - 12px);
    }

    #round-fairness-modal .round-fairness-header-main {
        gap: 6px;
    }

    #round-fairness-modal .round-fairness-result-labels,
    #round-fairness-modal .round-fairness-result-values {
        grid-template-columns: 1fr;
        row-gap: 6px;
    }

    #round-fairness-modal .round-fairness-result-labels span,
    #round-fairness-modal .round-fairness-result-values span {
        text-align: left;
    }
}
