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

body {
    font-family: "Consolas", "Monaco", "Menlo", "Courier New", "MS Gothic", "Hiragino Kaku Gothic ProN", "Hiragino Sans", monospace;
    background-color: #000000;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
    font-size: 14px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0;
    padding: 0;
    border: none;
}

.input-header {
    position: sticky;
    top: 0;
    background-color: #000000;
    padding: 20px 0 10px 0;
    margin: 0;
    border: none;
    z-index: 100;
}

#documentInput {
    width: 50%;
    padding: 8px;
    background-color: #000000;
    border: 1px solid #ffffff;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

#documentInput:focus {
    border-color: #ffffff;
}

.status-section {
    padding: 8px;
    background-color: #000000;
    min-height: 40px;
}

#statusMessage {
    font-size: 14px;
    color: #ffffff;
}


.display-section {
    flex: 1;
    min-height: 400px;
    background-color: #000000;
    padding: 15px;
}

#documentDisplay {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.8;
    color: #ffffff;
}

.speaker-line {
    margin-bottom: 8px;
}

.speaker-number {
    color: #6688dd;
    cursor: pointer;
    transition: color 0.2s;
}

.speaker-number:hover {
    color: #8298ce;
}

.speaker-text {
    color: #ffffff;
    margin-left: 10px;
}

.narrative-text {
    color: #ffff99;
    margin-bottom: 8px;
}

.narrative-text a,
.narrative-text .document-link {
    color: #ffff99 !important;
    text-decoration: underline !important;
    text-decoration-color: #ffff99 !important;
}

.narrative-text a:hover,
.narrative-text .document-link:hover {
    color: #cccc88 !important;
    text-decoration-color: #cccc88 !important;
}

h1 a,
h1 .document-link,
h3 a,
h3 .document-link {
    text-decoration: underline;
}

h1 a,
h1 .document-link {
    color: #ffff99;
    text-decoration-color: #ffff99;
}

h1 a:hover,
h1 .document-link:hover {
    color: #cccc88;
    text-decoration-color: #cccc88;
}

h3 a,
h3 .document-link {
    color: #db709f;
    text-decoration-color: #db709f;
}

h3 a:hover,
h3 .document-link:hover {
    color: #b5658a;
    text-decoration-color: #b5658a;
}

.document-link {
    color: #ffffff;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}

.document-link:hover {
    color: #cccccc;
}

.speaker-list {
    margin: 10px 0;
}

.speaker-item {
    display: block;
    margin: 5px 0;
    color: #ffffff;
    text-decoration: underline;
    cursor: pointer;
}

.document-list {
    margin: 10px 0;
}

.document-item {
    display: block;
    margin: 5px 0;
    color: #ffffff;
    text-decoration: underline;
    cursor: pointer;
}

.language-link {
    display: block;
    margin: 5px 0;
    color: #ffffff;
    text-decoration: underline;
    cursor: pointer;
}

.border-box {
    color: #ffffff;
    background-color: transparent;
    border: none;
    font-family: "Consolas", "Monaco", "Menlo", "Courier New", "MS Gothic", monospace;
    font-size: 14px;
    margin: 10px 0;
}

.text-box {
    border: 1px solid #ffffff;
    padding: 10px;
    margin: 10px 0;
    background-color: transparent;
    color: #ffffff;
    font-family: "Consolas", "Monaco", "Menlo", "Courier New", "MS Gothic", monospace;
}

.typewriter-text {
    color: #ffff99;
    margin: 10px 0;
}

.hangman-word {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 4px;
    text-align: center;
    margin: 20px 0;
}

.hangman-ascii {
    color: #db709f;
    font-family: "Consolas", "Monaco", "Menlo", "Courier New", "MS Gothic", monospace;
    font-size: 14px;
    text-align: center;
    margin: 20px 0;
    background-color: transparent;
    border: none;
}

.hangman-result {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    color: #ffffff;
}

.help-content, .language-content, .saveload-content {
    color: #ffffff;
    line-height: 1.6;
}

.help-content ul, .saveload-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.help-content li, .saveload-content li {
    margin-bottom: 5px;
}

.help-content strong {
    color: #db709f;
}

#documentDisplay br + br {
    line-height: 2.0;
}

#documentDisplay h3 + * {
    margin-top: 10px;
}

.help-commands {
    line-height: 2.2;
}

.help-commands strong {
    display: inline-block;
    margin-bottom: 8px;
    font-weight: normal;
}

.saveload-content code {
    background-color: #333333;
    color: #ffff99;
    padding: 2px 4px;
    font-family: "Consolas", "Monaco", "Menlo", "Courier New", "MS Gothic", monospace;
}

h3 {
    color: #db709f;
    margin-bottom: 15px;
    font-size: 16px;
}

.completed-section {
    color: #4CAF50 !important;
}

a, a:link, a:visited, a:active {
    color: #ffffff;
    text-decoration: underline;
    cursor: pointer;
}

a:hover {
    text-decoration: none;
}

.language-selection {
    text-align: center;
    margin-top: 100px;
}

.language-selection h1 {
    color: #ffffff;
    margin-bottom: 30px;
    font-size: 24px;
}

.language-selection a {
    display: block;
    margin: 10px 0;
    font-size: 18px;
    color: #ffffff;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .display-section {
        min-height: 300px;
        padding: 10px;
    }
    
    #documentDisplay {
        font-size: 13px;
    }
    
    .hangman-word {
        font-size: 18px;
        letter-spacing: 2px;
    }
}