.emoji-heart {
    font-family: "AppleEmojiHearts", "Segoe UI Emoji";
}

@font-face {
    font-family: "AppleEmojiHearts";
    src: url("/other-pages/fonts/AppleColorEmoji.ttf") format("truetype");
    unicode-range: 
        U+2665,
        U+2764,
        U+1F494,
        U+FE0F;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, "AppleEmojiHearts", "Segoe UI Emoji", "Noto Color Emoji";
    background: linear-gradient(135deg, #0f0f0f, #1a1f2b);
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 30px;
    padding-top: 90px;
    overflow-x: hidden;
}

h1 {
    font-size: 32px;
    margin-bottom: 15px;
    color: #00f0ff;
    text-shadow: 0 0 3px #00f0ff, 0 0 10px #00f0ff, 0 0 18px #00b0ff;
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 3px #00f0ff, 0 0 10px #00f0ff, 0 0 18px #00b0ff; }
    to { text-shadow: 0 0 10px #00f0ff, 0 0 25px #00f0ff, 0 0 40px #00b0ff; }
}

#searchInput {
    width: 100%;
    max-width: 700px;
    padding: 14px 20px;
    border-radius: 30px;
    border: none;
    font-size: 16px;
    margin-bottom: 25px;
    background-color: #0f0f0f;
    color: #e0e0e0;
    box-shadow: 0 0 8px #00b0ff;
    outline: none;
    transition: all 0.3s ease;
}

#searchInput::placeholder { color: #a0f0ff; }

#searchInput:hover, #searchInput:focus {
    animation: pulseGlow 1.8s infinite alternate;
    box-shadow: 0 0 20px #00FFFF, 0 0 40px #00FFFF, 0 0 60px #00FFFF inset, 0 0 80px #00FFFF inset;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 20px #00f0ff, 0 0 40px #00f0ff, 0 0 60px #00b0ff inset, 0 0 80px #00f0ff inset; }
    50% { box-shadow: 0 0 25px #00b0ff, 0 0 50px #00f0ff, 0 0 70px #00b0ff inset, 0 0 90px #00f0ff inset; }
    100% { box-shadow: 0 0 22px #00f0ff, 0 0 45px #00b0ff, 0 0 65px #00f0ff inset, 0 0 85px #00b0ff inset; }
}

.categories {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    padding: 12px 25px;
    border-radius: 15px;
    border: none;
    background: #2e3440;
    color: #88c0d0;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 100%;
    top: 0; left: 0;
    background: rgba(0,240,255,0.2);
    transition: width 0.3s ease;
    z-index: 0;
}

.category-btn:hover::after { width: 100%; }
.category-btn:hover, .category-btn.active {
    color: #0f0f0f;
    background: #00f0ff;
    box-shadow: 0 6px 20px rgba(0,240,255,0.7);
    transform: scale(1.05);
    z-index: 1;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    width: 100%;
    max-width: 1200px;
    justify-items: center;
}

a.game-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 220px;
    height: 320px;
    padding: 0;
    background: #2e3440;
    border-radius: 18px;
    text-align: center;
    text-decoration: none;
    color: #88c0d0;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

a.game-link img {
    width: 100%;
    height: 70%;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
    margin-bottom: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

a.game-link div {
    height: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 5px;
}

a.game-link:hover img {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,240,255,0.7);
}

a.game-link:hover {
    color: #0f0f0f;
    background: #00f0ff;
    transform: scale(1.1) rotate(-1deg);
    box-shadow: 0 12px 30px rgba(0,240,255,0.8);
}

.modal {
    position: fixed;
    top:0; left:0;
    width:100%; height:100%;
    background: rgba(0,0,0,0.9);
    display:flex;
    justify-content:center;
    align-items:center;
    opacity:0;
    pointer-events:none;
    transition:opacity 0.3s ease;
    z-index:1000;
}

.modal.active { opacity:1; pointer-events:all; }

.modal-content {
    width:90%;
    max-width:1200px;
    height:80%;
    background:#1a1f2b;
    border-radius:20px;
    overflow:hidden;
    position:relative;
    box-shadow:0 0 60px rgba(0,240,255,0.9);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal iframe { width:100%; height:100%; border:none; }

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: #ff0000;
    border-radius: 50%;
    border: 2px solid transparent;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    user-select: none;
    z-index: 1100;
}

.modal-close:hover {
    background: #cc0000;
    transform: scale(1.1);
    border-color: white;
    outline: none;
}

footer {
    margin-top: 50px;
    width: 100%;
    background: #2e3440;
    padding: 40px 50px;
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
    gap: 30px;
    border-top: 3px solid #00f0ff;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.5);
    color:#d8dee9;
}

footer h3 {
    margin-bottom: 12px;
    color: #00f0ff;
    text-shadow: 0 0 5px #00f0ff;
}

footer p, footer a {
    font-size: 14px;
    color:#d8dee9;
    text-decoration: none;
    line-height:1.5;
}

footer a:hover { color:#00b0ff; }

body::after {
    content:''; 
    position: fixed; 
    top:0; left:0; 
    width:100%; height:100%; 
    background: radial-gradient(circle, rgba(0,240,255,0.05), transparent 70%); 
    pointer-events:none; 
    animation: moveBg 25s linear infinite;
}

@keyframes moveBg {
    0% { transform: translate(0,0); }
    50% { transform: translate(60px,60px); }
    100% { transform: translate(0,0); }
}

::-webkit-scrollbar { width: 14px; height: 12px; background-color: #1a1f2b; }
::-webkit-scrollbar-track { background: #1a1f2b; border-radius: 10px; margin: 2px; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00f0ff, #00b0ff);
    border-radius: 10px;
    border: 2px solid #1a1a2b;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00b0ff, #0088ff);
    box-shadow: 0 0 12px rgba(0, 176, 255, 0.8);
}

::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-corner { background: #1a1f2b; }

.total-games {
    margin: 15px auto 30px auto;
    font-size: 1.25rem;
    font-weight: 700;
    color: #00f0ff;
    text-align: center;
    text-shadow: 0 0 5px #00f0ff, 0 0 15px #00f0ff, 0 0 25px #00b0ff;
    animation: glow 2.5s infinite alternate;
    max-width: 700px;
}

.playing-title {
    text-align: center;
    font-size: 1.4rem;
    color: #00f0ff;
    font-weight: bold;
    margin: 20px 0 10px;
    text-shadow: 0 0 8px #00f0ff, 0 0 18px #00b0ff;
    animation: glow 2s infinite alternate;
}

.modal-overlay-title {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: bold;
    color: #00f0ff;
    padding: 10px 20px;
    border-radius: 12px;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-shadow: 0 0 8px #00f0ff, 0 0 15px #00f0ff, 0 0 25px #00b0ff, 0 0 35px #0088ff;
}

.modal-overlay-title.active { opacity: 1; }

#modalGameTitle { white-space: nowrap; overflow-x: auto; }

.newsletter {
    max-width: 350px;
    background: #1a1f2b;
    padding: 20px 25px;
    border-radius: 16px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    color: #88c0d0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.newsletter h3 {
    color: #00f0ff;
    margin-bottom: 8px;
    text-shadow: 0 0 8px #00f0ff, 0 0 15px #00b0ff;
}

.newsletter p { font-size: 14px; margin-bottom: 15px; }

.newsletter input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: 30px;
    border: none;
    background-color: #0f0f0f;
    color: #e0e0e0;
    box-shadow: 0 0 8px #00b0ff;
    font-size: 15px;
    outline: none;
    transition: box-shadow 0.3s ease;
}

.newsletter input[type="email"]::placeholder { color: #66d9ff; }
.newsletter input[type="email"]:focus { box-shadow: 0 0 15px #00f0ff, 0 0 30px #00b0ff inset; }

footer {
    background: #2e3440;
    padding: 30px 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    border-top: 3px solid #00f0ff;
    box-shadow: 0 -3px 15px rgba(0, 240, 255, 0.5);
    color: #d8dee9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

footer > div h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #00f0ff;
    text-shadow: 0 0 6px #00f0ff, 0 0 12px #00b0ff;
}

footer > div p {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
    color: #d8dee9;
}

footer > div a {
    color: #88c0d0;
    text-decoration: none;
    transition: color 0.25s ease;
}

footer > div a:hover {
    color: #00b0ff;
    text-shadow: 0 0 5px #00b0ff;
}

footer .newsletter {
    max-width: 320px;
    background: #1a1f2b;
    padding: 12px 20px;
    border-radius: 16px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    color: #88c0d0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-label {
    font-weight: 600;
    font-size: 14px;
    color: #00f0ff;
    text-shadow: 0 0 6px #00b0ff;
    margin-bottom: 6px;
}

.newsletter input[type="email"], .newsletter button {
    font-size: 13px;
    border-radius: 20px;
    border: none;
    padding: 8px 14px;
    outline: none;
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.newsletter input[type="email"] {
    background-color: #0f0f0f;
    color: #e0e0e0;
    box-shadow: 0 0 8px #00b0ff;
    flex-grow: 1;
    margin: 0;
    min-width: 0;
}

.newsletter input[type="email"]::placeholder { color: #66d9ff; }
.newsletter input[type="email"]:focus { box-shadow: 0 0 14px #00f0ff, 0 0 28px #00b0ff inset; }

.newsletter-input-button {
    display: flex;
    gap: 10px;
}

.newsletter button {
    background: linear-gradient(135deg, #00f0ff, #0088ff);
    color: #0f0f0f;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 240, 255, 0.7);
    flex-shrink: 0;
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.newsletter button:hover {
    background: linear-gradient(135deg, #00b0ff, #005fbb);
    transform: scale(1.05);
    box-shadow: 0 8px 22px rgba(0, 240, 255, 0.9);
}

.newsletter button:active { transform: scale(0.95); }

@media (max-width: 480px) {
    .newsletter-input-button { flex-direction: column; }
}

.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

#randomGameBtn {
    width: 32px;
    height: 32px;
    cursor: pointer;
    user-select: none;
    position: relative;
    top: -2px;
}

@keyframes spinShake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    50% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
    100% { transform: rotate(0deg); }
}

.spin-shake { animation: spinShake 0.4s ease; }

.neon-btn {
    background: transparent;
    border: 2px solid #0ff;
    color: #0ff;
    font-size: 1.5rem;
    padding: 12px 30px;
    border-radius: 10px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    box-shadow: 0 0 5px #0ff, 0 0 10px #0ff, 0 0 20px #0ff, 0 0 40px #0ff;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    animation: pulseGlow 2.5s infinite alternate;
}

.neon-btn:hover {
    box-shadow: 0 0 10px #0ff, 0 0 20px #0ff, 0 0 30px #0ff, 0 0 60px #0ff;
    transform: scale(1.1);
}

#muteContainer {
    font-size: 1.3rem;
    color: #0ff;
    font-weight: 700;
    user-select: none;
    display: flex;
    gap: 6px;
    margin-left: -40px;
}

#muteCheckbox {
    width: 23px;
    height: 23px;
    cursor: pointer;
    accent-color: #0ff;
}

#infoModal .modal-content {
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes slideDownFadeIn {
    0% { opacity: 0; transform: translateY(-100%); }
    100% { opacity: 1; transform: translateY(0); }
}

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #2e3440;
    color: #0ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.7), 0 8px 30px rgba(0, 200, 255, 0.5), 0 12px 50px rgba(0, 150, 255, 0.3);
    font-family: 'Arial', sans-serif;
    animation: slideDownFadeIn 0.8s ease-out;
    transition: background-color 0.3s, box-shadow 0.3s;
    flex-wrap: wrap;
    gap: 10px;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #0ff;
    font-size: 20px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.logo a:hover { transform: scale(1.1); }
.logo img { margin-right: 10px; border-radius: 6px; transition: transform 0.4s ease; }
.logo img:hover { transform: rotate(10deg) scale(1.05); }

.main-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.main-nav a {
    position: relative;
    text-decoration: none;
    color: #0ff;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background-color: #0ff;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.main-nav a:hover { color: #fff; }
.main-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.main-nav .category-btn {
    padding: 8px 14px;
    font-size: 13px;
    margin: 0;
}

#profileBtn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #0ff;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 8px;
}

#profileBtn:hover {
    box-shadow: 0 0 15px #0ff;
    transform: scale(1.05);
}

#profileBtn img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #0ff;
}

#profileBtn .profile-name {
    color: #0ff;
    font-weight: bold;
    font-size: 13px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#profileDropdown {
    position: absolute;
    top: 55px;
    right: 20px;
    background: #0a0a12;
    border: 2px solid #0ff;
    border-radius: 12px;
    padding: 12px;
    display: none;
    min-width: 150px;
    z-index: 10000;
    box-shadow: 0 0 20px #0ff5;
}

#profileDropdown.show { display: block; }

#profileDropdown button {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 4px 0;
    background: #1a1a2e;
    border: 1px solid #0ff;
    color: #0ff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

#profileDropdown button:hover {
    background: #0ff;
    color: #000;
}

#profileDropdown .logout-btn {
    background: #2a1a1a;
    border-color: #ff4444;
    color: #ff4444;
}

#profileDropdown .logout-btn:hover {
    background: #ff4444;
    color: white;
}

#loginBtn {
    padding: 8px 16px;
    font-size: 13px;
    margin-left: 8px;
}

/* Auth Modals */
.auth-modal .modal-content {
    max-width: 380px;
    padding: 25px;
}

.auth-modal h2 {
    color: #0ff;
    margin-bottom: 20px;
    text-align: center;
}

.auth-modal input {
    width: 100%;
    padding: 12px 15px;
    margin: 8px 0 12px;
    background: #1a1a2e;
    border: 2px solid #0ff;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    box-sizing: border-box;
}

.auth-modal input:focus {
    outline: none;
    box-shadow: 0 0 10px #0ff;
}

.auth-modal input::placeholder { color: #666; }

.auth-error {
    color: #ff4444;
    font-size: 13px;
    margin: 8px 0;
    text-align: center;
}

.auth-success {
    color: #00ff88;
    font-size: 13px;
    margin: 8px 0;
    text-align: center;
}

.auth-modal .category-btn {
    width: 100%;
    margin: 10px 0;
}

.auth-modal p {
    color: #888;
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
}

.auth-modal p span {
    color: #0ff;
    cursor: pointer;
}

.auth-modal p span:hover { text-decoration: underline; }

/* Profile Modal */
#profileModal .modal-content {
    max-width: 450px;
    padding: 20px;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-avatar-container {
    position: relative;
    margin-bottom: 15px;
    width: 100px;
    height: 100px;
}

#profileAvatarImg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #0ff;
    object-fit: cover;
    cursor: pointer;
}

#changeAvatarBtn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0ff, #00aaaa);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

#changeAvatarBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.5);
}

#profileUsername {
    font-size: 22px;
    font-weight: bold;
    color: #0ff;
    margin: 10px 0;
    text-align: center;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
    width: 100%;
}

.profile-stat-box {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #0ff;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
}

.profile-stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #0ff;
}

.profile-stat-label {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.profile-style-selector {
    margin: 15px 0;
    width: 100%;
}

.profile-style-selector label {
    color: #0ff;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.profile-style-selector select {
    width: 100%;
    padding: 10px;
    background: #1a1a2e;
    border: 2px solid #0ff;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

#avatarUploadInput { display: none; }

/* Username Styles */
.user-glow { text-shadow: 0 0 10px #0ff, 0 0 20px #0ff, 0 0 30px #0ff; }

.user-rainbow {
    animation: rainbowGlow 3s linear infinite;
    background: linear-gradient(90deg, #ff0000, #ff8800, #ffff00, #00ff00, #00ffff, #0088ff, #8800ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    filter: drop-shadow(0 0 3px rgba(255,255,255,0.5));
}

@keyframes rainbowGlow {
    0% { filter: hue-rotate(0deg) drop-shadow(0 0 3px red); }
    100% { filter: hue-rotate(360deg) drop-shadow(0 0 3px violet); }
}

.user-gold {
    text-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700, 0 0 30px #ffaa00;
    color: #ffd700 !important;
}

.user-fire {
    animation: fireGlow 0.5s ease-in-out infinite alternate;
    text-shadow: 0 0 5px #ff4400, 0 0 10px #ff6600, 0 0 15px #ff8800;
    color: #ff6600 !important;
}

@keyframes fireGlow {
    from { text-shadow: 0 0 5px #ff4400, 0 0 10px #ff6600; }
    to { text-shadow: 0 0 10px #ff6600, 0 0 20px #ff8800, 0 0 30px #ffaa00; }
}

.user-ice {
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ccff, 0 0 30px #0088ff;
    color: #00ccff !important;
}

.user-neon {
    text-shadow: 0 0 5px #0ff, 0 0 10px #0ff, 0 0 20px #0ff, 0 0 40px #0ff;
    color: #00fff7 !important;
}

/* Space efficient modals */
#achievementsModal .modal-content,
#playedBeforeModal .modal-content,
#leaderboardModal .modal-content,
#settingsModal .modal-content,
#avatarCropModal .modal-content {
    max-width: 550px;
    max-height: 75vh;
    padding: 15px;
}

#achievementsList, #playedBeforeList, #leaderboardList {
    max-height: 55vh;
    overflow-y: auto;
}

#achievementsModal h2, #playedBeforeModal h2, #leaderboardModal h2, #settingsModal h2, #avatarCropModal h2 {
    color: #0ff;
    text-align: center;
    margin-bottom: 15px;
}

/* Achievement Cards */
.achievement-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #333;
    border-radius: 12px;
    margin: 8px 0;
    transition: all 0.3s;
}

.achievement-card.unlocked {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.achievement-icon {
    font-size: 28px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    border-radius: 50%;
    flex-shrink: 0;
}

.achievement-card.unlocked .achievement-icon {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    animation: iconPulse 2s ease-in-out infinite;
}

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

.achievement-info { flex: 1; min-width: 0; }

.achievement-title {
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.achievement-card.unlocked .achievement-title { color: #ffd700; }

.achievement-desc {
    font-size: 12px;
    color: #888;
}

.achievement-card.unlocked .achievement-desc { color: #aaa; }

.achievement-date {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

/* Played Before with Play Now button */
.played-game-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 8px;
    margin: 6px 0;
}

.played-game-item img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.played-game-info {
    flex: 1;
    min-width: 0;
}

.played-game-name {
    font-weight: bold;
    color: #0ff;
    font-size: 14px;
}

.played-game-meta {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.played-game-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.playNowBtn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #00aa00, #00cc00);
    border: 1px solid #00ff00;
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.playNowBtn:hover {
    box-shadow: 0 0 10px #00ff00;
    transform: scale(1.05);
}

/* Leaderboard */
.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid #333;
    border-radius: 10px;
    margin: 6px 0;
    transition: all 0.3s;
}

.leaderboard-entry:hover {
    transform: scale(1.02);
    border-color: #0ff;
}

.leaderboard-rank {
    font-size: 22px;
    font-weight: bold;
    min-width: 35px;
    text-align: center;
    flex-shrink: 0;
}

.leaderboard-rank.gold { color: #ffd700; }
.leaderboard-rank.silver { color: #c0c0c0; }
.leaderboard-rank.bronze { color: #cd7f32; }

.leaderboard-user { flex: 1; min-width: 0; }

.leaderboard-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
}

.leaderboard-stats {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.leaderboard-score {
    font-size: 18px;
    font-weight: bold;
    color: #0ff;
    flex-shrink: 0;
}

/* Settings Modal */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #333;
    flex-wrap: wrap;
    gap: 10px;
}

.setting-label {
    color: #fff;
    font-size: 14px;
}

.setting-toggle {
    width: 46px;
    height: 24px;
    background: #333;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}

.setting-toggle.active { background: #0ff; }

.setting-toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.3s;
}

.setting-toggle.active::after { left: 24px; }

.clear-history-btn {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s;
}

.clear-history-btn:hover {
    box-shadow: 0 0 15px #ff0000;
    transform: scale(1.05);
}

.auto-clear-select {
    padding: 8px 12px;
    background: #1a1a2e;
    border: 2px solid #0ff;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.auto-clear-select:focus {
    outline: none;
    box-shadow: 0 0 10px #0ff;
}

/* Avatar Crop Modal */
#avatarCropContainer {
    width: 100%;
    height: 280px;
    background: #1a1a2e;
    border: 2px solid #0ff;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

#avatarCropContainer img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.crop-instructions {
    color: #888;
    font-size: 12px;
    text-align: center;
    margin: 10px 0;
}

.crop-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.crop-buttons button {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

#saveCropBtn {
    background: linear-gradient(135deg, #0ff, #00aaaa);
    border: none;
    color: #000;
}

#cancelCropBtn {
    background: transparent;
    border: 2px solid #666;
    color: #888;
}

/* Responsive */
@media (max-width: 768px) {
    .main-header {
        padding: 10px 15px;
        flex-direction: column;
        align-items: flex-start;
    }
    .main-nav { width: 100%; justify-content: flex-start; }
    .logo { margin-bottom: 8px; }
    #profileDropdown { right: 10px; }
}

@media (max-width: 600px) {
    .auth-modal .modal-content { max-width: 90%; padding: 20px 15px; }
    #profileModal .modal-content, #achievementsModal .modal-content, #playedBeforeModal .modal-content, #leaderboardModal .modal-content, #settingsModal .modal-content, #avatarCropModal .modal-content { max-width: 95%; width: 95%; padding: 12px; }
    .profile-stats { gap: 6px; }
    .profile-stat-box { padding: 8px; }
    .profile-stat-value { font-size: 16px; }
    .achievement-card { padding: 10px; gap: 10px; }
    .achievement-icon { width: 40px; height: 40px; font-size: 24px; }
    .leaderboard-entry { padding: 10px; }
    .leaderboard-rank { font-size: 18px; min-width: 28px; }
    .leaderboard-name { font-size: 14px; }
    .leaderboard-score { font-size: 14px; }
}

@media (max-width: 480px) {
    .main-header { flex-direction: column; align-items: center; padding: 10px; }
    .logo { margin-bottom: 8px; }
    .main-nav { justify-content: center; gap: 6px; }
    .main-nav a { font-size: 12px; margin: 0 4px; }
    .main-nav .category-btn { padding: 6px 10px; font-size: 11px; }
    #profileBtn { padding: 4px 8px; }
    #profileBtn img { width: 24px; height: 24px; }
    #profileBtn .profile-name { font-size: 11px; max-width: 60px; }
    #profileDropdown { right: 50%; transform: translateX(50%); }
    .played-game-item { flex-wrap: wrap; }
    .playNowBtn { font-size: 10px; padding: 5px 8px; }
}

/* Achievement notification */
@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}