
:root{
  --ink:#18365a;
  --blue:#347cf4;
  --sky:#7cdbff;
  --yellow:#ffd64a;
  --red:#ff6375;
  --green:#49d883;
  --panel:#fff;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#d8f3ff;font-family:"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:var(--ink)}
button{font:inherit}
#app{width:100%;height:100%;display:grid;place-items:center}
.game-shell{
  width:min(100vw,540px);height:100dvh;max-height:980px;position:relative;overflow:hidden;background:#84ddff;
  box-shadow:0 26px 80px rgba(31,80,125,.18);
}
canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none}
.hidden{display:none!important}

.hud{
  position:absolute;z-index:15;left:0;right:0;top:0;
  padding:max(10px,env(safe-area-inset-top)) 12px 0;
  display:grid;grid-template-columns:auto auto 1fr auto;gap:8px;align-items:center;
}
.hud-chip,.icon-btn{
  height:42px;border:none;border-radius:16px;background:rgba(255,255,255,.94);
  box-shadow:0 5px 0 rgba(30,76,116,.10),0 8px 22px rgba(30,76,116,.10);
}
.hud-chip{display:flex;align-items:center;gap:5px;padding:0 11px;font-weight:1000;font-size:15px}
.hud-chip span{font-size:17px}
.icon-btn{width:42px;color:#2d567f;font-weight:1000;font-size:18px}
.progress-wrap{display:flex;align-items:center;gap:6px;background:rgba(255,255,255,.88);height:42px;border-radius:16px;padding:0 10px}
.progress-track{height:10px;flex:1;background:#dfeaf4;border-radius:999px;overflow:hidden}
.progress-track i{display:block;width:0;height:100%;background:linear-gradient(90deg,#55d887,#3eb8ff);border-radius:inherit;transition:width .2s}
.progress-wrap span{font-size:11px;font-weight:900;color:#56718f}

.question-card{
  position:absolute;z-index:13;left:50%;top:62px;transform:translateX(-50%);
  width:min(calc(100% - 26px),460px);min-height:94px;padding:11px 66px 10px 16px;
  background:rgba(255,255,255,.97);border:3px solid rgba(73,155,255,.18);
  border-radius:24px;box-shadow:0 8px 0 rgba(47,93,137,.10),0 15px 30px rgba(34,75,112,.14);text-align:center;
}
.q-type{font-size:12px;font-weight:900;color:#5e7ea1;letter-spacing:.4px}
.q-main{font-size:29px;line-height:1.1;font-weight:1000;margin:4px 0 2px;color:#173457}
.q-tip{font-size:12px;color:#8094a9;font-weight:700}
.sound-btn{
  position:absolute;right:16px;top:50%;transform:translateY(-50%);
  width:44px;height:44px;border:none;border-radius:15px;background:#e9f4ff;font-size:22px;box-shadow:inset 0 0 0 2px #d3e8ff
}
.lives{
  position:absolute;z-index:13;right:16px;top:164px;padding:6px 10px;border-radius:14px;background:rgba(255,255,255,.88);
  box-shadow:0 5px 16px rgba(30,76,116,.09);font-size:15px;letter-spacing:1px;
}
.feedback{
  position:absolute;z-index:18;left:50%;top:37%;transform:translate(-50%,-50%) scale(.8);
  opacity:0;pointer-events:none;padding:12px 20px;border-radius:999px;background:#fff;
  font-size:22px;font-weight:1000;box-shadow:0 10px 30px rgba(25,61,96,.22);transition:.18s;
}
.feedback.show{opacity:1;transform:translate(-50%,-50%) scale(1)}
.feedback.ok{color:#0a9a4c}.feedback.bad{color:#e24d58}

.touch-controls{
  position:absolute;z-index:14;left:0;right:0;bottom:calc(13px + env(safe-area-inset-bottom));
  display:flex;justify-content:space-between;padding:0 18px;pointer-events:none
}
.touch-controls button{
  pointer-events:auto;width:82px;height:68px;border:none;border-radius:24px;background:rgba(255,255,255,.92);
  box-shadow:0 7px 0 rgba(21,59,94,.14),0 12px 24px rgba(21,59,94,.10);color:#285a8b;font-weight:1000;
}
.touch-controls button:active{transform:translateY(3px);box-shadow:0 4px 0 rgba(21,59,94,.14)}
.touch-controls span{display:block;font-size:36px;line-height:31px}
.touch-controls small{font-size:11px}

.overlay{
  position:absolute;z-index:30;inset:0;display:flex;align-items:center;justify-content:center;padding:22px;
  background:linear-gradient(180deg,#79dcff 0%,#c7f0ff 56%,#f5fdff 100%);
}
.start-screen{justify-content:flex-start;flex-direction:column;padding-top:max(30px,calc(env(safe-area-inset-top) + 24px));}
.start-bg-bubbles i{position:absolute;border-radius:50%;background:rgba(255,255,255,.25)}
.start-bg-bubbles i:nth-child(1){width:140px;height:140px;left:-55px;top:12%}
.start-bg-bubbles i:nth-child(2){width:70px;height:70px;right:20px;top:12%}
.start-bg-bubbles i:nth-child(3){width:210px;height:210px;right:-110px;bottom:7%}
.start-bg-bubbles i:nth-child(4){width:52px;height:52px;left:30px;bottom:22%}
.start-bg-bubbles i:nth-child(5){width:25px;height:25px;right:25%;top:31%}

.brand-badge{
  position:relative;z-index:1;background:rgba(255,255,255,.78);color:#3576be;border-radius:999px;padding:7px 13px;
  font-size:12px;font-weight:900;box-shadow:0 5px 15px rgba(31,80,125,.08)
}
.logo{position:relative;z-index:1;text-align:center;margin-top:12px}
.logo-en{font-size:11px;font-weight:1000;letter-spacing:4px;color:#266bbf}
.logo h1{
  margin:3px 0 0;font-size:43px;line-height:1.06;color:#fff;letter-spacing:1px;
  text-shadow:0 4px 0 #347cf4,0 7px 15px rgba(38,108,191,.25);
  -webkit-text-stroke:2px #347cf4;
}
.logo p{margin:8px 0 0;font-size:15px;font-weight:900;color:#3271a7}

.hero-card{
  position:relative;z-index:1;width:min(100%,440px);margin-top:21px;padding:14px;border-radius:30px;background:rgba(255,255,255,.92);
  box-shadow:0 12px 0 rgba(37,102,151,.09),0 22px 46px rgba(38,91,134,.15)
}
.hero-scene{
  position:relative;height:220px;border-radius:23px;overflow:hidden;
  background:linear-gradient(#7edcff 0 52%,#70bd72 52% 62%,#626d79 62% 100%);
}
.hero-scene:before{
  content:"";position:absolute;left:50%;bottom:-5px;transform:translateX(-50%);
  width:120%;height:96px;clip-path:polygon(38% 0,62% 0,82% 100%,18% 100%);
  background:linear-gradient(90deg,#56616c 0 33%,#68737e 33% 66%,#56616c 66%);
}
.hero-scene:after{
  content:"🏫　🌳　　　🌳　🏫";position:absolute;left:0;right:0;top:45px;text-align:center;font-size:42px;letter-spacing:8px;opacity:.95
}
.hero-runner{position:absolute;z-index:2;left:50%;bottom:18px;transform:translateX(-50%);font-size:52px;filter:drop-shadow(0 7px 3px rgba(0,0,0,.14))}
.hero-stars{position:absolute;z-index:2;left:0;right:0;bottom:76px;text-align:center;font-size:20px}
.hero-gates{position:absolute;z-index:2;left:7%;right:7%;top:94px;display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.hero-gates b{padding:9px 3px;border-radius:12px;background:#fff;border:3px solid #c9e3ff;font:900 12px Arial;color:#1a3858;text-align:center;box-shadow:0 4px 0 rgba(0,0,0,.08)}
.rule-row{display:flex;justify-content:center;align-items:center;gap:8px;margin:13px 0 2px;font-size:13px;font-weight:900;color:#426586}
.rule-row i{font-style:normal;color:#8ca4ba}

.primary-btn,.secondary-btn{
  border:none;border-radius:20px;padding:14px 20px;font-weight:1000;font-size:18px
}
.start-screen>.primary-btn{
  position:relative;z-index:1;width:min(100%,410px);margin-top:22px;background:linear-gradient(180deg,#ffe35e,#ffc638);
  color:#694800;box-shadow:0 7px 0 #e4a722,0 13px 28px rgba(191,131,12,.18);font-size:22px
}
.primary-btn:active{transform:translateY(3px)}
.best-line{position:relative;z-index:1;margin-top:17px;color:#2f6596;font-size:13px;font-weight:800}
.tiny-tip{position:relative;z-index:1;font-size:11px;color:#6689a9;margin-top:10px}

.modal-card{
  width:min(100%,430px);padding:22px 18px;border-radius:30px;background:rgba(255,255,255,.97);text-align:center;
  box-shadow:0 18px 55px rgba(24,67,105,.18)
}
.modal-card.small{max-width:350px}
.modal-emoji{font-size:46px}
.modal-card h2{margin:4px 0;font-size:28px}.modal-card p{color:#728aa1;margin:4px 0 18px}
.modal-card .primary-btn{background:#347cf4;color:#fff;box-shadow:0 6px 0 #2262cd}
.modal-card .secondary-btn{background:#edf4fb;color:#3d6287}
.modal-card.small button{width:100%;margin-top:10px}

.result-ribbon{display:inline-block;background:#eaf4ff;color:#3975b6;border-radius:999px;padding:7px 13px;font-size:12px;font-weight:900}
.result-title{font-size:29px;font-weight:1000;margin:10px 0}
.score-orb{
  width:116px;height:116px;margin:5px auto 3px;border-radius:50%;display:grid;place-items:center;
  background:linear-gradient(145deg,#fff4a0,#ffd34f);box-shadow:inset 0 -10px 0 rgba(230,167,24,.18),0 10px 24px rgba(211,154,21,.18)
}
.score-orb span{font-size:42px;font-weight:1000;color:#7b5500;line-height:1}.score-orb small{font-size:12px;font-weight:900;color:#947211;margin-top:-28px}
.stars-grade{font-size:30px;margin:2px 0 12px}
.result-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:12px 0}
.result-grid>div{padding:10px 4px;border-radius:16px;background:#f3f8fd}
.result-grid b{display:block;font-size:22px}.result-grid span{font-size:11px;color:#7b91a8}
.review-box{margin-top:12px;text-align:left;background:#fff8e4;border-radius:18px;padding:12px}
.review-title{font-size:13px;font-weight:900;color:#7b651d;margin-bottom:8px}
.review-list{display:flex;gap:6px;flex-wrap:wrap}
.review-list span{background:#fff;border-radius:999px;padding:6px 9px;font-size:12px;font-weight:800;color:#4c6783}
.result-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:16px}
.result-actions .primary-btn,.result-actions .secondary-btn{font-size:15px;padding:12px}

@media (min-width:700px){
  .game-shell{height:min(94vh,960px);border-radius:30px}
}
