@charset "UTF-8";

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
    background: linear-gradient(135deg, #f3f7ff 0%, #ffffff 100%);
    color: #222;
}

.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 16px 60px;
}

.card {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.08);
    padding: 28px;
}

.center-card { max-width: 800px; margin: 40px auto; }
.form-card { max-width: 920px; margin: 20px auto; }
.small-card { max-width: 560px; margin: 40px auto; }
.game-card { max-width: 860px; margin: 30px auto; }
.result-card { max-width: 900px; margin: 30px auto; }

h1 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.3;
}

.sub {
    margin: 0 0 22px;
    color: #666;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.label {
    font-weight: 800;
    margin-top: 4px;
}

.input, .textarea {
    width: 100%;
    border: 1px solid #d7dfeb;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 16px;
    background: #fff;
}

.textarea {
    min-height: 320px;
    resize: vertical;
    font-family: Consolas, monospace;
    line-height: 1.6;
}

.big-input {
    font-size: 20px;
    padding: 16px 18px;
}

.btn {
    display: inline-block;
    text-decoration: none;
    border: 0;
    border-radius: 14px;
    padding: 13px 18px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    background: #eef2f7;
    color: #222;
}

.btn.primary {
    background: #2563eb;
    color: #fff;
}

.btn.ghost {
    background: #eef2f7;
    color: #222;
}

.btn.danger {
    background: #dc2626;
    color: #fff;
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-weight: 700;
}

.alert.error {
    background: #fef2f2;
    color: #991b1b;
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.big-menu {
    display: block;
    text-decoration: none;
    color: #222;
    background: #f8fafc;
    border: 2px solid #dbe4f0;
    border-radius: 20px;
    padding: 22px;
}

.big-title {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 8px;
}

.big-desc {
    color: #5f6b7a;
    line-height: 1.5;
}

.guide {
    margin-top: 24px;
    background: #f8fafc;
    border-radius: 16px;
    padding: 18px;
}

.guide pre {
    margin: 0;
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 14px;
    overflow-x: auto;
    line-height: 1.6;
}

.info-list, .mini-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.link-box {
    margin-bottom: 16px;
}

.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    color: #555;
    font-size: 18px;
}

.question-box, .chosung-box, .hint-box {
    background: #f8fafc;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
}

.q-label {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 800;
}

.question {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.5;
    word-break: keep-all;
}

.chosung {
    font-size: 38px;
    font-weight: 900;
    letter-spacing: 4px;
    color: #1d4ed8;
}

.hint {
    font-size: 18px;
    font-weight: 800;
    color: #334155;
}

.score-box {
    text-align: center;
    margin: 20px 0;
}

.score-number {
    font-size: 60px;
    font-weight: 900;
    color: #2563eb;
}

.score-total {
    font-size: 34px;
    color: #666;
}

.teacher-body {
    margin: 0;
    background: radial-gradient(circle at top, #1e293b 0%, #0f172a 60%, #020617 100%);
    color: #fff;
    min-height: 100vh;
}

.teacher-wrap {
    min-height: 100vh;
    padding: 18px;
}

.teacher-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    position: sticky;
    top: 12px;
    z-index: 20;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.teacher-badge {
    display: inline-block;
    padding: 6px 10px;
    background: rgba(37, 99, 235, 0.25);
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 999px;
    font-weight: 900;
}

.teacher-progress,
.teacher-file {
    color: #cbd5e1;
    font-weight: 700;
}

.teacher-stage {
    max-width: 1500px;
    margin: 26px auto 0;
}

.teacher-question-box,
.teacher-chosung-box,
.teacher-hidden-panel {
    border-radius: 28px;
    padding: 30px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.24);
    margin-bottom: 20px;
}

.teacher-question-box {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}

.teacher-chosung-box {
    background: linear-gradient(135deg, rgba(37,99,235,0.30), rgba(29,78,216,0.16));
    border: 1px solid rgba(96,165,250,0.32);
}

.teacher-hidden-panel {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    display: none;
}

.teacher-hidden-panel.show {
    display: block;
}

.teacher-label {
    font-size: 18px;
    color: #93c5fd;
    margin-bottom: 12px;
    font-weight: 900;
}

.teacher-question {
    font-size: clamp(2rem, 4vw, 4.2rem);
    line-height: 1.45;
    font-weight: 900;
    word-break: keep-all;
}

.teacher-chosung {
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 1.25;
    font-weight: 900;
    letter-spacing: 0.18em;
    color: #dbeafe;
    text-align: center;
}

.teacher-hint,
.teacher-answer {
    font-size: clamp(1.6rem, 3vw, 3rem);
    font-weight: 900;
    line-height: 1.5;
}

.teacher-answer {
    color: #fde68a;
}

.hint-btn {
    background: #0ea5e9;
    color: #fff;
}

.answer-btn {
    background: #f59e0b;
    color: #fff;
}

.disabled-link {
    pointer-events: none;
    opacity: 0.35;
}

.teacher-toolbar .btn,
.teacher-toolbar a.btn {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(148,163,184,0.24);
}

.teacher-toolbar .btn.primary,
.teacher-toolbar a.btn.primary {
    background: #2563eb;
    color: #fff;
    border: none;
}

@media (max-width: 900px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }

    .teacher-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-center,
    .toolbar-right {
        justify-content: center;
    }

    .question {
        font-size: 22px;
    }

    .chosung {
        font-size: 30px;
    }

    h1 {
        font-size: 28px;
    }
}

.selected-game-box {
    background: #f8fafc;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    padding: 18px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.selected-game-title {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 8px;
}

.selected-game-desc {
    color: #5f6b7a;
    margin-bottom: 10px;
    line-height: 1.5;
}

.selected-game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: #475569;
    font-size: 14px;
}