/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #0d0d15;
    color: #fff;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* App Container */
.app {
    max-width: 750px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: #0d0d15;
    position: relative;
    padding-bottom: 60px;
}

/* Header */
.header {
    background: linear-gradient(180deg, #1a1a2e 0%, #0d0d15 100%);
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
}

.avatar {
    position: relative;
    width: auto;
    height: 35px;
}

.avatar img {
    width: auto;
    height: 35px;
    border-radius: 50%;
}

.avatar .level {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #000;
    font-size: 8px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 6px;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
}

/* Hamburger Menu */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #ffd700;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger:hover span:nth-child(1) {
    transform: translateX(-3px);
}

.hamburger:hover span:nth-child(3) {
    transform: translateX(3px);
}

/* Language Wrapper */
.lang-wrapper {
    position: relative;
}

/* Language Button */
.lang-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: rgba(255, 215, 0, 0.2);
}

.lang-btn svg {
    width: 14px;
    height: 14px;
    color: #ffd700;
    transition: transform 0.3s;
}

.lang-wrapper.active .lang-btn svg {
    transform: rotate(180deg);
}

.lang-flag {
    font-size: 14px;
}

.lang-text {
    font-size: 12px;
    color: #ffd700;
    font-weight: 500;
}

/* Language Dropdown */
.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #1a1a2e;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 6px;
    min-width: 120px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.lang-option:hover {
    background: rgba(255, 215, 0, 0.1);
}

.lang-option.active {
    background: rgba(255, 215, 0, 0.2);
}

.lang-option .lang-flag {
    font-size: 16px;
}

.lang-option span:last-child {
    font-size: 13px;
    color: #fff;
}

/* Banner Carousel */
.banner-section {
    position: relative;
    overflow: hidden;
    margin: 12px;
    border-radius: 12px;
}

.carousel {
    position: relative;
    width: 100%;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease-out;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 160px;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
}

.banner-overlay h3 {
    font-size: 18px;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 4px;
}

.banner-overlay p {
    font-size: 12px;
    color: #ccc;
}

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: #ffd700;
    width: 20px;
    border-radius: 4px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 16px 8px;
    margin: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    cursor: pointer;
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.action-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.action-icon.purple {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.action-icon.red {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.action-icon.blue {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.action-icon.orange {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.action-item span {
    font-size: 11px;
    color: #aaa;
}

.badge {
    position: absolute;
    top: -2px;
    right: 4px;
    background: #e74c3c;
    color: #fff;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 8px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Announcement */
.announcement {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    margin: 0 12px 12px;
    padding: 12px;
    border-radius: 8px;
    gap: 10px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.announcement-icon {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    font-weight: bold;
}

.announcement-content {
    flex: 1;
    overflow: hidden;
    height: 24px;
}

.announcement-scroll {
    animation: scrollAnnouncement 8s linear infinite;
}

@keyframes scrollAnnouncement {
    0% {
        transform: translateY(0);
    }
    33.33% {
        transform: translateY(-24px);
    }
    66.66% {
        transform: translateY(-48px);
    }
    100% {
        transform: translateY(0);
    }
}

.announcement-item {
    font-size: 12px;
    color: #ffd700;
    line-height: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.announcement-arrow {
    color: #555;
    cursor: pointer;
}

.announcement-arrow svg {
    width: 20px;
    height: 20px;
}

/* Content Section - Tab + Grid Layout */
.content-section {
    display: flex;
    margin: 0 12px 12px;
    border-radius: 12px;
    overflow: hidden;
    height: 400px;
}

.tabs-sidebar {
    width: 76px;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.tab-item {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 4px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    border-left: 3px solid transparent;
    flex-shrink: 0;
}

.tab-item span {
    font-size: 11px;
    color: #888;
    text-align: center;
    line-height: 1.4;
}

.tab-item.active {
    background: rgba(255, 215, 0, 0.15);
    border-left-color: #ffd700;
}

.tab-item.active span {
    color: #ffd700;
    font-weight: bold;
}

.content-area {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    height: 100%;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Product Grid - 3 columns */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.game-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.game-card:active {
    transform: scale(0.98);
}

.game-image {
    position: relative;
    width: 100%;
    padding-bottom: 120%;
    background: #1a1a2e;
    overflow: hidden;
}

.game-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.game-tag.hot {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.game-tag.recommend {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.game-tag.new {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.game-info {
    padding: 8px;
}

.game-title {
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-players {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #888;
}

.game-players svg {
    width: 12px;
    height: 12px;
}

.game-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #000;
    font-size: 10px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 10px;
    cursor: pointer;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 750px;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.98) 0%, rgba(13, 13, 21, 0.99) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    position: relative;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    color: #666;
}

.nav-item span {
    font-size: 10px;
    color: #666;
}

.nav-item.active svg {
    color: #ffd700;
}

.nav-item.active span {
    color: #ffd700;
}

/* Mobile Responsive */
@media screen and (max-width: 375px) {
    .tabs-sidebar {
        width: 68px;
    }
    
    .tab-item span {
        font-size: 10px;
    }
    
    .game-title {
        font-size: 11px;
    }
}

/* Scrollbar Styling */
.content-area::-webkit-scrollbar {
    width: 4px;
}

.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 2px;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 90%;
    max-width: 360px;
    background: linear-gradient(180deg, #1a1a2e 0%, #0d0d15 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s;
    position: relative;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.modal-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffd700;
}

.modal-logo img {
    height: 35px;
    width: auto;
}

.modal-logo svg {
    width: 24px;
    height: 24px;
}

.modal-logo span {
    font-size: 16px;
    font-weight: bold;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
    z-index: 10;
}

.modal-close:hover {
    opacity: 1;
}

.modal-close svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.modal-tab {
    flex: 1;
    text-align: center;
    padding: 14px;
    font-size: 15px;
    color: #888;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.modal-tab.active {
    color: #ffd700;
    font-weight: bold;
}

.modal-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #ffd700, #ff8c00);
    border-radius: 3px 3px 0 0;
}

.modal-content {
    padding: 20px;
}

.form-panel {
    display: none;
}

.form-panel.active {
    display: block;
}

.form-group {
    margin-bottom: 16px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.form-input::placeholder {
    color: #666;
}

.form-input:focus {
    border-color: #ffd700;
}

.code-group {
    display: flex;
    gap: 10px;
}

.code-group .form-input {
    flex: 1;
}

.code-btn {
    padding: 0 16px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
}

.remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #ffd700;
}

.forgot {
    font-size: 12px;
    color: #ffd700;
    text-decoration: none;
}

.forgot:hover {
    text-decoration: underline;
}

.form-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.form-btn:active {
    transform: scale(0.98);
}

.login-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #000;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.register-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.social-login {
    margin-top: 20px;
    text-align: center;
}

.social-login > span {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
    position: relative;
}

.social-login > span::before,
.social-login > span::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 60px;
    height: 1px;
    background: rgba(255, 215, 0, 0.2);
}

.social-login > span::before {
    left: 0;
}

.social-login > span::after {
    right: 0;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
}

.social-icon:hover {
    background: rgba(255, 215, 0, 0.2);
}

.social-icon svg {
    width: 22px;
    height: 22px;
    color: #ffd700;
}

.agree {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 11px;
    color: #888;
    cursor: pointer;
    line-height: 1.5;
}

.agree input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    accent-color: #ffd700;
    flex-shrink: 0;
}

.agree a {
    color: #ffd700;
    text-decoration: none;
}

.agree a:hover {
    text-decoration: underline;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 16px 24px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon.error {
    background: #e74c3c;
}

.toast-icon.error::after {
    content: '✕';
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.toast-icon.success {
    background: #2ecc71;
}

.toast-icon.success::after {
    content: '✓';
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.toast-icon.loading {
    background: transparent;
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-top-color: #ffd700;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.toast-msg {
    color: #fff;
    font-size: 14px;
}

/* Activity Popup */
.activity-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.activity-overlay.active {
    opacity: 1;
    visibility: visible;
}

.activity-modal {
    width: 90%;
    max-width: 340px;
    background: linear-gradient(180deg, #1a1a2e 0%, #0d0d15 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s;
}

.activity-overlay.active .activity-modal {
    transform: scale(1) translateY(0);
}

.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.activity-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffd700;
    font-weight: bold;
    font-size: 16px;
}

.activity-badge svg {
    width: 20px;
    height: 20px;
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.activity-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.activity-close:hover {
    opacity: 1;
}

.activity-close svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.activity-content {
    padding: 20px;
}

.activity-title {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
}

.activity-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.activity-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.activity-text {
    flex: 1;
}

.activity-text strong {
    display: block;
    color: #ffd700;
    font-size: 14px;
    margin-bottom: 4px;
}

.activity-text p {
    color: #aaa;
    font-size: 12px;
    line-height: 1.4;
}

.activity-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    color: #888;
    font-size: 12px;
}

.activity-time svg {
    width: 16px;
    height: 16px;
}

.activity-footer {
    padding: 0 20px 20px;
}

.activity-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    border: none;
    border-radius: 25px;
    color: #000;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.activity-btn:active {
    transform: scale(0.98);
}

.activity-btn:hover {
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}
