<style>

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

  @media (max-height: 600px) {
    body { zoom: 0.90; }
  }




  html, body {

    height: 100%;

    overflow: hidden;

  }



  body {

    min-height: 100vh;

    min-height: -webkit-fill-available;

    background-color: #e8f5e0;

    background-image: linear-gradient(170deg, #d8f0c8 0%, #c8e8b8 40%, #d0ecc0 100%);

    background-position: center;

    background-repeat: no-repeat;

    background-size: cover;

    display: flex;

    align-items: center;

    justify-content: center;

    font-family: 'Gowun Dodum', sans-serif;

    padding: 0;
    margin: 0;

    position: relative;

    overflow: hidden;

  }



  /* 작은 꽃 장식 반복 */

  body::before {

    content: '';

    position: fixed;

    inset: 0;

    background-image:

      radial-gradient(circle 3px at 18% 28%, rgba(255,220,100,0.6) 0%, transparent 100%),

      radial-gradient(circle 2px at 82% 18%, rgba(255,200,80,0.5) 0%, transparent 100%),

      radial-gradient(circle 3px at 10% 72%, rgba(255,230,120,0.55) 0%, transparent 100%),

      radial-gradient(circle 2px at 90% 68%, rgba(200,240,160,0.6) 0%, transparent 100%),

      radial-gradient(circle 4px at 25% 88%, rgba(255,210,90,0.5) 0%, transparent 100%),

      radial-gradient(circle 2px at 75% 85%, rgba(255,220,110,0.55) 0%, transparent 100%);

    pointer-events: none;

    z-index: 0;

  }



  .wrapper {

    width: 100%;

    max-width: 460px;

    position: relative;

    z-index: 1;

    margin: 5%;

    padding-top: 10px;

    padding-bottom: 10px;

    height: 100vh;

    height: -webkit-fill-available;

    display: flex;

    flex-direction: column;

  }



  /* 카드 — 포스터의 달걀형 프레임 느낌 */

  .card {

    background: #fdfff8;

    border-radius: 28px;

    overflow: hidden;

    overflow-y: auto;

    box-shadow:

      0 2px 0 #c8e0a0,

      0 6px 0 #b0ce88,

      0 12px 40px rgba(80,120,40,0.18);

    border: 2px solid #c0da98;

    flex: 1;

    display: flex;

    flex-direction: column;

    max-height: calc(100vh - 32px);

  }

  .flash-overlay {

    position: absolute;

    inset: 0;

    background: #fff;

    opacity: 0;

    pointer-events: none;

    transition: opacity 0.25s ease;

    z-index: 100;

    border-radius: 28px;

  }

  .flash-overlay.active { opacity: 1; }



  /* 카드 푸터 */

  .card-footer {

    flex-shrink: 0;

    display: flex;

    flex-direction: column;

    align-items: center;

    border-top: 1px solid #ddeec8;

  }

  .card-footer .progress-bar-wrap {

    width: 100%;

    height: 6px;

    background: #dcefc8;

  }

  .footer-logo {

    height: 28px;

    opacity: 0.7;

    margin: 10px 0;

  }



  /* 이미지 */

  .img-wrap {

    width: 100%;

    height: 30vw;

    min-height: 140px;

    max-height: 300px;

    flex-shrink: 0;

    overflow: hidden;

    position: relative;

    background: #c8e8a8;

  }

  .img-wrap img {

    width: 100%; height: 100%;

    object-fit: cover;

    display: block;

  }

  .img-overlay {

    position: absolute; inset: 0;

    background: linear-gradient(to bottom, rgba(200,240,160,0.08) 0%, rgba(80,130,40,0.2) 100%);

  }



  /* 진행 바 */

  .progress-bar-wrap {

    height: 6px;

    background: #dcefc8;

  }

  .progress-bar {

    height: 100%;

    background: linear-gradient(90deg, #68a840, #98cc58);

    transition: width 0.45s ease;

    border-radius: 0 3px 3px 0;

  }



  /* 카드 바디 */

  .card-body {

    padding: 16px 16px 20px;

    flex: 1;

    overflow-y: auto;

    -webkit-overflow-scrolling: touch;

    animation: fadeUp 0.4s ease;

    display: flex;

    flex-direction: column;

  }

  .card-body .next-btn,
  .score-wrap .next-btn {

    margin-top: auto;

  }



  /* 페이지 타이틀 */

  .page-title {

    font-size: clamp(15px, 4.2vw, 18px);

    font-weight: bold;

    color: rgb(1, 86, 228);

    text-align: center;

    margin-bottom: 12px;

    word-break: keep-all;

  }



  /* 아이템 태그 뱃지 */

  .item {

    display: inline-block;

    background: #78bc50;

    color: #fff;

    font-weight: bold;

    padding: 2px 10px;

    border-radius: 20px;

    margin: 2px 3px;

    white-space: nowrap;

  }



  /* 설명 텍스트 */

  .desc {

    font-size: clamp(13px, 3.8vw, 15px);

    line-height: 2.0;

    color: #384830;

    text-align: center;

    margin-bottom: 18px;

    padding: 8px 10px;

    background: rgba(200,240,160,0.22);

    border-radius: 16px;

    border: 1.5px dashed #a8d080;

    word-break: keep-all;

    overflow-wrap: break-word;

  }



  /* 질문박스 */

  .q-box {

    background: linear-gradient(160deg, #edfae0 0%, #d8f2c0 100%);

    border: 2px solid #90c860;

    border-radius: 16px;

    padding: 5px 10px;

    margin-bottom: 16px;

    font-size: clamp(13.5px, 3.8vw, 15px);

    font-weight: bold;

    color: #306020;

    line-height: 2.0;

    text-align: center;

    word-break: keep-all;

    overflow-wrap: break-word;

  }



  /* OX 버튼 */

  .ox-wrap { display: flex; gap: 12px; margin-bottom: 14px; }

  .ox-btn {

    flex: 1; padding: 20px 8px;

    border-radius: 16px; border: 3px solid transparent;

    font-size: 34px; font-weight: 900;

    cursor: pointer; transition: transform 0.2s;

    font-family: inherit;

  }

  .ox-btn:hover:not(:disabled) { transform: scale(1.06); }

  .ox-o { background: #e4f8d8; border-color: #70c048; color: #286018; }

  .ox-x { background: #fdeee0; border-color: #e88858; color: #883018; }

  .ox-correct { background: #b8e898; border-color: #50a030; color: #1e5010; }

  .ox-wrong   { background: #f8c0a0; border-color: #c06030; color: #702010; }

  .ox-dim     { background: #f0f0e8; border-color: #ccc; color: #aaa; }



  /* 객관식 */

  .opts { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }

  .opt {

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

    padding: 12px 16px; border-radius: 14px;

    border: 2px solid #bcd898; background: #f5faf0;

    font-size: clamp(13px, 3.6vw, 14.5px); color: #384830; cursor: pointer;

    transition: transform 0.15s, background 0.15s, border-color 0.15s;

    font-family: inherit; text-align: left;

  }

  /* 마우스 환경에서만 hover 적용 (모바일 터치 후 hover 잔류 방지) */

  @media (hover: hover) and (pointer: fine) {

    .opt:hover:not(:disabled) {

      transform: translateX(6px);

      background: #e4f5d0;

      border-color: #78bc50;

    }

  }

  .opt:focus { outline: none; box-shadow: none; background: #f5faf0; }

  .opt:focus-visible { outline: none; }

  .opt:active:not(:disabled) { transform: scale(0.98); }

  .opt .num { font-size: 13px; opacity: 0.45; }

  .opt-correct { background: #b8e898 !important; border-color: #50a030 !important; color: #1a4e10; font-weight: bold; }

  .opt-wrong   { background: #f8c0a0 !important; border-color: #c06030 !important; color: #702010; }

  .opt-dim     { background: #f0f0e8 !important; border-color: #ddd !important; color: #bbb; }



  /* 피드백 */

  .feedback {

    padding: 12px 14px; border-radius: 13px;

    font-weight: bold; text-align: center;

    font-size: 14.5px; margin-bottom: 14px;

    animation: popIn 0.25s ease;

  }

  .fb-ok  { background: #d4f0b0; color: #1e6010; border: 2px solid #80c050; }

  .fb-bad { background: #fde8d0; color: #803020; border: 2px solid #e89060; }



  /* 버튼 */

  .next-btn {

    width: 100%; padding: 13px 16px;

    touch-action: manipulation;

    -webkit-tap-highlight-color: transparent;

    background: linear-gradient(135deg, #58a038 0%, #80c055 100%);

    color: #fff; border: none; border-radius: 50px;

    font-size: clamp(14px, 3.8vw, 15px); font-family: 'Gowun Dodum', sans-serif;

    font-weight: bold; cursor: pointer; letter-spacing: 0.5px;

    transition: transform 0.15s, box-shadow 0.15s;

    box-shadow: 0 4px 0 #387828, 0 6px 18px rgba(60,120,30,0.25);

  }

  .next-btn:hover {

    transform: translateY(-2px);

    box-shadow: 0 6px 0 #387828, 0 10px 22px rgba(60,120,30,0.3);

  }

  .next-btn:active {

    transform: translateY(2px);

    box-shadow: 0 2px 0 #387828;

  }



  /* 결과 */

  .result-emoji { font-size: 56px; text-align: center; margin-bottom: 10px; animation: bounce 0.65s; }

  .result-score {

    font-size: 27px; font-weight: 900;

    color: #2e6818; text-align: center; margin-bottom: 8px;

  }

  .result-msg {

    font-size: 15px; color: #3a5030;

    text-align: center; margin-bottom: 18px; line-height: 1.8;

    background: rgba(190,235,150,0.22);

    border-radius: 14px; padding: 10px 14px;

    border: 1.5px dashed #a0cc78;

  }

  .dots { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-bottom: 22px; }

  .dot {

    width: 29px; height: 29px; border-radius: 50%;

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

    font-size: 12px; font-weight: bold;

    border: 2px solid transparent;

  }

  .dot.hit  { background: #58a038; color: #fff; border-color: #387828; }

  .dot.miss { background: #e8e8d8; color: #aaa; border-color: #ccc; }



  /* 번호 표시 */

  .qnum {

    text-align: center; font-size: 16px;

    font-weight: bold;

    color: #609040; margin-bottom: 10px;

    letter-spacing: 1px;

  }



  /* 페이지 카운터 */

  .page-counter {

    text-align: center;

    padding: 7px 0 4px;

    font-size: 12.5px;

    color: #6a9040;

    letter-spacing: 1px;

    background: transparent;

    font-family: 'Gowun Dodum', sans-serif;

  }

  .page-counter span {

    font-weight: bold;

    color: #3a7020;

    font-size: 13.5px;

  }



  /* 점수 표시 */

  .score-wrap { text-align: center; padding: 0; flex: 1; display: flex; flex-direction: column; }

  .puzzle-grid {

    display: flex; flex-wrap: wrap; gap: 10px;

    justify-content: center; margin: 10px auto 18px;

    max-width: 260px;

  }

  .puzzle-piece {

    width: 64px; height: 64px; position: relative;

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

    font-size: 22px; font-weight: 900;

    filter: drop-shadow(0 3px 4px rgba(0,0,0,0.15));

  }

  .puzzle-piece svg { position: absolute; inset: 0; width: 100%; height: 100%; }

  .puzzle-piece span { position: relative; z-index: 1; }

  .score-title { font-size: 18px; font-weight: bold; color: #2e6018; margin-bottom: 10px; }

  .score-sub { font-size: 14px; color: #5a7040; line-height: 1.8; margin-bottom: 18px; }

  .score-dots { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }



  @keyframes fadeUp  { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:none} }

  @keyframes popIn   { from{transform:scale(0.88);opacity:0} to{transform:scale(1);opacity:1} }

  @keyframes bounce  { 0%,100%{transform:translateY(0)} 40%{transform:translateY(-16px)} 70%{transform:translateY(-6px)} }

