* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Times New Roman', Times, Georgia, serif;
}

body {
    background: #f4f0ea;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.page-title {
    font-size: 42px;
    color: #111;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 24px;
    font-family: 'Times New Roman', Times, Georgia, serif;
    text-align: center;
}

.page-title span {
    color: #c0392b;
}

.game-container {
    width: 100%;
    max-width: 520px;
    background-color: #fffcf7;
    border-radius: 0;
    box-shadow: none;
    padding: 32px;
    border: 1px solid #d4cdc0;
}

header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid #111;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-timer {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    background: none;
    padding: 6px 12px;
    border: 1px solid #111;
    min-width: 64px;
    text-align: center;
    font-family: 'Times New Roman', Times, Georgia, serif;
}

.settings-icon {
    color: #666;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.settings-icon:hover {
    border-color: #111;
    color: #111;
}

.words-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 28px;
    max-height: 180px;
    overflow-y: auto;
}

.words-container::-webkit-scrollbar {
    width: 4px;
}

.words-container::-webkit-scrollbar-track {
    background: transparent;
}

.words-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.word-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: none;
    border-bottom: 1px solid #e0d8cc;
    align-items: center;
    transition: all 0.2s ease;
}

.word-row:hover {
    background-color: #f0ebe3;
}

.word-display {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #111;
    font-family: 'Times New Roman', Times, Georgia, serif;
}

.word-timer {
    font-size: 13px;
    color: #666;
    font-weight: 400;
    font-family: 'Times New Roman', Times, Georgia, serif;
}

.current-word-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.word-letters-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px;
    background-color: #f6f2eb;
    min-height: 92px;
    align-items: center;
    border: 1px solid #e0d8cc;
}

.letter {
    width: 54px;
    height: 54px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    border-radius: 0;
    background: none;
    color: #111;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s ease;
    border: 2px solid #111;
    font-family: 'Times New Roman', Times, Georgia, serif;
}

.letter:hover {
    background-color: #111;
    color: #fffcf7;
}

.letter:active {
    transform: scale(0.93);
}

.letter.used {
    opacity: 0.2;
    pointer-events: none;
    transform: scale(0.85);
    border-color: #ccc;
}

.build-word-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.build-word-label {
    font-size: 11px;
    color: #666;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Times New Roman', Times, Georgia, serif;
}

.build-word-letters {
    display: flex;
    gap: 8px;
    min-height: 58px;
    padding: 8px 12px;
    background-color: #f6f2eb;
    border: 2px dashed #ccc;
    width: 100%;
    justify-content: center;
    align-items: center;
    transition: border-color 0.2s ease;
}

.build-word-letters:not(:empty) {
    border-style: solid;
    border-color: #111;
    background-color: #fcf9f5;
}

.build-letter {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    font-weight: 700;
    border-radius: 0;
    background: #111;
    color: #fffcf7;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    font-family: 'Times New Roman', Times, Georgia, serif;
    animation: popIn 0.2s ease forwards;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.build-letter:hover {
    background: #c0392b;
}

.correct-word {
    color: #c0392b;
    font-weight: 700;
}

.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fffcf7;
    width: 90%;
    max-width: 400px;
    border: 2px solid #111;
    animation: modalIn 0.2s ease forwards;
    padding: 28px;
}

@keyframes modalIn {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #111;
    font-weight: 700;
    font-family: 'Times New Roman', Times, Georgia, serif;
}

.close {
    color: #999;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.close:hover {
    color: #111;
}

.modal-body {
    margin-bottom: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

.setting-row {
    margin-bottom: 24px;
}

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-row label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 15px;
    font-family: 'Times New Roman', Times, Georgia, serif;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
}

.setting-row .slider {
    flex: 1;
    height: 4px;
    background: #e0d8cc;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.setting-row .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 0;
    background: #111;
    cursor: pointer;
    transition: all 0.2s;
}

.setting-row .slider::-webkit-slider-thumb:hover {
    background: #c0392b;
}

.setting-row .slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 0;
    background: #111;
    cursor: pointer;
    border: none;
}

.setting-row .slider-value {
    font-weight: 700;
    color: #111;
    font-size: 16px;
    min-width: 36px;
    text-align: center;
    font-family: 'Times New Roman', Times, Georgia, serif;
}

.btn {
    background: #111;
    color: #fffcf7;
    border: none;
    padding: 10px 32px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    width: 100%;
    font-family: 'Times New Roman', Times, Georgia, serif;
    text-transform: uppercase;
}

.btn:hover {
    background: #c0392b;
}

#gameOverMessage {
    text-align: center;
    font-size: 16px;
    color: #333;
    line-height: 1.8;
    font-family: 'Times New Roman', Times, Georgia, serif;
}

#gameOverMessage strong {
    color: #c0392b;
    font-size: 24px;
    display: block;
    margin-top: 4px;
}
