.hangul-container {
    max-width: 1100px;
    margin: 1rem auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.hangul-main-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .hangul-main-row {
        flex-direction: column;
    }
}

.hangul-tool-header {
    margin-bottom: 1.5rem;
}

.hangul-tool-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.hangul-tool-header .tool-description {
    color: #666;
    font-size: 1rem;
}

.hangul-list-wrap {
    flex: 0 0 auto;
    width: fit-content;
    max-width: 100%;
}

.hangul-detail-panel {
    flex: 0 0 280px;
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: calc(60px + 1rem);
}

@media (max-width: 768px) {
    .hangul-detail-panel {
        flex: none;
        width: 100%;
        position: static;
    }
}

.hangul-detail-panel h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-color);
}

.hangul-detail-placeholder {
    color: #666;
    margin: 0;
}

.hangul-detail-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.hangul-detail-active.hidden {
    display: none;
}

.hangul-detail-content.hidden {
    display: none;
}

.hangul-detail-char {
    font-size: 3.5rem;
    line-height: 1.2;
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
}

.hangul-detail-romaji {
    font-size: 1.25rem;
    color: #555;
}

.hangul-stroke-animation-wrap {
    width: 100%;
    padding: 0.75rem;
    background: var(--background-color);
    border-radius: 6px;
}

.hangul-stroke-animation-wrap h3 {
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
    color: var(--text-color);
}

.hangul-stroke-count {
    font-weight: normal;
    color: #555;
    font-size: 0.9em;
}

.hangul-stroke-svg-container {
    width: 100%;
    aspect-ratio: 1;
    max-width: 140px;
    margin: 0 auto 0.5rem;
}

.hangul-stroke-loading {
    display: block;
    text-align: center;
    color: #888;
    padding: 1rem;
    min-height: 80px;
}

.hangul-stroke-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.hangul-stroke-svg-real {
    max-height: 100%;
    object-fit: contain;
}

/* 실 SVG: 완전 정적 이미지 (애니메이션 없음) */
.hangul-stroke-svg-real path {
    animation: none !important;
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
}
.hangul-stroke-svg-real .jamo path {
    fill: var(--text-color, #111);
}
.hangul-stroke-svg-real .stroke-number path,
.hangul-stroke-svg-real [id^="number-"] path {
    fill: #0066cc;
}
.hangul-stroke-svg-real path.order-arrow,
.hangul-stroke-svg-real [id^="arrow-"] {
    fill: #3399ff;
}

/* 폴백(템플릿) SVG에만 애니메이션 적용 */
.hangul-stroke-svg:not(.hangul-stroke-svg-real) path {
    fill: none;
    stroke: var(--text-color);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: hangul-stroke-draw 0.55s ease-out forwards;
}
.hangul-stroke-svg:not(.hangul-stroke-svg-real) path:nth-child(1) { animation-delay: 0s; }
.hangul-stroke-svg:not(.hangul-stroke-svg-real) path:nth-child(2) { animation-delay: 0.5s; }
.hangul-stroke-svg:not(.hangul-stroke-svg-real) path:nth-child(3) { animation-delay: 1s; }
.hangul-stroke-svg:not(.hangul-stroke-svg-real) path:nth-child(4) { animation-delay: 1.5s; }
.hangul-stroke-svg:not(.hangul-stroke-svg-real) path:nth-child(5) { animation-delay: 2s; }

@keyframes hangul-stroke-draw {
    to {
        stroke-dashoffset: 0;
    }
}

.hangul-replay-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

.hangul-detail-strokes {
    width: 100%;
    padding: 0.75rem;
    background: var(--background-color);
    border-radius: 6px;
    font-size: 0.95rem;
}

.hangul-detail-strokes h3 {
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
    color: var(--text-color);
}

.hangul-detail-strokes p {
    margin: 0;
}

.hangul-detail-panel .btn-play {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hangul-list-wrap {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hangul-list-wrap h2 {
    width: 100%;
    box-sizing: border-box;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-color);
}

.hangul-row {
    margin-bottom: 1.5rem;
}

.hangul-row:last-child {
    margin-bottom: 0;
}

.hangul-row-title {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.hangul-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hangul-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 4rem;
    padding: 0.75rem 0.5rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hangul-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px var(--shadow-hover);
    background: #fff;
}

.hangul-char {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
}

.hangul-romaji {
    font-size: 0.85rem;
    color: #555;
}

.hangul-item.selected {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 2px 8px var(--shadow-hover);
}

.what-is-hangul-chart {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0078d4;
}

.instructions-container h2 {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0078d4;
    color: var(--text-color);
}

.instructions-container .text-emphasis {
    font-weight: 600;
    color: var(--text-color);
}

.instructions-container p,
.instructions-container ul {
    margin-bottom: 0.75rem;
}
