:root {
    --bg: #eef8ff;
    --bg-deep: #d7efff;
    --card: rgba(255, 255, 255, 0.82);
    --card-strong: rgba(255, 255, 255, 0.95);
    --line: rgba(88, 159, 219, 0.18);
    --text: #17324d;
    --muted: #58748f;
    --brand: #34a6eb;
    --brand-strong: #1179c4;
    --brand-soft: #c9edff;
    --shadow: 0 24px 60px rgba(34, 100, 150, 0.12);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    font-size: 16px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background:
        radial-gradient(circle at top left, rgba(90, 195, 255, 0.34), transparent 32%),
        radial-gradient(circle at top right, rgba(141, 227, 255, 0.28), transparent 28%),
        linear-gradient(180deg, #f7fcff 0%, var(--bg) 55%, #f9fdff 100%);
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Segoe UI", "Apple SD Gothic Neo", sans-serif;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    width: min(1180px, calc(100vw - 24px));
    margin: 0 auto;
    padding: 18px 0 34px;
}

.hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid rgba(113, 181, 229, 0.22);
    border-radius: 36px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(224, 246, 255, 0.75)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72));
    box-shadow: var(--shadow);
}

.hero__inner {
    position: relative;
    padding: 22px 20px 18px;
}

.hero__glow {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    filter: blur(18px);
    opacity: 0.45;
    pointer-events: none;
}

.hero__glow--left {
    left: -80px;
    top: -60px;
    background: radial-gradient(circle, rgba(52, 166, 235, 0.42), transparent 68%);
}

.hero__glow--right {
    right: -70px;
    bottom: -100px;
    background: radial-gradient(circle, rgba(93, 225, 255, 0.45), transparent 70%);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand__logo {
    width: 86px;
    height: auto;
}

.brand__eyebrow {
    color: var(--brand-strong);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1;
}

.hero__lead {
    max-width: 700px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.65;
}

.app {
    display: grid;
    gap: 14px;
}

.sidebar {
    display: grid;
    gap: 14px;
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--card);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.toolbar,
.history,
.filters,
.results {
    padding: 16px;
}

.toolbar {
    display: grid;
    gap: 10px;
}

.search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(92, 160, 217, 0.22);
    border-radius: 20px;
    background: var(--card-strong);
}

.search:focus-within {
    border-color: rgba(17, 121, 196, 0.38);
    box-shadow: 0 0 0 4px rgba(52, 166, 235, 0.12);
}

.search__icon {
    color: var(--brand-strong);
    font-size: 1.2rem;
}

.search input {
    width: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
}

.toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.button,
.chip {
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.button:hover,
.chip:hover,
.emoji-card:hover {
    transform: translateY(-1px);
}

.button {
    padding: 8px 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(239, 250, 255, 0.92));
    border-color: rgba(70, 151, 213, 0.18);
    color: var(--brand-strong);
    font-weight: 700;
}

.button--ghost {
    background: rgba(255, 255, 255, 0.72);
}

.status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status__item {
    min-width: 140px;
    padding: 10px 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(212, 240, 255, 0.45), rgba(255, 255, 255, 0.88));
    border: 1px solid rgba(89, 159, 218, 0.16);
}

.status__label {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.85rem;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    margin-bottom: 10px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.15rem;
}

.section-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.94rem;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(81, 156, 215, 0.16);
    color: var(--text);
    font-weight: 700;
}

.chip.is-active {
    background: linear-gradient(180deg, var(--brand), var(--brand-strong));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(17, 121, 196, 0.22);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}

.emoji-grid--history {
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
}

.emoji-card {
    display: grid;
    gap: 6px;
    width: 100%;
    min-height: 104px;
    padding: 10px 9px;
    border: 1px solid rgba(89, 159, 218, 0.14);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 249, 255, 0.9));
    color: inherit;
    text-align: left;
    box-shadow: 0 10px 20px rgba(42, 99, 145, 0.08);
    cursor: pointer;
    justify-items: center;
    align-content: start;
    text-align: center;
}

.emoji-card__char {
    font-size: 1.95rem;
    line-height: 1;
    text-align: center;
}

.emoji-card__name {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: keep-all;
    overflow-wrap: anywhere;
    text-align: center;
}

.emoji-card__meta {
    color: var(--muted);
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emoji-card--history {
    min-height: 76px;
    padding: 8px 7px;
    place-items: center;
    text-align: center;
}

.emoji-card--history .emoji-card__char {
    font-size: 1.7rem;
}

.emoji-card--history .emoji-card__name {
    font-size: 0.75rem;
    text-align: center;
}

.empty {
    padding: 14px;
    border: 1px dashed rgba(88, 159, 219, 0.26);
    border-radius: 18px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.55);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(23, 50, 77, 0.94);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 16px 40px rgba(17, 31, 51, 0.28);
    z-index: 20;
}

@media (min-width: 860px) {
    .page-shell {
        width: min(1240px, calc(100vw - 40px));
        padding-top: 20px;
    }

    .hero__inner {
        padding: 24px 24px 18px;
    }

    .toolbar,
    .history,
    .filters,
    .results {
        padding: 18px;
    }

    .app {
        grid-template-columns: 280px minmax(0, 1fr);
        grid-template-areas:
            "toolbar toolbar"
            "sidebar results";
        align-items: start;
    }

    .sidebar {
        grid-area: sidebar;
        position: sticky;
        top: 12px;
        align-self: start;
    }

    .toolbar {
        grid-area: toolbar;
    }

    .results {
        grid-area: results;
    }

    .toolbar {
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
    }

    .toolbar__actions {
        justify-content: flex-end;
    }

    .status {
        justify-content: flex-end;
    }

    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100vw - 16px, 1180px);
        padding-top: 12px;
    }

    .hero,
    .card {
        border-radius: 24px;
    }

    .brand__logo {
        width: 68px;
    }

    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
        gap: 8px;
    }

    .emoji-card {
        min-height: 98px;
        padding: 9px 8px;
    }

    .emoji-card__char {
        font-size: 1.8rem;
    }
}
