/* 집중 학습 v4: 단어 위치 고정 + 하단 예문 / 모바일 우선 */
.v-study-page {
    position: relative;
    max-width: 840px;
    margin: 0 auto;
}

.v-study-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

/* Blazor 이동 포커스용 숨김 제목만 테두리 제거 (버튼 접근성은 유지) */
.vocab-page .v-study-visually-hidden:focus-visible {
    outline: none;
}

.v-study-stage {
    min-height: calc(100dvh - 162px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.v-study-back {
    align-self: flex-start;
    margin: 0;
    min-height: 38px;
}

/* 정답 전/후 동일한 카드 높이 */
.v-study-card {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: 15px;
    height: clamp(430px, calc(100dvh - 265px), 625px);
    padding: 26px 34px 28px;
    border-color: #d4e5f0;
    border-radius: 22px;
    box-shadow: 0 12px 36px rgba(46, 95, 128, .075);
    overflow: hidden;
}

.v-study-progress-row {
    display: grid;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 15px;
    flex: 0 0 auto;
    color: #436b87;
    font-size: .82rem;
    font-weight: 760;
    font-variant-numeric: tabular-nums;
}

.v-study-progress-count,
.v-study-progress-percent {
    white-space: nowrap;
}

.v-study-progress {
    display: block;
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 7px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    background: #e5eef4;
}

.v-study-progress::-webkit-progress-bar {
    border-radius: 999px;
    background: #e5eef4;
}

.v-study-progress::-webkit-progress-value {
    border-radius: 999px;
    background: linear-gradient(90deg, #79b7db, var(--v-sky));
}

.v-study-progress::-moz-progress-bar {
    border-radius: 999px;
    background: var(--v-sky);
}

/* 카드의 위쪽 약 1/3에 단어를 배치합니다.
   같은 고정 영역을 앞/뒤에서 공유하므로 정답을 공개해도 단어가 튀지 않습니다. */
.v-study-card-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
}

.v-study-word-anchor {
    position: relative;
    display: flex;
    flex: 0 0 40%;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 0;
    padding: 0 8px;
    pointer-events: none;
}

.v-study-word-group {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.v-study-word {
    margin: 0;
    color: var(--v-charcoal);
    font-size: clamp(2.45rem, 7.3vw, 4.2rem);
    font-weight: 790;
    line-height: 1.25;
    letter-spacing: -.015em;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* 단어는 고정한 채 발음과 뜻을 바로 아래에 묶어 표시합니다. */
.v-study-word-answer {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-top: 6px;
    text-align: center;
}

.v-study-pronunciation {
    margin: 0;
    color: #64849b;
    font-size: 1.05rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.v-study-front-actions {
    flex: 0 0 auto;
    margin-top: auto;
}

.vocab-page .v-study-reveal-btn {
    width: 100%;
    min-height: 56px;
    font-size: 1.04rem;
}

/* 뜻·예문은 늘어난 하단 공간을 차지하고 평가 버튼은 카드 바닥에 유지합니다. */
.v-study-answer-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}

.v-study-answer-details {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    padding: 0 5px 6px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #d7e6ef transparent;
}

/* 단어 뜻은 예문이 아닌 단어 발음 바로 아래 */
.v-study-meaning {
    margin: 0;
    color: var(--v-charcoal);
    font-size: clamp(1.35rem, 3.8vw, 1.8rem);
    font-weight: 780;
    line-height: 1.5;
    text-align: center;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.v-study-example {
    flex: 0 0 auto;
    margin-top: auto;
    padding: 12px 18px;
    border: 1px solid #deebf4;
    border-radius: 16px;
    background: #eef6fb;
    text-align: center;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.v-study-example-original,
.vocab-page .v-study-example-trigger {
    margin: 0;
    color: var(--v-charcoal);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* 예문 텍스트 자체가 발음 토글. 테두리/추가 안내 없이 텍스트처럼 보이게 */
.vocab-page .v-study-example-trigger {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: 0;
    text-align: center;
    font-family: inherit;
    cursor: pointer;
    touch-action: manipulation;
}

.vocab-page .v-study-example-trigger:focus-visible {
    outline: 2px solid #80b5d9;
    outline-offset: 4px;
    border-radius: 3px;
}

.v-study-example-pronunciation {
    margin: 7px 0 0;
    color: #63839a;
    font-size: .86rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.v-study-example-meaning {
    margin: 9px 0 0;
    padding-top: 9px;
    border-top: 1px solid #d7e5ee;
    color: #536e82;
    font-size: .91rem;
    white-space: pre-wrap;
}

.v-study-rating-grid {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding-top: 12px;
}

.vocab-page .v-study-rate-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 0;
    min-height: 84px;
    padding: 9px 6px;
    gap: 5px;
    border: 1px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    font: inherit;
    font-size: .99rem;
    line-height: 1.3;
    text-align: center;
    touch-action: manipulation;
    transition: background-color .15s ease;
}

.v-study-rate-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.v-study-rate-button strong { font-weight: 800; }
.v-study-rate-icon { font-size: 1.4rem; }

.vocab-page .v-study-rate-unknown {
    color: #965b57;
    background: #fff1ef;
    border-color: #f5dcd8;
}
.vocab-page .v-study-rate-unknown:hover { background: #ffe6e3; }

.vocab-page .v-study-rate-unsure {
    color: #926b32;
    background: #fff7e9;
    border-color: #f0e2c9;
}
.vocab-page .v-study-rate-unsure:hover { background: #fff0d8; }

.vocab-page .v-study-rate-known {
    color: #2f6c95;
    background: #e7f3fb;
    border-color: #cfe5f4;
}
.vocab-page .v-study-rate-known:hover { background: #d6eaf7; }

.v-study-footer {
    min-height: 29px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.vocab-page .v-study-undo {
    padding: 7px 14px;
    min-height: 40px;
    font-size: .83rem;
}

.v-study-shortcut-note {
    margin: 0;
    text-align: center;
    color: var(--v-muted);
    font-size: .79rem;
    line-height: 1.6;
}

.v-study-footer .v-notice {
    flex-basis: 100%;
    margin: 0;
    text-align: center;
}

.v-study-complete {
    padding: 40px 24px;
    text-align: center;
}

.v-study-complete-symbol {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.v-study-complete h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
}

.v-study-complete p {
    margin: 12px 0 22px;
    font-size: .91rem;
    color: var(--v-muted);
}

.v-study-notice-card h2 {
    font-size: 1.15rem;
    font-weight: 780;
}

@media (max-height: 820px) {
    .v-study-word-anchor { flex-basis: 38%; }
}

@media (max-height: 650px) {
    .v-study-word-anchor { flex-basis: 34%; }
    .v-study-word { font-size: clamp(2rem, 6vw, 3.2rem); }
}

@media (max-width: 600px) {
    .v-study-stage {
        min-height: 0;
        gap: 10px;
    }

    .v-study-card {
        gap: 12px;
        padding: 19px 16px 21px;
        border-radius: 17px;
    }

    .v-study-progress-row {
        gap: 10px;
        font-size: .78rem;
    }

    .v-study-word-anchor { flex-basis: 37%; }
    .v-study-word { font-size: clamp(2.2rem, 9vw, 3.8rem); }
    .v-study-pronunciation { font-size: .93rem; }
    .v-study-meaning { margin-bottom: 9px; }
    .v-study-example { padding: 11px 12px; }

    .v-study-rating-grid { gap: 8px; }

    .vocab-page .v-study-rate-button {
        min-height: 78px;
        border-radius: 12px;
        padding: 8px 4px;
        gap: 4px;
        font-size: .87rem;
    }

    .v-study-rate-icon { font-size: 1.28rem; }
    .v-study-shortcut-note { font-size: .73rem; }
}

@media (max-width: 360px) {
    .v-study-word { font-size: clamp(2rem, 9vw, 3rem); }
    .vocab-page .v-study-rate-button { font-size: .81rem; }
}

@media (prefers-reduced-motion: reduce) {
    .v-study-rate-button { transition: none; }
}
