:root {
    --act-bg: #ffffff;
    --act-bg-gradient: #ffffff;
    --act-primary: #f0bc2c;
    --act-primary-dark: #b8821a;
    --act-text: #333333;
    --act-text-muted: rgba(0, 0, 0, 0.55);
    --act-block-bg: rgba(240, 188, 44, 0.06);
    --act-block-border: rgba(240, 188, 44, 0.35);
    --act-tab-bg: transparent;
    --act-tab-active-bg: var(--act-primary);
    --act-tab-active-text: #ffffff;
    --act-table-head-bg: rgba(240, 188, 44, 0.12);
    --act-table-row-bg: rgba(0, 0, 0, 0.03);
    --act-modal-bg: #ffffff;
    --act-modal-text: #333333;
    --act-max-width: 1200px;
}

body {
    margin: 0;
    background: #fff8ee;
    color: var(--act-text);
    font-family: "Microsoft JhengHei", "Heiti TC", Arial, sans-serif;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('/components/activity/images/top_bg.webp') top center / cover no-repeat;
    z-index: -1;
}

@media (max-width: 768px) {
    body::before {
        background-image: url('/components/activity/images/top_bg_mobile.webp');
    }
}

#activity-app {
    max-width: var(--act-max-width);
    margin: 0 auto;
    padding: 0 12px 60px;
    position: relative;
    z-index: 1;
}

.act-current-name {
    display: block;
    width: fit-content;
    max-width: calc(100% - 24px);
    margin: 16px auto 20px;
    padding: 10px 26px;
    border: 1px solid var(--act-primary);
    border-radius: 999px;
    background: #fff;
    color: #c62828;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(240, 188, 44, 0.15);
    text-align: center;
    word-break: break-word;
}

.act-switcher-wrap {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000;
}

.act-switcher-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(0, 0, 0, 0.45);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.act-switcher-btn:hover {
    background: rgba(0, 0, 0, 0.65);
}

.act-switcher-btn[aria-expanded="true"] .act-switcher-arrow {
    transform: rotate(180deg);
}

.act-switcher-arrow {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.2s;
}

.act-switcher-menu {
    position: absolute;
    top: 40px;
    right: 0;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: rgba(0, 0, 0, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    min-width: 220px;
    max-height: 60vh;
    overflow-y: auto;
}

.act-switcher-item {
    display: block;
    padding: 10px 16px;
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

a.act-switcher-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
}

.act-switcher-item.active {
    background: var(--act-primary, #888);
    color: #fff;
    font-weight: bold;
    cursor: default;
}

@media (min-width: 768px) {
    .act-switcher-btn {
        width: 44px;
        height: 44px;
        border-width: 2px;
    }
    .act-switcher-arrow {
        font-size: 24px;
    }
    .act-switcher-menu {
        top: 52px;
    }
}

.act-header {
    text-align: center;
    padding: 16px 0 8px;
}

.act-header img {
    max-width: 150px;
    height: auto;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.act-roulette-wrap {
    text-align: center;
    margin: 24px 0 16px;
    position: relative;
}

.act-roulette-wrap::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    max-width: 90vw;
    max-height: 90vw;
    background: radial-gradient(circle, rgba(240, 188, 44, 0.25) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

.act-roulette-box {
    position: relative;
    display: inline-block;
    width: 480px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    z-index: 1;
}

.act-roulette-box img {
    display: block;
    max-width: 100%;
}

.act-roulette-box .act-pointer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    cursor: pointer;
    z-index: 8;
}

.act-roulette-box .act-machine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    filter: drop-shadow(0 0 4px #444);
    pointer-events: none;
    z-index: 5;
}

.act-roulette-box .act-roulette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2;
    transition: transform 4s cubic-bezier(0.25, 0.1, 0.1, 1);
}

.act-wheel-img {
    filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, 0.55));
}

.act-molly-wrap {
    display: flex;
    justify-content: center;
    margin: 32px 0 24px;
    position: relative;
}

.act-molly-board {
    position: relative;
    width: min(508px, 92vw);
    aspect-ratio: 1.1 / 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 4px;
    padding: 5px;
    border: 12px solid #ffd35c;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    box-shadow:
        inset 0 0 0 2px #fff8dd,
        0 0 0 3px #e8902c,
        0 0 0 5px #b8651a,
        0 0 14px rgba(232, 144, 44, 0.55),
        0 0 28px rgba(255, 211, 92, 0.45);
}

.act-molly-slot-item {
    background: #f3b0b0;
    color: #a82f2f;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px;
    font-family: Bahnschrift, "微軟正黑體", sans-serif;
    font-weight: 700;
    box-shadow:
        rgba(45, 35, 66, 0.35) 0 2px 4px,
        rgba(45, 35, 66, 0.25) 0 7px 13px -3px,
        #c75a5a 0 -8px 0 inset;
    transition: background-color 0.08s ease, box-shadow 0.08s ease;
}

.act-molly-slot-img {
    width: 58%;
    max-height: 55%;
    object-fit: contain;
    pointer-events: none;
}

.act-molly-slot-prize {
    font-size: clamp(12px, 2vw, 18px);
    line-height: 1;
}

.act-molly-slot-item:nth-child(odd) {
    background-color: #fdf6e3;
    color: #d94444;
    box-shadow:
        rgba(45, 35, 66, 0.35) 0 2px 4px,
        rgba(45, 35, 66, 0.25) 0 7px 13px -3px,
        #ad915a 0 -8px 0 inset;
}

.act-molly-slot-item.active {
    background-color: #ffd35c !important;
    color: #5d0000 !important;
    box-shadow:
        #ffd35c 0 0 18px,
        #d99820 0 7px 13px -3px,
        #d99820 0 -8px 0 inset !important;
}

.act-molly-center {
    grid-row: 2 / 4;
    grid-column: 2 / 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.act-molly-draw {
    display: block;
    border: 0;
    border-radius: 12px;
    color: #5d0000;
    background: linear-gradient(180deg, #ffe48a 0%, #ffd35c 45%, #d99820 100%);
    cursor: pointer;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 4px;
    outline: none;
    min-width: 60%;
    padding: 0.95rem 1.5rem;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
    box-shadow:
        0 0 0 2px var(--act-primary-dark, #b8821a),
        inset 0 2px 0 rgba(255, 255, 255, 0.65),
        inset 0 -4px 0 rgba(122, 80, 18, 0.55),
        0 2px 5px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s, box-shadow 0.15s;
}

.act-molly-draw:hover:not(.disabled) {
    transform: translateY(-1px);
    box-shadow:
        0 0 0 2px var(--act-primary-dark, #b8821a),
        inset 0 2px 0 rgba(255, 255, 255, 0.85),
        inset 0 -4px 0 rgba(122, 80, 18, 0.55),
        0 4px 8px rgba(0, 0, 0, 0.22);
}

.act-molly-draw:active:not(.disabled) {
    transform: translateY(2px);
    box-shadow:
        0 0 0 2px var(--act-primary-dark, #b8821a),
        inset 0 3px 6px rgba(122, 80, 18, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.act-molly-draw.disabled {
    color: #f0e6c8;
    background: linear-gradient(140deg, #8a8a8a, #5a5a5a);
    text-shadow: none;
    box-shadow:
        0 0 0 2px #4a4a4a,
        inset 0 -3px 0 rgba(0, 0, 0, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.3);
    cursor: not-allowed;
}

.act-light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff8dd;
    box-shadow: 0 2px 5px 1px #ffd35c;
    position: absolute;
    animation: 1.5s infinite;
}

.act-light:nth-child(2n) { animation-name: actLightEven; }
.act-light:nth-child(odd) { animation-name: actLightOdd; }

@keyframes actLightOdd {
    0%   { box-shadow: 0 2px 5px 1px #b8821a; }
    50%  { box-shadow: 0 2px 5px 4px #ffd35c; }
    100% { box-shadow: 0 2px 5px 1px #b8821a; }
}
@keyframes actLightEven {
    0%   { box-shadow: 0 2px 5px 1px #d99820; }
    50%  { box-shadow: 0 2px 5px 5px #ffe48a; }
    100% { box-shadow: 0 2px 5px 1px #d99820; }
}

.act-light1  { top: -3.5%; left: -3%; }
.act-light2  { top: -4%;   left: 18%; }
.act-light3  { top: -4%;   left: 39%; }
.act-light4  { top: -4%;   left: 60%; }
.act-light5  { top: -4%;   left: 82%; }
.act-light6  { top: -3.5%; left: 100%; }
.act-light7  { top: 16%;   left: 100.5%; }
.act-light8  { top: 38%;   left: 100.5%; }
.act-light9  { top: 58%;   left: 100.5%; }
.act-light10 { top: 80%;   left: 100.5%; }
.act-light11 { top: 100%;  left: 100.5%; }
.act-light12 { top: 100%;  left: 100%; }
.act-light13 { top: 100%;  left: 80%; }
.act-light14 { top: 100%;  left: 58%; }
.act-light15 { top: 100%;  left: 38%; }
.act-light16 { top: 100%;  left: 18%; }
.act-light17 { top: 100%;  right: 100%; }
.act-light18 { top: 80%;   right: 100.5%; }
.act-light19 { top: 58%;   right: 100.5%; }
.act-light20 { top: 38%;   right: 100.5%; }
.act-light21 { top: 16%;   right: 100.5%; }

.act-status {
    text-align: center;
    margin-bottom: 16px;
}

.act-status-msg {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid var(--act-block-border);
    color: var(--act-text);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.act-status-msg a {
    color: inherit;
    text-decoration: none;
}

.act-status-msg a:hover {
    color: var(--act-primary-dark);
    text-decoration: none;
}

.act-status p {
    margin: 8px 0 0;
    color: #ffffff;
    font-weight: 500;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.act-count {
    color: #ffd35c;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.act-content {
    display: block;
}

.act-block {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 3px solid var(--act-primary);
    border-radius: 12px;
    padding: 36px 24px 20px;
    margin: 36px auto 20px;
    max-width: 800px;
    text-align: center;
    color: #eeeeee;
    box-shadow:
        rgba(50, 50, 93, 0.25) 0 10px 20px -5px,
        rgba(0, 0, 0, 0.3) 0 5px 10px -8px;
    transition: box-shadow 0.2s, transform 0.2s;
}


.act-block-title {
    display: inline-block;
    position: relative;
    top: -3.2rem;
    margin: 0;
    padding: 8px 32px;
    background: linear-gradient(135deg, #ffd35c 0%, #f0bc2c 100%);
    color: #5d4408;
    border-radius: 999px;
    border: 2px solid #fff;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.act-block > :first-child + * {
    margin-top: -2rem;
}

.act-block-text {
    text-align: center;
    line-height: 1.6;
    color: #eeeeee;
}

.act-text-left {
    text-align: left;
}

.act-block-text p {
    margin: 4px 0;
}

.act-date-pick {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 6px;
    margin: 8px 0 12px;
    width: 100%;
}

.act-date-pick .act-date-btn {
    max-width: 160px;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--act-block-border);
    color: var(--act-text-muted);
    background: transparent;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.15s ease;
}

.act-date-pick .act-date-btn:hover {
    color: var(--act-primary-dark);
    border-color: var(--act-primary);
}

.act-date-pick .act-date-btn.active {
    background: var(--act-primary);
    color: #5d0000;
    border-color: var(--act-primary);
}

.act-prize-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
}

.act-prize-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 10px;
    background: rgba(255, 248, 221, 0.55);
    border: 1px solid var(--act-primary);
    border-radius: 10px;
    text-align: center;
    max-width: 150px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.act-prize-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.act-prize-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 8px;
}

.act-prize-name {
    font-size: 14px;
    color: #5d0000;
    font-weight: 600;
    line-height: 1.3;
}

.act-user-got {
    background: rgba(240, 188, 44, 0.18) !important;
    font-weight: 600;
}

.act-table-block .act-table {
    width: 100%;
    border-collapse: collapse;
    color: #eeeeee;
    font-size: 13px;
}

.act-table th,
.act-table td {
    padding: 6px 6px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.act-table thead th {
    background: var(--act-primary);
    color: #5d0000;
    font-weight: 600;
}

.act-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

.act-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.12);
}

.act-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 420px;
    margin: 60px auto;
    padding: 48px 32px;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(180, 60, 20, 0.18);
}

.act-empty-icon {
    width: 100px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

.act-empty-text {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: var(--act-text);
    letter-spacing: 0.5px;
}

.act-empty-sub {
    margin: 10px 0 0;
    font-size: 14px;
    color: var(--act-text-muted);
}

.act-snow-item {
    position: fixed;
    top: -80px;
    z-index: 999;
    animation: act-snow-fall 4.5s ease-in forwards;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes act-snow-fall {
    0% { top: -80px; opacity: 0.9; }
    100% { top: 110vh; opacity: 0.85; }
}

.act-modal .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    background: #ffffff;
}

.act-modal .modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(240, 188, 44, 0.25);
    background: linear-gradient(180deg, #fff8e1 0%, #fff 100%);
    position: relative;
}

.act-modal .modal-header .close {
    margin: 0;
    padding: 0;
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 24px;
    color: #999;
    opacity: 1;
    text-shadow: none;
}

.act-modal .modal-header .close:hover {
    color: var(--act-primary);
}

.act-modal-logo {
    flex: 0 0 auto;
    height: 36px;
}

.act-modal-logo img {
    height: 100%;
}

.act-modal-code {
    margin-left: auto;
    margin-right: 36px;
    font-size: 12px;
    color: var(--act-primary-dark);
    letter-spacing: 2px;
    font-family: 'Consolas', monospace;
}

.act-modal .modal-body {
    padding: 28px 24px;
    text-align: center;
}

.act-modal-congrats {
    font-size: 18px;
    color: #c62828;
    font-weight: 600;
    letter-spacing: 4px;
    margin-bottom: 16px;
}

.act-modal-bonus-wrap {
    background: linear-gradient(135deg, #fff8e1 0%, #ffe9a8 100%);
    border: 2px solid var(--act-primary);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 0 auto 20px;
    max-width: 320px;
    box-shadow: inset 0 0 16px rgba(240, 188, 44, 0.2);
}

.act-modal-bonus {
    display: inline-block;
    font-size: 30px;
    font-weight: bold;
    color: #c62828;
    text-shadow: 0 2px 4px rgba(198, 40, 40, 0.2);
}

.act-modal-account,
.act-modal-time {
    margin: 4px 0;
    font-size: 14px;
    color: #555;
}

.act-modal-account span,
.act-modal-time span {
    color: #333;
    font-weight: 500;
}

.act-modal-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 12px;
}

.act-modal-headline {
    margin: 0 0 8px;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.act-modal-text {
    margin: 8px 0 20px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.act-modal-btn {
    display: inline-block;
    padding: 10px 30px;
    border-radius: 999px;
    background: var(--act-primary);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.act-modal-btn:hover {
    background: var(--act-primary-dark);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .act-block {
        padding: 30px 14px 14px;
        margin: 30px 0 16px;
        border-width: 2px;
    }
    .act-block-title {
        top: -2.8rem;
        padding: 6px 22px;
        font-size: 15px;
        letter-spacing: 1px;
    }
    .act-block > :first-child + * {
        margin-top: -1.6rem;
    }
}

@media (max-width: 480px) {
    #activity-app {
        padding: 0 8px 40px;
    }
    .act-roulette-box {
        width: 92vw;
        max-width: 92vw;
    }
}
