/* --------------------------------------------------
   컨트롤: 버튼, 아이콘 버튼, 입력, 상태 칩
   -------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: var(--tap);
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    transition: background-color 0.15s ease, transform 0.08s ease, opacity 0.15s ease;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    min-height: 52px;
    font-size: 16px;
}

.btn-sm {
    min-height: 32px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-strong);
}

.btn-secondary {
    background: var(--surface-2);
    border-color: var(--line-strong);
    color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
    background: #253049;
}

.btn-ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text);
}

/* 최소 장수를 채워 턴을 마칠 수 있을 때 */
#submit-turn-button.active-turn-end {
    background: var(--gold);
    border-color: var(--gold);
    color: #2a2000;
}

/* 아이콘 버튼 (앱 바, 닫기) */
.icon-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.icon-btn:hover {
    border-color: var(--line-strong);
}

.icon-btn-text {
    font-size: 12px;
    letter-spacing: 0.04em;
}

/* 입력 */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.text-input {
    width: 100%;
    min-height: var(--tap);
    padding: 0 14px;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-size: 16px;            /* 16px 미만이면 iOS 가 입력 시 화면을 확대함 */
    outline: none;
}

.text-input:focus {
    border-color: var(--accent);
}

.text-input:disabled {
    opacity: 0.5;
}

/* 상태 칩 */
.status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 28px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
}

body:not(.connected) .status-bar {
    display: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.chip-turn {
    background: var(--gold);
    border-color: var(--gold);
    color: #2a2000;
}

.chip-win {
    background: rgba(47, 212, 134, 0.16);
    border-color: var(--up);
    color: var(--up);
}

.chip-loss {
    background: rgba(255, 99, 128, 0.14);
    border-color: var(--down);
    color: var(--down);
}

.chip-muted {
    color: var(--muted);
    font-weight: 500;
}

/* 글자가 들어가는 앱 바 버튼 (예: 나가기) */
.icon-btn-wide {
    width: auto;
    padding: 0 10px;
    font-size: 13px;
}
