.stage-support{display:flex;align-items:center;gap:14px;margin-top:16px;padding:12px 16px;border-radius:18px;background:#e8f1ea;color:#3f7754}.stage-support img{width:72px;height:108px;object-fit:contain;object-position:center bottom}.stage-support p{margin:0;font-weight:800}.result-character{float:right;width:112px;height:160px;margin:-10px -4px 0 14px}.result-character img{width:100%;height:100%;object-fit:contain;object-position:center bottom}@media(max-width:650px){.stage-support{align-items:flex-start}.stage-support img{width:60px;height:90px}.result-character{width:88px;height:128px;margin-top:-4px}}@media(max-width:420px){.result-character{width:76px;height:110px}}
:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#24324a;background:#f5f0e7;line-height:1.45}*{box-sizing:border-box}body{margin:0;min-width:320px;background:radial-gradient(circle at 12% 0,#fff8dc 0 18%,transparent 42%),#f5f0e7}button,select{font:inherit}button{cursor:pointer}.screen{min-height:100svh;padding:18px 16px 72px}.main-canvas,.stage-canvas,.battle-canvas{width:min(100%,920px);margin:0 auto}.topbar,.panel-head,.mission-row,.settings-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.eyebrow{font-size:.7rem;font-weight:900;letter-spacing:.12em;text-transform:uppercase;color:#88714c}.icon-btn,.back-btn,.text-btn{border:0;background:transparent;color:#5d4d39;font-weight:800;padding:10px}.icon-btn{font-size:1.25rem}.hero-card{display:grid;grid-template-columns:minmax(150px,230px) 1fr;gap:24px;align-items:center;margin-top:24px;padding:24px;border-radius:28px;background:#fffdf7;border:1px solid #eadfc9;box-shadow:0 16px 38px #73552b14}.cover-art{width:100%;max-height:220px;object-fit:contain}.hero-copy h1{margin:3px 0 10px;font-size:clamp(2rem,6vw,3.5rem);line-height:1.03;color:#283e52}.intro,.panel-intro{color:#68758a;margin:0 0 14px}.progress{font-weight:800;color:#9a6b2f}.hero-actions,.battle-actions,.result-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}.primary-btn,.secondary-btn{border-radius:14px;padding:12px 16px;font-weight:900;border:1px solid #d7c9ae}.primary-btn{background:#d97b3f;color:#fff;border-color:#c76c31}.secondary-btn{background:#fff9eb;color:#675437}.guide{margin-top:20px;padding:20px;border-radius:22px;background:#e8f1ea}.guide h2{margin:0 0 14px}.guide-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.guide-grid article{background:#f8fff8;border-radius:15px;padding:14px}.guide-grid p{margin:5px 0 0;color:#68758a;font-size:.92rem}.settings-panel{margin-top:16px;background:#fffdf7;border:1px solid #eadfc9;border-radius:18px;padding:14px}.setting-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0}.setting-row select{border:1px solid #d9ccb5;border-radius:10px;padding:8px;background:#fff}.setting-sound{width:100%}.panel-head{padding-bottom:18px;border-bottom:1px solid #dfd3bd}.panel-head h2{margin:0;text-align:center;color:#283e52}.stage-list{display:grid;gap:12px;margin-top:20px}.stage-card{display:grid;grid-template-columns:auto 1fr auto;gap:6px 14px;align-items:center;text-align:left;padding:16px;border-radius:18px;border:1px solid #ddcfb5;background:#fffdf7;color:#283e52}.stage-card strong{font-size:1.08rem}.stage-card span:not(.stage-number){grid-column:2;color:#68758a}.stage-card b{grid-column:3;grid-row:1/3;color:#c76c31}.stage-card.complete{border-color:#77a77f;background:#f0faf0}.stage-card:disabled{opacity:.5;cursor:not-allowed}.stage-number{font-weight:900;color:#a66731}.stage-tabs{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;margin-top:20px;text-align:center;color:#88714c;font-weight:900}.stage-tabs span{height:1px;background:#dfd3bd}.stage-tabs button{border:0;background:transparent;color:inherit}.mission-row{margin-top:18px;align-items:flex-start}.mission-row .panel-intro{margin-top:4px}.progress-badge{padding:7px 10px;background:#e8f1ea;border-radius:999px;font-weight:900;color:#3f7754;white-space:nowrap}.target-card{margin-top:14px;padding:16px;border-radius:18px;background:#fff5d9;border:1px solid #ebd69c}.target-card>span{font-size:.75rem;text-transform:uppercase;font-weight:900;letter-spacing:.08em;color:#917044}.light-bars{display:flex;gap:9px;align-items:center;margin-top:10px}.light-bar{display:inline-flex;flex-direction:column-reverse;justify-content:flex-start;gap:3px;width:28px;height:52px;padding:4px;border:2px solid #b79c72;border-radius:10px;background:#f8edcc}.light-bar i{display:block;height:11px;border-radius:3px;background:#d9c9a1}.light-bar.level-1 i:first-child{background:#efb75a}.light-bar.level-2 i{background:#e77b3f}.shutter-board{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:18px}.shutter-card{display:flex;flex-direction:column;align-items:center;gap:5px;padding:16px 10px;border:2px solid #d9ccb5;border-radius:20px;background:#fffdf7;color:#283e52}.shutter-card:hover,.shutter-card:focus-visible{border-color:#d97b3f;transform:translateY(-2px)}.shutter-card small{color:#88714c;font-weight:800}.shutter-card .light-bar{width:44px;height:82px}.shutter-card .light-bar i{height:17px}.move-hint{color:#68758a;font-size:.9rem}.feedback{min-height:28px;margin:12px 0 0;font-weight:800;color:#b76435}.result-panel{margin-top:22px;padding:24px;border-radius:24px;background:#fffdf7;border:1px solid #eadfc9}.result-panel h2{margin:5px 0 8px;color:#283e52}.result-panel p{color:#68758a}.result-stats{padding:12px;border-radius:12px;background:#e8f1ea;color:#3f7754;font-weight:900}.toast{position:fixed;left:50%;bottom:22px;transform:translate(-50%,16px);opacity:0;pointer-events:none;background:#283e52;color:#fff;padding:10px 14px;border-radius:999px;transition:.2s}.toast.visible{opacity:1;transform:translate(-50%,0)}.game-ad-reserve{height:56px}@media(max-width:650px){.hero-card{grid-template-columns:1fr;text-align:center}.cover-art{max-height:160px}.hero-actions{justify-content:center}.guide-grid{grid-template-columns:1fr}.hero-copy .progress{text-align:center}.shutter-board{gap:7px}.shutter-card{padding:12px 6px}}@media(max-width:420px){.screen{padding-inline:12px}.hero-card,.result-panel{padding:18px}.shutter-card strong{font-size:.82rem}.light-bar{width:24px;height:46px}.shutter-card .light-bar{width:38px;height:72px}}
/* Interface 6 shell contract: standard Main, Stage, Battle, and General reserve. */
#mainScreen{width:min(100%,920px);margin:0 auto;padding:env(safe-area-inset-top) 18px calc(18px + env(safe-area-inset-bottom));}
#mainScreen .main-canvas{width:100%;margin:0;}
#mainScreen .main-header,#stageScreen .panel-head,#battleScreen .panel-head{display:grid;grid-template-columns:58px minmax(0,1fr) 48px;align-items:center;min-height:58px;gap:8px;}
#mainScreen .main-header .wp-shell-return{width:58px;height:48px;min-height:48px;padding:0;justify-content:center;gap:4px;overflow:hidden;}
#mainScreen .main-header .wp-shell-return img{display:block;width:28px;height:28px;object-fit:contain;}
#mainScreen .wp-shell-main-title,#stageScreen .panel-head h2,#battleScreen .panel-head h2{min-width:0;margin:0;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#mainScreen .topbar-actions{display:flex;justify-content:flex-end;}
.utility-button{width:48px;height:48px;min-height:48px;padding:0;border:1px solid #d7c9ae;border-radius:14px;background:#fff9eb;color:#675437;font-weight:900;}
#mainScreen .main-content{display:flex;flex-direction:column;align-items:stretch;width:min(100%,700px);margin:0 auto;padding:8px 0 12px;}
#mainScreen .main-cover{display:block;width:100%;max-width:420px;max-height:none;height:auto;aspect-ratio:1;margin:0 auto 10px;object-fit:contain;}
#mainScreen .main-copy{text-align:center;}
#mainScreen .main-copy .eyebrow{margin:0 0 5px;}
#mainScreen .main-copy h1{margin:0;}
#mainScreen .main-copy .lede{margin:8px auto 0;color:#e9eef5;}
#mainScreen .main-summary{margin:8px auto 0;min-height:40px;max-width:54ch;color:#e9eef5!important;font-size:.92rem;line-height:1.35;}
#mainScreen .main-progress{display:grid;place-items:center;min-height:42px;margin:4px 0;color:#9a6b2f;font-weight:800;}
#mainScreen .hero-actions{justify-content:center;}
#mainScreen #startBtn{height:52px;min-height:52px;}
#gameGuide.game-page-info{display:block;width:min(calc(100% - 36px),860px);margin:0 auto 18px;padding:16px 18px;border:1px solid #eadfc9;border-radius:18px;background:#e8f1ea;box-shadow:0 8px 20px #73552b14;}
#gameGuide.game-page-info h2{margin:0 0 10px;text-align:center;}
#gameGuide.game-page-info .guide-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
#gameGuide.game-page-info .guide-grid article{padding:12px;border:1px solid #c8ddca;border-radius:14px;background:#f8fff8;}
#gameGuide.game-page-info .guide-grid p{margin:5px 0 0;}
#mainScreen{position:relative;}
#mainScreen .settings-panel{position:absolute;top:66px;right:18px;z-index:20;width:min(280px,calc(100% - 36px));max-height:calc(100dvh - 78px);margin:0;padding:14px;overflow:auto;}
#stageScreen,#battleScreen{position:fixed;inset:0 0 56px;width:min(100vw,920px);height:calc(100dvh - 56px);min-height:0;margin:0 auto;padding:env(safe-area-inset-top) 18px 14px;overflow:auto;z-index:10;background:#f5f0e7;}
#stageScreen .stage-canvas,#battleScreen .battle-canvas{width:100%;min-height:calc(100% - 58px);margin:0 auto;}
#stageScreen .panel-head,#battleScreen .panel-head{padding:0 0 10px;border-bottom:1px solid #dfd3bd;}
#stageScreen .panel-head .back-btn,#battleScreen .panel-head .back-btn{width:58px;min-height:48px;padding:0;}
#stageScreen .stage-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;width:100%;margin-top:18px;}
#stageScreen .stage-list{max-height:calc(100dvh - 190px);overflow-y:auto;padding:2px 2px 8px;}
#stageScreen .stage-card{min-width:0;min-height:96px;}
#stageScreen .stage-tabs{margin-top:18px;}
#stageScreen .stage-tabs button{min-height:44px;padding:10px 16px;}
#battleScreen{background:linear-gradient(180deg,#f5f0e7ee,#f5f0e7f2),url('assets/animal-dawn-shutters-cover-v2.png');background-size:cover;background-position:center;}
#battleScreen .battle-canvas{color:#24324a;}
#battleScreen .battle-canvas>header{position:relative;z-index:2;}
#battleScreen #battlePanel,#battleScreen #resultPanel{width:min(100%,700px);margin:0 auto;}
#battleScreen #battlePanel{padding:12px 14px 14px;border:1px solid #eadfc9;border-radius:24px;background:#fffdf7;box-shadow:0 16px 38px #73552b14;}
#battleScreen #battlePanel>.feedback{min-height:64px;}
#battleScreen .battleSoundBtn{width:48px;height:48px;}
#battleScreen .shutter-board{margin-top:16px;}
#battleScreen .battle-actions{justify-content:flex-end;}
#battleScreen .result-panel{margin-top:18px;padding:24px;border-radius:24px;background:#fffdf7;border:1px solid #eadfc9;}
.stage-ad-reserve,.battle-ad-reserve{position:fixed;left:50%;bottom:0;transform:translateX(-50%);width:min(100vw,920px);height:56px;background:#24324af2;border-top:1px solid #dfd3bd;pointer-events:none;z-index:9;}
.stage-ad-reserve[hidden],.battle-ad-reserve[hidden]{display:none!important;}
@media(max-width:699px){
  #mainScreen .main-cover{width:100%;max-width:none;}
  #stageScreen,#battleScreen{padding-inline:14px;}
  #stageScreen .stage-list{grid-template-columns:1fr;}
  #gameGuide.game-page-info{width:calc(100% - 28px);}
  #gameGuide.game-page-info .guide-grid{grid-template-columns:1fr;gap:6px;}
}
@media(min-width:700px){
  #mainScreen .main-cover{width:420px;}
}
@media(orientation:landscape) and (max-height:560px){
  #mainScreen .main-cover{width:420px;max-width:420px;}
  #stageScreen .stage-list{grid-template-columns:repeat(3,minmax(0,1fr));}
  #stageScreen .stage-support{display:none;}
  #stageScreen .panel-intro{margin-bottom:4px;}
  #stageScreen .stage-list{height:138px;max-height:138px;margin-top:8px;overflow-y:auto;}
  #stageScreen .stage-card{height:138px;min-height:138px;}
  #stageScreen .stage-tabs{margin-top:4px;}
  #battleScreen{overflow:hidden;}
  #battleScreen .battle-canvas{display:flex;flex-direction:column;height:calc(100% - 14px);min-height:0;}
  #battleScreen .battle-canvas>.panel-head{flex:0 0 58px;}
  #battleScreen #battlePanel{display:grid;flex:1 1 auto;min-height:0;width:100%;padding:8px 10px;grid-template-columns:minmax(0,1fr) minmax(190px,240px);grid-template-rows:34px 64px minmax(48px,1fr) 15px 49px;align-items:center;column-gap:14px;row-gap:2px;overflow:hidden;}
  #battleScreen #battlePanel>.mission-row{grid-column:1/-1;}
  #battleScreen #battlePanel>.target-card{grid-column:2;grid-row:2;}
  #battleScreen #battlePanel>.shutter-board{grid-column:1;grid-row:2/6;height:100%;align-items:center;}
  #battleScreen #battlePanel>.feedback{grid-column:2;grid-row:3;}
  #battleScreen #battlePanel>.move-hint{grid-column:2;grid-row:4;}
  #battleScreen #battlePanel>.battle-actions{grid-column:2;grid-row:5;margin-top:0;}
  #battleScreen #battlePanel>.mission-row{margin-top:0;min-height:0;}
  #battleScreen #battlePanel>.target-card{margin-top:0;padding:6px 10px;}
#battleScreen #battlePanel>.feedback{min-height:0;margin:0;font-size:.72rem;line-height:1.1;}
  #battleScreen #battlePanel>.move-hint{margin:0;font-size:.72rem;line-height:1.1;}
  #battleScreen #battlePanel>.shutter-board{margin-top:0;}
  #battleScreen .shutter-card{padding:8px 6px;gap:3px;}
  #battleScreen .shutter-card .light-bar{width:36px;height:60px;}
  #battleScreen .shutter-card .light-bar i{height:12px;}
  #battleScreen .target-card .light-bars{gap:6px;margin-top:4px;}
  #battleScreen .target-card .light-bar{width:22px;height:38px;padding:3px;gap:2px;}
#battleScreen .target-card .light-bar i{height:8px;}
}
html:has(body[data-screen="stage"]),html:has(body[data-screen="battle"]),body[data-screen="stage"],body[data-screen="battle"]{width:100%;height:100%;min-height:0;overflow:hidden;overscroll-behavior:none;}
#gameGuide[hidden]{display:none!important;}

/* v3/I6 repair: the 30-room map is a horizontal, touch-browsable snap rail;
   localized Settings text stays inside its control instead of overflowing the
   RTL Main header. */
#mainScreen .topbar-actions{min-width:0;}
#mainScreen .topbar-actions .utility-button{width:auto!important;min-width:48px;max-width:100%;padding-inline:10px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#mainScreen .topbar-actions .utility-button>span[data-copy="settings"]{display:none!important;}
#stageScreen .stage-list{display:flex;flex-direction:row;align-items:center;gap:12px;width:100%;height:200px;min-height:198px;max-height:200px;margin-top:18px;padding-inline:max(24px,calc((100% - 264px) / 2));overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none;overscroll-behavior-x:contain;touch-action:pan-x!important;user-select:none;-webkit-user-select:none;}
#stageScreen .stage-list.stage-dragging{cursor:grabbing;}
#stageScreen .stage-list::-webkit-scrollbar{display:none;}
#stageScreen .stage-card{box-sizing:border-box;flex:0 0 264px;width:264px;min-width:264px;max-width:264px;height:190px;min-height:190px;max-height:190px;scroll-snap-align:center;}
@media(orientation:landscape) and (max-height:560px){
  #stageScreen .stage-list{height:138px;min-height:138px;max-height:138px;margin-top:8px;}
  #stageScreen .stage-card{height:138px;min-height:138px;max-height:138px;}
}
