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

:root {
    --primary-color: #5e72e4;
    --secondary-color: #825ee4;
    --background: #f8f9fe;
    --surface: #ffffff;
    --text-primary: #32325d;
    --text-secondary: #6c757d;
    --border: #e0e6ed;
    --shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.search-container {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 14px 45px 14px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.lang-switcher {
    display: flex;
    gap: 10px;
    background: var(--surface);
    padding: 8px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.lang-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: var(--background);
    transform: scale(1.1);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 15px rgba(94, 114, 228, 0.4);
}

.categories {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.categories::-webkit-scrollbar {
    height: 6px;
}

.categories::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.categories::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

.category-btn {
    padding: 10px 20px;
    border: none;
    background: var(--surface);
    color: var(--text-primary);
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.category-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(94, 114, 228, 0.4);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 12px;
    background: var(--surface);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-height: 400px;
}

.emoji-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: var(--background);
}

.emoji-item:hover {
    transform: scale(1.2);
    background: linear-gradient(135deg, rgba(94, 114, 228, 0.1), rgba(130, 94, 228, 0.1));
    box-shadow: 0 5px 15px rgba(94, 114, 228, 0.3);
}

.emoji-item:active {
    transform: scale(0.95);
}

.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 16px 32px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(94, 114, 228, 0.4);
    transition: bottom 0.3s ease;
    font-weight: 500;
    z-index: 1000;
}

.toast.show {
    bottom: 30px;
}

.selected-panel {
    position: fixed;
    right: -400px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    width: 350px;
    transition: right 0.3s ease;
    z-index: 100;
}

.selected-panel.active {
    right: 20px;
}

.selected-panel h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.selected-emoji {
    font-size: 80px;
    text-align: center;
    margin: 20px 0;
}

.emoji-details {
    background: var(--background);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.emoji-unicode {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.emoji-name {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

.copy-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(94, 114, 228, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: white;
    opacity: 0.9;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        padding: 20px;
        gap: 10px;
    }
    
    .emoji-item {
        font-size: 28px;
    }
    
    .selected-panel {
        width: 90%;
        right: -100%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .selected-panel.active {
        right: auto;
        left: 50%;
    }
    
    .categories {
        padding: 0 10px 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .search-container {
        min-width: 100%;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        padding: 15px;
        gap: 8px;
    }
    
    .emoji-item {
        font-size: 24px;
    }
}