* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* iOS Safari 입력 포커스 시 자동 확대 방지 (16px 미만이면 확대됨) */
input,
select,
textarea {
    font-size: 16px;
}

:root {
    /* Child Mode Colors (Default) */
    --main-color: #4C5C68;
    --sub-color: #C5C3C6;

    /* Alias variables for legacy / semantic colors using the new 2-color constraint */
    --primary-color: var(--main-color);
    --primary-light: var(--sub-color);
    --primary-dark: #3b4852;
    /* Slightly darker main color */

    --secondary-color: var(--sub-color);

    /* Semantic Colors -> All grayscaled per guidelines except main/sub */
    --danger-color: #333333;
    --success-color: #333333;
    --warning-color: #333333;

    /* Grayscales */
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-color: #212529;
    --text-light: #6C757D;
    --border-color: #E0E0E0;

    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body.parent-mode {
    /* Parent Mode Colors */
    --main-color: #7392B7;
    --sub-color: #C5D5EA;
    --primary-dark: #58789d;
    /* Slightly darker main color */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* 로그인 화면 */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--main-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-screen.active {
    visibility: visible;
    opacity: 1;
}

.login-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    width: 90%;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
}

.login-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-color);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.login-btn {
    background: var(--main-color);
    color: white;
    padding: 0.9rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.login-btn:active {
    transform: translateY(0);
}

.login-info {
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.login-info p {
    margin: 0.3rem 0;
    font-weight: 500;
}

.login-error {
    color: var(--danger-color);
    font-weight: 600;
    text-align: center;
    min-height: 1.5rem;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#mainApp {
    opacity: 0;
    transition: opacity 0.2s ease;
}

#mainApp.ready {
    opacity: 1;
}

/* 헤더 (부모 모드) */
.header {
    background-color: var(--main-color);
    color: white;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}

.header h1 {
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
}

.logout-btn {
    background-color: transparent;
    color: white;
    border: none;
    padding: 0;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 새 헤더 (아이 모드) */
.header-new {
    padding: 1rem 1.25rem 0;
    background: transparent;
}

.header-new-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.greeting-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.greeting-small {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.greeting-large {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-color);
}

/* 우측 상단: 포인트 + 로그아웃 */
.header-right-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.points-badge-compact {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    background: #F0F0F0;
    border-radius: 20px;
    white-space: nowrap;
}

.points-badge-star {
    color: #F59E0B;
    font-size: 0.85rem;
}

.points-badge-compact .points-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
}

.points-badge-compact .points-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
}

.header-logout-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.header-logout-btn:hover {
    color: var(--text-color);
}

/* 포인트 표시 (legacy) */
.points-display {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.points-icon {
    font-size: 1rem;
}

.points-value {
    font-size: 1rem;
    font-weight: 700;
}

.points-label {
    font-size: 0.85rem;
    font-weight: 600;
}

/* 탭 네비게이션 (부모 모드 상단) */
.tab-nav {
    display: flex;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-btn {
    flex: 1;
    padding: 0.6rem 0.5rem;
    border: none;
    background: none;
    color: #AAAAAA;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-icon {
    width: 22px;
    height: 22px;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.tab-btn.active .tab-icon,
.bottom-tab-btn.active .tab-icon {
    opacity: 1;
}

.tab-btn:hover .tab-icon {
    opacity: 0.75;
}

/* 하단 탭 네비게이션 (아이 모드) */
.bottom-tab-nav {
    display: flex;
    align-items: flex-end;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    border-radius: 18px 18px 0 0;
}

.bottom-tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.65rem 0.25rem 0.5rem;
    border: none;
    background: none;
    color: #AAAAAA;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bottom-tab-btn .tab-icon {
    width: 24px;
    height: 24px;
}

.bottom-tab-btn .tab-label {
    font-size: 0.62rem;
    line-height: 1;
}

.bottom-tab-btn.active {
    color: var(--main-color);
}

.bottom-tab-btn:hover {
    color: var(--main-color);
}

/* 가운데 타이머 강조 탭 */
.bottom-tab-center {
    position: relative;
    padding-top: 0.3rem;
}

.bottom-tab-center-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--main-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -22px;
    box-shadow: 0 4px 12px rgba(76, 92, 104, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

.bottom-tab-center-icon .tab-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
    opacity: 1;
}

.bottom-tab-center .tab-label {
    color: var(--main-color);
    font-weight: 700;
}

.bottom-tab-center.active .bottom-tab-center-icon {
    background: var(--main-color);
    box-shadow: 0 4px 16px rgba(76, 92, 104, 0.45);
}

.bottom-tab-center:hover .bottom-tab-center-icon {
    transform: scale(1.05);
}

/* active 아닐 때 center icon 약간 흐리게 */
.bottom-tab-center:not(.active) .bottom-tab-center-icon {
    background: var(--sub-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bottom-tab-center:not(.active) .tab-label {
    color: #AAAAAA;
}

/* Modal (Tetris Top 10) */
.modal.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    z-index: 2001;
    width: min(520px, 92vw);
    margin: 8vh auto;
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 10px 18px 18px;
    max-height: 60vh;
    overflow: auto;
}

.modal-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.modal-form-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.85rem;
    letter-spacing: .2px;
}

.modal-input {
    padding: 0.7rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
    transition: border-color .25s ease, box-shadow .25s ease;
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-input::placeholder {
    color: var(--text-light);
}

.preset-amount-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--danger-color);
    padding: 0.4rem 0.6rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    width: fit-content;
}

.add-points-body,
.subtract-points-body {
    padding-top: 16px;
}

.hidden {
    display: none !important;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 18px;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 100px;
    padding: 0.6rem 1.2rem;
}

/* 타이머 종료 모달 */
/* 시간 확인 모달 */
.time-confirm-modal {
    max-width: 450px;
}

.time-confirm-modal .modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.time-confirm-modal .warning-text {
    text-align: center;
    color: #fbbf24;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.time-input-group input {
    width: 70px;
    padding: 0.5rem;
    border: 2px solid #374151;
    border-radius: 8px;
    font-size: 1rem;
    color: #fff;
    background-color: #0b1220;
    text-align: center;
    transition: border-color 0.3s ease;
}

.time-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.stop-timer-modal {
    max-width: 450px;
}

.stop-timer-modal .modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.subject-selector-modal,
.memo-section-modal {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.subject-selector-modal label,
.memo-section-modal label {
    font-weight: 600;
    color: #e5e7eb;
    font-size: 0.95rem;
}

.subject-selector-modal select,
.memo-section-modal textarea {
    padding: 0.75rem;
    border: 2px solid #374151;
    border-radius: 8px;
    font-size: 1rem;
    color: #fff;
    background-color: #0b1220;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.subject-selector-modal select:focus,
.memo-section-modal textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.memo-section-modal textarea {
    resize: vertical;
    min-height: 100px;
}

/* 기록 수정 모달 */
.edit-record-modal {
    max-width: 420px;
}

/* Edit modal: time row */
.edit-time-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.edit-time-current {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    padding: 0.6rem 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

.edit-time-arrow {
    font-size: 1.2rem;
    color: var(--text-light);
    flex-shrink: 0;
}

.edit-time-input {
    width: 80px !important;
    flex: 0 0 80px !important;
    text-align: center;
}

.edit-helper-text {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Edit modal: footer with delete on left */
.edit-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-modal-footer-right {
    display: flex;
    gap: 0.5rem;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-danger-outline:hover {
    background: var(--danger-color);
    color: #fff;
}

.subject-display-modal {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.subject-display-modal label {
    font-weight: 600;
    color: #e5e7eb;
    font-size: 0.95rem;
}

.subject-label {
    padding: 0.75rem;
    border: 2px solid #374151;
    border-radius: 8px;
    font-size: 1rem;
    color: #fff;
    background-color: #0b1220;
    font-weight: 600;
}

/* 기록 추가 버튼과 헤더 */
.add-manual-record-btn {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    background: none;
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, border-color 0.2s;
}

.add-manual-record-btn:hover {
    background: var(--bg-color);
    border-color: var(--main-color);
    color: var(--text-color);
}

/* 수동 기록 추가 모달 */
.manual-record-modal {
    max-width: 420px;
}

.manual-row {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 2px;
}

.manual-half {
    flex: 1;
}

.manual-datetime-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.manual-date-input {
    flex: 1;
    min-width: 0;
}

.manual-time-select {
    width: 62px;
    flex: 0 0 62px;
    text-align: center;
}

.manual-time-colon {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-light);
    flex-shrink: 0;
}

.manual-duration-badge {
    text-align: center;
    padding: 0.45rem 0.75rem;
    margin-bottom: 14px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-color);
}

.form-input-small {
    flex: 1;
    min-width: 60px;
    padding: 0.75rem;
    border: 2px solid #374151;
    border-radius: 8px;
    font-size: 1rem;
    color: #fff;
    background-color: #0b1220;
    font-family: inherit;
    transition: border-color 0.3s ease;
    text-align: center;
}

.form-input-small:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-input-small::placeholder {
    color: #6b7280;
    font-size: 0.875rem;
}

/* 승인 모달 */
.approval-modal {
    max-width: 450px;
}

.approval-modal .modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.approval-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-color: #0b1220;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid #374151;
}

.approval-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.approval-label {
    font-weight: 600;
    color: #9ca3af;
    font-size: 0.875rem;
    flex-shrink: 0;
    min-width: 60px;
}

.approval-value {
    font-weight: 500;
    color: #e5e7eb;
    font-size: 0.875rem;
    text-align: right;
    word-break: break-word;
}

.approval-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.approval-footer .btn {
    flex: 1;
}

/* 승인 상태 표시 */
.approval-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.approval-status.pending {
    background-color: #fef3c7;
    color: #92400e;
}

.approval-status.approved {
    background-color: #d1fae5;
    color: #065f46;
}

.approval-status.rejected {
    background-color: #fee2e2;
    color: #991b1b;
}

/* 승인 대기 중 포인트 표시 (연하게) */
.record-points.pending {
    opacity: 0.5;
}

/* 거절된 포인트 표시 (취소선) */
.record-points.rejected {
    text-decoration: line-through;
    opacity: 0.6;
}

/* 승인 대기 섹션 (부모 모드) */
.pending-approval-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #fbbf24;
}

.pending-approval-section h3 {
    color: #f59e0b;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.points-item.pending-approval {
    background-color: #fef3c7;
    border: 2px solid #fbbf24;
}

.points-item-type.pending {
    background-color: #fbbf24;
    color: #78350f;
}

.points-item-amount.pending {
    color: #f59e0b;
    opacity: 0.7;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-warning:hover {
    background-color: #1a1a1a;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-success:hover {
    background-color: #1a1a1a;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background-color: #1a1a1a;
}

.leaderboard-list {
    display: grid;
    gap: 10px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    background: #0b1220;
    border: 1px solid #1f2937;
    transition: background .2s ease;
}

.leaderboard-item:hover {
    background: #142033;
}

.leaderboard-left {
    display: flex;
    gap: 12px;
    align-items: center;
}

.rank-badge {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #374151;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
}

.leaderboard-name {
    font-weight: 600;
    color: #e5e7eb;
}

.leaderboard-score {
    font-weight: 700;
    color: #60a5fa;
    text-align: right;
}

.leaderboard-date {
    color: #9ca3af;
    font-size: 11px;
    text-align: right;
    margin-top: 2px;
}

.tab-btn.active {
    color: var(--main-color);
    border-bottom-color: var(--main-color);
}

.tab-btn:hover {
    color: var(--main-color);
}

/* 탭 콘텐츠 */
.tab-content {
    display: none;
    padding: 1.5rem;
    padding-bottom: 80px;
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

/* 사용자 선택 버튼 */
.user-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.user-btn {
    flex: 1;
    min-width: 70px;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.user-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 부모 포인트 탭: 자녀 포인트 뱃지 */
.child-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.75rem 0.85rem;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all .2s ease;
    min-width: 90px;
}

.child-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.child-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.child-btn.active .child-points-badge {
    background: #fff;
    color: var(--primary-color);
    border-color: #fff;
}

.child-name-label {
    line-height: 1;
    font-size: 0.95rem;
}

.child-points-badge {
    display: inline-block;
    padding: 5px 12px;
    font-size: 1.05rem;
    font-weight: 700;
    background: var(--bg-color);
    color: var(--main-color);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    letter-spacing: .3px;
}

/* 타이머 섹션 - contents로 자식들이 부모 flex에 직접 참여 */
.timer-section {
    display: contents;
}

/* 버튼 그룹 (legacy) */
.button-group {
    display: flex;
    gap: 1rem;
}

.play-pause-btn {
    flex: 2;
    font-size: 1.4rem;
    padding: 1rem;
}

.stop-btn {
    flex: 1;
    font-size: 1.4rem;
    padding: 1rem;
}

.reset-btn {
    flex: 0.8;
    font-size: 1.3rem;
    padding: 1rem;
}

/* 카테고리 토글 */
.category-toggle {
    display: flex;
    position: relative;
    background: #F0F0F0;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 0;
    width: 100%;
}

.category-toggle-btn {
    flex: 1;
    padding: 0.6rem 0.5rem;
    border: none;
    background: none;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
    border-radius: 10px;
}

.category-toggle-btn.active {
    color: white;
}

.category-toggle-slider {
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: calc(33.333% - 2.67px);
    border-radius: 10px;
    background: #7C3AED;
    transition: transform 0.3s ease, background-color 0.3s ease;
    z-index: 1;
    left: 4px;
}

.category-toggle[data-active="공부"] .category-toggle-slider {
    transform: translateX(0);
    background: #7C3AED;
}

.category-toggle[data-active="학원"] .category-toggle-slider {
    transform: translateX(100%);
    background: #38BDF8;
}

.category-toggle[data-active="독서"] .category-toggle-slider {
    transform: translateX(200%);
    background: #92400E;
}

.category-toggle.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* 원형 타이머 링 */
.timer-ring-container {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto;
}

.timer-ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-ring-track {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 10;
    opacity: 0.3;
}

.timer-ring-progress {
    fill: none;
    stroke: #7C3AED;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 553;
    stroke-dashoffset: 553;
    transition: stroke 0.3s ease;
}

.timer-ring-overlap {
    fill: none;
    stroke: #7C3AED;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 553;
    stroke-dashoffset: 553;
    opacity: 0.35;
}

.timer-ring-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.timer-ring-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.timer-ring-center .time {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.02em;
    line-height: 1;
}

.timer-ring-starttime {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    margin-top: 0.2rem;
    min-height: 1.1em;
}

/* 타이머 컨트롤 버튼 */
.timer-controls {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.timer-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.5rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timer-ctrl-stop {
    flex: 1;
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-light);
}

.timer-ctrl-stop:not(:disabled):hover {
    border-color: var(--text-color);
    color: var(--text-color);
}

.timer-ctrl-stop:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.timer-ctrl-play {
    flex: 2;
    background: var(--play-btn-color, #7C3AED);
    border: none;
    color: white;
    box-shadow: 0 4px 15px var(--play-btn-shadow, rgba(124, 58, 237, 0.35));
}

.timer-ctrl-play:hover {
    filter: brightness(0.9);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--play-btn-shadow, rgba(124, 58, 237, 0.4));
}

.ctrl-icon {
    font-size: 0.85rem;
}

.timer-reset-link {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: -0.5rem;
    text-decoration: underline;
    padding: 0.25rem;
}

.timer-reset-link:hover {
    color: var(--text-color);
}

/* 종료 모달 - 카테고리 뱃지 */
.category-display-modal {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.category-display-modal label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.category-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    background: rgba(124, 58, 237, 0.1);
    color: #7C3AED;
    border: 2px solid rgba(124, 58, 237, 0.3);
    width: fit-content;
}

.category-badge[data-category="학원"] {
    background: rgba(56, 189, 248, 0.1);
    color: #0284C7;
    border-color: rgba(56, 189, 248, 0.3);
}

.category-badge[data-category="독서"] {
    background: rgba(146, 64, 14, 0.1);
    color: #92400E;
    border-color: rgba(146, 64, 14, 0.3);
}

/* 종료 모달 - 과목 선택 */
.subject-selector-stop {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.subject-selector-stop label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.subject-selector-stop select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-color);
    background-color: var(--card-bg);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.subject-selector-stop select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.timer-display {
    padding: 2.5rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    transition: border-color 0.5s ease;
    display: none;
    /* hidden - replaced by ring */
}

/* 타이머 실행 중 애니메이션 */
.timer-display.running {
    border-color: var(--main-color);
    animation: timerPulse 2s ease-in-out infinite;
}

/* 테두리 색상 펀스 애니메이션 */
@keyframes timerPulse {

    0%,
    100% {
        border-color: var(--main-color);
    }

    50% {
        border-color: var(--sub-color);
    }
}

.timer-display .time {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--main-color);
    font-family: 'SF Mono', 'Courier New', monospace;
    letter-spacing: 0.15em;
}

/* 과목 선택 */
/* 입력 필드 표시/숨김 */
#input-fields {
    transition: all 0.3s ease;
    max-height: 500px;
    opacity: 1;
}

#input-fields.input-fields-hidden {
    display: none;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.subject-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subject-selector label {
    font-weight: 600;
    color: var(--text-color);
}

.subject-selector select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-color);
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.subject-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 버튼 그룹 */
.button-group {
    display: flex;
    gap: 0.75rem;
}

.btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background-color: transparent;
    border: 2px solid #999;
    color: #666;
}

.btn-danger:hover:not(:disabled) {
    background-color: #f5f5f5;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-light);
}

.btn-secondary:hover:not(:disabled) {
    background-color: #f5f5f5;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    width: 100%;
}

.btn-success:hover:not(:disabled) {
    background-color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 메모 섹션 */
.memo-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.memo-section label {
    font-weight: 600;
    color: var(--text-color);
}

.memo-section textarea {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

.memo-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 기록 섹션 */
.history-section h2,
.stats-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background-color: white;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.filter-btn.active {
    background-color: var(--main-color);
    color: white;
    border-color: var(--main-color);
}

.filter-btn:hover {
    border-color: var(--main-color);
}

/* 기록 리스트 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 1rem;
}

.history-item {
    background-color: var(--card-bg);
    padding: 1rem 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.history-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.history-item-row-2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.4rem;
    font-size: 0.85rem;
}

.history-item-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.history-item-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.history-item-subject {
    display: inline-block;
    background-color: var(--main-color);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border: none;
}

.history-item-duration {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
}

.history-item-points {
    display: none;
}

.history-item-memo {
    color: var(--text-light);
    font-size: 0.85rem;
    margin: 0.5rem 0;
    display: block;
    width: 100%;
}

.history-item-date {
    color: var(--text-light);
    font-size: 0.75rem;
}

.history-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

/* 날짜 구분선 */
.date-separator {
    text-align: center;
    margin: 0.6rem 0 0.3rem 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.date-separator::before,
.date-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.date-separator::before {
    margin-right: 1rem;
}

.date-separator::after {
    margin-left: 1rem;
}

.date-divider {
    height: 0.25rem;
}

/* 통계 섹션 */
.period-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.period-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    background-color: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.period-btn.active {
    background-color: var(--main-color);
    color: white;
    border-color: var(--main-color);
}

.period-btn:hover {
    border-color: var(--main-color);
}

/* 날짜 네비게이션 */
.date-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.nav-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background-color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    transition: all 0.2s ease;
    min-width: 48px;
}

.nav-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.nav-btn:active {
    transform: scale(0.95);
}

.period-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    min-width: 200px;
    text-align: center;
}

/* 통계 카드 */
.stats-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1rem 0.75rem;
    border-radius: 12px;
    text-align: center;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--main-color);
}

/* 차트 섹션 */
.chart-section {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.chart-section h3 {
    margin-bottom: 1rem;
    text-align: center;
}

.chart-section canvas {
    max-height: 300px;
}

/* 통계 비교 섹션 */
.stats-comparison {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.total-hours-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    min-width: 100px;
    padding-right: 2rem;
    border-right: 2px solid var(--border-color);
}

.total-hours-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.total-hours-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.comparison-stats {
    display: flex;
    gap: 2rem;
    flex: 1;
    justify-content: space-around;
}

.comparison-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: center;
}

.comparison-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    text-align: center;
}

.comparison-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.comparison-value.positive {
    color: #10b981;
}

.comparison-value.negative {
    color: #ef4444;
}

.comparison-value.equal {
    color: #6b7280;
}

/* 과목별 통계 */
.subject-stats {
    margin-top: 2rem;
}

.subject-stats h3 {
    margin-bottom: 1rem;
}

.subject-list {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 새로운 가로 바 스타일 */
.subject-bar-row {
    display: grid;
    grid-template-columns: 100px 1fr 80px;
    align-items: center;
    gap: 1rem;
}

.subject-bar-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.subject-bar-container {
    width: 100%;
    height: 24px;
    background-color: var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.subject-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 12px;
    transition: width 0.3s ease;
    min-width: 2%;
}

.subject-bar-time {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
    text-align: right;
}

/* 기존 스타일 (사용하지 않지만 호환성 유지) */
.subject-item {
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subject-item-name {
    font-weight: 600;
    color: var(--text-color);
}

.subject-item-hours {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-weight: 600;
}

.subject-item-bar {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.subject-item-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

/* 반응형 디자인 */
@media (max-width: 600px) {
    .container {
        max-width: 100%;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .timer-display .time {
        font-size: 3rem;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    /* 모바일 통계 비교 섹션 */
    .stats-comparison {
        flex-direction: column;
        gap: 1rem;
    }

    .total-hours-section {
        padding-right: 0;
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        padding-bottom: 1rem;
    }

    .comparison-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .comparison-item {
        min-width: 0;
    }
}

/* 애니메이션 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-item {
    animation: slideIn 0.3s ease;
}

.history-more-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.history-more-btn:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

/* 쉬어가기 섹션 */
.break-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.break-menu {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.break-menu-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--border-color);
    background-color: white;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    transition: all 0.3s ease;
    color: var(--text-color);
    font-size: 0.95rem;
}

.break-menu-btn.active {
    background-color: var(--main-color);
    color: white;
    border-color: var(--main-color);
}

.break-menu-btn:hover {
    border-color: var(--main-color);
    color: var(--main-color);
}

.break-menu-btn.active:hover {
    color: white;
}

.break-content {
    display: none;
}

.break-content.active {
    display: block;
    animation: slideIn 0.3s ease;
}

/* 토막상식 카드 */
.fact-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.fact-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.fact-description {
    font-size: 1rem;
    line-height: 1.7;
    opacity: 0.95;
    flex: 1;
    display: flex;
    align-items: center;
}

@media (max-width: 600px) {
    .fact-card {
        min-height: auto;
        padding: 1.5rem;
    }

    .fact-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .fact-description {
        font-size: 0.95rem;
    }
}

/* O/X 퀴즈 카드 */
.ox-quiz-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.quiz-question {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    line-height: 1.6;
    min-height: 80px;
    display: flex;
    align-items: center;
}

.quiz-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.quiz-buttons .btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    flex: 1;
    min-width: 80px;
}

.quiz-buttons .btn-success:hover:not(:disabled) {
    background-color: #1a1a1a;
}

.quiz-buttons .btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    flex: 1;
    min-width: 80px;
}

.quiz-buttons .btn-danger:hover:not(:disabled) {
    background-color: #1a1a1a;
}

.quiz-buttons .btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.quiz-feedback {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-line;
}

.quiz-score {
    color: white;
    font-size: 1rem;
}

@media (max-width: 600px) {
    .ox-quiz-card {
        min-height: auto;
        padding: 1.5rem;
    }

    .quiz-question {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
        min-height: 60px;
    }

    .quiz-feedback {
        font-size: 0.9rem;
        padding: 1rem;
    }
}

/* 테트리스 게임 */
.tetris-layout {
    display: grid;
    grid-template-columns: 70% 30%;
    /* enforce 7:3 percentage */
    gap: 20px;
    align-items: start;
    width: 100%;
}

.tetris-game-area {
    /* left board cell */
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.tetris-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.tetris-next-block {
    text-align: center;
}

.next-block-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.8rem;
}

.next-block-canvas {
    border: 2px solid var(--border-color);
    background-color: #f5f5f5;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.tetris-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: 10px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.tetris-canvas {
    border: 3px solid var(--primary-color);
    background-color: #1a1a1a;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    /* slightly larger board */
    aspect-ratio: 10 / 20;
    /* width:height ratio consistent */
    box-shadow: var(--shadow-lg);
}

/* Tetris overlay (right column) */
.tetris-overlay {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 140px;
    /* slightly slimmer */
    margin: 0 auto;
    height: 100%;
    /* allow children to stretch and bottom-align items */
}

.tetris-overlay-next {
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 8px 8px 10px;
    backdrop-filter: blur(2px);
}

.tetris-overlay-next .next-block-canvas {
    width: 80px !important;
    height: 80px !important;
    display: block;
    margin: 0 auto;
}

.tetris-overlay-next .next-block-label {
    color: #9ca3af;
    font-size: 11px;
    margin-bottom: 4px;
    text-align: right;
}

.tetris-overlay-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    /* fill remaining space so ranking can sit at bottom */
}

/* Ranking button inline under stats, bottom-aligned */
.tetris-ranking-inline {
    margin-top: auto;
    /* push to bottom within stats column */
    display: flex;
    justify-content: flex-end;
}

.tetris-ranking-inline .tetris-ranking-btn {
    padding: 6px 12px;
    font-size: 14px;
}

.tetris-overlay-stats .stat-item {
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 10px 12px 8px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.tetris-overlay-stats .stat-label {
    color: #9ca3af;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
}

.tetris-overlay-stats .stat-value {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.4rem;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Controls under the grid */
.tetris-control-area {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.tetris-start-btn {
    width: min(420px, 90%);
}

.tetris-ranking-container {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.tetris-ranking-btn {
    min-width: 100px;
}

/* Make 최고 점수 clickable affordance */
#tetrisbest {
    cursor: pointer;
}

#tetrisbest:hover {
    color: #60a5fa;
}

.tetris-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.control-text {
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

.tetris-game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    color: white;
    z-index: 1000;
}

.tetris-game-over h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* 테트리스 터치 컨트롤 */
.tetris-touch-controls {
    width: 100%;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
}

/* 왼쪽 그룹: 좌우 이동 버튼 (좌우로 배치) */
.button-group-left {
    display: flex;
    gap: 0.5rem;
    flex-direction: row;
    align-items: center;
}

/* 오른쪽 그룹: 회전, 아래 버튼 (상하로 배치) */
.button-group-right {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
    align-items: center;
}

.control-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.touch-btn {
    padding: 1.3rem 1.6rem;
    border: 2px solid var(--primary-color);
    background-color: white;
    color: var(--primary-color);
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    flex: 1;
    max-width: 120px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.touch-btn:active {
    background-color: var(--primary-color);
    color: white;
    transform: scale(0.95);
}

/* 좌/우 버튼: 100x100px 정사각형 */
.touch-btn.touch-left,
.touch-btn.touch-right {
    width: 100px !important;
    height: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    min-height: 100px !important;
    max-height: 100px !important;
    padding: 0 !important;
    flex: 0 !important;
}

/* 회전/내리기 버튼: 100x67px (높이 2/3) */
.touch-btn.touch-rotate,
.touch-btn.touch-down {
    width: 100px !important;
    height: 67px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    min-height: 67px !important;
    max-height: 67px !important;
    padding: 0 !important;
    flex: 0 !important;
}

@media (max-width: 600px) {
    .tetris-layout {
        display: grid;
        grid-template-columns: 70% 30%;
        gap: 12px;
    }

    .tetris-game-area {
        width: 100%;
        display: block;
        /* allow canvas to fill first grid column */
    }

    .tetris-canvas {
        max-width: 100%;
        aspect-ratio: 10 / 20;
    }

    .tetris-overlay {
        flex-direction: column;
        gap: 10px;
        max-width: 130px;
        margin: 0 auto;
    }

    .tetris-control-area {
        grid-column: 1 / -1;
        gap: 10px;
    }

    .tetris-start-btn {
        width: 100%;
        max-width: 420px;
    }

    .tetris-sidebar {
        width: 100%;
        flex: none;
        gap: 1rem;
        align-items: center;
    }

    .tetris-next-block {
        text-align: center;
        width: 100%;
        order: 1;
    }

    .next-block-canvas {
        width: 80px;
        height: 80px;
        max-width: 80px;
    }

    .next-block-label {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }

    .tetris-stats {
        flex-direction: row;
        gap: 1rem;
        padding: 0;
        background-color: transparent;
        justify-content: center;
        width: 100%;
        order: 3;
    }

    .stat-item {
        gap: 0.2rem;
        flex: 1;
        min-width: 80px;
        text-align: center;
    }

    .stat-label {
        font-size: 0.65rem;
        color: var(--text-light);
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .tetris-touch-controls {
        gap: 0.3rem;
        width: 100%;
        order: 2;
    }

    .control-row {
        gap: 0.2rem;
    }

    .touch-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        max-width: 70px;
    }

    .touch-down {
        flex: 3;
        max-width: none;
    }

    #tetrisStartBtn {
        width: 100%;
        order: 4;
    }
}

/* 현재 공부 중인 과목 표시 */
.current-subject-display {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: 12px;
    border: 2px solid rgba(99, 102, 241, 0.2);
}

#currentSubjectText {
    display: block;
    font-size: 1.3rem;
    white-space: nowrap;
}

.current-subject-display.hidden {
    display: none;
}

/* 학원 시작 시간 표시 */
.academy-start-time {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.85;
}

.academy-start-time.hidden {
    display: none;
}

/* 쉬는 시간 표시 */
.break-time {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.75;
    color: #f59e0b;
}

.break-time.hidden {
    display: none;
}

/* 시작 모달 - 공부 방법 선택 */
.study-method-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.study-method-selector label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 600;
}

.study-method-selector input[type="radio"] {
    display: none;
}

.study-method-selector span {
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* 학원 버튼 - 메인색 */
.study-method-selector label:has(#methodAcademy) {
    background: var(--bg-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

.study-method-selector label:has(#methodAcademy):hover {
    border-color: var(--main-color);
    transform: translateY(-2px);
}

.study-method-selector label:has(#methodAcademy:checked) {
    background: var(--main-color);
    border-color: var(--main-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 독서 버튼 - 보조색 */
.study-method-selector label:has(#methodReading) {
    background: var(--bg-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

.study-method-selector label:has(#methodReading):hover {
    border-color: var(--sub-color);
    transform: translateY(-2px);
}

.study-method-selector label:has(#methodReading:checked) {
    background: var(--sub-color);
    border-color: var(--sub-color);
    color: var(--text-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 공부 버튼 - 메인색 (다른 톤) */
.study-method-selector label:has(#methodStudy) {
    background: var(--bg-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

.study-method-selector label:has(#methodStudy):hover {
    border-color: var(--main-color);
    transform: translateY(-2px);
}

.study-method-selector label:has(#methodStudy:checked) {
    background: var(--main-color);
    border-color: var(--main-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 과목 드롭다운 래퍼 */
.subject-dropdown-wrapper {
    margin-top: 1rem;
}

.subject-dropdown-wrapper label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.subject-dropdown-wrapper select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--card-bg);
    transition: border-color 0.2s ease;
}

.subject-dropdown-wrapper select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.subject-dropdown-wrapper.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* 종료 모달 - 과목 레이블 표시 */
.subject-display-modal {
    margin-bottom: 1.5rem;
}

.subject-display-modal label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #9ca3af;
    font-size: 0.9rem;
}

.subject-label {
    padding: 0.75rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* 부모 모드 스타일 */
.parent-section {
    padding: 0;
}

.parent-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* 아이 선택 탭 */
.child-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.child-btn {
    flex: 1;
    min-width: 70px;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.child-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.child-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 부모 모드: 포인트 관리 */
.parent-points-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.parent-points-header h2 {
    margin: 0;
}

.parent-points-actions {
    display: flex;
    gap: 0.5rem;
}

.parent-points-actions .btn {
    min-width: 48px;
    height: 48px;
    font-size: 1.5rem;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 포인트 거래 목록 */
.points-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.points-item {
    background-color: var(--card-bg);
    padding: 1rem 1.25rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.points-item.earn {
    border-color: var(--border-color);
}

.points-item.spend {
    border-color: var(--border-color);
}

/* 삭제된 포인트 항목 스타일 */
.points-item.deleted {
    opacity: 0.6;
    background-color: #f3f4f6;
}

.points-item.deleted .points-item-type,
.points-item.deleted .points-item-amount,
.points-item.deleted .points-item-reason {
    text-decoration: line-through;
}

.points-deleted-label {
    color: var(--text-light);
    font-size: 0.75rem;
    font-style: italic;
}

/* 2줄 레이아웃 */
.points-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.points-item-row-2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.points-item-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.points-item-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.points-item-type {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.points-item-type.earn {
    background-color: var(--success-color);
    color: white;
}

.points-item-type.spend {
    background-color: var(--danger-color);
    color: white;
}

.points-item-reason {
    color: var(--text-color);
    font-size: 0.9rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.points-item-duration {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
}

.points-item-amount {
    font-size: 1.1rem;
    font-weight: 700;
}

.points-item-amount.earn {
    color: var(--success-color);
}

.points-item-amount.spend {
    color: var(--danger-color);
}

.points-item-memo {
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.points-item-date {
    color: var(--text-light);
    font-size: 0.75rem;
}

.points-item-creator {
    color: var(--text-light);
    font-size: 0.75rem;
}

.points-delete-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.points-delete-btn:hover {
    background: var(--sub-color);
    color: var(--text-color);
}

.points-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

/* 한 달 더 보기 버튼 */
.load-more-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    background: none;
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.load-more-btn:hover {
    border-color: var(--main-color);
    color: var(--main-color);
}

/* 포인트 모달 */
/* 간편입력 버튼 */
.quick-reason-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-reason-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-reason-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.05);
    color: var(--primary-color);
}

.quick-reason-btn:active {
    transform: scale(0.98);
}

.preset-reasons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preset-reason-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-reason-item:hover {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.05);
}

.preset-reason-item input[type="radio"] {
    margin-right: 0.75rem;
    cursor: pointer;
}

.preset-reason-item input[type="radio"]:checked+span {
    font-weight: 600;
    color: var(--primary-color);
}

/* 포인트 추가 모달 - 녹색 계열 */
#addPointsModal .modal-content {
    border: 2px solid #059669;
    box-shadow: 0 12px 32px rgba(5, 150, 105, 0.3);
}

#addPointsModal .modal-header {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-bottom: 1px solid #047857;
}

#addPointsModal .modal-header h3 {
    color: #fff;
}

#addPointsModal .modal-close {
    color: rgba(255, 255, 255, 0.8);
}

#addPointsModal .modal-close:hover {
    color: #fff;
}

/* 포인트 사용 모달 - 빨간색 계열 */
#subtractPointsModal .modal-content {
    border: 2px solid #dc2626;
    box-shadow: 0 12px 32px rgba(220, 38, 38, 0.3);
}

#subtractPointsModal .modal-header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-bottom: 1px solid #b91c1c;
}

#subtractPointsModal .modal-header h3 {
    color: #fff;
}

#subtractPointsModal .modal-close {
    color: rgba(255, 255, 255, 0.8);
}

#subtractPointsModal .modal-close:hover {
    color: #fff;
}

/* 포인트 입력 필드 스타일 */
.points-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.points-input-icon {
    font-size: 1.5rem;
    font-weight: bold;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.plus-icon {
    background: #059669;
    color: #fff;
}

.minus-icon {
    background: #dc2626;
    color: #fff;
}

.points-input-small {
    width: 100px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

/* 뱃지 시스템 스타일 */
.stats-header-with-badges {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stats-header-with-badges h2 {
    margin: 0;
}

.badges-display {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.badge-item:hover {
    opacity: 0.8;
}

.badge-item.badge-grayscale {
    opacity: 0.4;
}

.badge-item.badge-grayscale .badge-icon {
    filter: grayscale(100%);
}

.badge-item.badge-grayscale:hover {
    opacity: 0.6;
}

.badge-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s ease;
}

.badge-item:hover .badge-icon {
    transform: scale(1.1);
}

.badge-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.2);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.badge-count-zero {
    color: #6b7280;
    background: rgba(107, 114, 128, 0.2);
}

/* 뱃지 획득 모달 */
.badge-earned-modal {
    max-width: 400px;
    text-align: center;
}

.badge-earned-content {
    padding: 1rem;
}

.badge-celebration {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: celebration 0.6s ease-in-out;
}

@keyframes celebration {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.2) rotate(-10deg);
    }

    75% {
        transform: scale(1.2) rotate(10deg);
    }
}

.badge-earned-modal h2 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    color: #fbbf24;
}

.earned-badge-display {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.earned-badge-icon {
    font-size: 5rem;
    animation: badgePop 0.5s ease-out;
}

@keyframes badgePop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.earned-badge-message {
    font-size: 1.1rem;
    color: #e5e7eb;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* 뱃지 상세 정보 모달 */
.badge-detail-modal {
    max-width: 450px;
}

.badge-detail-icon {
    font-size: 5rem;
    text-align: center;
    margin-bottom: 1rem;
}

.badge-detail-name {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: #fbbf24;
    margin-bottom: 0.5rem;
}

.badge-detail-description {
    font-size: 1rem;
    text-align: center;
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

.badge-detail-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.badge-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.badge-stat-label {
    font-size: 0.95rem;
    color: #9ca3af;
}

.badge-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fbbf24;
}

/* ===== Vocabulary Tab ===== */

/* Stats banner */
.vocab-stats-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
    background: var(--main-color);
    border-radius: 16px;
    color: #fff;
}

.vocab-stats-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.vocab-stats-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.vocab-stats-total-num {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
}

.vocab-stats-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

.vocab-stats-today-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.12);
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
}

.vocab-stats-today-row strong {
    color: #34d399;
}

.vocab-stats-today-icon {
    font-size: 0.7rem;
}

/* Action buttons row */
.vocab-action-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.vocab-action-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.2rem 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
}

.vocab-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.vocab-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.2rem;
}

.vocab-action-icon.add-icon {
    background: rgba(76, 92, 104, 0.12);
    color: var(--main-color);
}

.vocab-action-icon.quiz-icon {
    background: rgba(52, 211, 153, 0.15);
    color: #10b981;
}

.vocab-action-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
}

.vocab-action-sub {
    font-size: 0.7rem;
    color: var(--text-light);
}

.vocab-action-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    font-size: 0.6rem;
    font-weight: 700;
    color: #10b981;
    background: rgba(52, 211, 153, 0.15);
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
}

/* Recently Added */
.vocab-recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.vocab-recent-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
}

.vocab-view-all-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.vocab-view-all-btn:hover {
    text-decoration: underline;
}

.vocab-recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vocab-recent-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.vocab-recent-card:hover {
    background: var(--bg-color);
}

.vocab-recent-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(76, 92, 104, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--main-color);
}

.vocab-recent-info {
    flex: 1;
    min-width: 0;
}

.vocab-recent-word {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-color);
}

.vocab-recent-meaning {
    font-size: 0.75rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vocab-recent-card {
    position: relative;
}

.vocab-recent-author {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-light);
}

.vocab-recent-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Add Word Modal */
.vocab-add-modal {
    max-width: 420px;
}

/* Quiz Modal */
.vocab-quiz-modal {
    max-width: 360px;
}

/* Search Modal */
.vocab-search-modal {
    max-width: 480px;
}

.vocab-search-modal .modal-body {
    max-height: 70vh;
}

/* Legacy compat */
.vocab-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.vocab-header-left {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.vocab-total-count {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.vocab-header-right {
    text-align: right;
}

.vocab-today-stats {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.vocab-today-stats strong {
    color: var(--primary-color);
    font-size: 0.95rem;
}

.vocab-today-points strong {
    color: var(--success-color);
}

.vocab-menu {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.vocab-menu-btn {
    flex: 1;
    padding: 0.55rem 0.5rem;
    border: none;
    background: var(--card-bg);
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.vocab-menu-btn+.vocab-menu-btn {
    border-left: 1px solid var(--border-color);
}

.vocab-menu-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.vocab-menu-btn:hover:not(.active) {
    background: #f3f4f6;
}

.vocab-sub-content {
    display: none;
}

.vocab-sub-content.active {
    display: block;
}

.vocab-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ===== 찾아보기 ===== */
.vocab-browse-form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.vocab-search-result {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vocab-search-card {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.vocab-search-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.vocab-search-card-word {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
}

.vocab-search-card-diff {
    font-size: 0.7rem;
    color: var(--text-light);
    background: #f3f4f6;
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-weight: 600;
}

.vocab-search-card-meanings {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: 0.3rem;
}

.vocab-search-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* 단어 상세 모달 */
.vocab-detail-modal {
    width: 95%;
    max-width: 480px;
}

.vocab-detail-modal .modal-header h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.vocab-detail-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.vocab-detail-meta span {
    background: #f3f4f6;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.vocab-detail-meanings {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.vocab-detail-meaning-item {
    border-left: 3px solid var(--primary-color);
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border-radius: 0 6px 6px 0;
}

.vocab-detail-meaning-item .detail-pos {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 0.15rem;
}

.vocab-detail-meaning-item .detail-meaning {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

.vocab-detail-meaning-item .detail-example {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.2rem;
    font-style: italic;
}

.vocab-detail-actions {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.vocab-detail-actions .btn {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
}

/* 의미 수정 모드 스타일 */
.vocab-detail-meaning-item-edit {
    border-left: 3px solid var(--primary-color);
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border-radius: 0 6px 6px 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vocab-detail-meaning-item-edit .edit-pos-select {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
}

.vocab-detail-meaning-item-edit .edit-meaning-input,
.vocab-detail-meaning-item-edit .edit-example-input {
    padding: 0.5rem 0.6rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
    transition: border-color 0.2s;
}

.vocab-detail-meaning-item-edit .edit-meaning-input:focus,
.vocab-detail-meaning-item-edit .edit-example-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.vocab-detail-meaning-item-edit .edit-example-input {
    font-style: italic;
    color: var(--text-light);
}

/* ===== 영어 단어 등록 인라인 폼 ===== */
.vocab-register-form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.vocab-form-group {
    margin-bottom: 0.75rem;
}

.vocab-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.3rem;
}

.vocab-input {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background: #fff;
}

.vocab-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.vocab-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.vocab-form-actions .btn {
    flex: 1;
    padding: 0.6rem;
    font-size: 0.9rem;
}

.vocab-word-input-row {
    display: flex;
    gap: 0.5rem;
}

.vocab-word-input-row .modal-input {
    flex: 1;
}

.vocab-word-input-row .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* 중복 알림 */
.vocab-duplicate-alert {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    color: #92400e;
    font-size: 0.85rem;
}

.vocab-duplicate-header {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.vocab-duplicate-content {
    margin-bottom: 0.5rem;
    max-height: 150px;
    overflow-y: auto;
}

.vocab-duplicate-content .dup-meaning-item {
    padding: 0.25rem 0;
    border-bottom: 1px solid #fde68a;
}

.vocab-duplicate-content .dup-meaning-item:last-child {
    border-bottom: none;
}

.vocab-force-new-btn {
    width: 100%;
    margin-top: 0.25rem;
}

/* Step2 */
.vocab-step2-word {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.vocab-meanings-section {
    margin-top: 0.75rem;
}

.vocab-meanings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.vocab-meanings-header label {
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}

.vocab-meaning-item {
    background: #f3f4f6;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.vocab-meaning-item .meaning-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.vocab-meaning-item .meaning-row:last-child {
    margin-bottom: 0;
}

.vocab-meaning-item .pos-select {
    width: 100px;
    flex-shrink: 0;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fff;
}

.vocab-meaning-item .meaning-input,
.vocab-meaning-item .example-input {
    flex: 1;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
}

.vocab-meaning-remove {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.1rem 0.3rem;
}

.vocab-meaning-remove:hover {
    background: #fee2e2;
    border-radius: 4px;
}

.vocab-meaning-num {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.btn-warning {
    background: var(--warning-color);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.btn-warning:hover {
    background: #1a1a1a;
}

/* ===== 격언 (Maxims) 스타일 ===== */

/* 타이머 탭 위 격언 표시 */
.maxim-display {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0 10%;
}

.maxim-text {
    color: var(--text-light);
    font-size: 0.8rem;
    line-height: 1.6;
    font-style: italic;
    text-align: center;
}

.maxim-author {
    color: var(--text-light);
    font-size: 0.7rem;
    opacity: 0.6;
    text-align: center;
}

/* 부모 모드: 격언 관리 */
.parent-maxims-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.parent-maxims-header h2 {
    margin: 0;
    color: var(--text-color);
}

.maxims-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.maxim-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.maxim-card:hover {
    border-color: var(--main-color);
}

.maxim-card.inactive {
    opacity: 0.5;
}

.maxim-card-text {
    color: var(--text-color);
    font-size: 0.88rem;
    line-height: 1.4;
    font-style: italic;
}

.maxim-card-author {
    color: var(--text-light);
    font-size: 0.75rem;
    margin-top: 0.3rem;
    text-align: right;
}

.maxim-card-meta {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.5rem;
    align-items: center;
}

.maxim-stat {
    color: var(--text-light);
    font-size: 0.75rem;
}

.maxim-badge-inactive {
    background: #fef2f2;
    color: #dc2626;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-left: auto;
}

/* 격언 상세 모달 */
.maxim-detail-content {
    color: var(--text-color);
    font-size: 1rem;
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.maxim-detail-author {
    color: #94a3b8;
    font-size: 0.85rem;
    text-align: right;
    margin-bottom: 1rem;
}

.maxim-detail-stats {
    border-top: 1px solid #334155;
    padding-top: 0.8rem;
}

.maxim-detail-stat-row {
    display: flex;
    justify-content: space-between;
    color: #cbd5e1;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.maxim-detail-reactions {
    margin-top: 0.8rem;
}

.maxim-reactions-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.maxim-reaction-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #cbd5e1;
    font-size: 0.82rem;
    padding: 0.25rem 0;
}

.empty-message {
    color: #64748b;
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.9rem;
}

/* ===== 타이머 서브 네비게이션 ===== */
.timer-sub-nav {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.timer-sub-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timer-sub-btn.active {
    color: var(--main-color);
    border-bottom-color: var(--main-color);
    font-weight: 700;
}

.timer-sub-btn:hover:not(.active) {
    color: var(--text-color);
}

.timer-sub-content {
    display: none;
}

.timer-sub-content.active {
    display: block;
}

#timerMainContent.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    min-height: calc(100vh - 160px);
    gap: 0;
    padding-bottom: 70px;
}

/* ===== 알바 탭 ===== */
.alba-section {
    display: flex;
    flex-direction: column;
}

.placeholder-message {
    text-align: center;
    color: var(--text-light);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.placeholder-message h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    color: var(--text-color);
}

.placeholder-message p {
    font-size: 1rem;
    color: var(--text-light);
}

/* ===== 부모 관리 탭 서브 메뉴 ===== */
.manage-menu {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.manage-menu-btn {
    flex: 1;
    padding: 0.6rem 0.5rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.manage-menu-btn+.manage-menu-btn {
    border-left: none;
}

.manage-menu-btn.active {
    color: var(--main-color);
    border-bottom-color: var(--main-color);
    font-weight: 700;
}

.manage-sub-content {
    display: none;
}

.manage-sub-content.active {
    display: block;
}

/* ===== 알바 스타일 ===== */
.alba-monthly-summary {
    background: var(--main-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.alba-summary-title {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* 자녀모드 월 네비게이션 */
.alba-month-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.alba-month-nav-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alba-month-nav-btn:active:not(.disabled) {
    background: rgba(255, 255, 255, 0.35);
}

.alba-month-nav-btn.disabled {
    opacity: 0.3;
    cursor: default;
}

.alba-month-nav-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    min-width: 100px;
    text-align: center;
}

/* 부모모드 월 네비게이션 */
.parent-alba-month-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.parent-alba-month-nav-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.parent-alba-month-nav-btn:active:not(.disabled) {
    background: var(--border-color);
}

.parent-alba-month-nav-btn.disabled {
    opacity: 0.3;
    cursor: default;
}

.parent-alba-month-nav-label {
    font-size: 0.8rem;
    color: var(--text-color);
    font-weight: 600;
    min-width: 120px;
    text-align: center;
}

.alba-summary-items {
    display: flex;
    gap: 0.5rem;
}

.alba-summary-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
}

.alba-summary-item.points {
    border: none;
}

.alba-summary-item.cash {
    border: none;
}

.alba-summary-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
}

.alba-summary-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.alba-summary-item.points .alba-summary-value {
    color: #fff;
}

.alba-summary-item.cash .alba-summary-value {
    color: #fff;
}

.alba-do-btn-wrap {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.alba-do-btn-sm {
    flex: 7;
    padding: 0.7rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
}

.alba-manage-btn-sm {
    font-size: 0.9rem;
    padding: 0.65rem 1.2rem;
    border-radius: 10px;
    flex: 7;
}

.alba-calendar-btn {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    font-size: 1.1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.2s;
}

.alba-calendar-btn:hover {
    color: var(--text-color);
}

/* 알바 캘린더 */
.alba-calendar-modal-content {
    max-width: 420px;
    width: 95%;
}

.alba-calendar-child-selector {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.alba-cal-child-btn {
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}

.alba-cal-child-btn.active {
    background: var(--main-color);
    color: #fff;
    border-color: var(--main-color);
}

.alba-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.alba-cal-month-label {
    font-size: 1.05rem;
    font-weight: 700;
    min-width: 8rem;
    text-align: center;
    color: var(--text-color);
}

.alba-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.alba-cal-header {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-light);
    padding: 0.3rem 0;
}

.alba-cal-cell {
    min-height: 3rem;
    padding: 0.2rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.65rem;
}

.alba-cal-cell.empty {
    border-color: transparent;
}

.alba-cal-cell.has-data {
    background: rgba(76, 92, 104, 0.06);
    border-color: var(--sub-color);
}

.alba-cal-day {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1px;
}

.alba-cal-day.today {
    background: var(--main-color);
    color: #fff;
    border-radius: 50%;
    width: 1.4rem;
    height: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alba-cal-pts {
    color: var(--main-color);
    font-weight: 600;
    line-height: 1.1;
}

.alba-cal-cash {
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.1;
}

/* 부모 알바 월간 요약 */
.parent-alba-monthly-summary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.parent-alba-child-summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.parent-alba-child-name {
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 3rem;
}

.parent-alba-child-totals {
    display: flex;
    gap: 0.8rem;
    font-size: 0.8rem;
}

.parent-alba-child-totals .pts {
    color: var(--main-color);
    font-weight: 600;
}

.parent-alba-child-totals .cash {
    color: var(--text-color);
    font-weight: 600;
}

.alba-form-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.alba-form-row .modal-input {
    flex: 1;
    min-width: 0;
}

.alba-form-sep {
    color: #9ca3af;
    font-size: 1rem;
    flex-shrink: 0;
}

.alba-reward-select {
    flex: 1 !important;
}

.alba-reward-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.alba-reward-input-wrap .modal-input {
    flex: 1;
    padding-right: 2.5rem;
    text-align: right;
}

.alba-reward-unit {
    position: absolute;
    right: 0.8rem;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
}

.parent-alba-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.alba-records-list,
.alba-jobs-list,
.alba-available-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 알바 수행 기록 카드 */
.alba-record-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    gap: 0.8rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.alba-record-card:active {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.alba-record-info {
    flex: 1;
    min-width: 0;
}

.alba-done-badge {
    display: inline-block;
    background: var(--main-color);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.alba-record-child-name {
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.alba-record-title {
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.alba-record-meta {
    display: flex;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: var(--text-light);
    flex-wrap: wrap;
    align-items: center;
}

.alba-record-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    flex-shrink: 0;
}

.alba-record-reward {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
}

.alba-record-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.alba-record-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

/* 알바 보상 뱃지 */
.alba-reward-badge {
    display: inline-block;
    background: var(--sub-color);
    color: var(--text-color);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

/* 알바 관리 목록 카드 */
.alba-job-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.9rem 1.25rem;
    gap: 0.6rem;
    box-shadow: var(--shadow);
}

.alba-job-card.inactive {
    opacity: 0.5;
}

.alba-job-info {
    flex: 1;
    min-width: 0;
}

.alba-job-title {
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.95rem;
}

.alba-job-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    align-items: center;
}

.alba-job-actions {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

.alba-inactive-badge {
    background: var(--sub-color);
    color: var(--text-color);
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
    border-radius: 6px;
}

/* 자녀: 알바 하기 목록 */
.alba-available-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow);
}

.alba-available-card:hover {
    border-color: var(--main-color);
}

.alba-available-card:active {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.alba-available-title {
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.alba-available-meta {
    display: flex;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: var(--text-light);
    align-items: center;
}

/* 알바 상세 모달 */
.alba-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.alba-detail-label {
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
}

/* 사진 미리보기 */
.alba-photo-preview {
    margin-top: 1rem;
    text-align: center;
}

.alba-photo-img {
    max-width: 100%;
    max-height: 240px;
    border-radius: 8px;
    object-fit: contain;
}

/* ===== 포인트 탭 (자녀 보상 상점) ===== */

#points-tab {
    padding-top: 0;
}

/* 포인트 서브 네비게이션 */
.points-sub-nav {
    display: flex;
    gap: 0;
    margin: 0 -1.5rem 1rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.points-sub-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.points-sub-btn.active {
    color: var(--main-color);
    border-bottom-color: var(--main-color);
    font-weight: 700;
}

.points-sub-btn:hover:not(.active) {
    color: var(--text-color);
}

.points-sub-content {
    display: none;
}

.points-sub-content.active {
    display: block;
}

/* 포인트 배너 */
.reward-points-banner {
    background: var(--main-color);
    border-radius: 12px;
    padding: 1.2rem 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

.reward-points-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.reward-points-value {
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.reward-points-value span {
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0.85;
}

/* 보상 카드 */
.reward-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: relative;
}

.reward-card-featured {
    border: 2px solid var(--main-color);
}

.reward-card-badge {
    display: inline-block;
    background: var(--sub-color);
    color: var(--text-color);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0.5rem;
}

.reward-card-badge.featured {
    background: var(--main-color);
    color: #fff;
}

.reward-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.reward-card-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

/* 라디오 옵션 (스마트폰) */
.reward-options {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.reward-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.6rem 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.reward-option input[type="radio"] {
    display: none;
}

.reward-option.selected {
    border-color: var(--main-color);
    background: rgba(76, 92, 104, 0.05);
}

.reward-option-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
}

.reward-option-cost {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
}

/* 수량 입력 (용돈/저축) */
.reward-amount-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.reward-amount-input button {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.reward-amount-input button:active {
    background: var(--sub-color);
}

/* 필요 포인트 표시 */
.reward-cost-display {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.reward-cost-display strong {
    color: var(--main-color);
    font-weight: 700;
}

/* 저축 원래 가격 취소선 */
.savings-original-cost {
    text-decoration: line-through;
    color: #AAAAAA;
    font-size: 0.85rem;
    margin-right: 0.25rem;
}

/* 보상 신청 버튼 */
.reward-request-btn {
    display: block;
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 10px;
    background: var(--main-color);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.reward-request-btn:active {
    transform: scale(0.98);
}

.reward-request-btn.featured {
    background: var(--primary-dark);
}

/* 포인트 기록 (자녀) - 부모 포인트 목록 스타일 재사용 */
#childPointsList .points-empty {
    text-align: center;
    color: var(--text-light);
    padding: 2rem 1rem;
    font-size: 0.9rem;
}

/* 보상 요청 pending 아이템 */
.reward-pending-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--sub-color);
}

.reward-pending-section h3 {
    color: var(--main-color);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding: 0 1rem;
}

.points-item.reward-pending {
    background-color: rgba(76, 92, 104, 0.06);
    border: 1px solid var(--sub-color);
}

.points-item-type.reward-pending-type {
    background-color: var(--sub-color);
    color: var(--text-color);
    font-size: 0.7rem;
}

/* 부모 모드 보상 요청 표시 */
.reward-request-item {
    background-color: rgba(76, 92, 104, 0.06);
    border: 1px solid var(--sub-color);
}

.points-item-type.reward-request {
    background-color: var(--sub-color);
    color: var(--text-color);
}

/* Vocab 사용 중단 오버레이 */
.vocab-suspend-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: vocabSuspendFadeIn 0.3s ease;
}

.vocab-suspend-overlay.hidden {
    display: none !important;
}

.vocab-suspend-content {
    text-align: center;
    color: #fff;
}

.vocab-suspend-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.vocab-suspend-text {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
}

.vocab-suspend-sub {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
}

@keyframes vocabSuspendFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}