/* ============================================
   ACE 학생 녹음 페이지 스타일
   ============================================ */

.ace-page {
    font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #F8F9FA;
    min-height: 100vh;
    -webkit-user-select: none;
    user-select: none;
}

/* 대시보드 */
.ace-dashboard {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px;
}

.ace-hero {
    text-align: center;
    padding: 32px 0 24px;
}
.ace-hero-icon {
    font-size: 56px;
    margin-bottom: 12px;
    animation: ace-bounce 2s infinite;
}
@keyframes ace-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.ace-hero-title {
    font-size: 28px;
    font-weight: 900;
    color: #FF5722;
    margin: 0 0 4px;
}
.ace-hero-desc {
    font-size: 14px;
    color: #9E9E9E;
    margin: 0;
}

/* ACE 레벨 카드 */
.ace-levels {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.ace-level-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 14px;
    border: 2px solid #E0E0E0;
    transition: all .2s;
}
.ace-level-card.current {
    border-color: #FF5722;
    background: #FFF3E0;
    box-shadow: 0 2px 12px rgba(255,87,34,.12);
}
.ace-level-card.passed {
    border-color: #4CAF50;
    background: #E8F5E9;
}
.ace-level-card.locked {
    opacity: 0.5;
}

.ace-level-icon {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F5F5;
    border-radius: 12px;
    flex-shrink: 0;
}
.ace-level-card.current .ace-level-icon { background: #FFCCBC; }
.ace-level-card.passed .ace-level-icon { background: #C8E6C9; }

.ace-level-info { flex: 1; min-width: 0; }
.ace-level-name { font-size: 16px; font-weight: 700; color: #333; }
.ace-level-desc { font-size: 12px; color: #9E9E9E; margin-top: 2px; }

.ace-level-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.ace-level-badge.passed { background: #4CAF50; color: #fff; }
.ace-level-badge.current { background: #FF5722; color: #fff; }
.ace-level-badge.locked { background: #E0E0E0; color: #999; }
.ace-level-badge.waiting { background: #E0E0E0; color: #999; }

/* ACE/BRAVO 섹션 토글 */
.ace-section-toggle {
    margin: 0 0 16px;
}
.ace-section-toggle .tab-btn.active {
    background: #FF5722;
    color: #fff;
    box-shadow: 0 2px 8px rgba(255,87,34,0.25);
}

/* 액션 버튼 영역 */
.ace-action {
    text-align: center;
    padding: 20px 0;
}
.ace-action-hint {
    font-size: 13px;
    color: #9E9E9E;
    margin-top: 10px;
}

/* 버튼 */
.ace-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.ace-btn:disabled { opacity: 0.4; pointer-events: none; }

.ace-btn-primary {
    background: #FF5722;
    color: #fff;
    box-shadow: 0 3px 12px rgba(255,87,34,.25);
}
.ace-btn-primary:active { transform: scale(0.97); }

.ace-btn-outline {
    background: #fff;
    color: #666;
    border: 1.5px solid #E0E0E0;
}
.ace-btn-outline:active { background: #F5F5F5; }

.ace-btn-lg { padding: 14px 32px; font-size: 17px; border-radius: 14px; }
.ace-btn-sm { padding: 7px 14px; font-size: 13px; }

.ace-btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: #E3F2FD;
    color: #1565C0;
    font-family: inherit;
}

.ace-link {
    color: #999;
    font-size: 14px;
    text-decoration: none;
}
.ace-link:hover { color: #666; }

/* ============================================
   녹음 화면
   ============================================ */

.ace-recording-view {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px 80px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 진행바 */
.ace-progress-bar {
    height: 4px;
    background: #E0E0E0;
    border-radius: 2px;
    margin: 16px 0 6px;
    overflow: hidden;
}
.ace-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF5722, #FF9800);
    border-radius: 2px;
    transition: width .3s ease;
}
.ace-progress-text {
    text-align: center;
    font-size: 12px;
    color: #9E9E9E;
    margin-bottom: 16px;
}

/* 레벨 뱃지 바 */
.ace-level-badge-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}
.ace-role-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}
.ace-role-badge.before { background: #E3F2FD; color: #1565C0; }
.ace-role-badge.after { background: #FFF3E0; color: #E65100; }
.ace-level-label { font-size: 14px; font-weight: 800; color: #333; }
.ace-item-counter { font-size: 12px; color: #999; }

/* 단어/문장 카드 */
.ace-word-card {
    background: #fff;
    border-radius: 20px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    margin-bottom: 24px;
    flex: 0 0 auto;
}
.ace-word-card.sentence {
    padding: 24px 20px;
}
.ace-word-text {
    font-size: 36px;
    font-weight: 900;
    color: #333;
    line-height: 1.3;
    word-break: keep-all;
}
.ace-word-card.sentence .ace-word-text {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.5;
}
.ace-word-ipa {
    font-size: 16px;
    color: #9E9E9E;
    margin-top: 8px;
    font-family: 'Segoe UI', 'Lucida Sans Unicode', sans-serif;
}
.ace-word-card.sentence .ace-word-ipa {
    font-size: 13px;
    margin-top: 12px;
    line-height: 1.6;
}

/* 녹음 영역 */
.ace-record-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    flex: 1;
}

.ace-record-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: #FF5722;
    color: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    box-shadow: 0 4px 16px rgba(255,87,34,.3);
    transition: all .15s;
    font-family: inherit;
}
.ace-record-btn span {
    font-size: 10px;
    font-weight: 600;
}
.ace-record-btn:active { transform: scale(0.95); }
.ace-record-btn.recording {
    background: #D32F2F;
    animation: ace-pulse 1s infinite;
}
@keyframes ace-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,87,34,.4); }
    50% { box-shadow: 0 0 0 16px rgba(255,87,34,0); }
}

.ace-record-btn-inner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ace-recorded-badge {
    font-size: 16px;
    font-weight: 700;
    color: #4CAF50;
    margin-bottom: 4px;
}

/* 타이머 */
.ace-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #D32F2F;
}
.ace-timer.hidden { display: none; }
.ace-timer-dot {
    width: 8px;
    height: 8px;
    background: #D32F2F;
    border-radius: 50%;
    animation: ace-blink 1s infinite;
}
@keyframes ace-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* 하단 네비게이션 */
.ace-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
    max-width: 480px;
    margin: 0 auto;
}

/* ============================================
   축하 화면
   ============================================ */

.ace-celebration {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ace-celebration-content {
    text-align: center;
    padding: 40px 24px;
    position: relative;
    z-index: 1;
}

.ace-coin-drop {
    animation: ace-coin-drop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 20px;
}
.ace-coin-icon { font-size: 56px; }
.ace-coin-text {
    font-size: 28px;
    font-weight: 900;
    color: #FF9800;
    margin-top: 4px;
}
@keyframes ace-coin-drop {
    0% { transform: translateY(-100px) scale(0.5); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.ace-celebration-title {
    font-size: 24px;
    font-weight: 900;
    color: #333;
    margin-bottom: 8px;
}
.ace-celebration-message {
    font-size: 15px;
    color: #666;
    margin-bottom: 8px;
}
.ace-celebration-sub {
    font-size: 14px;
    color: #9E9E9E;
    margin-bottom: 24px;
}
.ace-celebration-coins {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #FFF8E1;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 15px;
}
.ace-total-coins {
    font-weight: 800;
    color: #FF9800;
    font-size: 18px;
}

/* 컨페티 */
.ace-confetti {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}
.confetti-piece {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ============================================
   반응형
   ============================================ */

@media (max-width: 380px) {
    .ace-word-text { font-size: 28px; }
    .ace-word-card.sentence .ace-word-text { font-size: 18px; }
    .ace-record-btn { width: 70px; height: 70px; }
}
