:root {
    --background-color: #111827;
    --text-color: #f9fafb;
    --title-color: #e0f2fe;
    --paragraph-color: #d1d5db;
    --category-title-color: #ffffff;
    --category-border-color: #4b5563;
    --emoticon-bg-color: #f0f0f0;
    --button-bg-color: #4caf50;
    --button-hover-bg-color: #45a049;
    --button-copied-bg-color: #1e7e34;
    --button-text-color: #fff;
    --emoticon-code-color: #9ca3af;
    --loading-spinner-border: rgba(240, 240, 240, 0.3);
    --loading-spinner-top: #f0f0f0;
    --copied-message-bg: #333;
    --copied-message-text: #fff;
    --error-message-color: #dc2626;
}

* {
    box-sizing: border-box;
}
body {
    font-family: 'Italipixel', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    background-image: url('../images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}
.copied-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--title-color);
    color: var(--background-color);
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 0 8px rgba(192, 255, 255, 0.3);
    animation: neon-flicker 1.5s infinite alternate;
    z-index: 9999;
    font-size: 14px;
    opacity: 0;
    animation: flash-fade 2s ease-in-out forwards;
}
h1 {
    font-family: 'Italipixel', monospace;
    font-size: 2rem;
    color: var(--title-color);
    margin-bottom: 1rem;
    text-shadow: 0 0 8px rgba(192, 255, 255, 0.3);
    animation: neon-flicker 1.5s infinite alternate;
}

@keyframes neon-flicker {
    0%, 100% {
        text-shadow: 0 0 8px rgba(192, 255, 255, 0.3), 
                     0 0 16px rgba(192, 255, 255, 0.5), 
                     0 0 24px rgba(192, 255, 255, 0.7);
    }
    50% {
        text-shadow: 0 0 4px rgba(192, 255, 255, 0.2), 
                     0 0 12px rgba(192, 255, 255, 0.4), 
                     0 0 20px rgba(192, 255, 255, 0.6);
    }
    75% {
        text-shadow: 0 0 6px rgba(192, 255, 255, 0.25), 
                     0 0 14px rgba(192, 255, 255, 0.45), 
                     0 0 22px rgba(192, 255, 255, 0.65);
    }
}
/* logo as picture */
.logo {
    width: 100%;
    height: 150px;
    margin-bottom: 1rem;
}
.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .logo {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .logo {
        height: 50px;
    }
}
p {
    color: var(--paragraph-color);
    margin-bottom: 2rem;
    text-shadow: 0 0 6px rgba(192, 255, 255, 0.65);
}
.category-container {
    margin-bottom: 2rem;
    text-align: left;
}
.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--category-title-color);
    margin-bottom: 1rem;
    font-family: 'Colt Soft Black', sans-serif;
    border-bottom: 2px solid var(--category-border-color);
    padding-bottom: 0.5rem;
    text-shadow: 0 0 8px rgba(192, 255, 255, 0.3), 
                 0 0 16px rgba(192, 255, 255, 0.5), 
                 0 0 24px rgba(192, 255, 255, 0.7);
}
.category-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.emoticon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    justify-content: center;
}
.emoticon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.emoticon-image {
    width: 32px;
    height: 32px;
    border: 1px solid var(--category-border-color);
    border-radius: 4px;
    background-color: var(--emoticon-bg-color);
    /* wide glow effect */
    box-shadow: 0 0 8px rgba(192, 255, 255, 0.3), 
                0 0 16px rgba(192, 255, 255, 0.5), 
                0 0 24px rgba(192, 255, 255, 0.7);
    transition: transform 0.3s ease;
    cursor: pointer;
}
.copy-button {
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.3s ease;
    width: 100%;
    text-align: center;
    font-family: 'Press Start 2P', monospace;
}
.copy-button:hover {
    background-color: var(--button-hover-bg-color);
}
.copy-button.copied {
    background-color: var(--button-copied-bg-color);
    color: var(--button-text-color);
}
.emoticon-code {
    font-size: 0.75rem;
    color: var(--emoticon-code-color);
    font-family: 'Courier New', monospace;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
}
.emoticon-image:hover {
    transform: scale(5);
    transition: transform 0.3s ease;
}

.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80vh;
}
.loading-spinner {
    border: 5px solid var(--loading-spinner-border);
    border-radius: 50%;
    border-top: 5px solid var(--loading-spinner-top);
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
}

@keyframes flash-fade {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.9);
    }
    10% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) scale(0.9);
    }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.error-message {
    color: var(--error-message-color);
    font-size: 1rem;
    text-align: center;
}

@font-face {
    font-family: 'Italipixel';
    src: url('../fonts/italipixel.woff') format('woff')
}

@font-face {
    font-family: 'Colt Soft Black';
    src: url('../fonts/coltsoftblack.ttf') format('truetype');
}

/* Base styles remain unchanged */

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    .container {
        padding: 10px;
    }
    h1 {
        font-size: 1.5rem;
    }
    p {
        font-size: 0.9rem;
    }
    .category-title {
        font-size: 1.2rem;
    }
    .emoticon-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 0.5rem;
    }
    .emoticon-image {
        width: 24px;
        height: 24px;
    }
    .copy-button {
        font-size: 0.65rem;
        padding: 0.4rem 0.8rem;
    }
    .emoticon-code {
        font-size: 0.65rem;
    }
    .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 4px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.2rem;
    }
    p {
        font-size: 0.8rem;
    }
    .category-title {
        font-size: 1rem;
    }
    .emoticon-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }
    .emoticon-image {
        width: 20px;
        height: 20px;
    }
    .copy-button {
        font-size: 0.6rem;
        padding: 0.3rem 0.6rem;
    }
    .emoticon-code {
        font-size: 0.6rem;
    }
    .loading-spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }
}
