:root {
    --primary-color: #5D9CEC; /* 活力蓝 */
    --secondary-color: #A0D468; /* 草地绿 */
    --accent-color: #FFCE54; /* 阳光黄 */
    --bg-color: #F5F7FA; /* 现代灰白 */
    --text-color: #434A54;
    --card-bg: #FFFFFF;
    --font-stack: 'Nunito', 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    margin: 0;
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    background-image: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%); /* 清新蓝天渐变 */
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

header {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 1rem 2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 10px 10px;
}

h1 {
    margin: 0;
    font-size: 1.6rem;
    color: var(--primary-color);
    text-shadow: none;
    letter-spacing: 1px;
    font-weight: 800;
}

.controls {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Custom Dropdown - Modern Style */
.custom-dropdown {
    position: relative;
    cursor: pointer;
    font-size: 1rem;
    min-width: 140px;
    font-family: var(--font-stack);
}

.dropdown-current {
    padding: 0.6rem 1.2rem;
    border: 2px solid #E6E9ED;
    border-radius: 8px;
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-color);
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.dropdown-current:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.dropdown-list {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background-color: white;
    border: 1px solid #E6E9ED;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    display: none;
    z-index: 100;
    overflow: hidden;
}

.custom-dropdown:hover .dropdown-list {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.dropdown-list li {
    padding: 0.6rem 1rem;
    transition: background-color 0.2s;
    font-weight: 600;
    color: var(--text-color);
}

.dropdown-list li:hover {
    background-color: #F5F7FA;
    color: var(--primary-color);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

select {
    padding: 0.6rem;
    border-radius: 8px;
    border: 2px solid #E6E9ED;
    font-size: 1rem;
    font-family: var(--font-stack);
    color: var(--text-color);
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

/* Main Start Button - Modern Style */
.main-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1.5rem 4rem;
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, #4FC1E9, #5D9CEC); /* Blue Gradient */
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(93, 156, 236, 0.3);
    z-index: 50; 
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: var(--font-stack);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.main-btn:hover {
    transform: translate(-50%, -55%) scale(1.02);
    box-shadow: 0 15px 30px rgba(93, 156, 236, 0.4);
}

.main-btn:active {
    transform: translate(-50%, -48%) scale(0.98);
    box-shadow: 0 5px 10px rgba(93, 156, 236, 0.2);
}

.main-btn.hidden {
    display: none;
}

/* Idle Floating Name - Modern Tag Style */
.idle-name {
    position: absolute;
    padding: 12px 24px;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    color: var(--text-color);
    font-weight: 700;
    font-family: var(--font-stack);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    z-index: 1;
    transition: transform 0.1s linear;
    border: 1px solid rgba(0,0,0,0.05);
    backdrop-filter: blur(4px);
}

/* Remove colored borders for a cleaner look */
.idle-name:nth-child(3n) { color: #5D9CEC; }
.idle-name:nth-child(3n+1) { color: #A0D468; }
.idle-name:nth-child(3n+2) { color: #AC92EC; }

main {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent; 
}

#anim-mode-display {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    border: 1px solid #E6E9ED;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    z-index: 20;
    pointer-events: none;
    font-family: var(--font-stack);
    transition: opacity 0.3s;
}

#anim-mode-display.hidden {
    opacity: 0;
}

#anim-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.placeholder-text {
    font-size: 2rem;
    color: #CCD1D9;
    font-weight: bold;
    user-select: none;
}

#result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.7); /* Lighter overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

#result-overlay.hidden {
    display: none;
}

.result-box {
    background: #FFF;
    padding: 3rem 4rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 80%;
    border: none; /* Removed heavy border */
    position: relative;
    overflow: visible; /* Allow confetti to spill if needed */
}

/* Simpler celebration icons */
.result-box::before {
    content: '✨';
    font-size: 3rem;
    position: absolute;
    top: -15px;
    left: -15px;
    transform: rotate(-20deg);
}

.result-box::after {
    content: '✨';
    font-size: 3rem;
    position: absolute;
    bottom: -15px;
    right: -15px;
    transform: rotate(20deg);
}

#result-name {
    display: block;
    font-size: 5rem;
    font-weight: 800;
    background: linear-gradient(45deg, #5D9CEC, #4FC1E9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
    word-wrap: break-word;
    font-family: var(--font-stack);
    text-shadow: none;
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-stack);
    transition: all 0.2s;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(93, 156, 236, 0.3);
}

.btn.primary:hover {
    background-color: #4A89DC;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(93, 156, 236, 0.4);
}

.btn.primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(93, 156, 236, 0.2);
}

.btn.small {
    padding: 0.6rem 2rem;
    font-size: 1rem;
    background-color: var(--secondary-color);
    color: white;
    margin-top: 1rem;
    box-shadow: 0 4px 10px rgba(160, 212, 104, 0.3);
}

.btn.small:hover {
    transform: translateY(-2px);
    background-color: #8CC152;
    box-shadow: 0 6px 15px rgba(160, 212, 104, 0.4);
}

.btn.small:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(160, 212, 104, 0.2);
}

/* Flash */
.flash-name {
    font-size: 8vw;
    font-weight: bold;
    color: #333;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* Wheel */
.wheel-wrapper {
    position: relative;
    width: 500px;
    height: 500px;
}
.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; 
    height: 0; 
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #e74c3c;
    z-index: 5;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}
.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 10px solid #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    transition: transform 4s cubic-bezier(0.15, 0, 0.15, 1);
}
.wheel-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: 100% 100%;
    left: 0;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    font-size: 1.2rem;
    border: 1px solid rgba(255,255,255,0.2);
    box-sizing: border-box;
}
.wheel-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: 0 0;
    white-space: nowrap;
    text-align: right;
    width: 200px; /* Adjust based on wheel radius */
}

/* Balls */
.ball {
    position: absolute;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    box-shadow: inset -2px -2px 10px rgba(0,0,0,0.2), 2px 2px 5px rgba(0,0,0,0.2);
    color: white;
    user-select: none;
    font-size: 0.9rem;
}

/* Slot */
.slot-machine {
    display: flex;
    gap: 10px;
    background: #333;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.slot-reel {
    width: 150px;
    height: 200px;
    background: white;
    overflow: hidden;
    border-radius: 5px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
}
.slot-strip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}
.slot-item {
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
}

/* Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
}
.grid-item {
    padding: 15px;
    background: #f0f2f5;
    text-align: center;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.1s;
    min-width: 80px;
}
.grid-item.active {
    background: var(--secondary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--secondary-color);
    z-index: 2;
}

/* Cloud */
.cloud-container {
    width: 100%;
    height: 100%;
    position: relative;
    perspective: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.aim-scope {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 4px dashed rgba(255, 206, 84, 0.4);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.aim-scope::before, .aim-scope::after {
    content: '';
    position: absolute;
    background: rgba(255, 206, 84, 0.6);
}
.aim-scope::before {
    top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%);
}
.aim-scope::after {
    left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%);
}
.aim-scope.locked {
    border-style: solid;
    border-color: #FFCE54;
    box-shadow: 0 0 30px rgba(255, 206, 84, 0.6), inset 0 0 20px rgba(255, 206, 84, 0.2);
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 206, 84, 0.05);
}
.cloud-tag {
    position: absolute;
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
    white-space: nowrap;
    left: 50%;
    top: 50%;
    will-change: transform, opacity;
    /* transition: color 0.3s; removed transition to avoid lag in loop */
}

/* Flip */
.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 800px;
}
.flip-card {
    background-color: transparent;
    width: 100px;
    height: 140px;
    perspective: 1000px;
    cursor: pointer;
}
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.flip-card-front {
    background-color: var(--primary-color);
    color: white;
    font-size: 2rem;
}
.flip-card-back {
    background-color: white;
    color: var(--text-color);
    transform: rotateY(180deg);
    font-weight: bold;
    border: 2px solid var(--primary-color);
}

/* Zoom - Rocket Launch Style */
.zoom-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, #2b32b2 0%, #141e30 100%);
}

.rocket-wrapper {
    position: absolute;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    z-index: 10;
    transition: bottom 2s cubic-bezier(0.45, 0.05, 0.55, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rocket {
    font-size: 60px;
    transform: rotate(-45deg);
    filter: drop-shadow(0 0 10px rgba(255,100,100,0.8));
}

.rocket-fire {
    width: 20px;
    height: 40px;
    background: linear-gradient(to bottom, #ff9966, #ff5e62);
    border-radius: 50%;
    margin-top: -10px;
    animation: flicker 0.1s infinite alternate;
}

@keyframes flicker {
    from { transform: scale(1); opacity: 0.8; }
    to { transform: scale(1.2); opacity: 1; }
}

.star-field {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
}

.zoom-target-name {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: #fff;
    font-size: 4rem;
    font-weight: bold;
    text-shadow: 0 0 20px #4facfe;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
}

.zoom-target-name.show {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 1;
}

/* 响应式调整 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }
    .controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    .wheel-wrapper {
        width: 300px;
        height: 300px;
    }
}
