:root {
    --primary-blue: #3b82f6;
    --primary-orange: #f59e0b;
    --primary-dark: #1e293b;
    --bg-gray: #f1f5f9;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body { 
    font-family: 'Pretendard', sans-serif; 
    background-color: var(--bg-gray); 
    margin: 0; padding: 20px; color: #334155;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1000px; margin: 0 auto; }

/* 헤더 및 통계 카드 */
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }
.nickname-settings { display: flex; gap: 10px; }
.name-card { background: white; padding: 8px 15px; border-radius: 12px; display: flex; align-items: center; gap: 10px; box-shadow: var(--card-shadow); }
.name-value { font-weight: 700; }
.btn-name-edit { border: none; background: #e2e8f0; padding: 4px 8px; border-radius: 6px; font-size: 0.75rem; cursor: pointer; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 25px; }
.stat-card { background: white; padding: 20px; border-radius: 18px; box-shadow: var(--card-shadow); }
.stat-label { font-size: 0.85rem; color: #64748b; margin-bottom: 5px; display: block; }
.stat-value { font-size: 1.5rem; font-weight: 800; }
.val-a { color: var(--primary-blue); }
.val-b { color: var(--primary-orange); }

/* 입력 카드 */
.input-card { background: white; padding: 25px; border-radius: 20px; box-shadow: var(--card-shadow); margin-bottom: 25px; }
.user-toggle { display: flex; background: #f1f5f9; padding: 5px; border-radius: 12px; margin-bottom: 20px; }
.toggle-btn { flex: 1; padding: 10px; border: none; border-radius: 8px; cursor: pointer; font-weight: 700; background: transparent; color: #64748b; }
.toggle-btn.active.A { background: white; color: var(--primary-blue); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.toggle-btn.active.B { background: white; color: var(--primary-orange); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

.input-row { display: flex; gap: 15px; align-items: flex-end; flex-wrap: wrap; }
.input-item { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 5px; }
.input-item label { font-size: 0.85rem; font-weight: 600; color: #64748b; }
.input-item input { padding: 12px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 1rem; }
.btn-save { background: var(--primary-dark); color: white; border: none; padding: 13px 25px; border-radius: 10px; cursor: pointer; font-weight: 700; height: 46px; }

/* 테이블 카드 */
.table-card { background: white; border-radius: 20px; box-shadow: var(--card-shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { background: #f8fafc; padding: 15px; font-size: 0.85rem; color: #64748b; text-align: center; }
td { padding: 15px; border-bottom: 1px solid #f1f5f9; text-align: center; cursor: pointer; }
tr.selected { background-color: #f0f7ff; }

/* 인라인 버튼 그룹 */
.cell-content { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.rate-text { font-weight: 700; font-size: 1rem; }
.action-group { display: flex; gap: 4px; }
.btn-mini-edit { border: none; background: #f1f5f9; color: #475569; padding: 3px 8px; border-radius: 4px; font-size: 0.7rem; cursor: pointer; font-weight: 600; }
.btn-mini-del { border: none; background: #fee2e2; color: #ef4444; padding: 3px 8px; border-radius: 4px; font-size: 0.7rem; cursor: pointer; font-weight: 600; }
.btn-fill { background: #f8fafc; border: 1px dashed #cbd5e1; padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; cursor: pointer; color: #94a3b8; }

/* 📱 모바일 최적화 */
@media (max-width: 768px) {
    body { padding: 10px; }
    thead { display: none; }
    tr { display: block; margin-bottom: 15px; border: 1px solid #e2e8f0; border-radius: 15px; padding: 10px; background: white; }
    td { display: flex; justify-content: space-between; align-items: center; border: none; padding: 8px 5px; }
    td::before { content: attr(data-label); font-weight: 700; color: #94a3b8; font-size: 0.8rem; }
    .cell-content { align-items: flex-end; }
}