/* --------------------------------------------------
   감정 표현 / 더미 신호 (emotes.js)
   -------------------------------------------------- */

.btn-emote {
    padding: 0;
    min-width: var(--tap);
    font-size: 20px;
}

.chat-input-row {
    display: flex;
    gap: 8px;
}

.chat-input-row .chat-input {
    flex: 1;
}

/* 트레이: 모바일은 손패 독 위에 뜨는 판, 넓은 화면도 같은 위치(가운데 아래) */
.emote-tray {
    position: fixed;
    z-index: 30;
    left: 50%;
    bottom: calc(150px + var(--safe-bottom));
    transform: translateX(-50%);
    width: min(420px, calc(100vw - 20px));
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    animation: tray-up 0.16s ease-out;
}

body:not(.in-game) .emote-tray {
    bottom: calc(80px + var(--safe-bottom));
}

@keyframes tray-up {
    from { transform: translate(-50%, 10px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.emote-section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin: 2px 2px 8px;
}

.emote-section-note {
    font-weight: 500;
    font-size: 11px;
}

.emote-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.emote-grid-signals {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 0;
}

.emote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 2px 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: transform 0.08s ease, border-color 0.15s ease;
}

.emote-btn:active:not(:disabled) {
    transform: scale(0.94);
}

.emote-btn:hover:not(:disabled) {
    border-color: var(--line-strong);
}

.emote-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.emote-emoji {
    font-size: 24px;
    line-height: 1;
}

.emote-name {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

/* 더미 신호 대상 고르기 */
.emote-hint {
    position: fixed;
    z-index: 30;
    left: 50%;
    top: calc(64px + var(--safe-top));
    transform: translateX(-50%);
    width: min(440px, calc(100vw - 20px));
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 14px;
    background: var(--gold);
    color: #2a2000;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
}

.emote-hint-text {
    flex: 1;
}

.emote-hint .btn-ghost {
    color: #2a2000;
    border-color: rgba(42, 32, 0, 0.35);
}

body.emote-targeting .pile {
    border-color: var(--gold);
    cursor: pointer;
    animation: target-pulse 1s ease-in-out infinite alternate;
}

@keyframes target-pulse {
    from { box-shadow: 0 0 0 0 rgba(255, 201, 61, 0.0); }
    to { box-shadow: 0 0 0 4px rgba(255, 201, 61, 0.35); }
}

/* 좌석 위 말풍선 */
.seat-bubble {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: -14px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px 3px 6px;
    background: var(--card-face);
    color: var(--card-ink);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    animation: bubble-pop 0.25s cubic-bezier(.3, 1.6, .5, 1);
    pointer-events: none;
}

.bubble-emoji {
    font-size: 18px;
    line-height: 1;
}

@keyframes bubble-pop {
    from { transform: translate(-50%, 6px) scale(0.6); opacity: 0; }
    to { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

/* 더미 위 신호 배지 */
.pile-signal {
    position: absolute;
    z-index: 3;
    left: 6px;
    right: 6px;
    bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    animation: bubble-pop-plain 0.25s ease-out;
    pointer-events: none;
}

.signal-block { background: rgba(220, 38, 70, 0.92); }
.signal-ok { background: rgba(22, 160, 96, 0.92); }
.signal-mine { background: rgba(118, 86, 245, 0.92); }

.signal-emoji {
    font-size: 14px;
}

.signal-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 건드리지 마: 더미 전체를 살짝 가림 */
.pile:has(.signal-block) {
    filter: saturate(0.6);
}

@keyframes bubble-pop-plain {
    from { transform: translateY(6px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* hidden 속성이 display 지정보다 우선하도록 (안 그러면 처음부터 보임) */
.emote-tray[hidden],
.emote-hint[hidden] {
    display: none;
}
