/* --------------------------------
   Base
-------------------------------- */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    min-height: 100%;
}

body {
    min-height: 100vh;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Pretendard",
        sans-serif;

    color: #302b26;

    background:
        radial-gradient(circle at 14% 18%,
            rgba(255, 214, 180, 0.42),
            transparent 34%),
        radial-gradient(circle at 86% 82%,
            rgba(255, 235, 205, 0.52),
            transparent 38%),
        linear-gradient(135deg,
            #f8f2e9 0%,
            #f4eee7 48%,
            #f7f1e9 100%);

    overflow: hidden;
}

#presentation-root {
    width: 100%;
    min-height: 100vh;
}


/* --------------------------------
   Presentation stage
-------------------------------- */

.screen {
    width: 100%;
    height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding:
        clamp(22px, 2.8vw, 46px) clamp(24px, 3.5vw, 58px) clamp(14px, 2vw, 28px);
}


/* --------------------------------
   Main slide glass card
-------------------------------- */

.slide-card {
    width: min(92vw, 1500px);
    height: min(82vh, 860px);

    display: flex;
    flex-direction: column;

    padding:
        clamp(34px, 4vw, 62px) clamp(38px, 5vw, 78px);

    background:
        linear-gradient(145deg,
            rgba(255, 255, 255, 0.58),
            rgba(255, 255, 255, 0.34));

    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);

    border:
        1px solid rgba(255, 255, 255, 0.72);

    border-radius: 34px;

    box-shadow:
        0 22px 65px rgba(88, 67, 44, 0.11),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}


/* --------------------------------
   Header
-------------------------------- */

.slide-header {
    flex: 0 0 auto;
}

.slide-header h1 {
    font-size: clamp(32px, 3.2vw, 56px);
}

.slide-header h2 {
    font-size: clamp(18px, 1.6vw, 26px);
    white-space: pre-line;
}


/* --------------------------------
   Content
-------------------------------- */

.slide-content {
    flex: 1;
    min-height: 0;

    margin-top: clamp(28px, 4vh, 48px);
}


/* 기본: 이미지 40 / 텍스트 60 */

.split-layout {
    display: grid;
    grid-template-columns: 40fr 60fr;
    gap: clamp(24px, 3vw, 46px);
}


/* 이미지가 없을 때 */

.text-layout {
    display: flex;
    width: 100%;
}


/* --------------------------------
   Floating content cards
-------------------------------- */

.text-panel,
.image-panel,
.column-card {
    background:
        linear-gradient(145deg,
            rgba(255, 255, 255, 0.46),
            rgba(255, 255, 255, 0.25));

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    border:
        1px solid rgba(255, 255, 255, 0.62);

    border-radius: 26px;

    box-shadow:
        0 12px 32px rgba(81, 63, 45, 0.075);
}


/* --------------------------------
   Text panel
-------------------------------- */

.text-panel {
    width: 100%;

    padding: clamp(28px, 3vw, 44px);

    display: flex;
    flex-direction: column;
    justify-content: center;

    font-size: clamp(17px, 1.4vw, 24px);
    line-height: 1.65;
}

.text-panel p {
    margin: 0 0 0.85em;

    white-space: pre-line;
}

.text-panel p:last-child {
    margin-bottom: 0;
}


/* --------------------------------
   Image panel
-------------------------------- */

.image-panel {
    padding: clamp(12px, 1.2vw, 18px);

    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 0;
    min-height: 0;

    overflow: hidden;
}

.image-panel img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;

    border-radius: 18px;
}


/* --------------------------------
   Footer
   Main card 밖에 위치
-------------------------------- */

.slide-footer {
    flex: 0 0 auto;

    margin-top: clamp(12px, 1.4vh, 18px);

    font-size: clamp(13px, 0.95vw, 17px);
    font-weight: 500;

    letter-spacing: -0.01em;

    color: rgba(48, 43, 38, 0.4);

    text-align: center;
}


/* --------------------------------
   Cover / Center slide
-------------------------------- */

.center-slide {
    justify-content: center;
}

.center-slide .slide-header {
    text-align: center;
}

.center-slide .slide-header h1 {
    font-size: clamp(54px, 6vw, 96px);
}

.center-slide .slide-header h2 {
    margin-top: 20px;

    font-size: clamp(24px, 2.3vw, 36px);
}

.center-slide .slide-content {
    flex: 0 0 auto;

    margin-top: clamp(34px, 5vh, 54px);

    display: flex;
    justify-content: center;
}

.center-slide .text-panel {
    width: auto;

    padding: 0;

    background: transparent;

    backdrop-filter: none;
    -webkit-backdrop-filter: none;

    border: none;
    box-shadow: none;

    text-align: center;

    font-size: clamp(19px, 1.6vw, 27px);

    color: rgba(48, 43, 38, 0.7);
}


/* --------------------------------
   Double column
-------------------------------- */

.double-column {
    flex: 1;
    min-height: 0;

    margin-top: clamp(28px, 4vh, 48px);

    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: clamp(24px, 3vw, 44px);
}

.column-card {
    min-width: 0;
    min-height: 0;

    padding: clamp(22px, 2.4vw, 34px);

    display: flex;
    flex-direction: column;
}

.column-card h2 {
    margin: 0 0 22px;

    font-size: clamp(21px, 2vw, 31px);
    line-height: 1.3;

    font-weight: 650;
    letter-spacing: -0.025em;
}

.column-card img {
    width: 100%;

    flex: 1;
    min-height: 0;

    display: block;

    object-fit: contain;

    border-radius: 18px;
}

.column-card p {
    margin: 22px 0 0;

    font-size: clamp(18px, 1.45vw, 24px);
    line-height: 1.55;

    white-space: pre-line;
}


/* --------------------------------
   4:3 projector support
-------------------------------- */

@media (max-aspect-ratio: 4/3) {

    .screen {
        padding:
            24px 28px 14px;
    }

    .slide-card {
        width: 94vw;
        height: 84vh;

        padding:
            36px 44px;
    }

    .split-layout {
        grid-template-columns: 44fr 56fr;

        gap: 24px;
    }

    .slide-header h1 {
        font-size: clamp(34px, 4.2vw, 54px);
    }

    .slide-header h2 {
        font-size: clamp(19px, 2vw, 27px);
    }

    .text-panel {
        padding: 28px;

        font-size: clamp(18px, 2vw, 25px);
    }

    .double-column {
        gap: 22px;
    }
}


/* --------------------------------
   Smaller laptop screens
-------------------------------- */

@media (max-height: 720px) {

    .slide-card {
        height: 80vh;

        padding-top: 30px;
        padding-bottom: 30px;
    }

    .slide-content,
    .double-column {
        margin-top: 24px;
    }

    .slide-footer {
        margin-top: 9px;
    }
}


/* --------------------------------
   Admin
-------------------------------- */

.admin-page {
    min-height: 100vh;
    overflow: auto;
}

.admin-wrap {
    width: min(900px, 92vw);
    margin: 60px auto;
}

.admin-wrap h1 {
    margin-bottom: 40px;
}

.admin-wrap h2 {
    margin-bottom: 18px;
}

#slide-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-slide-button {
    width: 100%;

    padding: 16px 18px;

    display: flex;
    align-items: center;
    gap: 16px;

    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.65);

    font: inherit;
    text-align: left;

    cursor: pointer;
}

.admin-slide-button span {
    min-width: 28px;
    opacity: 0.45;
}

.admin-slide-button.active {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.22);
}

/* --------------------------------
   Question presentation
-------------------------------- */

.question-screen {
    overflow-y: auto;
    justify-content: flex-start;

    padding-top:
        clamp(34px, 5vh, 70px);
}

.question-stage {
    width: min(92vw, 1500px);

    display: flex;
    flex-direction: column;

    gap: 18px;
}

.question-card {
    padding:
        clamp(30px, 4vw, 56px);

    background:
        linear-gradient(145deg,
            rgba(255, 255, 255, 0.58),
            rgba(255, 255, 255, 0.34));

    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);

    border:
        1px solid rgba(255, 255, 255, 0.72);

    border-radius: 32px;

    box-shadow:
        0 22px 65px rgba(88, 67, 44, 0.11);
}

.submission-count {
    margin-top: 26px;

    font-size: 18px;
    font-weight: 600;

    color:
        rgba(48, 43, 38, 0.48);
}

.public-answer-list {
    display: flex;
    flex-direction: column;

    gap: 12px;
}

.public-answer-card {
    width: 100%;

    padding:
        18px 24px;

    border-radius: 20px;

    background:
        rgba(255, 255, 255, 0.48);

    border:
        1px solid rgba(255, 255, 255, 0.68);

    box-shadow:
        0 10px 26px rgba(81, 63, 45, 0.07);

    font-size:
        clamp(18px, 1.5vw, 25px);

    line-height: 1.5;
}


/* --------------------------------
   Student
-------------------------------- */

.student-page {
    min-height: 100vh;

    overflow-y: auto;
}

.student-shell {
    width: 100%;
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
}

.student-card {
    width: min(620px, 100%);

    padding: 30px;

    border-radius: 28px;

    background:
        rgba(255, 255, 255, 0.52);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border:
        1px solid rgba(255, 255, 255, 0.68);

    box-shadow:
        0 18px 48px rgba(80, 64, 47, 0.1);
}

.student-eyebrow {
    margin-bottom: 12px;

    font-size: 14px;
    font-weight: 700;

    color:
        rgba(48, 43, 38, 0.45);
}

.student-card h1 {
    margin:
        0 0 10px;

    font-size:
        clamp(28px, 7vw, 40px);

    line-height: 1.2;
}

.student-question-subtitle {
    margin:
        0 0 28px;

    font-size: 18px;
    line-height: 1.5;

    color:
        rgba(48, 43, 38, 0.65);
}

.student-label {
    display: block;

    margin:
        20px 0 8px;

    font-size: 14px;
    font-weight: 700;
}

.student-input,
.student-textarea {
    width: 100%;

    padding:
        14px 16px;

    border:
        1px solid rgba(48, 43, 38, 0.12);

    border-radius: 14px;

    background:
        rgba(255, 255, 255, 0.6);

    font: inherit;

    outline: none;
}

.student-textarea {
    min-height: 160px;

    resize: vertical;
}

.student-submit-button,
.student-edit-button {
    width: 100%;

    margin-top: 22px;

    padding:
        14px 18px;

    border: none;
    border-radius: 14px;

    background: #332e29;

    color: white;

    font: inherit;
    font-weight: 700;

    cursor: pointer;
}

.student-submitted {
    margin-top: 28px;
}

.submitted-message {
    font-weight: 700;
}

.submitted-answer {
    margin-top: 14px;

    padding: 16px;

    border-radius: 14px;

    background:
        rgba(255, 255, 255, 0.45);

    line-height: 1.55;
}


/* --------------------------------
   Admin answers
-------------------------------- */

.admin-question-section {
    margin-top: 40px;
}

#answer-list {
    display: flex;
    flex-direction: column;

    gap: 10px;
}

.admin-answer-button {
    width: 100%;

    padding: 14px 16px;

    display: grid;
    grid-template-columns:
        110px 1fr 70px;

    gap: 12px;

    align-items: center;

    border:
        1px solid rgba(0, 0, 0, 0.08);

    border-radius: 12px;

    background:
        rgba(255, 255, 255, 0.65);

    text-align: left;

    cursor: pointer;
}

.admin-answer-button.public {
    border-color:
        rgba(0, 0, 0, 0.32);

    background:
        rgba(255, 255, 255, 0.98);
}

.admin-answer-button small {
    text-align: right;

    opacity: 0.5;
}

.admin-empty {
    opacity: 0.5;
}

/* --------------------------------
   Question image
-------------------------------- */

.question-image {
    margin-top: 18px;

    display: flex;
    justify-content: center;
    align-items: center;

    max-height: 16vh;

    overflow: hidden;
}

.question-image img {
    max-width: 100%;
    max-height: 16vh;

    object-fit: contain;

    border-radius: 16px;
}


/* 학생 화면 질문 이미지 */

.student-question-image {
    margin: 18px 0 24px;

    display: flex;
    justify-content: center;
    align-items: center;
}

.student-question-image img {
    max-width: 100%;
    max-height: 220px;

    object-fit: contain;

    border-radius: 14px;
}

/* --------------------------------
   Backup page
-------------------------------- */

.backup-page {
    min-height: 100vh;
    overflow-y: auto;
}

#backup-root {
    width: 100%;
}

.backup-slide {
    width: 100%;
    min-height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding:
        clamp(24px, 3vw, 48px) clamp(24px, 3.5vw, 58px) clamp(16px, 2vw, 30px);
}

.backup-slide-card {
    width: min(92vw, 1500px);
    aspect-ratio: 16 / 9;

    display: flex;
    flex-direction: column;

    padding:
        clamp(34px, 4vw, 62px) clamp(38px, 5vw, 78px);

    background:
        linear-gradient(145deg,
            rgba(255, 255, 255, 0.58),
            rgba(255, 255, 255, 0.34));

    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);

    border:
        1px solid rgba(255, 255, 255, 0.72);

    border-radius: 34px;

    box-shadow:
        0 22px 65px rgba(88, 67, 44, 0.11),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}


/* Header */

.backup-header h1 {
    margin: 0;

    font-size: clamp(32px, 3.2vw, 56px);
    line-height: 1.12;

    font-weight: 760;
    letter-spacing: -0.045em;
}

.backup-header h2 {
    margin: 14px 0 0;

    font-size: clamp(18px, 1.6vw, 26px);
    line-height: 1.35;

    font-weight: 500;

    color: rgba(48, 43, 38, 0.62);

    white-space: pre-line;
}


/* 기본 발표 슬라이드 */

.backup-content {
    flex: 1;
    min-height: 0;

    margin-top: clamp(28px, 4vh, 48px);
}

.backup-split-layout {
    display: grid;
    grid-template-columns: 40fr 60fr;

    gap: clamp(24px, 3vw, 46px);
}

.backup-text-layout {
    display: flex;
    width: 100%;
}

.backup-text-panel,
.backup-image-panel,
.backup-column-card {
    background:
        linear-gradient(145deg,
            rgba(255, 255, 255, 0.46),
            rgba(255, 255, 255, 0.25));

    border:
        1px solid rgba(255, 255, 255, 0.62);

    border-radius: 26px;

    box-shadow:
        0 12px 32px rgba(81, 63, 45, 0.075);
}

.backup-text-panel {
    width: 100%;

    padding: clamp(28px, 3vw, 44px);

    display: flex;
    flex-direction: column;
    justify-content: center;

    font-size: clamp(17px, 1.4vw, 24px);
    line-height: 1.65;
}

.backup-text-panel p {
    margin: 0 0 0.85em;

    white-space: pre-line;
}

.backup-text-panel p:last-child {
    margin-bottom: 0;
}

.backup-image-panel {
    padding: 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 0;
    min-height: 0;
}

.backup-image-panel img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    border-radius: 18px;
}


/* 표지 */

.backup-center-slide {
    justify-content: center;
}

.backup-center-slide .backup-header {
    text-align: center;
}

.backup-center-slide .backup-header h1 {
    font-size: clamp(54px, 6vw, 96px);
}

.backup-center-slide .backup-content {
    flex: 0 0 auto;

    margin-top: 40px;

    justify-content: center;
}

.backup-center-slide .backup-text-panel {
    width: auto;

    padding: 0;

    background: transparent;

    border: none;
    box-shadow: none;

    text-align: center;
}


/* 더블 컬럼 */

.backup-double-column {
    flex: 1;
    min-height: 0;

    margin-top: clamp(28px, 4vh, 48px);

    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: clamp(24px, 3vw, 44px);
}

.backup-column-card {
    min-width: 0;

    padding: clamp(22px, 2.4vw, 34px);

    display: flex;
    flex-direction: column;
}

.backup-column-card h2 {
    margin: 0 0 22px;

    font-size: clamp(21px, 2vw, 31px);
    line-height: 1.3;
}

.backup-column-card img {
    width: 100%;

    max-height: 48vh;

    object-fit: contain;

    border-radius: 18px;
}

.backup-column-card p {
    margin: 22px 0 0;

    font-size: clamp(18px, 1.45vw, 24px);
    line-height: 1.55;

    white-space: pre-line;
}


/* 질문 */

.backup-question-label {
    margin-bottom: 14px;

    font-size: 14px;
    font-weight: 700;

    opacity: 0.45;
}

.backup-question-image {
    margin-top: 22px;

    display: flex;
    justify-content: center;
}

.backup-question-image img {
    max-width: 100%;
    max-height: 20vh;

    object-fit: contain;

    border-radius: 16px;
}


/* Footer */

.backup-footer {
    margin-top: 14px;

    font-size: clamp(13px, 0.95vw, 17px);
    font-weight: 500;

    color: rgba(48, 43, 38, 0.4);

    text-align: center;
}


/* --------------------------------
   Print / PDF
-------------------------------- */

@media print {

    .backup-slide-card {
        width: 100%;
        aspect-ratio: 16 / 9;
        min-height: 0;

        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}