/* --- Global & Background --- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #050510; /* Darker space blue */
    color: #fff;
    overflow-x: hidden;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
}

/* --- Shooting Stars (Fixed & Enhanced) --- */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Ensure it's behind content but visible */
    pointer-events: none;
    overflow: hidden;
}

.star {
    position: absolute;
    height: 2px;
    /* Tail (Left/Transparent) -> Head (Right/White). Rotated -45deg so Tail is TL, Head is BR */
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    opacity: 0;
    animation: shooting-star-anim ease-in-out infinite;
    width: 120px; /* Slightly shorter for realism */
    border-radius: 2px; /* Rounded ends */
}

/* The glowing head of the star */
.star::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 0; /* Head is at the "front" (bottom-right) */
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 
        0 0 10px #fff, 
        0 0 20px #fff,
        0 0 30px #00c6ff; /* Blueish tint for sci-fi feel */
}

/* Remove the old pseudo-elements */
.star::before {
    display: none;
}

@keyframes shooting-star-anim {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(45deg) scale(0.5);
    }
    10% { opacity: 1; }
    80% { opacity: 1; }
    100% {
        opacity: 0;
        transform: translateX(600px) translateY(600px) rotate(45deg) scale(1.0);
    }
}

/* --- Premium Glassmorphism (3D & Light Effect - Dark Mode) --- */
/* Base Glass Style - Visuals Only */
.glass-style {
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    color: #fff;
    position: relative;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Glass Panel - Layout + Visuals */
.glass-panel {
    /* Inherit visual styles */
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    color: #fff;
    position: relative;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    
    /* Layout specific */
    border-radius: 24px;
    padding: 30px;
}

/* Add a subtle shine animation to glass elements */
.glass-style::before, .glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: shine 6s infinite;
    pointer-events: none;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

/* --- Navigation & Language Toggle --- */
.nav-toggle {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1000;
    cursor: pointer;
    font-size: 24px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.lang-toggle {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 1000;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-toggle:hover, .lang-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* --- Modal (Refined - Dark Neon Style) --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent scrolling on body when modal is open */
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(15px);
    animation: fadeIn 0.3s;
    /* Flexbox for perfect centering */
    align-items: center;
    justify-content: center;
}

/* When JS sets display: flex, these rules apply. 
   We don't need the [style*="display: none"] hack if JS toggles correctly. */

.modal-content {
    background: rgba(20, 20, 25, 0.9); /* Slightly more opaque */
    margin: auto; /* Fallback */
    padding: 40px;
    border-radius: 30px;
    width: 90%;
    max-width: 380px;
    /* Neon Glow Border */
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 
        0 0 40px rgba(0,0,0,0.8),
        inset 0 0 0 1px rgba(255,255,255,0.1),
        0 0 20px rgba(80, 200, 255, 0.1); /* Blueish glow */
    text-align: center;
    color: #fff;
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-header {
    margin-bottom: 15px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255,255,255,0.5);
    background: linear-gradient(to bottom, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 3D Neon Buttons (Vibrant Style) */
.modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 20px;
    margin: 0; /* Reset margin, use gap */
    border: none;
    border-radius: 50px; /* Pill shape */
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    
    /* 3D Glassy Look */
    box-shadow: 
        0 10px 20px -10px rgba(0,0,0,0.5),
        inset 0 2px 0 rgba(255,255,255,0.2),
        inset 0 -2px 0 rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
}

.modal-btn span {
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Hover Effects */
.modal-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 15px 30px -10px rgba(0,0,0,0.6),
        inset 0 2px 0 rgba(255,255,255,0.3),
        0 0 15px rgba(255,255,255,0.2); /* Outer glow */
}

.modal-btn:active {
    transform: translateY(1px);
    box-shadow: 0 5px 10px -5px rgba(0,0,0,0.4);
}

/* Vibrant Gradients (Matching Reference Image 3) */
.btn-blue { 
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%); 
}
.btn-purple { 
    background: linear-gradient(135deg, #b721ff 0%, #21d4fd 100%); 
}
.btn-orange { 
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #feada6 100%); 
    /* Make orange a bit more vibrant/pinkish like the image */
    background: linear-gradient(135deg, #ff6a88 0%, #ff99ac 100%);
}
/* Add a new Cyan/Green variant if needed, or stick to these 3 */

.close-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 24px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s;
}

.close-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) rotate(90deg);
}

.close-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 24px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s;
}

.close-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) rotate(90deg);
}

.modal-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 15px 30px -10px rgba(0,0,0,0.6),
        inset 0 2px 0 rgba(255,255,255,0.3),
        0 0 15px rgba(255,255,255,0.2); /* Outer glow */
}

.modal-btn:active {
    transform: translateY(1px);
    box-shadow: 0 5px 10px -5px rgba(0,0,0,0.4);
}

/* Gradient Styles (Refined) */
.btn-blue { 
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%); 
}
.btn-purple { 
    background: linear-gradient(135deg, #b721ff 0%, #21d4fd 100%); 
}
.btn-orange { 
    background: linear-gradient(135deg, #ff6a88 0%, #ff99ac 100%);
}

/* --- Team Page Styles --- */
.team-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 20px;
}

.team-item {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 20px;
    width: 150px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
    border: 1px solid rgba(255,255,255,0.2);
}

.team-item:hover {
    transform: translateY(-10px);
    background: rgba(255,255,255,0.2);
}

.team-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 3px solid rgba(255,255,255,0.5);
}

.team-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.team-role {
    font-size: 0.9em;
    color: #ddd;
}

/* --- Typing Animation --- */
.typing-container {
    text-align: center;
    margin-top: 15vh; /* Moved up */
    text-shadow: 0 0 20px rgba(255,255,255,0.6);
    position: relative;
    z-index: 1;
}

.typing-text {
    font-family: 'Ma Shan Zheng', cursive;
    white-space: nowrap;
    overflow: hidden;
    margin: 0 auto;
    display: inline-block;
    border-right: 3px solid rgba(255,255,255,0.8);
}

#main-title {
    font-size: 5em;
    margin-bottom: 10px;
    background: linear-gradient(to bottom, #fff, #e0e0e0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#sub-title {
    font-size: 2em;
    color: #ddd;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 300;
    letter-spacing: 2px;
}

/* --- Music Player Widget --- */
.music-widget-container {
    position: fixed;
    bottom: 80px;
    right: 30px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.music-player {
    width: 50px;
    height: 50px;
    padding: 0 !important; /* Fix for glass-panel padding */
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 
        0 5px 15px rgba(0,0,0,0.3),
        inset 0 0 10px rgba(255,255,255,0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.music-player:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

.netease-player-wrapper {
    /* Hidden by default, toggled via JS */
    opacity: 0;
    transform: translateX(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.4s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 0; /* Remove padding for APlayer */
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    width: 300px; /* Fixed width for APlayer */
    overflow: hidden;
}

/* APlayer Customization for Glass Theme */
.aplayer {
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.aplayer .aplayer-body {
    background: transparent !important;
}
.aplayer .aplayer-info {
    border-bottom: none !important;
}
.aplayer .aplayer-info .aplayer-music .aplayer-title {
    color: #fff !important;
}
.aplayer .aplayer-info .aplayer-music .aplayer-author {
    color: #ddd !important;
}
.aplayer .aplayer-lrc:before, .aplayer .aplayer-lrc:after {
    background: transparent !important; /* Remove gradient mask */
}
.aplayer .aplayer-lrc p {
    color: #ccc !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.aplayer .aplayer-list ol li {
    border-top: 1px solid rgba(255,255,255,0.1) !important;
}
.aplayer .aplayer-list ol li:hover {
    background: rgba(255,255,255,0.1) !important;
}
.aplayer .aplayer-list ol li.aplayer-list-light {
    background: rgba(255,255,255,0.2) !important;
}
.aplayer .aplayer-list ol li .aplayer-list-title {
    color: #fff !important;
}
.aplayer .aplayer-list ol li .aplayer-list-author {
    color: #ddd !important;
}

.netease-player-wrapper.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: all;
}

/* Keep the old controls hidden if we are using Netease */
.music-controls {
    display: none;
}

/* --- Admin Dashboard (Enhanced) --- */
.admin-container {
    display: flex;
    min-height: 80vh;
    gap: 20px;
    padding: 20px;
}

.admin-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.admin-content {
    flex-grow: 1;
}

.admin-card {
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.admin-nav-item {
    display: block;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    transition: background 0.3s;
}

.admin-nav-item:hover, .admin-nav-item.active {
    background: rgba(255,255,255,0.2);
}

input[type="text"], input[type="password"], textarea, select {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.3);
    color: #fff;
    box-sizing: border-box;
}

input[type="file"] {
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    width: 100%;
}

/* --- Member Modal Specifics --- */
.member-card {
    width: 95%;
    max-width: 1000px !important; /* Increased width further for better gallery view */
    padding: 0 !important;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(30, 30, 40, 0.95) !important;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.member-header-banner {
    height: 160px; /* Taller banner */
    /* Glass Effect */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        inset 0 0 20px rgba(255,255,255,0.1),
        0 5px 15px rgba(0,0,0,0.2);
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Add a subtle shine/gradient overlay to the glass */
.member-header-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0) 60%);
    transform: rotate(30deg);
    pointer-events: none;
}

.close-btn-member {
    position: absolute;
    top: 15px;
    right: 15px;
    color: rgba(255,255,255,0.8);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
    z-index: 10;
}

.close-btn-member:hover {
    color: #fff;
    transform: scale(1.1);
}

.member-body {
    padding: 0 30px 30px;
    margin-top: -80px; /* Pull avatar up more */
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Target ONLY the avatar image using the direct child selector or ID */
.member-body > img {
    width: 160px; /* Larger Avatar */
    height: 160px;
    border-radius: 50%;
    border: 6px solid rgba(30, 30, 40, 1); /* Match card bg */
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    object-fit: cover;
    background: #fff;
    z-index: 2;
    margin-bottom: 15px;
}

#modal-name {
    margin-top: 5px;
    margin-bottom: 5px;
    font-size: 2.2em; /* Larger Name */
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#modal-role {
    color: #00c6ff;
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 1em;
    background: rgba(0, 198, 255, 0.1);
    padding: 5px 20px;
    border-radius: 20px;
    border: 1px solid rgba(0, 198, 255, 0.2);
}

.member-desc-box {
    background: rgba(255,255,255,0.03);
    padding: 30px;
    border-radius: 15px;
    width: 100%;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.05);
    max-height: 500px; /* Taller scroll area */
    overflow-y: auto;
}

/* Custom Scrollbar for description */
.member-desc-box::-webkit-scrollbar {
    width: 6px;
}
.member-desc-box::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
}
.member-desc-box::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}
.member-desc-box::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.4);
}

.member-desc-box p {
    margin: 0 0 10px 0;
    line-height: 1.6;
    color: #ccc;
    font-size: 1em;
}

/* Content Styling for Rich Text Descriptions */
.member-detail-content h4 {
    color: #00c6ff;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px;
    text-shadow: 0 0 10px rgba(0, 198, 255, 0.3);
}

.member-detail-content ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.member-detail-content li {
    margin-bottom: 10px;
    color: #ddd;
    font-size: 1em;
    line-height: 1.6;
}

/* --- Reward Gallery Styles --- */
.reward-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Much larger columns */
    gap: 20px;
    margin-top: 25px;
}

.reward-frame {
    position: relative;
    border-radius: 12px; /* Rounded corners, not round */
    overflow: hidden;
    background: #000;
    border: 2px solid rgba(255, 215, 0, 0.3); /* Gold tint border */
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    cursor: pointer;
    aspect-ratio: 4/3; /* Fixed aspect ratio for uniformity */
}

.reward-frame:hover {
    transform: scale(1.05);
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
    z-index: 10;
}

/* --- Chat Widget --- */
/* Toggle Button Positioned above Live2D */
.chat-toggle-btn {
    position: fixed;
    bottom: 320px; /* Adjusted to be above Live2D head */
    left: 40px;    /* Slightly offset */
    z-index: 950;
    width: 50px;
    height: 50px;
    padding: 0 !important; /* Fix for glass-panel padding */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: float 3s ease-in-out infinite;
}

.chat-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Chat Box Centered */
.chat-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px; /* Increased width */
    height: 700px; /* Increased height */
    display: none; /* Hidden by default */
    flex-direction: column;
    background: rgba(20, 20, 30, 0.95); /* Darker bg */
    border-radius: 30px; /* More rounded corners */
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    z-index: 1000; /* High z-index */
    animation: fadeIn 0.3s ease;
}

.chat-header {
    padding: 15px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-weight: bold;
}

.close-chat {
    font-size: 24px;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    transition: color 0.3s;
    line-height: 1;
}

.close-chat:hover {
    color: #fff;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 5px;
}
.chat-messages::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.message {
    padding: 8px 12px;
    border-radius: 10px;
    max-width: 85%;
    font-size: 0.9em;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.system {
    background: rgba(0, 198, 255, 0.2);
    color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.message.user {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-input-area {
    padding: 10px;
    background: rgba(0,0,0,0.2);
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.chat-input-area input {
    flex-grow: 1;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    color: #fff;
    outline: none;
}

.chat-input-area input::placeholder {
    color: rgba(255,255,255,0.5);
}

.chat-input-area button {
    background: transparent;
    border: none;
    color: #00c6ff;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-input-area button:hover {
    transform: scale(1.2);
    color: #fff;
}

.reward-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensure the whole certificate is visible */
    background: #1a1a1a; /* Dark background for letterboxing */
    display: block;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.reward-frame:hover img {
    opacity: 1;
}

.reward-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.7em;
    padding: 4px;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.reward-frame:hover .reward-caption {
    transform: translateY(0);
}

/* --- Other Pages --- */
.finance-grid, .shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.finance-card, .shop-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s;
}

.finance-card:hover, .shop-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.daily-stock {
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    color: #006064;
    border-radius: 25px;
    padding: 25px;
    margin: 30px 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- Footer (Social Icons) --- */
footer {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 25px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.1);
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

footer a:hover {
    color: #fff;
    transform: scale(1.2) translateY(-3px);
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* --- Mobile Responsive Design --- */
@media (max-width: 768px) {
    /* Typography Adjustments */
    #main-title {
        font-size: 2.5em !important;
        margin-top: 10vh;
    }
    
    #sub-title {
        font-size: 1.2em !important;
    }

    .typing-container {
        margin-top: 15vh;
        padding: 0 20px;
    }

    /* Navigation & Toggles */
    .nav-toggle {
        top: 20px;
        right: 20px;
        padding: 8px 12px;
        font-size: 20px;
    }

    .lang-toggle {
        top: 20px;
        left: 20px;
        padding: 8px 15px;
        font-size: 14px;
    }

    /* Chat Widget (Dialogue) - Bottom Right on Mobile */
    .chat-box {
        width: 85%; 
        height: 50vh; /* Shorter */
        bottom: 90px; /* Above the toggle button */
        right: 7.5%; /* Center horizontally relative to screen width roughly */
        left: auto;
        transform: none;
        border-radius: 20px;
    }

    /* Music Player - Bottom Left on Mobile */
    .music-widget-container {
        bottom: 30px !important; 
        left: 20px !important;
        right: auto !important;
        align-items: flex-start; /* Align left */
    }
    
    .music-player {
        width: 50px !important;
        height: 50px !important;
        padding: 0 !important;
        border-radius: 50% !important; /* Circular */
    }

    .netease-player-wrapper {
        width: 260px; 
        transform-origin: bottom left;
        left: 0;
        right: auto;
        margin-bottom: 10px;
    }

    /* Hide Live2D on Mobile (Backup for JS) */
    #waifu, .live2d-widget-container {
        display: none !important;
    }

    /* Footer */
    footer {
        bottom: 10px;
        padding: 5px 10px;
        gap: 15px;
        width: 100%;
        justify-content: center;
        background: rgba(0,0,0,0.5); /* Add background for readability */
        backdrop-filter: blur(5px);
    }

    footer a {
        font-size: 18px;
    }

    /* Modals & Cards - Auto Scaling */
    .modal-content {
        width: 85%;
        max-width: 320px;
        padding: 25px 20px;
        margin: auto;
        gap: 12px;
        border-radius: 20px;
    }
    
    .modal-header {
        margin-bottom: 15px;
    }

    .modal-header h2 {
        font-size: 1.4em;
    }

    .modal-btn {
        padding: 12px 15px;
        font-size: 15px;
        margin-bottom: 0;
        height: auto;
        min-height: 44px;
        border-radius: 12px; /* Softer corners */
    }

    /* Member Card */
    .member-card {
        width: 95% !important;
        max-height: 80vh;
        overflow-y: auto;
        padding: 0 !important;
    }

    .member-header-banner {
        height: 100px;
    }

    .member-body > img {
        width: 100px;
        height: 100px;
        margin-top: 0;
        border: 3px solid rgba(255,255,255,0.2);
    }
    
    .member-body {
        margin-top: -50px;
        padding: 15px;
    }

    #modal-name {
        font-size: 1.5em;
    }
    
    #modal-role {
        font-size: 1em;
    }

    /* Grids & Layouts */
    .reward-gallery {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
        gap: 10px;
    }
    
    .finance-grid, .shop-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0;
    }

    /* Glass Panel Adjustments - General */
    .glass-panel {
        width: 92% !important;
        margin: 15px auto !important;
        padding: 20px;
        margin-bottom: 80px !important; /* Space for bottom widgets */
    }

    /* --- Floating Widgets (Mobile Optimized) --- */
    .chat-toggle-btn, 
    .music-player {
        width: 50px !important;
        height: 50px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        /* Ensure glass style doesn't override size */
        box-sizing: border-box !important;
    }

    .chat-toggle-btn {
        bottom: 30px !important; 
        right: 20px !important;
        left: auto !important;
    }

    .music-widget-container {
        bottom: 30px !important; 
        left: 20px !important;
        right: auto !important;
        width: auto !important;
        margin: 0 !important;
        align-items: flex-start !important;
    }
    
    /* Specific adjustments for content pages */
    .team-list {
        justify-content: center;
    }
    
    .team-item {
        width: 45%;
        min-width: 130px;
    }

    /* Cloud List */
    .cloud-item {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .cloud-item .modal-btn {
        width: 100%;
        text-align: center;
    }
}

/* --- Enhanced Mobile Optimization (User Request) --- */
@media (max-width: 768px) {
    /* Ensure Nav Toggle is a perfect circle and well positioned */
    .nav-toggle {
        top: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        border-radius: 50%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Ensure Lang Toggle is well positioned */
    .lang-toggle {
        top: 20px;
        left: 20px;
        padding: 8px 15px;
        font-size: 14px;
    }

    /* Adjust Typing Text for Mobile */
    .typing-text#main-title {
        font-size: 2.5em !important;
        text-align: center;
    }
    .typing-text#sub-title {
        font-size: 1.2em !important;
        text-align: center;
    }
    
    /* Chat Box Full Screen on Mobile */
    .chat-box {
        width: 95% !important;
        height: 80vh !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        border-radius: 20px !important;
    }

    /* Ensure Chat Toggle is circular */
    .chat-toggle-btn {
        width: 50px !important;
        height: 50px !important;
        border-radius: 50% !important;
        bottom: 80px !important;
        right: 20px !important;
        left: auto !important;
    }
    
    /* Ensure Music Player is circular */
    .music-player {
        width: 50px !important;
        height: 50px !important;
        border-radius: 50% !important;
    }
}


/* --- Refined UI & Mobile Layout (User Request 2) --- */

/* Finance Hall Improvements */
.finance-grid {
    gap: 15px;
}

.finance-card {
    background: rgba(30, 30, 40, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.finance-card h4 {
    font-size: 1.1em;
    color: #aaa;
    margin: 0 0 10px 0;
    font-weight: normal;
}

.finance-card p:nth-of-type(1) { /* Price */
    font-size: 2em !important;
    font-weight: 700 !important;
    margin: 5px 0;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.finance-card p:nth-of-type(2) { /* Change */
    font-size: 1em;
    margin: 0;
    font-weight: 500;
}

/* Team Page Improvements */
.team-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    padding: 10px;
    justify-content: center;
}

.team-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.team-item:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.08);
}

.team-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.team-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.team-role {
    font-size: 0.85em;
    color: #00c6ff;
    background: rgba(0, 198, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Member Modal Detail Improvements */
.member-card {
    background: linear-gradient(180deg, rgba(30,30,40,0.95) 0%, rgba(20,20,30,0.98) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    max-width: 90%;
    width: 340px; /* Optimal mobile width */
    border-radius: 24px;
    overflow: hidden;
}

.member-header-banner {
    height: 120px;
    background: linear-gradient(45deg, #4b0000, #1a0505); /* Dark Red theme from screenshot */
    position: relative;
}

.close-btn-member {
    position: absolute;
    top: 15px;
    right: 15px;
    color: rgba(255,255,255,0.7);
    font-size: 28px;
    background: rgba(0,0,0,0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.member-body {
    padding: 0 25px 30px 25px;
    text-align: center;
    margin-top: -60px; /* Pull up avatar */
    position: relative;
}

.member-body img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #1e1e28; /* Match card bg */
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    object-fit: cover;
    margin-bottom: 15px;
}

#modal-name {
    font-size: 1.8em;
    margin: 0 0 5px 0;
    font-weight: bold;
}

#modal-role {
    display: inline-block;
    font-size: 0.9em;
    color: #00c6ff;
    border: 1px solid rgba(0, 198, 255, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 25px;
    background: rgba(0, 198, 255, 0.05);
}

.member-desc-box {
    text-align: left;
    background: rgba(255,255,255,0.03);
    padding: 20px;
    border-radius: 16px;
    font-size: 0.95em;
    line-height: 1.6;
    color: #ddd;
    border: 1px solid rgba(255,255,255,0.05);
}

/* Mobile Overrides */
@media (max-width: 768px) {
    /* Floating Buttons Alignment */
    .chat-toggle-btn {
        bottom: 60px !important;
        right: 25px !important;
        left: auto !important;
        width: 55px !important;
        height: 55px !important;
        box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    }

    .music-widget-container {
        bottom: 60px !important;
        left: 25px !important;
        right: auto !important;
        width: auto !important;
        margin: 0 !important;
    }

    .music-player {
        width: 55px !important;
        height: 55px !important;
        box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    }

    /* Content Padding */
    .glass-panel {
        padding: 20px 15px !important;
        width: 94% !important;
    }
    
    /* Finance Grid Mobile */
    .finance-grid {
        grid-template-columns: 1fr; /* Single column */
    }
    
    /* Team Grid Mobile */
    .team-list {
        grid-template-columns: repeat(2, 1fr); /* 2 columns */
        gap: 12px;
    }
    
    .team-item {
        padding: 15px 5px;
    }
    
    .team-avatar {
        width: 70px;
        height: 70px;
    }
}

