/* Title Screen Styles - Modern Dark Theme */

#title-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

/* Animated grid background */
.grid-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(rgba(100, 200, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 200, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridPulse 4s ease-in-out infinite;
}

.grid-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(rgba(100, 200, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 200, 255, 0.05) 1px, transparent 1px);
    background-size: 200px 200px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(200px, 200px); }
}

/* Scanning line effect */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(100, 200, 255, 0.4), transparent);
    animation: scanDown 8s linear infinite;
    pointer-events: none;
}

@keyframes scanDown {
    0% { top: -2px; opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Corner decorations */
.corner-decoration {
    position: absolute;
    width: 100px;
    height: 100px;
    pointer-events: none;
}

.corner-decoration.top-left {
    top: 20px;
    left: 20px;
    border-top: 2px solid rgba(100, 200, 255, 0.15);
    border-left: 2px solid rgba(100, 200, 255, 0.15);
}

.corner-decoration.top-right {
    top: 20px;
    right: 20px;
    border-top: 2px solid rgba(100, 200, 255, 0.15);
    border-right: 2px solid rgba(100, 200, 255, 0.15);
}

.corner-decoration.bottom-left {
    bottom: 20px;
    left: 20px;
    border-bottom: 2px solid rgba(100, 200, 255, 0.15);
    border-left: 2px solid rgba(100, 200, 255, 0.15);
}

.corner-decoration.bottom-right {
    bottom: 20px;
    right: 20px;
    border-bottom: 2px solid rgba(100, 200, 255, 0.15);
    border-right: 2px solid rgba(100, 200, 255, 0.15);
}

/* Glowing orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    animation: orbFloat 10s ease-in-out infinite;
}

.glow-orb.orb1 {
    width: 300px;
    height: 300px;
    background: rgba(60, 140, 200, 0.12);
    top: 20%;
    right: 10%;
    animation-delay: 0s;
}

.glow-orb.orb2 {
    width: 200px;
    height: 200px;
    background: rgba(100, 180, 255, 0.08);
    bottom: 20%;
    left: 20%;
    animation-delay: -5s;
}

.glow-orb.orb3 {
    width: 150px;
    height: 150px;
    background: rgba(80, 160, 220, 0.08);
    top: 60%;
    right: 30%;
    animation-delay: -3s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -30px) scale(1.1); }
    50% { transform: translate(-10px, 20px) scale(0.95); }
    75% { transform: translate(30px, 10px) scale(1.05); }
}

/* Dust particles animation */
.dust-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(150, 200, 255, 0.4);
    border-radius: 50%;
    animation: floatDust 15s infinite linear;
    pointer-events: none;
}

@keyframes floatDust {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-10vh) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

/* Title logo area */
.title-header {
    position: absolute;
    top: 40px;
    left: 50px;
    z-index: 10;
}

.game-title {
    font-size: 48px;
    font-weight: 300;
    letter-spacing: 8px;
    color: #7dd3fc;
    text-transform: uppercase;
    margin: 0;
    text-shadow: 0 2px 20px rgba(125, 211, 252, 0.3);
    animation: titleFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes titleFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
        letter-spacing: 20px;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: 8px;
    }
}

.game-title span {
    color: #38bdf8;
    animation: titleSpanGlow 3s ease-in-out infinite;
}

@keyframes titleSpanGlow {
    0%, 100% { text-shadow: 0 2px 20px rgba(56, 189, 248, 0.3); }
    50% { text-shadow: 0 2px 30px rgba(56, 189, 248, 0.5), 0 0 40px rgba(56, 189, 248, 0.2); }
}

.game-subtitle {
    font-size: 12px;
    letter-spacing: 4px;
    color: #666;
    text-transform: uppercase;
    margin-top: 5px;
    animation: subtitleFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

@keyframes subtitleFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
        letter-spacing: 8px;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: 4px;
    }
}

/* Menu container */
.title-menu {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

.title-menu .menu-item {
    animation: menuItemSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.title-menu .menu-item:nth-child(1) { animation-delay: 0.1s; }
.title-menu .menu-item:nth-child(3) { animation-delay: 0.15s; }
.title-menu .menu-item:nth-child(4) { animation-delay: 0.2s; }
.title-menu .menu-item:nth-child(5) { animation-delay: 0.25s; }
.title-menu .menu-item:nth-child(6) { animation-delay: 0.3s; }

@keyframes menuItemSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.menu-item {
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 12px 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    font-family: inherit;
}

.menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: #7dd3fc;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 10px rgba(125, 211, 252, 0.5);
}

.menu-item:hover {
    color: #7dd3fc;
    transform: translateX(5px);
    text-shadow: 0 0 20px rgba(125, 211, 252, 0.3);
}

.menu-item:hover::before {
    width: 15px;
}

.menu-item:active {
    transform: translateX(8px) scale(0.98);
}

.menu-item.primary {
    color: #7dd3fc;
    font-size: 16px;
    font-weight: 500;
}

.menu-item.primary:hover {
    color: #a5e8ff;
    text-shadow: 0 0 25px rgba(125, 211, 252, 0.5);
}

.menu-item.primary:hover::before {
    width: 20px;
    background: #a5e8ff;
}

.menu-divider {
    height: 1px;
    background: rgba(100, 100, 100, 0.2);
    margin: 10px 20px;
}

/* Version info */
.version-info {
    position: absolute;
    bottom: 30px;
    left: 50px;
    color: #444;
    font-size: 11px;
    letter-spacing: 1px;
    z-index: 10;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
    transition: color 0.3s ease;
}

.version-info:hover {
    color: #666;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Right side decoration */
.title-decoration {
    position: absolute;
    right: 0;
    top: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(10, 20, 30, 0.3) 100%);
    pointer-events: none;
}

/* Ambient glow */
.ambient-glow {
    position: absolute;
    bottom: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(56, 189, 248, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* Settings Panel */
#settings-panel {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 18, 0.98);
    border: 1px solid rgba(125, 211, 252, 0.2);
    z-index: 100;
    width: 700px;
    max-width: 90vw;
    max-height: 85vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(125, 211, 252, 0.1);
    border-radius: 4px;
}

#settings-panel.active {
    display: block;
    animation: panelSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes panelSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* In-game settings panel styling */
#settings-panel.ingame {
    z-index: 2500;
}

.settings-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 85vh;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(100, 100, 100, 0.2);
    background: rgba(20, 20, 25, 0.5);
}

.settings-header .settings-title {
    color: #7dd3fc;
    font-size: 18px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0;
    padding: 0;
    border: none;
}

.settings-close {
    background: none;
    border: none;
    color: #666;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-close:hover {
    color: #7dd3fc;
    transform: rotate(90deg) scale(1.1);
}

.settings-close:active {
    transform: rotate(90deg) scale(0.95);
}

.settings-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(100, 100, 100, 0.2);
    background: rgba(20, 20, 25, 0.3);
}

.settings-tab {
    background: none;
    border: none;
    color: #666;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    font-family: inherit;
}

.settings-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #7dd3fc;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 10px rgba(125, 211, 252, 0.5);
}

.settings-tab:hover {
    color: #999;
    background: rgba(125, 211, 252, 0.05);
}

.settings-tab:hover::after {
    width: 30%;
}

.settings-tab.active {
    color: #7dd3fc;
    background: rgba(125, 211, 252, 0.08);
}

.settings-tab.active::after {
    width: 100%;
    left: 0;
    transform: translateX(0);
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
    max-height: calc(85vh - 130px);
}

.settings-content::-webkit-scrollbar {
    width: 6px;
}

.settings-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.settings-content::-webkit-scrollbar-thumb {
    background: rgba(125, 211, 252, 0.3);
    border-radius: 3px;
}

.settings-content::-webkit-scrollbar-thumb:hover {
    background: rgba(125, 211, 252, 0.5);
}

.settings-tab-content {
    display: none;
    animation: tabContentFade 0.3s ease;
}

.settings-tab-content.active {
    display: block;
}

@keyframes tabContentFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-section {
    margin-bottom: 25px;
}

.section-title {
    color: #7dd3fc;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(125, 211, 252, 0.15);
    font-weight: 500;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: #888;
    font-size: 13px;
    padding: 8px 12px;
    background: rgba(30, 30, 35, 0.4);
    border-radius: 4px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}

.setting-row:hover {
    background: rgba(45, 45, 55, 0.6);
    border-color: rgba(125, 211, 252, 0.1);
    transform: translateX(3px);
}

.setting-row:hover {
    background: rgba(40, 40, 48, 0.6);
}

.setting-row label {
    letter-spacing: 0.5px;
    color: #aaa;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-value {
    min-width: 45px;
    text-align: right;
    color: #7dd3fc;
    font-size: 12px;
    font-family: monospace;
}

.setting-row input[type="range"] {
    width: 120px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(60, 60, 70, 0.8);
    border-radius: 2px;
    outline: none;
}

.setting-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #7dd3fc;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(125, 211, 252, 0.3);
}

.setting-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 3px 12px rgba(125, 211, 252, 0.5);
}

.setting-row select {
    background: rgba(30, 30, 35, 0.9);
    border: 1px solid rgba(100, 100, 100, 0.3);
    color: #aaa;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
    min-width: 100px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.setting-row select:hover {
    border-color: rgba(125, 211, 252, 0.4);
    background: rgba(40, 40, 48, 0.9);
    transform: scale(1.02);
}

.setting-row select:focus {
    outline: none;
    border-color: #7dd3fc;
    box-shadow: 0 0 15px rgba(125, 211, 252, 0.2);
}

.setting-row input[type="checkbox"] {
    -webkit-appearance: none;
    width: 40px;
    height: 20px;
    background: rgba(60, 60, 70, 0.8);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.setting-row input[type="checkbox"]:hover {
    background: rgba(70, 70, 80, 0.9);
}

.setting-row input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #666;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.setting-row input[type="checkbox"]:checked {
    background: rgba(125, 211, 252, 0.3);
    box-shadow: 0 0 15px rgba(125, 211, 252, 0.2);
}

.setting-row input[type="checkbox"]:checked::after {
    left: 22px;
    background: #7dd3fc;
    box-shadow: 0 2px 8px rgba(125, 211, 252, 0.4);
}

.setting-row input[type="color"] {
    -webkit-appearance: none;
    width: 40px;
    height: 28px;
    border: 1px solid rgba(100, 100, 100, 0.3);
    border-radius: 3px;
    cursor: pointer;
    padding: 2px;
    background: transparent;
}

.setting-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.setting-row input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* Keybind buttons */
.setting-row.keybind {
    padding: 6px 12px;
}

.keybind-btn {
    background: rgba(40, 40, 48, 0.8);
    border: 1px solid rgba(100, 100, 100, 0.3);
    color: #aaa;
    padding: 6px 16px;
    font-size: 11px;
    font-family: monospace;
    letter-spacing: 1px;
    border-radius: 3px;
    cursor: pointer;
    min-width: 80px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.keybind-btn:hover {
    border-color: #7dd3fc;
    color: #7dd3fc;
    background: rgba(125, 211, 252, 0.1);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(125, 211, 252, 0.15);
}

.keybind-btn:active {
    transform: scale(0.98);
}

.keybind-btn:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.keybind-btn.listening {
    border-color: #38bdf8;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    animation: pulse-keybind 1s infinite;
}

@keyframes pulse-keybind {
    0%, 100% { box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2); }
    50% { box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.3); }
}

/* Settings action buttons */
.buttons-row {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.settings-btn {
    background: rgba(40, 40, 48, 0.8);
    border: 1px solid rgba(100, 100, 100, 0.3);
    color: #aaa;
    padding: 10px 20px;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.settings-btn:hover {
    border-color: #7dd3fc;
    color: #7dd3fc;
    background: rgba(125, 211, 252, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(125, 211, 252, 0.15);
}

.settings-btn:active {
    transform: translateY(0) scale(0.98);
}

.settings-btn.danger {
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.settings-btn.danger:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.settings-back {
    margin-top: 20px;
    background: none;
    border: 1px solid rgba(100, 100, 100, 0.3);
    color: #888;
    padding: 8px 20px;
    cursor: pointer;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.2s;
}

.settings-back:hover {
    border-color: #7dd3fc;
    color: #7dd3fc;
}

/* Fade out animation */
#title-screen.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* ==================== Loading Screen ==================== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1001;
    background: #0a0a0a;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#loading-screen.active {
    animation: loadingFadeIn 0.2s ease forwards;
}

#loading-screen.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes loadingFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #7dd3fc;
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
}

@keyframes spinnerRotate {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 0.9rem;
    color: #64748b;
    letter-spacing: 0.05em;
    margin: 0;
}

.loading-tip {
    font-size: 0.8rem;
    color: #475569;
    margin: 0;
    margin-top: 8px;
}

/* Profile Panel */
#profile-panel {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(12, 12, 15, 0.98);
    border: 1px solid rgba(125, 211, 252, 0.2);
    z-index: 100;
    width: 750px;
    max-width: 90vw;
    max-height: 85vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(125, 211, 252, 0.1);
    border-radius: 4px;
}

#profile-panel.active {
    display: block;
    animation: panelSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 85vh;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(100, 100, 100, 0.2);
    background: rgba(20, 20, 25, 0.5);
}

.profile-title {
    color: #7dd3fc;
    font-size: 18px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-close {
    background: none;
    border: none;
    color: #666;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-close:hover {
    color: #7dd3fc;
    transform: rotate(90deg) scale(1.1);
}

.profile-close:active {
    transform: rotate(90deg) scale(0.95);
}

.profile-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    max-height: calc(85vh - 75px);
}

.profile-content::-webkit-scrollbar {
    width: 6px;
}

.profile-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.profile-content::-webkit-scrollbar-thumb {
    background: rgba(125, 211, 252, 0.3);
    border-radius: 3px;
}

.profile-section {
    margin-bottom: 30px;
}

.profile-section:last-child {
    margin-bottom: 0;
}

.profile-section-title {
    color: #7dd3fc;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(125, 211, 252, 0.15);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-section-title svg {
    opacity: 0.7;
}

.achievement-progress {
    margin-left: auto;
    font-size: 11px;
    color: #888;
    font-weight: 400;
    letter-spacing: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.stat-card {
    background: rgba(25, 25, 30, 0.8);
    border: 1px solid rgba(60, 60, 70, 0.4);
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card:hover {
    border-color: rgba(125, 211, 252, 0.4);
    background: rgba(35, 35, 45, 0.9);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(125, 211, 252, 0.1);
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #7dd3fc;
    margin-bottom: 5px;
    font-family: 'Segoe UI', monospace;
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-value {
    transform: scale(1.1);
}

.stat-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.achievement-card {
    background: rgba(25, 25, 30, 0.6);
    border: 1px solid rgba(50, 50, 55, 0.5);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.5;
}

.achievement-card.unlocked {
    opacity: 1;
    background: rgba(30, 30, 38, 0.8);
    border-color: rgba(var(--ach-r, 125), var(--ach-g, 211), var(--ach-b, 252), 0.3);
}

.achievement-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.achievement-card.unlocked:hover {
    border-color: rgba(var(--ach-r, 125), var(--ach-g, 211), var(--ach-b, 252), 0.6);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(var(--ach-r, 125), var(--ach-g, 211), var(--ach-b, 252), 0.15);
}

.achievement-card-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(40, 40, 45, 0.8);
    border-radius: 6px;
    color: #555;
    transition: all 0.3s ease;
}

.achievement-card:hover .achievement-card-icon {
    transform: scale(1.1) rotate(5deg);
}

.achievement-card.unlocked .achievement-card-icon {
    color: rgb(var(--ach-r, 125), var(--ach-g, 211), var(--ach-b, 252));
    background: rgba(var(--ach-r, 125), var(--ach-g, 211), var(--ach-b, 252), 0.1);
}

.achievement-card-icon svg {
    width: 20px;
    height: 20px;
}

.achievement-card-content {
    flex: 1;
    min-width: 0;
}

.achievement-card-name {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.achievement-card.unlocked .achievement-card-name {
    color: #ddd;
}

.achievement-card-desc {
    font-size: 10px;
    color: #555;
    line-height: 1.3;
}

.achievement-card.unlocked .achievement-card-desc {
    color: #888;
}

/* Export Section */
.export-description {
    color: #888;
    font-size: 13px;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.export-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(125, 211, 252, 0.1);
    border: 1px solid rgba(125, 211, 252, 0.3);
    color: #7dd3fc;
    padding: 12px 20px;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.profile-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.2), transparent);
    transition: left 0.5s ease;
}

.profile-btn:hover {
    background: rgba(125, 211, 252, 0.2);
    border-color: rgba(125, 211, 252, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(125, 211, 252, 0.2);
}

.profile-btn:hover::before {
    left: 100%;
}

.profile-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.profile-btn svg {
    transition: transform 0.3s ease;
}

.profile-btn:hover svg {
    transform: translateY(-2px);
}

.profile-btn.secondary {
    background: rgba(60, 60, 70, 0.3);
    border-color: rgba(100, 100, 110, 0.4);
    color: #999;
}

.profile-btn.secondary:hover {
    background: rgba(80, 80, 90, 0.4);
    border-color: rgba(125, 211, 252, 0.3);
    color: #bbb;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ==================== Mods Panel (Electron) ==================== */
#mods-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(12, 12, 15, 0.98);
    border: 1px solid rgba(125, 211, 252, 0.2);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    z-index: 200;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

#mods-panel.active {
    animation: panelSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.mods-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 85vh;
}

.mods-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(125, 211, 252, 0.1);
    flex-shrink: 0;
}

.mods-panel-title {
    color: #e2e8f0;
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    margin: 0;
}

.mods-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mods-close:hover {
    color: #7dd3fc;
    transform: rotate(90deg) scale(1.1);
}

.mods-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.mods-section {
    margin-bottom: 25px;
}

.mods-section:last-child {
    margin-bottom: 0;
}

.mods-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mods-section-title {
    color: #7dd3fc;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
}

.mods-hint-text {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.mods-hint-text code {
    background: rgba(125, 211, 252, 0.1);
    color: #7dd3fc;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 0.85em;
}

.mods-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(125, 211, 252, 0.1);
    border: 1px solid rgba(125, 211, 252, 0.2);
    color: #7dd3fc;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mods-action-btn:hover {
    background: rgba(125, 211, 252, 0.2);
    border-color: rgba(125, 211, 252, 0.4);
    transform: translateY(-1px);
}

.mods-action-btn svg {
    opacity: 0.8;
}

.mods-buttons-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mods-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.mods-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px dashed rgba(100, 116, 139, 0.3);
}

.mods-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.mods-empty p {
    margin: 5px 0;
}

.mods-hint {
    font-size: 0.8rem;
    opacity: 0.7;
}

.mod-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mod-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(125, 211, 252, 0.2);
}

.mod-item.enabled {
    border-color: rgba(125, 211, 252, 0.3);
}

.mod-item.has-error {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
}

.mod-item.dragging {
    opacity: 0.5;
    background: rgba(125, 211, 252, 0.1);
}

.mod-drag-handle {
    color: #475569;
    cursor: grab;
    font-size: 1rem;
    letter-spacing: 2px;
    user-select: none;
}

.mod-drag-handle:hover {
    color: #7dd3fc;
}

.mod-info {
    flex: 1;
    min-width: 0;
}

.mod-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.mod-name {
    color: #e2e8f0;
    font-weight: 500;
    font-size: 0.95rem;
}

.mod-version {
    color: #64748b;
    font-size: 0.75rem;
}

.mod-author {
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.mod-description {
    color: #94a3b8;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mod-error {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 4px;
}

.mod-controls {
    flex-shrink: 0;
}

/* Toggle switch */
.mod-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.mod-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(100, 116, 139, 0.3);
    transition: 0.3s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: #64748b;
    transition: 0.3s;
    border-radius: 50%;
}

.mod-toggle input:checked + .toggle-slider {
    background: rgba(56, 189, 248, 0.3);
    border-color: rgba(56, 189, 248, 0.5);
}

.mod-toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background: #38bdf8;
}

.mod-toggle input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.mods-restart-notice {
    margin-top: 15px;
    padding: 12px 15px;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 8px;
    color: #eab308;
    font-size: 0.85rem;
    text-align: center;
}

/* Mod notification toast */
.mod-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(125, 211, 252, 0.3);
    color: #e2e8f0;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.mod-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.mod-notification.info {
    border-color: rgba(125, 211, 252, 0.3);
}

.mod-notification.success {
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.mod-notification.warning {
    border-color: rgba(234, 179, 8, 0.3);
    color: #eab308;
}

.mod-notification.error {
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ==================== Desktop Settings (Electron) ==================== */
.system-info-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(125, 211, 252, 0.1);
}

.system-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.system-info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #64748b;
    font-size: 0.85rem;
}

.info-value {
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
}

.info-loading {
    color: #64748b;
    font-style: italic;
    text-align: center;
    padding: 20px;
    margin: 0;
}

/* Desktop-only badge */
.desktop-badge {
    display: inline-block;
    background: linear-gradient(135deg, #7dd3fc, #38bdf8);
    color: #0a0a0a;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Desktop-only elements - hidden by default, shown when in Electron */
.desktop-only {
    display: none !important;
}

body.electron-app .desktop-only {
    display: block !important;
}

/* Mods panel should stay hidden until .active is added */
body.electron-app #mods-panel {
    display: none !important;
}

body.electron-app #mods-panel.active {
    display: block !important;
}

body.electron-app .settings-tab.desktop-only {
    display: inline-block !important;
}

body.electron-app .settings-tab-content.desktop-only {
    display: none !important;
}

body.electron-app .settings-tab-content.desktop-only.active {
    display: block !important;
}

/* Electron app styling */
body.electron-app {
    /* Remove overscroll on desktop */
    overscroll-behavior: none;
}

body.electron-app #title-screen {
    /* Can use native window controls */
}

/* Platform-specific adjustments */
body[data-platform="darwin"] .settings-title {
    /* macOS specific styling if needed */
}

body[data-platform="win32"] .settings-title {
    /* Windows specific styling if needed */
}

/* ==================== Credits Screen (Terraria-style) ==================== */
#about-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a0a12 0%, #12121f 50%, #0a0a12 100%);
    z-index: 200;
    overflow: hidden;
}

#about-panel.active {
    animation: creditsFadeIn 0.5s ease forwards;
}

@keyframes creditsFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.credits-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow-y: auto;
    padding: 80px 20px 120px 20px;
    box-sizing: border-box;
}

/* Starfield background effect */
.credits-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, white, transparent),
        radial-gradient(1px 1px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 50px 160px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 90px 40px, white, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 160px 120px, white, transparent),
        radial-gradient(1px 1px at 200px 50px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 250px 100px, white, transparent),
        radial-gradient(1px 1px at 300px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 350px 150px, white, transparent),
        radial-gradient(1px 1px at 400px 30px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 450px 90px, white, transparent),
        radial-gradient(1px 1px at 500px 140px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 550px 60px, white, transparent),
        radial-gradient(1px 1px at 600px 110px, rgba(255,255,255,0.5), transparent);
    background-repeat: repeat;
    background-size: 600px 200px;
    animation: starsMove 60s linear infinite;
    opacity: 0.4;
}

@keyframes starsMove {
    from { transform: translateY(0); }
    to { transform: translateY(-200px); }
}

.credits-logo {
    text-align: center;
    z-index: 1;
    margin-bottom: 60px;
    flex-shrink: 0;
}

.credits-game-title {
    font-size: 2.8rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #f0f9ff;
    text-shadow: 
        0 0 20px rgba(56, 189, 248, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.5);
    margin: 0;
}

.credits-game-title span {
    color: #38bdf8;
    font-weight: 600;
}

.credits-scroll {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 35px;
    z-index: 1;
    flex-shrink: 0;
}

.credit-block {
    text-align: center;
    animation: creditFadeInUp 0.8s ease forwards;
    opacity: 0;
}

.credit-block:nth-child(1) { animation-delay: 0.3s; }
.credit-block:nth-child(2) { animation-delay: 0.5s; }
.credit-block:nth-child(3) { animation-delay: 0.7s; }
.credit-block:nth-child(4) { animation-delay: 0.9s; }
.credit-block:nth-child(5) { animation-delay: 1.1s; }
.credit-block:nth-child(6) { animation-delay: 1.3s; }
.credit-block:nth-child(7) { animation-delay: 1.5s; }
.credit-block:nth-child(8) { animation-delay: 1.7s; }

@keyframes creditFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.credit-block .credit-role {
    color: #64748b;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.credit-block .credit-name {
    color: #e2e8f0;
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.credit-block.version-block {
    margin-top: 20px;
}

.credit-block.version-block .credit-name {
    color: #7dd3fc;
    font-size: 1.1rem;
}

.credit-block.version-block .credit-role {
    font-size: 0.85rem;
    margin-top: 5px;
    margin-bottom: 0;
}

.credits-back-btn {
    margin-top: 50px;
    flex-shrink: 0;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    font-family: inherit;
    letter-spacing: 0.1em;
    cursor: pointer;
    padding: 10px 30px;
    transition: all 0.3s ease;
    z-index: 1;
    opacity: 0;
    animation: creditFadeInUp 0.8s ease forwards;
    animation-delay: 2s;
}

.credits-back-btn:hover {
    color: #7dd3fc;
    text-shadow: 0 0 15px rgba(125, 211, 252, 0.5);
    transform: scale(1.05);
}
