﻿/* =========================================================
   1. RESET
   ========================================================= */
html,
body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    min-width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}

/* =========================================================
   2. XÓA PADDING CỦA MUDLAYOUT / MUDMAINCONTENT
   ========================================================= */
    body:has(#lotteryContainer) .mud-layout {
        margin: 0 !important;
        padding: 0 !important;
    }

    body:has(#lotteryContainer) .mud-main-content {
        margin: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body:has(#lotteryContainer) .mud-container {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }


/* =========================================================
   3. LOTTERY PAGE
   ========================================================= */
.lottery-page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    background: radial-gradient( circle, #0f2027, #203a43, #2c5364 );
    color: white;
    font-family: Arial, sans-serif;
    text-align: center;
    overflow-x: hidden;
    overflow-y: auto;
}

/* =========================================================
   4. FULLSCREEN
   ========================================================= */
html:fullscreen {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

    html:fullscreen body {
        width: 100%;
        height: 100%;
        margin: 0 !important;
        padding: 0 !important;
    }

    html:fullscreen #lotteryContainer {
        width: 100vw !important;
        min-height: 100vh !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden;
        overflow-y: auto;
        background: radial-gradient( circle, #0f2027, #203a43, #2c5364 );
    }

/* =========================================================
   5. HEADER
   ========================================================= */
.lottery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    padding: 6px 40px;
    background: rgba(0, 0, 0, 0.65);
    border-bottom: 3px solid gold;
    min-height: 72px;
}

/* =========================================================
   6. LOGO
   ========================================================= */
.lottery-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* =========================================================
   7. TITLE
   ========================================================= */
.lottery-title {
    font-size: 30px;
    font-weight: bold;
    color: gold;
    text-align: center;
    white-space: nowrap;
}

/* =========================================================
   8. COMPANY
   ========================================================= */
.lottery-company {
    font-size: 18px;
    font-weight: bold;
    color: white;
    white-space: nowrap;
}

/* =========================================================
   9. MARQUEE
   ========================================================= */
.lottery-marquee {
    width: 100%;
    box-sizing: border-box;
    background: black;
    color: gold;
    font-size: 18px;
    padding: 6px;
    overflow: hidden;
    white-space: nowrap;
}

    .lottery-marquee span {
        display: inline-block;
        animation: lottery-scroll 18s linear infinite;
    }

@keyframes lottery-scroll {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(-100%);
    }
}

/* =========================================================
   10. MAIN
   ========================================================= */
.lottery-main {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 20px 30px 20px;
}

/* =========================================================
   11. TIÊU ĐỀ LOẠI GIẢI
   ========================================================= */
    .lottery-main h2 {
        margin: 8px 0 8px 0;
        font-size: 26px;
        color: white;
    }

/* =========================================================
   12. WRAPPER MUDSELECT
   ========================================================= */
.lottery-select-wrapper {
    width: 100%;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto 8px auto !important;
    text-align: center !important;
}

/* =========================================================
   13. MUDSELECT - COMPONENT CHÍNH
   ========================================================= */
.lottery-prize-select {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: fit-content !important;
    min-width: 0 !important;
    max-width: 90vw !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: left !important;
    border-radius: 10px !important;
    overflow: hidden;
}

/* =========================================================
   14. MUD INPUT CONTROL
   ========================================================= */
    .lottery-prize-select.mud-input-control {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        width: fit-content !important;
        min-width: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
        border-radius: 10px !important;
        overflow: hidden;
        background: transparent !important;
    }

    .lottery-prize-select .mud-input-control {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        width: fit-content !important;
        min-width: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
        border-radius: 10px !important;
        overflow: hidden;
        background: transparent !important;
    }

/* =========================================================
   15. INPUT MUDSELECT
   ========================================================= */
    .lottery-prize-select .mud-input {
        min-height: 36px !important;
        height: 36px !important;
        box-sizing: border-box;
        border-radius: 10px !important;
        overflow: hidden;
        background: white !important;
    }

/* =========================================================
   16. INPUT ROOT
   ========================================================= */
    .lottery-prize-select .mud-input-root {
        min-height: 36px !important;
        height: 36px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        padding-left: 12px !important;
        padding-right: 8px !important;
        box-sizing: border-box;
        border-radius: 10px !important;
        background: white !important;
    }

/* =========================================================
   17. OUTLINED INPUT
   ========================================================= */
    .lottery-prize-select .mud-input-outlined {
        background: white !important;
        color: #222 !important;
        border-radius: 10px !important;
        min-height: 36px !important;
        height: 36px !important;
        overflow: hidden;
    }

/* =========================================================
   18. OUTLINED BORDER
   ========================================================= */
    .lottery-prize-select .mud-input-outlined-border {
        border-color: #d0d0d0 !important;
        border-radius: 10px !important;
        box-shadow: none !important;
    }

    .lottery-prize-select:hover
    .mud-input-outlined-border {
        border-color: #594AE2 !important;
    }

    .lottery-prize-select
    .mud-input-outlined-border.mud-input-outlined-border-focused {
        border-color: #594AE2 !important;
    }

/* =========================================================
   19. CHỮ TRONG MUDSELECT
   ========================================================= */
    .lottery-prize-select .mud-input-slot {
        color: #222 !important;
        line-height: 34px !important;
        min-height: 34px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* =========================================================
   20. PHẦN SELECT INPUT
   ========================================================= */
    .lottery-prize-select .mud-select-input {
        min-height: 34px !important;
        height: 34px !important;
        line-height: 34px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

/* =========================================================
   21. ICON MŨI TÊN
   ========================================================= */
    .lottery-prize-select .mud-input-adornment {
        height: 34px !important;
        min-height: 34px !important;
        color: #594AE2 !important;
    }

/* =========================================================
   22. COUNTDOWN
   ========================================================= */
.lottery-countdown {
    font-size: 80px;
    font-weight: bold;
    line-height: 1;
    color: yellow;
    text-shadow: 0 0 20px red;
    margin: 10px 0;
}

/* =========================================================
   23. HAI Ô SỐ
   ========================================================= */
.lottery-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin: 15px auto 20px auto;
}

/* =========================================================
   24. Ô SỐ
   ========================================================= */
.lottery-number-box {
    width: 150px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: black;
    color: #00ffea;
    font-size: 155px;
    font-weight: bold;
    line-height: 1;
    border-radius: 18px;
    box-shadow: 0 0 20px #00ffea;
    user-select: none;
}

/* =========================================================
   25. BUTTONS
   ========================================================= */
.lottery-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 20px 0;
}

/* =========================================================
   26. MUD BUTTON
   ========================================================= */
.lottery-button {
    margin: 4px !important;
    border-radius: 10px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

/* =========================================================
   27. NÚT "ĐANG QUAY..."
   ========================================================= */
    .lottery-button.mud-button-root:disabled {
        color: #ffffff !important;
        opacity: 1 !important;
        border-radius: 10px !important;
        overflow: hidden !important;
        box-shadow: none !important;
    }

        .lottery-button.mud-button-root:disabled span {
            color: #ffffff !important;
        }

        .lottery-button.mud-button-root:disabled
        .mud-button-label {
            color: #ffffff !important;
        }

        .lottery-button.mud-button-root:disabled * {
            color: #ffffff !important;
        }

/* =========================================================
   28. EXCEL
   ========================================================= */
.lottery-excel-button {
    margin: 5px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

/* =========================================================
   29. TIÊU ĐỀ KẾT QUẢ
   ========================================================= */
.lottery-result-title {
    margin: 15px 0 8px 0;
    font-size: 22px;
    color: white;
}

/* =========================================================
   30. TABLE CONTAINER
   ========================================================= */
/*
   QUAN TRỌNG:

   Header desktop:
       padding trái  = 40px
       padding phải  = 40px

   Vì vậy Table cũng phải bắt đầu ở 40px
   và kết thúc ở 40px.

   .lottery-main đang có padding trái/phải = 20px.

   Ta cộng thêm 20px mỗi bên:

       20px của lottery-main
       +
       20px của margin table
       =
       40px

   Kết quả:

       Logo       |-----------------------------|
                  40px

       MudTable   |-----------------------------|
                  40px
*/
.lottery-table-container {
    width: calc(100% - 40px);
    max-width: none;
    margin-top: 15px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 10px !important;
    background: white;
    border: 1px solid #d8d8d8;
}

/* =========================================================
   31. MUD TABLE
   ========================================================= */
.lottery-table {
    width: 100%;
    background: white;
    color: black;
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

/* =========================================================
   32. MUD TABLE CONTAINER BÊN TRONG
   ========================================================= */
    .lottery-table .mud-table-container {
        background: white !important;
        border-radius: 10px !important;
        overflow: hidden !important;
        box-shadow: none !important;
    }

/* =========================================================
   33. TABLE THẬT
   ========================================================= */
    .lottery-table table {
        width: 100%;
        background: white !important;
        border-radius: 10px !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        overflow: hidden;
    }

/* =========================================================
   34. CĂN GIỮA TABLE
   ========================================================= */
    .lottery-table .lottery-table-center {
        text-align: center !important;
        vertical-align: middle !important;
    }

    .lottery-table .mud-table-head
    .lottery-table-center {
        text-align: center !important;
        vertical-align: middle !important;
    }

    .lottery-table .mud-table-body
    .lottery-table-center {
        text-align: center !important;
        vertical-align: middle !important;
    }

/* =========================================================
   35. HEADER TABLE
   ========================================================= */
    .lottery-table .mud-table-head {
        background: #66ede5 !important;
    }

        .lottery-table .mud-table-head th {
            background: #66ede5 !important;
            color: #6e6e6e !important;
            text-align: center;
            vertical-align: middle;
        }

/* =========================================================
   36. BODY TABLE
   ========================================================= */
    .lottery-table .mud-table-body {
        background: white !important;
    }

        .lottery-table .mud-table-body td {
            background: white !important;
            color: #6e6e6e !important;
        }

/* =========================================================
   37. TABLE BORDER
   ========================================================= */
    .lottery-table td,
    .lottery-table th {
        border-color: #e0e0e0 !important;
    }

/* =========================================================
   38. PHÁO HOA
   ========================================================= */
#fireworksCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* =========================================================
   39. TABLET
   ========================================================= */
@media (max-width: 900px) {

    .lottery-header {
        padding: 6px 20px;
    }

    .lottery-title {
        font-size: 24px;
    }

    .lottery-company {
        font-size: 15px;
    }

    .lottery-logo {
        height: 50px;
    }

    .lottery-number-box {
        width: 125px;
        height: 155px;
        font-size: 130px;
    }

    /*
       Header tablet = 20px.

       lottery-main cũng = 20px.

       Vì vậy table rộng toàn bộ phần main
       để mép table đúng bằng mép Header.
    */

    .lottery-table-container {
        width: 100%;
        max-width: none;
    }
}

/* =========================================================
   40. MOBILE
   ========================================================= */
@media (max-width: 600px) {
    .lottery-header {
        padding: 6px 10px;
        min-height: 58px;
    }

    .lottery-logo {
        height: 40px;
    }

    .lottery-title {
        font-size: 17px;
        white-space: normal;
    }

    .lottery-company {
        font-size: 11px;
    }

    .lottery-marquee {
        font-size: 14px;
        padding: 5px;
    }

    .lottery-main {
        padding: 8px 10px 20px 10px;
    }

        .lottery-main h2 {
            font-size: 21px;
        }

    .lottery-prize-select {
        max-width: 92vw !important;
        border-radius: 10px !important;
    }

        .lottery-prize-select .mud-input {
            border-radius: 10px !important;
        }

        .lottery-prize-select .mud-input-outlined {
            border-radius: 10px !important;
        }

        .lottery-prize-select .mud-input-outlined-border {
            border-radius: 10px !important;
        }

    .lottery-countdown {
        font-size: 60px;
    }

    .lottery-numbers {
        gap: 10px;
        margin-top: 10px;
    }

    .lottery-number-box {
        width: 105px;
        height: 130px;
        font-size: 105px;
        border-radius: 14px;
    }

    .lottery-button {
        font-size: 15px !important;
        border-radius: 10px !important;
    }

    /*
       Header mobile = 10px.
       Main mobile = 10px.
       Table width 100% => đúng cùng mép.
    */
    .lottery-table-container {
        width: 100%;
        max-width: none;
        border-radius: 10px !important;
    }

    .lottery-table {
        border-radius: 10px !important;
    }

        .lottery-table .mud-table-container {
            border-radius: 10px !important;
        }
}

/* =========================================================
   41. ĐIỆN THOẠI RẤT NHỎ
   ========================================================= */
@media (max-width: 380px) {
    .lottery-title {
        font-size: 14px;
    }

    .lottery-company {
        font-size: 9px;
    }

    .lottery-logo {
        height: 34px;
    }

    .lottery-number-box {
        width: 85px;
        height: 110px;
        font-size: 85px;
    }

    .lottery-countdown {
        font-size: 50px;
    }
}
