/* ==========================================================================
   LUCKY WHEEL COMPONENT
   ========================================================================== */

/* ------------------------------
   Wheel Base
   ------------------------------ */
.wheel {
    width: 300px;
    height: 300px;
    margin-inline: auto;
    position: relative;
    border: 6px solid #fff;
    border-radius: 50%;
    box-shadow: 0 4px 9px rgba(0, 0, 0, 0.1);
}

.wheel__inner {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    transition: cubic-bezier(0.19, 1, 0.22, 1) 5s;
}

/* ------------------------------
   Wheel Segments (6 wedges)
   ------------------------------ */
.wheel__sec {
    position: absolute;
    top: 0;
    left: 62px;
    width: 0;
    height: 0;
    border: solid;
    border-width: 150px 88px 0;
    border-color: transparent;
    transform-origin: 50% 100%;
}

/* Colors & rotation (must match legend order) */
.wheel__sec:nth-child(1) { border-top-color: #16a085; }
.wheel__sec:nth-child(2) { border-top-color: #2980b9; transform: rotate(60deg); }
.wheel__sec:nth-child(3) { border-top-color: #34495e; transform: rotate(120deg); }
.wheel__sec:nth-child(4) { border-top-color: #f39c12; transform: rotate(180deg); }
.wheel__sec:nth-child(5) { border-top-color: #d35400; transform: rotate(240deg); }
.wheel__sec:nth-child(6) { border-top-color: #c0392b; transform: rotate(300deg); }

/* ------------------------------
   Arrow & Button
   ------------------------------ */
.wheel__arrow {
    width: 70px;
    height: 70px;
    position: absolute;
    top: 121px;
    left: 115px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wheel__arrow::after {
    content: "";
    position: absolute;
    top: -15px;
    left: 25px;
    width: 0;
    height: 0;
    border: solid;
    border-width: 0 10px 20px;
    border-color: transparent;
    border-bottom-color: #fff;
}

/* Spin Button */
.wheel__button {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background-color: lightgray;
    font-weight: 600;
    font-size: 18px;
    cursor: pointer;
    transition: 0.3s;
}

.wheel__button:hover {
    color: var(--im-theme-color);
}

.wheel__button:active {
    border: 3px solid rgba(0, 0, 0, 0.1);
    font-size: 15px;
}

/* Disabled state */
.wheel__button.is-disabled,
.wheel__button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto;
}

.wheel__button.is-disabled:hover {
    transform: none;
}

/* ==========================================================================
   LEGEND
   ========================================================================== */

/* Legend Container */
.init-lw-legend {
    text-align: left;
}

/* Legend List */
.lw-legend-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.lw-legend-item {
    display: grid;
    grid-template-columns: 16px 1fr;
    align-items: center;
    column-gap: 8px;
    margin-bottom: 6px;
}

/* Dot & Colors */
.lw-legend-dot {
    width: 12px;
    height: 12px;
    display: inline-block;
    border-radius: 4px;
}

.lw-color-1 { background-color: #16a085; }
.lw-color-2 { background-color: #2980b9; }
.lw-color-3 { background-color: #34495e; }
.lw-color-4 { background-color: #f39c12; }
.lw-color-5 { background-color: #d35400; }
.lw-color-6 { background-color: #c0392b; }

.lw-legend-text {
    line-height: 1.4;
}

/* ==========================================================================
   LAYOUT WRAPPER
   ========================================================================== */

.init-lw-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-inline: auto;
}

/* Wheel container center alignment */
.init-lw-wrapper .wheel {
    margin: 0 auto;
}

/* Legend center alignment */
.init-lw-legend {
    margin-top: 24px;
    text-align: left;
    display: inline-block; /* để text align trái mà vẫn center tổng thể */
}

/* ==========================================================================
   RESPONSIVE TWEAKS
   ========================================================================== */
@media (max-width: 640px) {
    .lw-legend-item {
        margin-bottom: 8px;
    }
}

/* ==========================================================================
   LUCKY WHEEL MARQUEE (seamless)
   ========================================================================== */
.lw-winners .lw-chip {
    gap: 0.45rem;
    padding: 0.25rem 0.5rem;
    line-height: 1.2;
}

.lw-winners .lw-emoji { transform: translateY(1px); }

.lw-winners .lw-avatar {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06) inset;
}

.lw-winners .lw-name { max-width: 140px; }

.lw-winners .lw-dash { opacity: 0.6; }

.lw-winners .lw-time {
    margin-left: 0.25rem;
    white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
    .lw-winners .lw-chip {
        background: rgba(255, 255, 255, 0.06);
    }
    .lw-winners .lw-avatar {
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    }
}
