.kg-chat-footer { position: relative; }

.kg-chat-sticker-btn {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--gold, #d4af37);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.kg-chat-sticker-btn:hover:not(:disabled),
.kg-chat-sticker-btn[aria-expanded="true"] {
    border-color: var(--gold-dim, #8a7228);
    background: rgba(212, 175, 55, 0.1);
}
.kg-chat-sticker-btn:active:not(:disabled) { transform: scale(0.95); }
.kg-chat-sticker-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.kg-chat-sticker-btn:focus-visible,
.kg-stk-close:focus-visible,
.kg-stk-tab:focus-visible,
.kg-stk-item:focus-visible,
.kg-newchat-btn:focus-visible {
    outline: 2px solid var(--gold, #d4af37);
    outline-offset: 2px;
}

.kg-stk-picker {
    position: absolute;
    z-index: 40;
    left: 14px;
    bottom: calc(100% + 8px);
    width: min(448px, calc(100% - 28px));
    max-height: min(468px, 62dvh);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(200, 32, 58, 0.18), transparent 60%),
        #180b0f;
    box-shadow: 0 22px 48px -16px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.3);
    color: var(--cream);
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    transform-origin: bottom left;
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}
.kg-stk-picker[hidden] { display: none; }
.kg-stk-picker.is-open { opacity: 1; transform: none; }

.kg-stk-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 8px 4px 16px;
}
.kg-stk-title {
    margin: 0;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--gold, #d4af37);
}
.kg-stk-close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: none;
    color: var(--cream-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.kg-stk-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--cream); }

.kg-stk-head,
.kg-stk-nav { flex: 0 0 auto; }
.kg-stk-nav {
    position: relative;
    min-width: 0;
    border-bottom: 1px solid var(--line);
}
.kg-stk-tabs {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 0 12px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
    scroll-padding-inline: 40px;
}
.kg-stk-tabs::-webkit-scrollbar { display: none; }
.kg-stk-nav::before,
.kg-stk-nav::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 8px;
    width: 44px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}
.kg-stk-nav::before {
    left: 0;
    background: linear-gradient(90deg, #1a0c10 30%, rgba(26, 12, 16, 0));
}
.kg-stk-nav::after {
    right: 0;
    background: linear-gradient(270deg, #1a0c10 30%, rgba(26, 12, 16, 0));
}
.kg-stk-nav.can-prev::before,
.kg-stk-nav.can-next::after { opacity: 1; }
.kg-stk-nav-btn {
    position: absolute;
    z-index: 2;
    top: 4px;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(24, 11, 15, 0.94);
    color: var(--gold, #d4af37);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.kg-stk-nav-btn--prev { left: 6px; }
.kg-stk-nav-btn--next { right: 6px; }
.kg-stk-nav-btn:hover {
    border-color: var(--gold, #d4af37);
    background: #2a1418;
}
.kg-stk-nav-btn:focus-visible {
    outline: 2px solid var(--gold, #d4af37);
    outline-offset: 2px;
}
.kg-stk-nav-btn[hidden] { display: none; }
@media (hover: none) and (pointer: coarse) {
    .kg-stk-nav-btn { display: none; }
    .kg-stk-nav::before,
    .kg-stk-nav::after { width: 32px; }
    .kg-stk-tabs { scroll-padding-inline: 28px; }
}
.kg-stk-tab {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--cream-dim);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}
.kg-stk-tab:hover { color: var(--cream); border-color: rgba(243, 237, 226, 0.22); }
.kg-stk-tab.is-active {
    color: #1b0d10;
    background: var(--gold, #d4af37);
    border-color: var(--gold, #d4af37);
}

.kg-stk-body {
    flex: 1 1 auto;
    min-height: 120px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px 10px 12px;
}
.kg-stk-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 4px;
}
.kg-stk-section {
    margin: 2px 4px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-dim, #8a7228);
}
.kg-stk-item {
    width: 100%;
    min-height: 44px;
    padding: 0;
    border: none;
    border-radius: 16px;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: background-color 0.15s ease, transform 0.12s ease;
}
.kg-stk-item:hover { background: radial-gradient(closest-side, rgba(200, 32, 58, 0.26), rgba(200, 32, 58, 0.06) 70%, transparent); }
.kg-stk-item:active { transform: scale(0.96); }
.kg-stk-img {
    display: block;
    flex: 0 0 auto;
    width: 108%;
    aspect-ratio: 1;
    height: auto;
    object-fit: contain;
    margin: -12% -4%;
    pointer-events: none;
    -webkit-user-drag: none;
}
.kg-stk-ghost {
    display: block;
    aspect-ratio: 5 / 4;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
    background-size: 200% 100%;
    animation: kgStkShimmer 1.2s linear infinite;
}
@keyframes kgStkShimmer { to { background-position: -200% 0; } }

.kg-stk-empty {
    padding: 22px 12px;
    text-align: center;
    color: var(--cream-dim);
    font-size: 13px;
    line-height: 1.5;
}
.kg-stk-empty p { margin: 0 0 6px; }
.kg-stk-empty-title { color: var(--cream); font-weight: 600; }

.kg-msg-row.is-sticker .kg-chat-bubble--sticker,
.kg-chat-bubble--sticker {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    max-width: min(220px, 75%);
    color: var(--cream);
}
.kg-chat-bubble--sticker .kg-chat-quote {
    max-width: 100%;
    margin-bottom: 4px;
    background: rgba(28, 14, 18, 0.88);
    border-left-color: var(--gold);
}
.kg-chat-bubble--sticker.kg-chat-bubble--mine .kg-chat-quote-name { color: var(--gold); }
.kg-chat-bubble--sticker .kg-chat-sender { margin-bottom: 2px; }
.kg-sticker {
    width: clamp(136px, 44vw, 180px);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kg-msg-row.is-mine .kg-sticker { align-self: flex-end; }
.kg-sticker-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
    -webkit-user-drag: none;
    user-select: none;
}
.kg-sticker-img.is-missing,
.kg-sticker-thumb.is-missing {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--line);
}
.kg-chat-bubble--sticker .kg-chat-bubble-text--meta {
    align-self: flex-end;
    margin-top: -14px;
    position: relative;
}
.kg-chat-bubble--sticker .kg-chat-meta {
    float: none;
    margin: 0;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(12, 5, 8, 0.7);
    color: var(--cream);
    opacity: 1;
}
.kg-msg-row.is-theirs .kg-chat-bubble--sticker .kg-chat-bubble-text--meta { align-self: flex-start; }
.kg-chat-bubble--sticker .kg-chat-reactions { margin-top: 4px; }
.kg-msg-row.is-mine .kg-chat-bubble--sticker .kg-chat-reactions { align-self: flex-end; }

@media (min-width: 900px) {
    .kg-sticker { width: clamp(180px, 15vw, 220px); }
}

.kg-sticker-thumb {
    flex: 0 0 auto;
    width: 44px;
    height: 36px;
    object-fit: cover;
    object-position: center;
    display: block;
}
.kg-chat-quote.has-sticker {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}
.kg-chat-quote-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
}
.kg-chat-composer-bar .kg-sticker-thumb { width: 48px; height: 40px; }

.kg-msg-chat-panel.is-draft .kg-chat-search-btn,
.kg-msg-chat-panel.is-draft .kg-chat-block-btn { display: none; }

.kg-newchat {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 24px 16px;
    box-sizing: border-box;
}
.kg-newchat-card {
    max-width: 480px;
    width: 100%;
    text-align: center;
    padding: 28px 22px 24px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    background:
        radial-gradient(90% 70% at 50% 0%, rgba(200, 32, 58, 0.22), transparent 70%),
        rgba(255, 255, 255, 0.02);
    box-sizing: border-box;
}
.kg-newchat-peer {
    margin: 0 0 2px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold, #d4af37);
    overflow-wrap: anywhere;
}
.kg-newchat-label {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cream-dim);
}
.kg-newchat-picks { margin: 0 0 16px; }
.kg-newchat-greetings {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}
.kg-newchat-sticker {
    width: 100%;
    min-height: 44px;
    padding: 0;
    border: none;
    border-radius: 16px;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: background-color 0.15s ease, transform 0.12s ease;
}
.kg-newchat-sticker:hover { background: radial-gradient(closest-side, rgba(200, 32, 58, 0.26), rgba(200, 32, 58, 0.06) 70%, transparent); }

.kg-newchat-sticker:active { transform: scale(0.96); }
.kg-newchat-sticker:focus-visible { outline: 2px solid var(--gold, #d4af37); outline-offset: 2px; }
.kg-newchat-sticker-img {
    display: block;
    flex: 0 0 auto;
    width: 108%;
    aspect-ratio: 1;
    height: auto;
    object-fit: contain;
    margin: -12% -4%;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
    pointer-events: none;
    -webkit-user-drag: none;
}
.kg-newchat-title {
    margin: 0 0 6px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--cream);
}
.kg-newchat-text {
    margin: 0 auto 18px;
    max-width: 30ch;
    font-size: 15px;
    line-height: 1.5;
    color: var(--cream-dim);
}
.kg-newchat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid var(--gold, #d4af37);
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold, #d4af37);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 0.15s ease, transform 0.12s ease;
}
.kg-newchat-btn:hover { background: rgba(212, 175, 55, 0.2); }
.kg-newchat-btn:active { transform: scale(0.97); }

@media (max-width: 899px) {
    .kg-stk-picker {
        left: 8px;
        right: 8px;
        width: auto;
        max-width: 448px;
        max-height: min(420px, 56dvh);
    }
}
@media (max-width: 479px) {
    .kg-newchat-greetings { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 300px; margin: 0 auto; }
}
@media (max-width: 360px) {
    .kg-stk-grid { gap: 4px; }
    .kg-stk-body { padding: 8px; }
    .kg-newchat-card { padding: 22px 12px 20px; }
}

@keyframes kgStkBounce {
    0%, 86%, 100% { transform: translateY(0); }
    90% { transform: translateY(-5px); }
    94% { transform: translateY(0); }
    97% { transform: translateY(-2px); }
}
@keyframes kgStkShake {
    0%, 88%, 100% { transform: rotate(0); }
    90% { transform: rotate(-2deg); }
    92% { transform: rotate(2deg); }
    94% { transform: rotate(-1.5deg); }
    96% { transform: rotate(1deg); }
}
@keyframes kgStkTense {
    0%, 90%, 100% { transform: translateX(0); }
    92% { transform: translateX(-1.5px); }
    94% { transform: translateX(1.5px); }
    96% { transform: translateX(-1px); }
}
@keyframes kgStkPulse {
    0%, 84%, 100% { transform: scale(1); }
    90% { transform: scale(1.05); }
    95% { transform: scale(0.99); }
}
@keyframes kgStkParty {
    0%, 84%, 100% { transform: rotate(0) scale(1); }
    88% { transform: rotate(-3deg) scale(1.03); }
    92% { transform: rotate(3deg) scale(1.03); }
    96% { transform: rotate(0) scale(1); }
}
.kg-msg-row.is-inview .kg-sticker[data-anim] .kg-sticker-img {
    animation-duration: 7s;
    animation-iteration-count: 3;
    animation-timing-function: ease-in-out;
    animation-delay: 1.5s;
}
.kg-msg-row.is-inview .kg-sticker[data-anim="bounce"] .kg-sticker-img { animation-name: kgStkBounce; }
.kg-msg-row.is-inview .kg-sticker[data-anim="shake"] .kg-sticker-img { animation-name: kgStkShake; }
.kg-msg-row.is-inview .kg-sticker[data-anim="tense"] .kg-sticker-img { animation-name: kgStkTense; }
.kg-msg-row.is-inview .kg-sticker[data-anim="pulse"] .kg-sticker-img { animation-name: kgStkPulse; }
.kg-msg-row.is-inview .kg-sticker[data-anim="party"] .kg-sticker-img { animation-name: kgStkParty; }

@media (prefers-reduced-motion: reduce) {
    .kg-stk-picker,
    .kg-stk-nav::before,
    .kg-stk-nav::after,
    .kg-stk-nav-btn,
    .kg-chat-sticker-btn,
    .kg-stk-item,
    .kg-newchat-btn,
    .kg-newchat-sticker { transition: none; }
    .kg-stk-picker { transform: none; }
    .kg-stk-ghost { animation: none; }
    .kg-msg-row .kg-sticker .kg-sticker-img,
    .kg-msg-row.is-inview .kg-sticker[data-anim] .kg-sticker-img { animation: none !important; }
    .kg-stk-item:active,
    .kg-chat-sticker-btn:active:not(:disabled),
    .kg-newchat-btn:active,
    .kg-newchat-sticker:active { transform: none; }
}

.kg-sticker.kg-sticker--pack { width: clamp(112px, 34vw, 140px); }
@media (min-width: 900px) {
    .kg-sticker.kg-sticker--pack { width: 152px; }
}
.kg-stk-img.kg-stk-img--pack {
    width: 100%;
    margin: 0;
}
.kg-stk-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 180px;
}
.kg-stk-tab-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kg-stk-tab-icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    margin-left: -8px;
    object-fit: contain;
    pointer-events: none;
}
.kg-stk-tab--epic:not(.is-active) { border-color: rgba(189, 159, 232, 0.35); }
.kg-stk-tab--legendary:not(.is-active) { border-color: rgba(226, 191, 79, 0.45); }
.kg-stk-tab--shop {
    text-decoration: none;
    color: var(--gold, #d4af37);
    border-style: dashed;
    border-color: rgba(212, 175, 55, 0.45);
}
.kg-stk-tab--shop:focus-visible,
.kg-stk-shop-btn:focus-visible {
    outline: 2px solid var(--gold, #d4af37);
    outline-offset: 2px;
}
.kg-stk-shop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 10px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--gold, #d4af37);
    color: #1b0d10;
    font-weight: 700;
    text-decoration: none;
}
@media (min-width: 600px) {
    .kg-stk-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 479px) {
    .kg-stk-tab-text { max-width: 132px; }
}
