/* タブレット連打時の拡大防止・表示テキストの選択防止 */
*{
  box-sizing:border-box;
  user-select:none;
  -webkit-user-select:none;
  touch-action:manipulation;
}
html{margin:0;height:100%;}
body{
  margin:0;height:100vh;
  font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic","Meiryo",sans-serif;
  background:#f2f2f2;display:flex;justify-content:center;align-items:center;
}
.container{
  position:relative;margin:0 auto;width:100%;max-width:1196px;height:540px;
  display:flex;flex-direction:column;overflow:hidden;
  background:#fff8ef;border:2px solid #333;border-radius:28px;
}
.game-header{
  height:50px;flex:0 0 50px;padding:6px 14px;
  display:flex;align-items:center;justify-content:space-between;
  background:transparent;z-index:100;color:#2b3a67;font-weight:900;
}
.game-header[aria-hidden="true"]{visibility:hidden;}
.header-score,.header-actions{width:32%;display:flex;align-items:center;gap:8px;}
.header-actions{justify-content:flex-end;}
.header-title{flex:1;text-align:center;font-size:22px;white-space:nowrap;}
.header-button{
  min-height:36px;padding:6px 14px;border:0;border-radius:18px;
  color:#fff;font:800 16px inherit;cursor:pointer;
}
.quit-button{background:#e85d5d;}
.sound-button{background:#397fc5;min-width:92px;}
.game-main{position:relative;flex:1;overflow:hidden;display:grid;place-items:center;}
:root{
    --pink:#ff6fa5;
    --yellow:#ffd23f;
    --blue:#4dc6ff;
    --green:#63d471;
    --purple:#b98af0;
    --red:#ff5c5c;
    --navy:#2b3a67;
  }
  @keyframes floaty{
    0%,100%{transform:translateY(0px);}
    50%{transform:translateY(-22px);}
  }
  
  .screen{
    position:absolute;inset:0;
    display:none;flex-direction:column;
    align-items:center;justify-content:center;
    padding:24px;
  }
  .screen.active{display:flex;}

  /* ---------- TITLE ---------- */
  .title-sound-button{
    position:absolute;top:16px;right:18px;z-index:10;
  }
  .deco-shape{
    position:absolute;border-radius:50%;opacity:.55;
    animation:floaty 5s ease-in-out infinite;
  }
  .title-main{
    font-size:56px;font-weight:900;color:var(--navy);
    text-shadow:3px 3px 0 #fff, 6px 6px 0 rgba(255,111,165,.4);
    letter-spacing:4px;margin:0 0 8px 0;z-index:2;
  }
  .title-sub{
    font-size:22px;color:var(--navy);font-weight:700;
    background:rgba(255,255,255,.75);
    padding:8px 22px;border-radius:24px;
    margin-bottom:34px;z-index:2;
  }
  .title-art{
    display:flex;gap:18px;margin-bottom:30px;z-index:2;
  }
  .title-art .quiz-image{
    width:110px;height:82px;object-fit:cover;border-radius:16px;
    border:4px solid #fff;filter:drop-shadow(0 6px 8px rgba(0,0,0,.15));
  }

  /* ---------- BUTTONS ---------- */
  .btn{
    border:none;border-radius:44px;cursor:pointer;
    font-family:inherit;font-weight:800;color:#fff;
    font-size:28px;padding:18px 48px;
    min-height:68px;min-width:200px;
    box-shadow:0 8px 0 rgba(0,0,0,.18);
    transition:transform .08s;
    touch-action:manipulation;
    z-index:2;
  }
  .btn:active{transform:translateY(6px);box-shadow:0 2px 0 rgba(0,0,0,.18);}
  .btn-start{background:linear-gradient(180deg,#ff9f45,#ff6f45);}
  .btn-again{background:linear-gradient(180deg,#63d471,#2fae4e);}
  .btn-home{background:linear-gradient(180deg,#4dc6ff,#2f9fe0);}
  

  /* ---------- GAME SCREEN ---------- */
  #screen-game{justify-content:flex-start;padding-top:18px;}
  .question-box{
    text-align:center;font-size:26px;font-weight:800;color:var(--navy);
    background:rgba(255,255,255,.85);
    border-radius:22px;padding:10px 24px;
    margin:6px auto 12px auto;
    line-height:1.5;
    white-space:nowrap;
    box-shadow:0 4px 0 rgba(0,0,0,.08);
  }
  .answers-row{
    display:flex;gap:22px;width:100%;justify-content:center;flex:1;
    align-items:center;min-height:0;
  }
  .answer-box{
    width:auto;height:100%;max-width:44%;max-height:320px;
    aspect-ratio:1 / 1;flex:0 1 auto;background:#fff;
    border:6px dashed #cfd8e3;
    border-radius:26px;
    display:flex;align-items:center;justify-content:center;
    padding:8px;
    transition:border-color .15s, transform .15s, background .15s;
    cursor:pointer;min-height:0;overflow:hidden;
    box-shadow:0 5px 10px rgba(77,63,46,.12);
  }
  .answer-box .quiz-image{
    width:100%;height:100%;display:block;object-fit:contain;
    min-width:0;min-height:0;border-radius:18px;pointer-events:none;
  }
  .answer-box.correct-flash{
    border-color:var(--green);background:#eefff2;
  }
  .answer-box.wrong-flash{
    border-color:var(--red);background:#fff0f0;
  }
  .confetti-layer{
    position:absolute;inset:0;z-index:60;overflow:hidden;pointer-events:none;
  }
  .confetti-piece{
    --confetti-x:0px;--confetti-rotate:540deg;
    position:absolute;top:-18px;width:10px;height:16px;border-radius:2px;
    animation:confetti-fall 1.2s cubic-bezier(.18,.72,.35,1) forwards;
  }
  @keyframes confetti-fall{
    0%{transform:translate3d(0,-20px,0) rotate(0deg);opacity:1;}
    100%{transform:translate3d(var(--confetti-x),560px,0) rotate(var(--confetti-rotate));opacity:.15;}
  }

  .feedback-toast{
    position:absolute;top:70px;left:50%;transform:translate(-50%,-30px);
    padding:14px 34px;border-radius:30px;
    font-size:26px;font-weight:900;color:#fff;
    opacity:0;pointer-events:none;
    transition:opacity .25s, transform .25s;
    z-index:40;
    box-shadow:0 8px 16px rgba(0,0,0,.2);
  }
  .feedback-toast.show{opacity:1;transform:translate(-50%,0);}
  .feedback-toast.good{background:linear-gradient(180deg,#7be08a,#33b24a);}
  .feedback-toast.bad{background:linear-gradient(180deg,#ffab91,#ff6f45);}

  /* ---------- RESULT SCREEN ---------- */
  .result-title{font-size:40px;font-weight:900;color:var(--navy);margin-bottom:6px;text-align:center;}
  .result-score{font-size:30px;font-weight:800;color:var(--purple);margin-bottom:14px;}
  .result-stars{display:flex;gap:10px;margin-bottom:22px;}
  .result-stars svg{width:56px;height:56px;}
  .result-buttons{display:flex;gap:22px;}

  @media (max-width:700px){
    .title-main{font-size:38px;}
    .title-sub{font-size:16px;}
    .question-box{font-size:19px;}
    .btn{font-size:20px;padding:14px 30px;min-width:150px;}
    .answer-box{max-width:48%;border-width:4px;}
    .result-title{font-size:28px;}
  }
.question-progress{width:100%;display:flex;justify-content:center;gap:12px;margin-bottom:5px;}
.progress-dot{width:20px;height:20px;border:3px solid #b98af0;border-radius:50%;background:#fff;}
.progress-dot.done{background:#b98af0;}
.deco-one{width:70px;height:70px;background:var(--pink);top:30px;left:40px;}
.deco-two{width:50px;height:50px;background:var(--blue);top:60px;right:70px;}
.deco-three{width:40px;height:40px;background:var(--yellow);bottom:60px;left:90px;}
.deco-four{width:60px;height:60px;background:var(--green);bottom:40px;right:110px;}
.answer-box{font-family:inherit;}
@media(max-width:700px){
  .header-title{font-size:16px;}
  .header-button{font-size:14px;padding:5px 8px;}
  .sound-button{min-width:74px;}
  .screen{padding-left:10px;padding-right:10px;}
  .answers-row{gap:8px;}
}
/* ---------- 絵日記背景（罫線なし） ---------- */
.game-main,
#screen-title,
#screen-game,
#screen-result{
  background:
    radial-gradient(circle at 25px 23px, #d6d0c5 0 5px, #fffdf7 6px 9px, transparent 10px) 0 0 / 100% 46px,
    radial-gradient(circle at 8% 14%, rgba(255,158,190,.36) 0 34px, transparent 35px),
    radial-gradient(circle at 92% 17%, rgba(113,196,239,.34) 0 30px, transparent 31px),
    radial-gradient(circle at 88% 88%, rgba(116,214,142,.30) 0 36px, transparent 37px),
    radial-gradient(circle at 12% 86%, rgba(255,214,89,.32) 0 27px, transparent 28px),
    linear-gradient(145deg, #fffdf7 0%, #fff8eb 52%, #fffaf3 100%);
}
#screen-title{
  position:absolute;
  inset:0;
  width:auto;
  height:auto;
  overflow:hidden;
}
