/* mirror.css - Mirror Twin look: risograph paper, ink navy, vermilion and teal. */
.mt{--paper:#efe5cf;--paper2:#e4d8bd;--ink:#1d2540;--red:#e2432a;--teal:#0f7f8e;
  color:var(--ink);background:var(--paper);border:3px solid var(--ink);border-radius:6px;box-shadow:4px 4px 0 var(--red);
  padding:.5rem;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-user-select:none;user-select:none;
  padding-left:max(.5rem,env(safe-area-inset-left));padding-right:max(.5rem,env(safe-area-inset-right));padding-bottom:max(.5rem,env(safe-area-inset-bottom))}
.mt [hidden]{display:none!important}
.mt-hud{display:grid;grid-template-columns:1fr auto 1fr;gap:.5rem;align-items:center;padding:.25rem .25rem .5rem}
.mt-lv b{display:block;font-size:1rem}.mt-lv span{font-size:.75rem;opacity:.75}
.mt-moves{text-align:center;border:2px solid var(--ink);border-radius:6px;padding:.1rem .6rem;background:var(--paper2);min-width:76px}
.mt-moves b{display:block;font-size:1.6rem;line-height:1.1}.mt-moves span{font-size:.65rem;text-transform:uppercase;letter-spacing:.04em}
.mt-moves.low{background:var(--red);color:#fff;animation:mtpulse .8s ease-in-out infinite}
.mt-axis{display:flex;gap:.4rem;align-items:center;justify-content:flex-end;font-size:.7rem;line-height:1.25}
.mt-axis canvas{width:28px;height:28px;flex:none}.mt-axis b{display:block;font-size:.72rem}.mt-axis span{opacity:.8}
.mt-stage{position:relative;min-height:440px;display:flex;align-items:center;justify-content:center;background:var(--paper2);border-radius:4px;overflow:hidden}
.mt-board{display:block;touch-action:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;max-width:100%;cursor:grab}
.mt-coach{position:absolute;left:.5rem;right:.5rem;bottom:.5rem;background:var(--ink);color:var(--paper);font-size:.82rem;line-height:1.35;padding:.5rem .65rem;border-radius:4px;pointer-events:none}
.mt-screen{position:absolute;inset:0;background:var(--paper);display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:.55rem;padding:1rem;text-align:center;overflow:auto;-webkit-overflow-scrolling:touch}
.mt-screen h2{font-size:1.7rem;letter-spacing:.01em}
.mt-result{background:rgba(239,229,207,.94)}
.mt-result.lost h2{color:var(--red)}
.mt-tag,.mt-note{font-size:.9rem;opacity:.85;line-height:1.35}
.mt-note{font-size:.8rem}
.mt-btn{min-height:46px;min-width:46px;padding:.4rem .7rem;border:2.5px solid var(--ink);border-radius:6px;background:var(--paper);color:var(--ink);font:600 .9rem system-ui,sans-serif;cursor:pointer;box-shadow:2px 2px 0 var(--teal);touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.mt-btn:active{transform:translate(2px,2px);box-shadow:none}
.mt-btn:disabled{opacity:.4;cursor:default;box-shadow:none}
.mt-btn.main{background:var(--red);color:#fff;font-size:1.05rem;box-shadow:3px 3px 0 var(--ink)}
.mt-btn.done{background:var(--paper2)}
.mt-btn:focus-visible,.mt-link:focus-visible,.mt-lvbtn:focus-visible{outline:3px solid var(--teal);outline-offset:2px}
.mt-link{min-height:44px;background:none;border:0;color:var(--ink);text-decoration:underline;font:600 .85rem system-ui,sans-serif;cursor:pointer}
.mt-row{display:grid;grid-template-columns:1fr 1fr;gap:.5rem}
.mt-bar{display:grid;grid-template-columns:repeat(5,1fr);gap:.4rem;padding-top:.5rem}
.mt-bar .mt-btn{padding:.3rem .2rem;font-size:.78rem}
.mt-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:.4rem;font-size:.7rem}
.mt-stats b{display:block;font-size:1.1rem}
.mt-logo{display:flex;align-items:center;justify-content:center;gap:.7rem;height:64px}
.mt-logo i{display:block;width:40px;height:40px;border:3px solid var(--ink);background:var(--red);box-shadow:3px 3px 0 var(--teal)}
.mt-logo i.a{border-radius:50%}.mt-logo i.b{border-radius:8px;background:var(--teal);box-shadow:3px 3px 0 var(--red)}
.mt-logo s{display:block;width:0;height:56px;border-left:3px dashed var(--ink);text-decoration:none}
.mt-lvgrid{display:grid;grid-template-columns:repeat(5,1fr);gap:.4rem}
.mt-lvbtn{min-height:56px;border:2.5px solid var(--ink);border-radius:6px;background:var(--paper);color:var(--ink);font:inherit;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;touch-action:manipulation}
.mt-lvbtn:disabled{opacity:.35;cursor:default}.mt-lvbtn b{font-size:1rem}
.mt-stars{display:inline-flex;gap:3px;justify-content:center}
.mt-stars i{display:block;width:14px;height:14px;background:rgba(29,37,64,.2);clip-path:polygon(50% 0,62% 36%,100% 38%,70% 60%,80% 100%,50% 76%,20% 100%,30% 60%,0 38%,38% 36%)}
.mt-stars i.on{background:var(--red)}
#resStars .mt-stars i{width:34px;height:34px}
@keyframes mtpulse{50%{transform:scale(1.06)}}
@media (prefers-reduced-motion:reduce){.mt-moves.low{animation:none}.mt-btn:active{transform:none}}

/* depth: soft light on the stage, lifted board */
.mt-stage{background:radial-gradient(ellipse at 50% 42%,#efe5cf 0,var(--paper2) 78%)}
.mt-board{filter:drop-shadow(0 3px 0 rgba(29,37,64,.18))}

/* full screen: playfield fills the stage under the dock */
html.pip-immersive .game-wrap.pip-stage,html.pip-native .game-wrap.pip-stage,.game-wrap.pip-stage:fullscreen{display:flex;flex-direction:column;padding:0}
html.pip-immersive .pip-actions,html.pip-native .pip-actions,html.pip-immersive .game-wrap .ad-well,html.pip-native .game-wrap .ad-well{display:none}
html.pip-immersive .mt,html.pip-native .mt{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;border-width:0;border-radius:0;box-shadow:none;
  padding-top:max(.4rem,env(safe-area-inset-top));padding-bottom:max(.4rem,env(safe-area-inset-bottom))}
html.pip-immersive .mt-stage,html.pip-native .mt-stage{flex:1 1 auto;min-height:0}
html.pip-immersive .mt-screen,html.pip-native .mt-screen{padding:.6rem;gap:.4rem}
html.pip-immersive .mt-bar .mt-btn,html.pip-native .mt-bar .mt-btn{min-height:48px}
@media (orientation:landscape) and (max-height:520px){
  html.pip-immersive .mt:not(:has(.mt-hud[hidden])),html.pip-native .mt:not(:has(.mt-hud[hidden])){display:grid;grid-template-columns:minmax(0,1fr) 190px;grid-template-rows:auto 1fr;gap:.4rem}
  html.pip-immersive .mt-stage,html.pip-native .mt-stage{grid-column:1;grid-row:1/3}
  html.pip-immersive .mt-hud,html.pip-native .mt-hud{grid-column:2;grid-row:1;grid-template-columns:1fr;padding:0}
  html.pip-immersive .mt-bar,html.pip-native .mt-bar{grid-column:2;grid-row:2;grid-template-columns:1fr 1fr;align-content:end;padding-top:0}
  html.pip-immersive .mt-screen,html.pip-native .mt-screen{padding:.4rem;gap:.3rem}
  html.pip-immersive .mt-logo,html.pip-native .mt-logo{display:none}
}
