
.page-roulette {
    display: block !important;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    background: var(--color-background);
}

.roulette-layout {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 18px;
    padding: calc(var(--topbar-height) + 18px) 20px 20px;
}

.roulette-panel,
.roulette-content {
    border: 1px solid rgba(255,255,255,.08);
    background:
        linear-gradient(135deg, rgba(255,255,255,.045), rgba(255,255,255,.018)),
        rgba(12,12,16,.72);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.045),
        0 14px 34px rgba(0,0,0,.20);
}

.roulette-panel {
    min-height: 0;
    padding: 20px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.roulette-content {
    min-width: 0;
    min-height: 0;
    padding: 18px;
    border-radius: 18px;
    overflow-y: auto;
    overflow-x: hidden;
}

.roulette-heading h1,
.roulette-progress-head h2,
.roulette-results h2,
.roulette-empty h2 {
    margin: 0;
}

.roulette-heading h1 {
    margin-top: 3px;
    font-size: 27px;
    line-height: 1.05;
}

.roulette-heading p,
.roulette-credit,
.roulette-empty p,
.roulette-current-copy p {
    color: #94949e;
    font-size: 12px;
    line-height: 1.65;
}

.roulette-heading p {
    margin: 10px 0 0;
}

.roulette-kicker {
    color: #8b8b96;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.roulette-section {
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.065);
}

.roulette-section-title {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.roulette-section-title > span {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.roulette-section-title small {
    color: #777781;
    font-size: 10px;
}

.roulette-toggle {
    min-height: 48px;
    margin-bottom: 8px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 11px;
    background: rgba(255,255,255,.025);
    cursor: pointer;
    transition:
        transform .2s ease,
        border-color .2s ease,
        background .2s ease;
}

.roulette-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(255,255,255,.13);
    background: rgba(255,255,255,.045);
}

.roulette-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.roulette-toggle-ui {
    position: relative;
    width: 34px;
    height: 19px;
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.10);
    transition: background .2s ease, border-color .2s ease;
}

.roulette-toggle-ui::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #a6a6af;
    transition: transform .22s cubic-bezier(.22,1,.36,1), background .2s ease;
}

.roulette-toggle input:checked + .roulette-toggle-ui {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.26);
}

.roulette-toggle input:checked + .roulette-toggle-ui::after {
    transform: translateX(15px);
    background: #fff;
}

.roulette-toggle > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.roulette-toggle strong {
    font-size: 11px;
}

.roulette-toggle small {
    color: #777781;
    font-size: 9px;
}

.page-roulette .roulette-primary {
    width: 100%;
    margin-top: 6px;
}

.roulette-mini-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.roulette-mini-stats > div {
    padding: 11px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 11px;
    background: rgba(255,255,255,.025);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.roulette-mini-stats strong {
    font-size: 18px;
}

.roulette-mini-stats span {
    color: #777781;
    font-size: 9px;
}

.roulette-save-actions {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.roulette-credit {
    margin-top: auto;
}

.roulette-credit a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.roulette-empty {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.roulette-empty-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 14px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.045);
    box-shadow: 0 0 26px rgba(255,255,255,.035);
}

.roulette-empty-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: #d6d6dc;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.roulette-empty p {
    max-width: 330px;
}

.roulette-progress-head {
    margin-bottom: 14px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.roulette-progress-head h2 {
    margin-top: 3px;
    font-size: 22px;
}

.roulette-progress-badge {
    padding: 7px 10px;
    border-radius: 999px;
    color: #ffe68a;
    background: rgba(202,138,4,.16);
    border: 1px solid rgba(250,204,21,.30);
    font-family: Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
}

.roulette-level-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.roulette-level-card {
    overflow: hidden;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,.075);
    background: rgba(255,255,255,.025);
    transition:
        transform .22s ease,
        border-color .22s ease,
        box-shadow .22s ease;
}

.roulette-level-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,.15);
    box-shadow:
        0 10px 24px rgba(0,0,0,.22),
        0 0 12px rgba(255,255,255,.03);
}

.roulette-level-card.is-completed,
.roulette-level-card.is-remaining {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    min-height: 102px;
}

.roulette-level-card.is-current {
    display: grid;
    grid-template-columns: minmax(220px, .72fr) minmax(0, 1.28fr);
    grid-template-rows: auto auto;
    border-color: rgba(255,255,255,.18);
    box-shadow:
        0 0 0 1px rgba(255,255,255,.04),
        0 0 18px rgba(255,255,255,.04);
}

.roulette-thumb {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: #08080b;
}

.roulette-thumb img {
    width: 100%;
    height: 100%;
    min-height: 102px;
    display: block;
    object-fit: cover;
}

.is-current .roulette-thumb img {
    min-height: 210px;
}

.roulette-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 42px;
    height: 42px;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(0,0,0,.60);
    border: 1px solid rgba(255,255,255,.15);
    backdrop-filter: blur(10px);
}

.roulette-play svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
    stroke: currentColor;
}

.roulette-level-meta {
    position: relative;
    min-width: 0;
    background-size: cover !important;
    background-position: center !important;
}

.roulette-level-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(7,7,9,.50),
        rgba(7,7,9,.70) 65%,
        rgba(7,7,9,.86)
    );
}

.roulette-level-copy,
.roulette-current-copy {
    position: relative;
    z-index: 1;
}

.roulette-level-copy {
    min-height: 102px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 10px;
}

.roulette-rank {
    color: #a6a6af;
    font-size: 12px;
    font-weight: 750;
}

.roulette-level-copy h3,
.roulette-current-copy h2 {
    margin: 0;
    color: #fff;
}

.roulette-level-copy h3 {
    font-size: 16px;
}

.roulette-percent {
    font-family: Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
}

.roulette-percent.is-done {
    color: #86efac;
}

.roulette-percent.is-missed {
    color: #fca5a5;
}

.roulette-current-copy {
    min-height: 210px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
}

.roulette-current-copy h2 {
    margin-top: 4px;
    font-size: clamp(22px, 2vw, 30px);
}

.roulette-current-copy p {
    margin: 9px 0 0;
}

.roulette-current-copy p strong {
    color: #ffe68a;
}

.roulette-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.roulette-link-chip {
    padding: 5px 8px;
    border-radius: 8px;
    color: #d7d7dc;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.09);
    text-decoration: none;
    font-size: 9px;
    font-weight: 650;
    transition: background .18s ease, border-color .18s ease;
}

.roulette-link-chip:hover {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.16);
}

.roulette-actions {
    grid-column: 1 / -1;
    padding: 12px;
    display: grid;
    grid-template-columns: minmax(160px,1fr) auto auto;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,.065);
    background: rgba(255,255,255,.025);
}

.roulette-percent-input {
    min-width: 0;
    padding: 0 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(0,0,0,.22);
}

.roulette-percent-input > span {
    color: #777781;
    font-size: 11px;
}

.roulette-percent-input input {
    width: 100%;
    min-width: 0;
    padding: 10px 0;
    border: 0;
    outline: 0;
    color: #fff;
    background: transparent;
    font: inherit;
    font-size: 11px;
}

.roulette-percent-input input::placeholder {
    color: #66666f;
}

.page-roulette .roulette-give-up {
    color: #fca5a5;
    border-color: rgba(239,68,68,.24);
    background: rgba(239,68,68,.09);
}

.roulette-results,
.roulette-remaining {
    margin-top: 16px;
    padding: 16px;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,.075);
    background: rgba(255,255,255,.025);
}

.roulette-results {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.roulette-results h2 {
    margin-top: 3px;
    font-size: 20px;
}

.roulette-result-grid {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px;
}

.roulette-result-grid > div {
    min-width: 100px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.roulette-result-grid strong {
    font-size: 17px;
}

.roulette-result-grid span {
    color: #777781;
    font-size: 9px;
}

.roulette-remaining .roulette-section-title {
    margin-bottom: 12px;
}

.roulette-remaining .roulette-level-card + .roulette-level-card {
    margin-top: 8px;
}

.roulette-toasts {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.roulette-toast {
    max-width: 320px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #fff;
    background: rgba(25,25,30,.92);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 10px 24px rgba(0,0,0,.28);
    backdrop-filter: blur(16px);
    font-size: 10px;
}

@media (max-width: 1050px) {
    .roulette-layout {
        grid-template-columns: 240px minmax(0,1fr);
    }

    .roulette-level-card.is-current {
        grid-template-columns: 220px minmax(0,1fr);
    }
}

@media (max-width: 820px) {
    .page-roulette {
        overflow-y: auto;
    }

    .roulette-layout {
        height: auto;
        min-height: 100vh;
        grid-template-columns: 1fr;
    }

    .roulette-panel,
    .roulette-content {
        overflow: visible;
    }

    .roulette-level-card.is-current,
    .roulette-level-card.is-completed,
    .roulette-level-card.is-remaining {
        grid-template-columns: 1fr;
    }

    .roulette-thumb img,
    .is-current .roulette-thumb img {
        min-height: 180px;
        max-height: 230px;
    }

    .roulette-results {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .roulette-layout {
        padding-left: 10px;
        padding-right: 10px;
    }

    .roulette-actions,
    .roulette-result-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   ROULETTE POLISH V7
   ========================================================= */

/* Force all four corners to remain visibly rounded even with scrollbar */
.roulette-panel {
    border-radius: 20px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background-clip: padding-box !important;
    clip-path: inset(0 round 20px);
}

/* Very subtle white glass glow */
.roulette-panel,
.roulette-content {
    border-color: rgba(255,255,255,.115) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.055),
        0 0 0 1px rgba(255,255,255,.018),
        0 0 16px rgba(255,255,255,.025),
        0 14px 34px rgba(0,0,0,.20) !important;
}

.roulette-panel:hover,
.roulette-content:hover {
    border-color: rgba(255,255,255,.15) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.065),
        0 0 0 1px rgba(255,255,255,.025),
        0 0 18px rgba(255,255,255,.035),
        0 16px 38px rgba(0,0,0,.22) !important;
}

/* Current roulette card: white glow only, no colored/neon feel */
.roulette-level-card.is-current {
    border-color: rgba(255,255,255,.22) !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.045),
        0 0 12px rgba(255,255,255,.055),
        0 10px 28px rgba(0,0,0,.20) !important;
}
