body { font-family: 'Malgun Gothic', sans-serif; background-color: #f0f4f8; margin: 0; display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.container { background-color: white; border-radius: 16px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); width: 440px; padding: 30px; text-align: center; position: relative; box-sizing: border-box; max-width: 95%; margin: 10px; }
.wide-container { width: 680px; max-width: 95%; }
h1 { color: #58cc02; margin-bottom: 20px; }
h2 { color: #4b4b4b; font-size: 20px; margin-bottom: 15px; }

.btn { background-color: #58cc02; color: white; border: none; border-radius: 12px; padding: 15px 20px; font-size: 16px; font-weight: bold; cursor: pointer; width: 100%; margin-top: 15px; box-shadow: 0 4px 0 #58a700; transition: transform 0.1s; }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 #58a700; }
.btn-blue { background-color: #1cb0f6; box-shadow: 0 4px 0 #1899d6; }
.btn-blue:active { box-shadow: 0 0 0 #1899d6; }
.btn-purple { background-color: #854fee; box-shadow: 0 4px 0 #6b3cc9; }
.btn-purple:active { box-shadow: 0 0 0 #6b3cc9; }
.btn-red { background-color: #ff4d4d; box-shadow: 0 4px 0 #cf3c3c; }
.btn-red:active { box-shadow: 0 0 0 #cf3c3c; }

.screen { display: none; }
.active-screen { display: block; }

.input-field, select { width: 100%; padding: 12px; margin: 10px 0; border: 2px solid #e5e5e5; border-radius: 8px; box-sizing: border-box; font-size: 14px; }

.game-board { display: flex; justify-content: space-between; margin-top: 20px; }
.word-column { display: flex; flex-direction: column; width: 48%; gap: 10px; }

.word-btn { background-color: white; border: 2px solid #e5e5e5; border-radius: 10px; padding: 15px 10px; font-size: 14px; color: #4b4b4b; cursor: pointer; font-weight: bold; transition: all 0.2s; word-break: break-all; }
.word-btn.selected { background-color: #ddf4ff; border-color: #1cb0f6; color: #1cb0f6; }
.word-btn.matched { background-color: #e5e5e5; border-color: #e5e5e5; color: #afafaf; pointer-events: none; }

.word-btn.incorrect, .chunk-btn.incorrect { background-color: #ffdde0 !important; border-color: #ff4d4d !important; color: #ff4d4d !important; animation: shake 0.3s; }

.target-kr { font-size: 16px; color: #4b4b4b; margin: 20px 0; font-weight: bold; word-break: keep-all; line-height: 1.4; }
.answer-area { min-height: 80px; border-bottom: 2px dashed #e5e5e5; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 10px; justify-content: center; align-items: center; }
.word-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 80px; align-content: flex-start; }
.chunk-btn { background-color: white; border: 2px solid #e5e5e5; border-radius: 10px; padding: 10px 15px; font-size: 14px; color: #4b4b4b; cursor: pointer; font-weight: bold; transition: all 0.1s; }

table { width: 100%; border-collapse: collapse; margin-top: 15px; font-size: 13px; table-layout: fixed; }
th, td { border: 1px solid #e5e5e5; padding: 8px; text-align: center; word-break: break-all; }
th { background-color: #f9f9f9; color: #4b4b4b; }

.hint-box { color: #ff4d4d; font-weight: bold; margin: 10px 0; min-height: 22px; font-size: 15px; }
.live-score-banner { background-color: #e8f5e9; border: 2px solid #81c784; color: #2e7d32; border-radius: 10px; padding: 8px; font-size: 14px; font-weight: bold; margin-bottom: 15px; }
.badge-box { display: inline-block; background: #e0f2fe; color: #0369a1; padding: 3px 8px; font-size: 11px; border-radius: 6px; font-weight: bold; margin: 2px; border: 1px solid #bae6fd; }

@media (max-width: 600px) {
    body { align-items: flex-start; }
    .container { padding: 12px; border-radius: 12px; margin: 5px auto; width: 100%; max-width: 100%; }
    h1 { font-size: 22px; margin-bottom: 10px; }
    h2 { font-size: 15px; }
    .btn { padding: 10px 12px; font-size: 14px; margin-top: 10px; }
    table { font-size: 11px; }
    th, td { padding: 4px 2px; font-size: 11px; }
    
    #teacher-screen div { box-sizing: border-box; }
    #teacher-screen input { width: 100%; box-sizing: border-box; }
    
    th:nth-child(1), td:nth-child(1) { width: 25%; }
    th:nth-child(2), td:nth-child(2) { width: 25%; }
    th:nth-child(3), td:nth-child(3) { width: 16%; }
    th:nth-child(4), td:nth-child(4) { width: 14%; }
    th:nth-child(5), td:nth-child(5) { width: 10%; }
    th:nth-child(6), td:nth-child(6) { width: 10%; }
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}