:root{
  --mm-pink:#f45b8b;
  --mm-pink2:#ff8eb0;
  --mm-yellow:#ffd75e;
  --mm-cream:#fff8ec;
  --mm-ink:#5c3850;
  --mm-green:#69c66d;
  --mm-blue:#68c9ef;
}
*{box-sizing:border-box}
.marina-miau-app{width:100%;max-width:1100px;margin:20px auto;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--mm-ink);overflow:hidden;border-radius:28px;background:linear-gradient(#bfeeff,#fff7ea);box-shadow:0 16px 50px rgba(75,47,62,.16);position:relative}
.marina-miau-app button{font:inherit}
.mm-screen{min-height:680px;position:relative}
.mm-home{padding:34px 34px 24px;display:flex;flex-direction:column;justify-content:space-between;background:linear-gradient(#9fe2ff 0 50%,#b9e987 50% 100%);overflow:hidden}
.mm-brand{display:flex;align-items:center;gap:14px;position:relative;z-index:5}
.mm-paw{font-size:50px;filter:drop-shadow(0 5px 0 rgba(111,59,77,.12))}
.mm-title{font-weight:1000;font-size:clamp(44px,8vw,78px);line-height:.8;color:#fff;text-shadow:0 4px 0 #db4c79,0 7px 14px rgba(0,0,0,.12)}
.mm-title span{color:#ffd75e}
.mm-subtitle{font-weight:800;font-size:17px;margin-top:12px;color:#70455a}
.mm-home-scene{position:absolute;inset:0;pointer-events:none}
.mm-start-game-scene{background:linear-gradient(#6fcdf2 0 55%,#9edb68 55% 100%);overflow:hidden}
.mm-game-sky{position:absolute;inset:0;background:linear-gradient(#69c9f2 0%,#bceeff 60%,#b8e47a 60%,#72c65c 100%)}
.mm-start-game-scene .c1{top:150px;left:8%}.mm-start-game-scene .c2{top:210px;right:12%}
.mm-start-hill{position:absolute;border-radius:50% 50% 0 0;width:62%;height:270px;bottom:-165px;background:#7cc76d}
.mm-start-hill.h1{left:-10%}.mm-start-hill.h2{right:-18%;background:#68b960}
.mm-start-platform{position:absolute;background:#6fc957;border-radius:18px 18px 0 0;box-shadow:inset 0 10px 0 #a5e477;bottom:22%;height:80px}
.mm-start-platform.p1{left:0;width:38%}.mm-start-platform.p2{right:0;width:31%;bottom:17%}
.mm-start-water{position:absolute;left:38%;right:31%;bottom:0;height:25%;background:linear-gradient(#43c9ee,#2caed8)}
.mm-start-stars{position:absolute;left:45%;top:48%;font-size:clamp(26px,4vw,48px);z-index:2;filter:drop-shadow(0 4px 3px rgba(0,0,0,.16))}
.mm-start-fish{position:absolute;left:52%;bottom:5%;font-size:44px;z-index:2}
.mm-start-snail{position:absolute;right:16%;bottom:23%;font-size:42px;z-index:4}
.mm-start-house{position:absolute;right:7%;top:38%;font-size:70px;z-index:2}
.mm-start-game-scene .mm-home-cat{z-index:5;top:54%;width:min(300px,31vw);max-height:360px;transform:translate(-50%,-50%) rotate(-4deg)}
.mm-start-game-scene .f1,.mm-start-game-scene .f2,.mm-start-game-scene .f3{z-index:6;bottom:4%}
.mm-home-actions{position:relative;z-index:12}
.mm-home .mm-brand{z-index:12}

.mm-cloud{position:absolute;background:#fff;border-radius:999px;opacity:.75;width:170px;height:50px}
.mm-cloud:before,.mm-cloud:after{content:"";position:absolute;background:#fff;border-radius:50%}
.mm-cloud:before{width:65px;height:65px;left:28px;top:-25px}
.mm-cloud:after{width:80px;height:80px;right:22px;top:-35px}
.c1{top:105px;left:10%}.c2{top:185px;right:7%;transform:scale(.72)}
.mm-hill{position:absolute;border-radius:50% 50% 0 0;width:75%;height:330px;bottom:-190px}
.h1{left:-15%;background:#77c96d}.h2{right:-20%;bottom:-220px;background:#62b961}
.mm-home-cat{position:absolute;z-index:3;width:min(330px,38vw);max-height:450px;object-fit:contain;left:50%;top:50%;transform:translate(-50%,-45%);filter:drop-shadow(0 14px 12px rgba(63,87,46,.2))}
.mm-flower{position:absolute;font-size:48px;bottom:45px;z-index:4}.f1{left:9%}.f2{left:34%;bottom:28px}.f3{right:12%}
.mm-home-actions{display:flex;flex-direction:column;align-items:center;gap:12px;position:relative;z-index:7;margin-top:auto}
.mm-main-btn,.mm-small-btn{border:0;border-radius:999px;font-weight:1000;cursor:pointer;touch-action:manipulation}
.mm-main-btn{background:linear-gradient(#ff86aa,#ee4f80);color:#fff;padding:17px 62px;font-size:23px;box-shadow:0 7px 0 #c73d69,0 12px 22px rgba(199,61,105,.2)}
.mm-main-btn:active{transform:translateY(4px);box-shadow:0 3px 0 #c73d69}
.mm-small-btn{background:#fff;color:#70455a;padding:12px 24px;font-size:15px;box-shadow:0 4px 14px rgba(75,47,62,.13)}
.mm-small-btn.danger{color:#b73d59}
.mm-home-note{font-size:12px;text-align:center;font-weight:700;opacity:.72;position:relative;z-index:7;margin-top:12px}
.mm-loading{position:absolute;inset:0;z-index:20;background:#fff6ec;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;font-size:16px}
.mm-loading-cat{font-size:70px;animation:mm-bounce 1s infinite}
@keyframes mm-bounce{50%{transform:translateY(-10px)}}
.mm-topbar{display:flex;align-items:center;gap:14px;padding:22px;background:#fffaf4;border-bottom:1px solid #eedfce}
.mm-round-btn,.mm-hud-btn{border:0;background:#fff;border-radius:50%;width:48px;height:48px;font-size:24px;cursor:pointer;box-shadow:0 4px 12px rgba(75,47,62,.12);color:#70455a}
.mm-section-title{font-size:25px;font-weight:1000}.mm-section-sub{font-size:13px;opacity:.7}.mm-stars-total{margin-left:auto;font-weight:1000;background:#fff0a8;padding:10px 15px;border-radius:999px}
.mm-levels{background:#fffaf4}
.mm-level-grid{padding:26px;display:grid;grid-template-columns:repeat(5,1fr);gap:18px}
.mm-level-card{border:0;border-radius:22px;background:#fff;box-shadow:0 8px 20px rgba(75,47,62,.12);padding:14px;min-height:190px;cursor:pointer;text-align:left;position:relative;overflow:hidden;color:var(--mm-ink)}
.mm-level-card .level-art{height:112px;border-radius:16px;background:linear-gradient(#8bdcff,#b8ee8c);display:flex;align-items:center;justify-content:center;font-size:54px}
.mm-level-card h3{margin:10px 0 2px;font-size:17px}.mm-level-card p{margin:0;font-size:12px;opacity:.65}.mm-level-card.locked{filter:grayscale(.35);opacity:.65;cursor:not-allowed}.mm-lock{position:absolute;right:12px;top:12px;background:#fff;padding:6px;border-radius:50%}
.mm-game{background:#1d2931;padding:12px}
.mm-game-wrap{max-width:1100px;margin:auto}
.mm-hud{height:58px;display:flex;align-items:center;gap:10px;color:#fff;padding:0 4px}
.mm-level-name{font-weight:1000;font-size:18px}.mm-hud-stats{margin-left:auto;display:flex;gap:8px}.mm-hud-stats span{background:rgba(255,255,255,.13);padding:7px 11px;border-radius:999px;font-size:13px}.mm-hud-btn{width:42px;height:42px;background:rgba(255,255,255,.92)}
.mm-canvas-box{position:relative;background:#78d9f7;border-radius:22px;overflow:hidden;box-shadow:0 10px 35px rgba(0,0,0,.25)}
#mm-canvas{display:block;width:100%;height:auto;aspect-ratio:16/9;touch-action:none}
.mm-message{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(35,38,52,.38);z-index:5}
.mm-message>div{background:#fff;border-radius:24px;padding:24px;text-align:center;box-shadow:0 14px 30px rgba(0,0,0,.2)}
.mm-pause-panel{position:absolute;inset:0;background:rgba(20,25,30,.55);display:flex;align-items:center;justify-content:center;z-index:8}
.mm-panel-card{background:#fffaf4;border-radius:28px;padding:30px;min-width:min(340px,80%);text-align:center;box-shadow:0 18px 45px rgba(0,0,0,.25)}
.mm-panel-cat{font-size:60px}.mm-panel-card h2{margin:5px 0 18px}.mm-panel-card .mm-small-btn{margin-top:10px}
.mm-controls{display:flex;justify-content:space-between;align-items:center;padding:15px 4px 4px}
.mm-move-controls{display:flex;gap:12px}.mm-control-btn,.mm-jump-btn{width:72px;height:72px;border:0;border-radius:50%;background:rgba(255,255,255,.94);font-size:34px;color:#70455a;box-shadow:0 6px 16px rgba(0,0,0,.22);touch-action:none}
.mm-jump-btn{background:#ff6f9b;color:#fff;font-size:38px}
.mm-modal{position:absolute;inset:0;background:rgba(30,28,35,.48);display:flex;align-items:center;justify-content:center;z-index:30;padding:20px}
.mm-modal-card{background:#fffaf4;border-radius:26px;padding:30px;min-width:min(380px,94%);position:relative;text-align:center;box-shadow:0 20px 50px rgba(0,0,0,.25)}
.mm-close{position:absolute;right:14px;top:12px;border:0;background:#f4e8dd;width:40px;height:40px;border-radius:50%;font-size:25px;cursor:pointer}.mm-switch-row{display:flex;justify-content:space-between;align-items:center;background:#fff;padding:15px;border-radius:14px;margin:12px 0;font-weight:800}.mm-switch-row input{width:25px;height:25px}.mm-parent-note{font-size:12px;opacity:.7;line-height:1.5}
@media (max-width:800px){
 .mm-start-game-scene .mm-home-cat{width:245px;max-height:310px}
 .mm-start-stars{left:43%;top:49%;font-size:30px}
 .mm-start-house{font-size:54px;right:5%}
 .mm-start-snail{font-size:34px;right:12%}

 .mm-screen{min-height:600px}
 .mm-home{padding:24px 18px 18px}
 .mm-title{font-size:50px}
 .mm-paw{font-size:38px}
 .mm-home-cat{width:270px;max-height:330px;top:49%}
 .mm-level-grid{grid-template-columns:repeat(2,1fr);padding:16px;gap:12px}
 .mm-level-card{min-height:165px}
 .mm-level-card .level-art{height:90px}
 .mm-topbar{padding:15px}
 .mm-section-title{font-size:20px}
 .mm-section-sub{display:none}
 .mm-stars-total{padding:8px 11px}
}
@media (max-width:520px){
 .marina-miau-app{margin:0;border-radius:0;box-shadow:none}
 .mm-screen{min-height:100svh}
 .mm-game{padding:4px}
 .mm-hud{height:48px}
 .mm-hud-stats{gap:4px}.mm-hud-stats span{padding:6px 7px;font-size:11px}
 .mm-hud-btn{width:38px;height:38px}
 .mm-controls{padding:8px 3px 3px}
 .mm-control-btn,.mm-jump-btn{width:62px;height:62px;font-size:28px}
 .mm-jump-btn{font-size:32px}
 .mm-home-cat{width:235px;max-height:300px}
 .mm-title{font-size:43px}
 .mm-main-btn{padding:15px 52px}
}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important}}

/* Visibility safety: HTML hidden must always stay hidden. */
.marina-miau-app [hidden]{display:none !important}

html,body.marina-miau-standalone{margin:0!important;padding:0!important;background:#111820!important;min-height:100%!important}
body.marina-miau-standalone .marina-miau-app{margin:0 auto!important;max-width:1100px!important;min-height:100vh}

/* v1.0.5 — mobile orientation and fullscreen */
.marina-miau-app:fullscreen{
  width:100vw!important;
  max-width:none!important;
  height:100vh!important;
  min-height:100vh!important;
  margin:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  background:#111820!important;
}
.marina-miau-app:fullscreen .mm-screen{min-height:100vh}
.marina-miau-app:fullscreen .mm-game{padding:0}
.marina-miau-app:fullscreen .mm-game-wrap{max-width:none;width:100%;height:100%;display:flex;flex-direction:column}
.marina-miau-app:fullscreen .mm-canvas-box{flex:1;min-height:0;border-radius:0;display:flex;align-items:center;justify-content:center}
.marina-miau-app:fullscreen #mm-canvas{width:100%;height:100%;max-height:calc(100vh - 140px);object-fit:contain}
.marina-miau-app:fullscreen .mm-controls{padding:10px 18px 14px;background:rgba(17,24,32,.95)}
@media (orientation:landscape) and (max-width:900px){
  .marina-miau-app{margin:0!important;max-width:none!important;border-radius:0!important}
  .marina-miau-app .mm-game{padding:0}
  .marina-miau-app .mm-game-wrap{max-width:none;width:100%}
  .marina-miau-app .mm-canvas-box{border-radius:0}
  .marina-miau-app #mm-canvas{width:100%;height:auto;min-height:0}
}
@media (orientation:portrait) and (max-width:700px){
  .marina-miau-app .mm-game{padding:0}
  .marina-miau-app .mm-game-wrap{width:100%}
  .marina-miau-app .mm-canvas-box{width:100%;border-radius:0;display:flex;align-items:center;justify-content:center;background:#1d2931}
  .marina-miau-app #mm-canvas{width:100%;height:auto;aspect-ratio:16/9;max-width:none}
  .marina-miau-app .mm-controls{padding:10px 10px 14px}
  .marina-miau-app .mm-control-btn,.marina-miau-app .mm-jump-btn{width:70px;height:70px}
}


/* Marina Miau v1.0.8 - mobile viewport fit */
html, body {
  width: 100%;
  min-width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  overscroll-behavior: none;
  background: #000;
}
#marina-miau, .marina-miau-root {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-width: 100vw !important;
  min-height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}
#marina-miau canvas, .marina-miau-root canvas {
  display: block !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-width: 100vw !important;
  max-height: 100dvh !important;
  object-fit: contain !important;
  touch-action: none !important;
}
@supports not (height: 100dvh) {
  #marina-miau, .marina-miau-root { height: 100vh !important; min-height: 100vh !important; }
  #marina-miau canvas, .marina-miau-root canvas { height: 100vh !important; max-height: 100vh !important; }
}
