@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes float-diagonal {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(8px, -4px); }
    50% { transform: translate(0, -8px); }
    75% { transform: translate(-8px, -4px); }
}

@keyframes sparkle {
    0%, 100% { opacity: 0.5; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

@keyframes bounce-in {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes slide-up {
    from { transform: translateY(25px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes cloud-float {
    0% { transform: translateX(0); }
    100% { transform: translateX(120px); }
}

@keyframes sun-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes sun-pulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.1); opacity: 1; }
}

@keyframes letter-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes butterfly-flap {
    0%, 100% { transform: scaleX(1) rotate(0deg); }
    30% { transform: scaleX(0.35) rotate(-12deg); }
    70% { transform: scaleX(0.35) rotate(12deg); }
}

@keyframes bird-fly {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(25px, -8px) rotate(4deg); }
    50% { transform: translate(50px, 4px) rotate(-2deg); }
    75% { transform: translate(75px, -4px) rotate(2deg); }
    100% { transform: translate(100px, 0) rotate(0deg); }
}

@keyframes loading-dot {
    0%, 80%, 100% { transform: scale(0.85); opacity: 0.4; }
    40% { transform: scale(1.15); opacity: 1; }
}

@keyframes star-twinkle {
    0%, 100% { opacity: 0.4; transform: scale(0.85) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.05) rotate(45deg); }
}

@keyframes stick-bounce {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: -100% 0; }
    100% { background-position: 100% 0; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 217, 61, 0.35); }
    50% { box-shadow: 0 0 22px rgba(255, 217, 61, 0.65); }
}

@keyframes blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

@keyframes rainbow-glow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes rainbow-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes chat-bounce {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    30% { transform: translateY(-3px) rotate(1deg); }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Chalkboard', 'ChalkboardSE-Regular', cursive, -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 30%, #98FB98 50%, #90EE90 70%, #7cba5f 100%);
    background-size: 100% 500%;
    min-height: 100vh;
    overflow: hidden;
    touch-action: none;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(135,206,235,0.85) 0%, rgba(100,149,237,0.92) 40%, rgba(70,130,180,0.98) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fade-in 0.3s ease-out;
}

.overlay-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.floating-cloud {
    position: absolute;
    background: rgba(255,255,255,0.7);
    border-radius: 50px;
    animation: cloud-float linear infinite;
    pointer-events: none;
}

.cloud-1 {
    top: 15%;
    left: -150px;
    width: 100px;
    height: 40px;
    animation-duration: 25s;
}

.cloud-1::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 20px;
    width: 50px;
    height: 30px;
    background: rgba(255,255,255,0.7);
    border-radius: 30px;
}

.cloud-2 {
    top: 30%;
    left: -120px;
    width: 80px;
    height: 35px;
    animation-duration: 35s;
    animation-delay: -10s;
}

.cloud-2::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 15px;
    width: 40px;
    height: 25px;
    background: rgba(255,255,255,0.7);
    border-radius: 25px;
}

.cloud-3 {
    top: 8%;
    right: -150px;
    width: 120px;
    height: 50px;
    animation-duration: 30s;
    animation-direction: reverse;
}

.cloud-3::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 25px;
    width: 60px;
    height: 35px;
    background: rgba(255,255,255,0.7);
    border-radius: 35px;
}

.cloud-4 {
    top: 45%;
    right: -100px;
    width: 70px;
    height: 30px;
    animation-duration: 40s;
    animation-delay: -5s;
    animation-direction: reverse;
}

.floating-bird {
    position: absolute;
    width: 30px;
    height: 15px;
    animation: bird-fly 15s linear infinite;
    pointer-events: none;
}

.bird-1 {
    top: 20%;
    left: -30px;
    animation-delay: 0s;
}

.bird-2 {
    top: 35%;
    left: -30px;
    animation-delay: 5s;
}

.floating-butterfly {
    position: absolute;
    width: 20px;
    height: 20px;
    animation: butterfly-flap 20s ease-in-out infinite;
    pointer-events: none;
}

.butterfly-1 {
    top: 50%;
    left: 10%;
    animation-delay: 0s, 0s;
}

.butterfly-2 {
    top: 60%;
    right: 15%;
    animation-delay: 0.2s, 2s;
    animation-direction: normal, reverse;
}

.rainbow-decoration {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 150px;
    background: linear-gradient(180deg, 
        transparent 0%,
        #FF6B6B 10%,
        #FFD93D 25%,
        #6BCB77 40%,
        #4D96FF 55%,
        #FF6B9D 70%,
        transparent 85%
    );
    border-radius: 300px 300px 0 0;
    opacity: 0.15;
    animation: rainbow-glow 10s linear infinite;
    pointer-events: none;
}

.sun-rays {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    pointer-events: none;
}
    background: radial-gradient(circle, rgba(255,217,61,0.4) 0%, rgba(255,140,50,0.2) 30%, transparent 70%);
    animation: sun-rotate 60s linear infinite;
}

.overlay-content {
    background: linear-gradient(145deg, #FFE5B4 0%, #FFDAB9 25%, #FFF8DC 50%, #FFFACD 75%, #FFE5B4 100%);
    padding: 20px 25px;
    border-radius: 30px;
    max-width: 480px;
    width: 90%;
    max-height: 95vh;
    box-shadow: 
        0 20px 60px rgba(255,150,100,0.35),
        0 0 0 10px rgba(255,200,100,0.25),
        0 0 0 20px rgba(255,220,150,0.15),
        inset 0 -8px 25px rgba(255,255,255,0.6),
        inset 0 8px 20px rgba(255,220,150,0.4);
    animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 10px;
}

.sun-decoration-container {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 8px;
    animation: sun-pulse 3s ease-in-out infinite;
}

.sun-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, #FFD93D 0%, #FF8C32 50%, #FF6B6B 100%);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(255,217,61,0.7), 0 0 60px rgba(255,140,50,0.4);
    z-index: 1;
}

.sun-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    z-index: 5;
}

.sun-ray {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 16px;
    background: linear-gradient(to top, #FF8C32, #FFD93D);
    border-radius: 3px;
    transform-origin: center bottom;
    animation: sun-rotate 20s linear infinite;
    z-index: 10;
}

.ray-1 { transform: translate(-50%, -100%) rotate(0deg); animation-delay: 0s; }
.ray-2 { transform: translate(-50%, -100%) rotate(45deg); animation-delay: -2.5s; }
.ray-3 { transform: translate(-50%, -100%) rotate(90deg); animation-delay: -5s; }
.ray-4 { transform: translate(-50%, -100%) rotate(135deg); animation-delay: -7.5s; }
.ray-5 { transform: translate(-50%, -100%) rotate(180deg); animation-delay: -10s; }
.ray-6 { transform: translate(-50%, -100%) rotate(225deg); animation-delay: -12.5s; }
.ray-7 { transform: translate(-50%, -100%) rotate(270deg); animation-delay: -15s; }
.ray-8 { transform: translate(-50%, -100%) rotate(315deg); animation-delay: -17.5s; }

.sun-eye {
    position: absolute;
    top: 7px;
    width: 5px;
    height: 5px;
    background: #5D4037;
    border-radius: 50%;
    animation: blink 4s ease-in-out infinite;
}

.sun-eye-left { left: 6px; }
.sun-eye-right { right: 6px; }

.sun-eye::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 1px;
    height: 1px;
    background: #fff;
    border-radius: 50%;
}

@keyframes blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

.sun-mouth {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 5px;
    background: #FF6B6B;
    border-radius: 0 0 6px 6px;
}

.game-title {
    position: relative;
}

.game-title h1 {
    font-size: 38px;
    color: #FF6B6B;
    text-shadow: 
        3px 3px 0 #FFD93D,
        -2px -2px 0 #FF8C32,
        6px 6px 15px rgba(255,150,100,0.4);
    margin: 0;
    display: flex;
    justify-content: center;
}

.letter {
    display: inline-block;
    animation: letter-bounce 0.8s ease-in-out infinite;
}

.letter-1 { animation-delay: 0s; }
.letter-2 { animation-delay: 0.05s; }
.letter-3 { animation-delay: 0.1s; }
.letter-4 { animation-delay: 0.15s; }
.letter-5 { animation-delay: 0.2s; }
.letter-6 { animation-delay: 0.25s; }
.letter-7 { animation-delay: 0.3s; }
.letter-8 { animation-delay: 0.35s; }
.letter-9 { animation-delay: 0.4s; }
.letter-10 { animation-delay: 0.45s; }
.letter-11 { animation-delay: 0.5s; }

.sparkles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    color: #FFD93D;
    font-size: 18px;
    animation: star-twinkle 1.5s ease-in-out infinite;
}

.sparkle-1 { top: -10px; left: 10%; animation-delay: 0s; }
.sparkle-2 { top: -5px; left: 30%; animation-delay: 0.3s; }
.sparkle-3 { top: -15px; left: 50%; animation-delay: 0.6s; }
.sparkle-4 { top: -8px; right: 25%; animation-delay: 0.9s; }
.sparkle-5 { top: -12px; right: 5%; animation-delay: 1.2s; }

.character-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 5px 0;
}

.character-preview {
    background: linear-gradient(145deg, #87CEEB, #98FB98);
    border-radius: 15px;
    padding: 3px;
    box-shadow: 
        0 5px 15px rgba(255,150,100,0.25),
        inset 0 2px 5px rgba(255,255,255,0.5);
    animation: float 3s ease-in-out infinite;
}

#preview-canvas {
    border-radius: 12px;
    display: block;
}

.character-preview {
    background: linear-gradient(145deg, #87CEEB, #98FB98);
    border-radius: 20px;
    padding: 5px;
    box-shadow: 
        0 8px 20px rgba(255,150,100,0.3),
        inset 0 2px 8px rgba(255,255,255,0.5);
    animation: float 3s ease-in-out infinite;
}

#preview-canvas {
    border-radius: 15px;
}

.preview-label {
    margin-top: 8px;
    color: #6BCB77;
    font-size: 14px;
    font-style: italic;
    font-weight: bold;
}

.subtitle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    color: #FF6B6B;
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.8);
}

.subtitle-icon {
    animation: wiggle 2s ease-in-out infinite;
}

.login-form {
    margin-top: 10px;
}

.form-group {
    margin-bottom: 12px;
    animation: slide-up 0.5s ease-out;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #FF6B6B;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.8);
}

.label-icon {
    font-size: 16px;
    animation: sparkle 2s ease-in-out infinite;
}

.form-group input {
    width: 100%;
    padding: 10px 15px;
    border: 3px solid #FFD93D;
    border-radius: 18px;
    background: linear-gradient(180deg, #FFFACD 0%, #FFF8DC 100%);
    color: #5D4037;
    font-size: 14px;
    font-family: inherit;
    box-shadow: 
        inset 0 2px 4px rgba(255,150,100,0.2),
        0 3px 10px rgba(255,200,100,0.2);
    transition: all 0.3s ease;
}

.form-group input {
    width: 100%;
    padding: 12px 18px;
    border: 3px solid #FFD93D;
    border-radius: 20px;
    background: linear-gradient(180deg, #FFFACD 0%, #FFF8DC 100%);
    color: #5D4037;
    font-size: 16px;
    font-family: inherit;
    box-shadow: 
        inset 0 2px 6px rgba(255,150,100,0.25),
        0 4px 15px rgba(255,200,100,0.25);
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: #FF8C32;
    outline: none;
    box-shadow: 
        inset 0 2px 5px rgba(255,150,100,0.2),
        0 0 20px rgba(255,200,100,0.4),
        0 5px 15px rgba(255,200,100,0.2);
    transform: scale(1.01);
}

.form-group input::placeholder {
    color: #C9B896;
    opacity: 0.8;
}

.form-group small {
    color: #6BCB77;
    font-size: 11px;
    margin-top: 4px;
    display: block;
    font-style: italic;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: bold;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    pointer-events: auto;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
    pointer-events: none;
}

.btn:hover::before {
    width: 250px;
    height: 250px;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 3s linear infinite;
    pointer-events: none;
}

.btn-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
    transform: scale(1.2) rotate(8deg);
}

.primary-btn {
    background: linear-gradient(145deg, #FFD93D 0%, #FF8C32 40%, #FF6B6B 80%, #FF6B9D 100%);
    color: #5D4037;
    box-shadow: 
        0 8px 25px rgba(255,140,50,0.45),
        inset 0 -4px 12px rgba(255,100,50,0.35),
        inset 0 4px 12px rgba(255,255,255,0.35);
    animation: pulse-glow 2s ease-in-out infinite;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(255,140,50,0.55),
        inset 0 -4px 12px rgba(255,100,50,0.35),
        inset 0 4px 12px rgba(255,255,255,0.35);
}

.primary-btn:active {
    transform: translateY(-3px) scale(1.04);
}

.secondary-btn {
    background: linear-gradient(145deg, #6BCB77 0%, #4D96FF 50%, #4a90d9 100%);
    color: #FFFACD;
    box-shadow: 
        0 8px 25px rgba(107,203,119,0.45),
        inset 0 -4px 12px rgba(77,150,255,0.35),
        inset 0 4px 12px rgba(255,255,255,0.25);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.25);
}

.secondary-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(107,203,119,0.55),
        inset 0 -4px 12px rgba(77,150,255,0.35),
        inset 0 4px 12px rgba(255,255,255,0.25);
}

.small-btn {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 22px;
}

.close-btn {
    background: linear-gradient(145deg, #FF6B6B 0%, #FF6B9D 100%);
    border: none;
    color: #FFFACD;
    font-size: 26px;
    cursor: pointer;
    padding: 10px 14px;
    line-height: 1;
    border-radius: 50%;
    box-shadow: 
        0 6px 20px rgba(255,107,107,0.45),
        inset 0 -3px 8px rgba(255,107,157,0.35);
    transition: all 0.3s ease;
}

.close-btn:hover {
    transform: rotate(90deg) scale(1.15);
    box-shadow: 0 10px 30px rgba(255,107,107,0.55);
}

.token-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    color: #4D96FF;
    margin-top: 22px;
    font-size: 16px;
    text-decoration: none;
    padding: 12px;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(77,150,255,0.15), rgba(107,203,119,0.15));
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(255,255,255,0.3);
}

.link-icon {
    animation: sparkle 2s ease-in-out infinite;
}

.token-link:hover {
    background: linear-gradient(145deg, rgba(77,150,255,0.25), rgba(107,203,119,0.25));
    transform: scale(1.05);
    box-shadow: 
        inset 0 2px 5px rgba(255,255,255,0.3),
        0 5px 15px rgba(77,150,255,0.25);
}

.footer-decoration {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    animation: fade-in 0.8s ease-out;
}

.footer-flower {
    font-size: 22px;
    animation: wiggle 1.5s ease-in-out infinite;
}

.footer-flower {
    font-size: 26px;
    animation: flower-sway 3s ease-in-out infinite;
}

.footer-flower {
    font-size: 20px;
    animation: wiggle 1.5s ease-in-out infinite;
}

.flower-1 { animation-delay: 0s; }
.flower-2 { animation-delay: 0.3s; }
.flower-3 { animation-delay: 0.6s; }
.flower-4 { animation-delay: 0.9s; }

#game-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
}

#game-canvas {
    flex: 1;
    width: 100%;
    background: linear-gradient(180deg, #87CEEB 0%, #98FB98 100%);
}

.control-area {
    position: fixed;
    bottom: 35px;
    left: 35px;
    right: 35px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 50;
}

.joystick-container {
    width: 145px;
    height: 145px;
}

.joystick-base {
    width: 145px;
    height: 145px;
    background: linear-gradient(145deg, #FFFACD 0%, #FFE5B4 40%, #FFDAB9 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 
        0 12px 35px rgba(255,150,100,0.35),
        inset 0 -10px 25px rgba(255,150,100,0.25),
        inset 0 10px 25px rgba(255,255,255,0.55);
    border: 5px solid #FFD93D;
    animation: breathe 3.5s ease-in-out infinite;
}

.joystick-outer-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 3px dashed rgba(255,140,50,0.4);
    border-radius: 50%;
    animation: sun-rotate 30s linear infinite reverse;
}

.joystick-inner-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 2px solid rgba(255,217,61,0.5);
    border-radius: 50%;
}

.joystick-stars {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
}

.joystick-star {
    position: absolute;
    color: #FFD93D;
    font-size: 12px;
    animation: star-twinkle 2s ease-in-out infinite;
}

.star-1 { top: 0; left: 50%; transform: translateX(-50%); animation-delay: 0s; }
.star-2 { top: 25%; right: 10%; animation-delay: 0.3s; }
.star-3 { top: 50%; right: 0; transform: translateY(-50%); animation-delay: 0.6s; }
.star-4 { bottom: 25%; right: 10%; animation-delay: 0.9s; }
.star-5 { bottom: 0; left: 50%; transform: translateX(-50%); animation-delay: 1.2s; }
.star-6 { top: 50%; left: 0; transform: translateY(-50%); animation-delay: 1.5s; }

.joystick-stick {
    width: 65px;
    height: 65px;
    background: radial-gradient(circle at 30% 30%, #FF6B9D 0%, #FF6B6B 30%, #FF8C32 60%, #FFD93D 100%);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 
        0 8px 20px rgba(255,140,50,0.5),
        inset 0 -5px 12px rgba(255,100,50,0.4),
        inset 0 5px 12px rgba(255,255,255,0.5);
    transition: transform 0.15s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: stick-bounce 2s ease-in-out infinite;
    z-index: 10;
}

.stick-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
}

.stick-eye {
    position: absolute;
    top: 5px;
    width: 7px;
    height: 8px;
    background: #5D4037;
    border-radius: 50%;
}

.stick-eye-left { left: 3px; }
.stick-eye-right { right: 3px; }

.stick-eye::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 2.5px;
    height: 2.5px;
    background: #fff;
    border-radius: 50%;
}

.stick-mouth {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 5px;
    background: #FF8C32;
    border-radius: 0 0 6px 6px;
}

.stick-highlight {
    position: absolute;
    top: 8px;
    left: 10px;
    width: 18px;
    height: 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
}

.stick-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.stick-sparkle {
    position: absolute;
    font-size: 8px;
    color: #FFD93D;
    animation: star-twinkle 1s ease-in-out infinite;
}

.stick-sparkle:first-child { top: -5px; left: 25%; }
.stick-sparkle:last-child { top: -5px; right: 25%; animation-delay: 0.5s; }

.joystick-direction-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 15px solid rgba(255,140,50,0.6);
    opacity: 0;
    transition: all 0.2s ease;
}

.joystick-base.dragging .joystick-direction-indicator {
    opacity: 1;
}

.joystick-label {
    position: absolute;
    bottom: -35px;
    color: #FFD93D;
    font-size: 15px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
    font-weight: bold;
    animation: wiggle 2s ease-in-out infinite;
}

.button-area {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.button-area .btn {
    padding: 14px 28px;
    font-size: 17px;
    border-radius: 28px;
    min-width: 110px;
}

.info-area {
    position: fixed;
    top: 18px;
    left: 18px;
    right: 18px;
    z-index: 50;
}

#player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(145deg, rgba(255,217,61,0.92) 0%, rgba(255,140,50,0.92) 100%);
    padding: 18px 28px;
    border-radius: 28px;
    color: #5D4037;
    box-shadow: 
        0 10px 30px rgba(255,150,100,0.35),
        inset 0 -4px 12px rgba(255,100,50,0.25),
        inset 0 4px 12px rgba(255,255,255,0.35);
    border: 4px solid rgba(255,200,100,0.35);
    animation: slide-up 0.5s ease-out;
}

#current-player-name {
    font-weight: bold;
    font-size: 22px;
    text-shadow: 2px 2px 0 rgba(255,255,255,0.55);
}

#player-count {
    font-size: 17px;
    padding: 6px 18px;
    background: rgba(255,255,255,0.35);
    border-radius: 18px;
    box-shadow: inset 0 2px 4px rgba(255,150,100,0.2);
}

.settings-panel { max-width: 620px; }

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 4px dashed rgba(255,140,50,0.35);
}

.header-icon {
    font-size: 24px;
    animation: wiggle 2s ease-in-out infinite;
}

.settings-body {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 12px;
}

.settings-body::-webkit-scrollbar {
    width: 14px;
}

.settings-body::-webkit-scrollbar-track {
    background: rgba(255,150,100,0.12);
    border-radius: 12px;
}

.settings-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FFD93D 0%, #FF8C32 100%);
    border-radius: 12px;
    border: 3px solid rgba(255,255,255,0.35);
}

.settings-section {
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 3px dashed rgba(107,203,119,0.35);
    animation: fade-in 0.35s ease-out;
}

.settings-section:last-child { border-bottom: none; }

.settings-section h3 {
    color: #FF6B6B;
    margin-bottom: 22px;
    font-size: 22px;
    text-shadow: 2px 2px 0 rgba(255,255,255,0.55);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-icon {
    font-size: 24px;
    animation: sparkle 2s ease-in-out infinite;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.setting-item label {
    color: #5D4037;
    min-width: 110px;
    font-weight: bold;
    font-size: 17px;
}

.setting-item input[type="text"],
.setting-item input[type="number"],
.setting-item select {
    padding: 14px 20px;
    border: 4px solid #FFD93D;
    border-radius: 22px;
    background: linear-gradient(180deg, #FFFACD 0%, #FFF8DC 100%);
    color: #5D4037;
    font-size: 17px;
    font-family: inherit;
    box-shadow: inset 0 3px 8px rgba(255,150,100,0.25);
    transition: all 0.3s ease;
}

.setting-item input[type="text"]:focus,
.setting-item input[type="number"]:focus,
.setting-item select:focus {
    border-color: #FF8C32;
    outline: none;
    box-shadow: 
        inset 0 3px 8px rgba(255,150,100,0.25),
        0 0 20px rgba(255,200,100,0.35);
}

.setting-item input[type="range"] {
    width: 200px;
    height: 12px;
    -webkit-appearance: none;
    background: linear-gradient(90deg, #FFD93D 0%, #FF8C32 50%, #FF6B6B 100%);
    border-radius: 12px;
    box-shadow: inset 0 3px 5px rgba(255,150,100,0.35);
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    background: radial-gradient(circle at 30% 30%, #FF6B9D 0%, #FF6B6B 40%, #FF8C32 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255,140,50,0.45);
    border: 3px solid rgba(255,255,255,0.45);
    transition: all 0.3s ease;
}

.setting-item input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.setting-item input[type="color"] {
    width: 70px;
    height: 45px;
    border: 4px solid #FFD93D;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(255,150,100,0.25);
    transition: all 0.3s ease;
}

.setting-item input[type="color"]:hover {
    transform: scale(1.12);
    box-shadow: 0 10px 25px rgba(255,150,100,0.35);
}

.setting-item small {
    color: #6BCB77;
    font-size: 14px;
    font-style: italic;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #5D4037;
    cursor: pointer;
    padding: 10px 18px;
    background: linear-gradient(145deg, rgba(255,217,61,0.25), rgba(255,140,50,0.25));
    border-radius: 18px;
    transition: all 0.3s ease;
    font-weight: normal;
    border: 2px solid rgba(255,200,100,0.2);
}

.checkbox-group label:hover {
    background: linear-gradient(145deg, rgba(255,217,61,0.4), rgba(255,140,50,0.4));
    transform: scale(1.08);
    border-color: rgba(255,200,100,0.4);
    box-shadow: 0 5px 15px rgba(255,150,100,0.25);
}

.checkbox-group input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #FF6B6B;
}

.settings-footer {
    display: flex;
    gap: 18px;
    justify-content: center;
    margin-top: 28px;
    flex-wrap: wrap;
}

.chat-panel { max-width: 480px; }

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 4px dashed rgba(255,140,50,0.35);
}

.chat-body textarea {
    width: 100%;
    height: 130px;
    padding: 18px 24px;
    border: 4px solid #FFD93D;
    border-radius: 25px;
    background: linear-gradient(180deg, #FFFACD 0%, #FFF8DC 100%);
    color: #5D4037;
    font-size: 17px;
    font-family: inherit;
    resize: none;
    box-shadow: inset 0 4px 12px rgba(255,150,100,0.25);
    transition: all 0.3s ease;
}

.chat-body textarea:focus {
    border-color: #FF8C32;
    outline: none;
    box-shadow: 
        inset 0 4px 12px rgba(255,150,100,0.25),
        0 0 25px rgba(255,200,100,0.35);
}

.chat-buttons {
    display: flex;
    gap: 18px;
    margin-top: 22px;
}

.chat-body small {
    color: #6BCB77;
    display: block;
    margin-top: 18px;
    font-style: italic;
    text-align: center;
}

.character-list {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 28px;
}

.character-item {
    background: linear-gradient(145deg, rgba(255,217,61,0.35) 0%, rgba(255,140,50,0.35) 100%);
    padding: 22px;
    border-radius: 28px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    flex: 1;
    min-width: 130px;
    border: 4px solid rgba(255,200,100,0.25);
    box-shadow: 0 8px 20px rgba(255,150,100,0.25);
    animation: bounce-in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.character-item:hover {
    background: linear-gradient(145deg, rgba(255,217,61,0.55) 0%, rgba(255,140,50,0.55) 100%);
    transform: translateY(-10px) scale(1.08);
    box-shadow: 0 15px 35px rgba(255,150,100,0.35);
    border-color: rgba(255,200,100,0.5);
}

.character-item.selected {
    background: linear-gradient(145deg, #FFD93D 0%, #FF8C32 100%);
    border: 5px solid #FF6B6B;
    box-shadow: 0 12px 30px rgba(255,140,50,0.45);
    transform: scale(1.05);
}

.character-item-name {
    font-weight: bold;
    color: #5D4037;
    font-size: 20px;
    text-shadow: 2px 2px 0 rgba(255,255,255,0.35);
}

.loading-panel {
    text-align: center;
}

.loading-sun {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 25px;
}

.loading-sun-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35px;
    height: 35px;
    background: radial-gradient(circle, #FFD93D 0%, #FF8C32 50%, #FF6B6B 100%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255,217,61,0.6);
    animation: sun-pulse 1.5s ease-in-out infinite;
}

.loading-sun-rays {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    animation: sun-rotate 3s linear infinite;
}

.loading-sun-rays::before,
.loading-sun-rays::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loading-sun-rays::before {
    width: 10px;
    height: 55px;
    background: linear-gradient(to top, transparent 20%, #FFD93D 40%, transparent 60%, #FF8C32 80%, transparent);
}

.loading-sun-rays::after {
    width: 55px;
    height: 10px;
    background: linear-gradient(to left, transparent 20%, #FFD93D 40%, transparent 60%, #FF8C32 80%, transparent);
}

.loading-spinner {
    width: 65px;
    height: 65px;
    border: 7px solid rgba(255,217,61,0.35);
    border-top-color: #FF6B6B;
    border-right-color: #FF8C32;
    border-bottom-color: #FF6B9D;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 28px;
    box-shadow: 0 8px 25px rgba(255,150,100,0.35);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-text {
    color: #5D4037;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.loading-dot {
    color: #FF6B6B;
    font-size: 14px;
    animation: loading-dot 1.4s ease-in-out infinite;
}

.dot-1 { animation-delay: 0s; }
.dot-2 { animation-delay: 0.2s; }
.dot-3 { animation-delay: 0.4s; }

h2 {
    color: #FF6B6B;
    text-align: center;
    margin-bottom: 18px;
    font-size: 32px;
    text-shadow: 
        3px 3px 0 rgba(255,255,255,0.8),
        -2px -2px 0 rgba(255,140,50,0.3);
    animation: wiggle 2.5s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.game-logo .sparkles {
    position: relative;
    height: 15px;
    margin-top: 5px;
}

.game-logo .sparkle {
    position: relative;
    display: inline-block;
}

@media (max-width: 600px) {
    .overlay-content {
        padding: 15px 20px;
        border-radius: 20px;
        max-height: 95vh;
        width: 95%;
    }
    
    .game-title h1 {
        font-size: 20px;
    }
    
    .sun-decoration-container {
        width: 45px;
        height: 45px;
        margin: 0 auto 5px;
    }
    
    .sun-core {
        width: 22px;
        height: 22px;
    }
    
    .sun-ray {
        height: 12px;
        width: 4px;
    }
    
    .sun-face {
        width: 22px;
        height: 22px;
    }
    
    .sun-eye {
        width: 3px;
        height: 4px;
        top: 5px;
    }
    
    .sun-eye-left { left: 4px; }
    .sun-eye-right { right: 4px; }
    
    .sun-mouth {
        width: 7px;
        height: 4px;
        bottom: 4px;
    }
    
    .character-preview-container {
        margin: 3px 0;
    }
    
    #preview-canvas {
        width: 70px;
        height: 90px;
    }
    
    .preview-label {
        font-size: 10px;
        margin-top: 4px;
    }
    
    .login-form {
        margin-top: 8px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-group label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .form-group input {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .form-buttons {
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
        width: 100%;
    }
    
    .footer-decoration {
        margin-top: 8px;
        gap: 10px;
    }
    
    .footer-flower {
        font-size: 18px;
    }
    
    .game-title h1 {
        font-size: 24px;
    }
    
    .sun-decoration-container {
        width: 50px;
        height: 50px;
        margin: 0 auto 8px;
    }
    
    .sun-core {
        width: 25px;
        height: 25px;
    }
    
    .sun-ray {
        height: 15px;
        width: 4px;
    }
    
    .sun-face {
        width: 25px;
        height: 25px;
    }
    
.sun-eye {
        width: 4px;
        height: 5px;
        top: 6px;
    }
    
    .sun-eye-left { left: 5px; }
    .sun-eye-right { right: 5px; }
    
    .sun-mouth {
        width: 9px;
        height: 4px;
        bottom: 5px;
    }
    
    .sun-eye-left { left: 5px; }
    .sun-eye-right { right: 5px; }
    
    .sun-mouth {
        width: 9px;
        height: 4px;
        bottom: 5px;
    }
    
    .sun-eye-left { left: 4px; }
    .sun-eye-right { right: 4px; }
    
    .sun-mouth {
        width: 12px;
        height: 6px;
        bottom: 6px;
    }
    
    .character-preview-container {
        display: none;
    }
    
.character-preview-container {
        margin: 8px 0;
    }
    
    #preview-canvas {
        width: 80px;
        height: 100px;
    }
    
.preview-label {
    font-size: 11px;
    color: #5D4037;
    margin-top: 5px;
    font-weight: bold;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.8);
}
    
    .login-form {
        margin-top: 10px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-group input {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .form-buttons {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
    }
    
    .footer-decoration {
        margin-top: 10px;
        gap: 12px;
    }
    
    .footer-flower {
        font-size: 20px;
    }
    
    .btn {
        width: 100%;
    }
    
    .control-area {
        flex-direction: column;
        align-items: center;
        gap: 22px;
    }
    
    .joystick-container {
        order: 1;
    }
    
    .button-area {
        order: 2;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .setting-item label {
        min-width: auto;
    }
    
    h2 {
        font-size: 26px;
    }
    
    .floating-bird,
    .floating-butterfly {
        display: none;
    }
}

.toast {
    padding: 18px 35px;
    border-radius: 25px;
    font-size: 17px;
    animation: bounce-in 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    margin-bottom: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    font-weight: bold;
    border: 4px solid rgba(255,255,255,0.35);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-success {
    background: linear-gradient(145deg, #6BCB77 0%, #4D96FF 100%);
    color: #FFFACD;
}

.toast-success::before {
    content: '✅';
    font-size: 20px;
}

.toast-error {
    background: linear-gradient(145deg, #FF6B6B 0%, #FF6B9D 100%);
    color: #FFFACD;
}

.toast-error::before {
    content: '❌';
    font-size: 20px;
}

.toast-info {
    background: linear-gradient(145deg, #FFD93D 0%, #FF8C32 100%);
    color: #5D4037;
}

.toast-info::before {
    content: 'ℹ️';
    font-size: 20px;
}

.toast-warning {
    background: linear-gradient(145deg, #4D96FF 0%, #6BCB77 100%);
    color: #FFFACD;
}

.toast-warning::before {
    content: '⚠️';
    font-size: 20px;
}

@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translateY(-25px) scale(0.85);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-25px) scale(0.85);
    }
}

@supports (-webkit-touch-callout: none) {
    body {
        position: fixed;
        width: 100%;
        height: 100%;
    }
    
    .overlay-content {
        -webkit-overflow-scrolling: touch;
    }
}