body {
    background-color: #900;
    color: white;
    font-family: "IBM Plex Sans JP", sans-serif;
    font-weight: 400;
    font-style: normal;
    margin: 0;
    padding: 20px;
    min-height: calc(100vh - 176px);
    min-height: calc(100svh - 176px);
    min-height: calc(100dvh - 176px);
}

.font-galpil {
    font-family: "PRK P BG Galpil", serif;
    font-weight: 400;
    font-style: normal;
}

.font-prk-gothic {
    font-family: "PRK P Gothic", serif;
    font-weight: 400;
    font-style: normal;
    vertical-align: -0.05em;
}

.font-fugafude {
    font-family: "ta-fuga-fude", serif;
    font-weight: 400;
    font-style: normal;
}

.font-chollima {
    font-family: "KP CheonRiMa", serif;
    font-weight: 400;
    font-style: normal;
}

.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border: 8px solid #fbbf24;
    border-radius: 20px;
    color: black;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 40px 40px;
    background-color: #ff0033;
    border-radius: 10px;
    transition: padding 2s ease, margin-bottom 2s ease, min-height 2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.header.bgm-expanded {
    padding: 40px 40px;
    margin-bottom: 0;
    min-height: calc(100vh - 176px);
    min-height: calc(100svh - 176px);
    min-height: calc(100dvh - 176px);
}

.title {
    font-size: 64px;
    font-weight: bold;
    margin: 0;
    color: #2563eb;
    text-shadow:
        -1px -1px 0 white,
        1px -1px 0 white,
        -1px 1px 0 white,
        1px 1px 0 white,
        -1px 0 0 white,
        1px 0 0 white,
        0 -1px 0 white,
        0 1px 0 white;
    opacity: 0;
    transform: scale(0.1);
    transition: opacity 1s ease, transform 1.5s ease;
    line-height: 1.5;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .title {
        font-size: 36px;
    }

    .modal-content {
        padding: 30px 15px;
        width: 95%;
        margin: 0 10px;
    }

    .modal-title {
        font-size: 28px;
        margin-bottom: 20px;
    }

    .modal-buttons {
        gap: 10px;
        margin-top: 20px;
    }

    .btn-primary,
    .btn-secondary {
        font-size: 16px;
        padding: 12px 20px;
        min-width: 100px;
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 25px 10px;
        width: 98%;
        margin: 0 5px;
    }

    .modal-title {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .btn-primary,
    .btn-secondary {
        font-size: 14px;
        padding: 10px 15px;
        min-width: 80px;
        max-width: 120px;
    }
}

.title.show {
    opacity: 1;
    transform: scale(1);
}

.subtitle {
    font-size: 18px;
    color: white;
    font-weight: bold;
    text-shadow: 2px 2px 0px #000000;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

body.modal-open {
    overflow: hidden;
}

.modal-content {
    background-color: white;
    border: 4px solid #0033ff;
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    margin: 0 20px;
    color: black;
}

.modal-title {
    font-size: 36px;
    font-weight: bold;
    color: #0033ff;
    margin-bottom: 30px;
}

.modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-primary {
    padding: 15px 30px;
    background-color: #22c55e;
    border: 3px solid #22c55e;
    border-radius: 12px;
    font-weight: bold;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
    color: white;
    min-width: 120px;
    flex: 1;
    max-width: 200px;
}

.btn-primary:hover {
    transform: scale(1.05);
}

.btn-secondary {
    padding: 15px 30px;
    background-color: #6b7280;
    border: 3px solid #6b7280;
    border-radius: 12px;
    font-weight: bold;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
    color: white;
    min-width: 120px;
    flex: 1;
    max-width: 200px;
}

.btn-secondary:hover {
    transform: scale(1.05);
}

.btn-play {
    padding: 8px 16px;
    background-color: #22c55e;
    border: 1px solid #fbbf24;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-play:hover {
    transform: scale(1.05);
}

.btn-play.playing {
    background-color: #dc2626;
}

.btn-play.playing:hover {
    background-color: #b91c1c;
}

.btn-download {
    display: inline-block;
    padding: 8px 16px;
    background-color: #fbbf24;
    border: 1px solid #fbbf24;
    border-radius: 5px;
    font-weight: bold;
    color: black;
    text-decoration: none;
    transition: transform 0.2s;
}

.btn-download:hover {
    transform: scale(1.05);
}

.content-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.content-section.show {
    opacity: 1;
    transform: translateY(0);
}

.content-section.bgm-mode {
    display: none;
}

.content-section.bgm-mode.show {
    display: flex;
}

.section {
    background-color: #f3f4f6;
    border: 1px solid #2563eb;
    border-radius: 10px;
    padding: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    margin-bottom: 20px;
}

.section p {
    margin: 0;
}

.section .section {
    margin-bottom: 15px;
    background-color: #f8fafc;
    border-color: #3b82f6;
}

.section .section:last-child {
    margin-bottom: 0;
}

.section.show {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 24px;
    font-weight: bold;
    color: #1e40af;
    margin-bottom: 10px;
    text-shadow: 1px 1px 0px #ffffff;
}

.section-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}


.section-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: flex-start;
    margin-top: 20px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e40af;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.volume-control label {
    white-space: nowrap;
    flex-shrink: 0;
}

.volume-control span {
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 40px;
}

.volume-slider {
    width: 100%;
    height: 16px;
    background-color: #1e3a8a;
    border: 1px solid #fbbf24;
    border-radius: 5px;
}



.lyrics-line {
    margin-bottom: 15px;
    font-size: 18px;
}

.korean-word {
    position: relative;
    display: inline;
    cursor: help;
    border-bottom: 1px dotted #2563eb;
    padding: 2px 0;
    margin: 0;
    transition: background-color 0.2s;
    font-family: "KP CheonRiMa", serif;
    font-weight: 400;
    font-style: normal;
    vertical-align: -0.05em;
}

.korean-word+.korean-word {
    margin-left: 1px;
}

.korean-word:hover {
    background-color: #dbeafe;
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e40af;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    font-family: "IBM Plex Sans JP", sans-serif;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e40af;
}

.korean-word:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.japanese-translation {
    color: #6b7280;
    font-size: 16px;
    margin-top: 8px;
    font-style: italic;
}

.no-js .modal-overlay {
    display: none !important;
}

.no-js .content-section {
    opacity: 1 !important;
    transform: none !important;
}

.no-js .title {
    opacity: 1 !important;
    transform: none !important;
}

.no-js .section {
    opacity: 1 !important;
    transform: none !important;
}

.no-js .header {
    padding: 40px 40px !important;
    margin-bottom: 30px !important;
    min-height: 120px !important;
}

.no-js #midi-control-section {
    display: none !important;
}
