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

body {
    font-family: 'Malgun Gothic', '맑은 고딕', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
}

/* 사이드바 스타일 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 250px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    z-index: 1000;
    transform: translateX(0);
}

.sidebar.closed {
    transform: translateX(-100%);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-header h2 {
    color: white;
    font-size: 1.5em;
    margin: 0;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.3s;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-nav {
    padding: 20px 0;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin: 0;
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
    border-left: 3px solid transparent;
}

.menu-item a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item.active a {
    background: rgba(255, 255, 255, 0.2);
    border-left-color: white;
}

.menu-icon {
    font-size: 1.5em;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.menu-text {
    font-size: 1.1em;
    white-space: nowrap;
}

/* 사이드바 오버레이 (모바일용) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* 메인 컨텐츠 */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    padding: 20px;
    transition: margin-left 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-content.sidebar-closed {
    margin-left: 0;
}

.menu-toggle-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(102, 126, 234, 0.9);
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 998;
    transition: background 0.3s, transform 0.2s, opacity 0.3s;
    opacity: 0;
    pointer-events: none;
}

.menu-toggle-btn.show {
    opacity: 1;
    pointer-events: auto;
}

.menu-toggle-btn:hover {
    background: rgba(102, 126, 234, 1);
    transform: scale(1.1);
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.game-info {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.info-item {
    text-align: center;
}

.label {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.info-item span:last-child {
    display: block;
    color: #667eea;
    font-size: 1.5em;
    font-weight: bold;
}

.game-area {
    margin-bottom: 30px;
}

.sentence-display {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    font-size: 1.3em;
    line-height: 1.8;
    min-height: 100px;
    margin-bottom: 20px;
    color: #333;
    word-break: keep-all;
}

.sentence-display .correct {
    color: #4CAF50;
    background-color: #e8f5e9;
}

.sentence-display .incorrect {
    color: #f44336;
    background-color: #ffebee;
    text-decoration: underline;
}

.sentence-display .current {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
    padding-left: 2px;
}

.input-area {
    margin-bottom: 20px;
}

#user-input {
    width: 100%;
    padding: 20px;
    font-size: 1.2em;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Malgun Gothic', '맑은 고딕', Arial, sans-serif;
    resize: none;
    transition: border-color 0.3s;
}

#user-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#user-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s;
}

.start-btn, .restart-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.start-btn:hover, .restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.start-btn:active, .restart-btn:active {
    transform: translateY(0);
}

.results {
    margin-top: 30px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

.results h2 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2em;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    min-width: 200px;
    margin: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2.5em;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
}

.sentence-results {
    text-align: left;
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.sentence-result-item {
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
    background: #f8f9fa;
    border-radius: 5px;
}

.sentence-result-item .sentence-text {
    margin-bottom: 8px;
    font-size: 1.1em;
    color: #333;
}

.sentence-result-item .sentence-speed {
    color: #667eea;
    font-weight: bold;
}

/* 반응속도 게임 스타일 */
.game-section {
    display: block;
}

.reaction-game-info {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.reaction-area {
    margin-bottom: 30px;
}

.reaction-box {
    width: 100%;
    height: 400px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #667eea;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    user-select: none;
}

.reaction-box:hover {
    transform: scale(1.02);
}

.reaction-message {
    font-size: 2.5em;
    color: white;
    font-weight: bold;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.reaction-results {
    margin-top: 30px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

.reaction-results h2 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2em;
}

.reaction-times {
    text-align: left;
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle-btn {
        top: 15px;
        left: 15px;
        opacity: 1;
        pointer-events: auto;
    }

    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .game-info {
        flex-direction: column;
        gap: 15px;
    }

    .result-stats {
        flex-direction: column;
    }

    .stat-item {
        width: 100%;
    }

    .reaction-game-info {
        flex-direction: column;
        gap: 15px;
    }

    .reaction-box {
        height: 300px;
    }

    .reaction-message {
        font-size: 1.8em;
    }
}


