@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;700&family=Space+Mono:wght@400;700&display=swap');

:root {
    --bg: #0d0d14;
    --surface: #15151f;
    --surface2: #1e1e2e;
    --border: #2e2e4a;
    --accent: #c084fc;
    --accent2: #f472b6;
    --accent3: #38bdf8;
    --text: #e2e8f0;
    --muted: #74748b;
    --glow: rgba(192, 132, 252, 0.3);
}

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

body {
    font-family: 'Space Mono', monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 4rem;
    overflow-x: hidden;
}

body::before {
    pointer-events: none;
    z-index: -1;
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 20% 10%, rgba(192, 132, 252, 0.07) 0%, transparent 60%),
        radial-gradient(ellipse 50% 30% at 80% 80%, rgba(56, 189, 248, 0.06) 0%, transparent 60%);
}

header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent), var(--accent2), var(--accent3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
}

header p {
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
}

.kaomoji-display {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 2.5rem 3rem;
    margin-bottom: 2.5rem;
    text-align: center;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 0 60px rgba(192, 132, 252, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
}

.kaomoji-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: nowrap;
    margin-bottom: 1.2rem;
}

.part {
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 0.5rem;
    transition: all 0.15s;
    position: relative;
    user-select: none;
    line-height: 1.2;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0.8em; 
    min-height: 1.2em;
}

.part:empty::before,
.part:blank::before {
    content: '\00a0';
}

.part:hover {
    background: rgba(192, 132, 252, 0.12);
    color: var(--accent);
    transform: translateY(-3px) scale(1.1);
}

.part:empty:hover,
.part:hover:has(:empty) {
    outline: 1px dashed var(--accent);
    outline-offset: 2px;
}

.part.active {
    background: rgba(192, 132, 252, 0.2);
    color: var(--accent);
    box-shadow: 0 0 20px var(--glow);
    transform: translateY(-3px) scale(1.12);
    outline: 1px solid var(--accent); /* Destaque extra para o slot ativo */
}

.part-label {
    font-size: 0.55rem;
    color: var(--muted);
    position: absolute;
    bottom: -1.4rem;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: 'Space Mono', monospace;
    opacity: 0;
    transition: opacity 0.2s;
}

.part:hover .part-label,
.part.active .part-label {
    opacity: 1;
}

.kaomoji-full {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1rem;
    color: var(--muted);
    letter-spacing: 0.1em;
    margin-top: 1rem;
    min-height: 1.4rem;
    word-break: break-all;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.2rem;
    padding: 0.5rem 1.2rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 2rem;
    color: var(--muted);
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.05em;
}

.copy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(192, 132, 252, 0.06);
}

.copy-btn.copied {
    border-color: #4ade80;
    color: #4ade80;
}  

.picker {
    width: 100%;
    max-width: 700px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    min-height: 120px;
    transition: all 0.3s;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}

.picker-title {
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.picker-title:after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.picker-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70px;
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
}

.options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.option-btn {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.option-btn:hover {
    border-color: var(--accent2);
    background: rgba(192, 132, 252, 0.1);
    transform: scale(1.1);
    color: var(--accent2);
}

.option-btn.selected {
    border-color: var(--accent);
    background: rgba(192, 132, 252, 0.15);
    color: var(--accent);
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.25);
}

.controls {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 0.6rem 1.4rem;
    border-radius: 2rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-color: transparent;
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(192, 132, 252, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(192, 132, 252, 0.5);
}

.btn-secondary {
    background: transparent;
    border-color: var(--border);
    color: var(--muted);
}

.btn-secondary:hover {
    border-color: var(--accent3);
    color: var(--accent3);
}

.presets-section {
    width: 100%;
    max-width: 700px;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.presets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preset-btn {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.preset-btn:hover {
    border-color: var(--accent2);
    background: rgba(56, 189, 248, 0.08);
    color: var(--accent3);
    transform: translateY(-2px);
}

.history-section {
    width: 100%;
    max-width: 700px;
}

.history-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.history-item {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.95rem;
    padding: 0.4rem 0.9rem;
    background: var(--surface2);
    border: 1px dashed var(--border);
    border-radius: 0.6rem;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s;
}

.history-item:hover {
    color: var(--text);
    border-color: var(--accent);
    border-style: solid;
    background: rgba(192, 132, 252, 0.06);
}

@keyframes sparkle {
    0% { opacity: 0; transform: scale(0.5) translateY(0); }
    50% { opacity: 1; transform: scale(1.2) translateY(-10px); }
    100% { opacity: 0; transform: scale(0.8) translateY(-20px);}
}

.sparkle {
    position: absolute;
    pointer-events: none;
    animation: sparkle 0.6s ease forwards;
    font-size: 1rem;
}

@keyframes pop {
    0% { transform: translateY(-3px) scale(1.12); }
    50% { transform: translateY(-5px) scale(1.2); }
    100% { transform: translateY(-3px) scale(1.12); }
}

.kaomoji-display, .controls, .picker, .presets-section {
    position: relative;
    z-index: 10;
}

.part.pop { animation: pop 0.25s ease; }

::-webkit-scrollbar { width: 4px }
::-webkit-scrollbar-track { background: var(--bg);}
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }