:root{--ink:#07263b;--aqua:#76f3dc;--pink:#fd5eaa;--cream:#fff7df}*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#061527;color:#fff8eb;font-family:'Trebuchet MS',Verdana,Arial,sans-serif}body{display:flex;align-items:flex-start;justify-content:center;padding:10px;overscroll-behavior:none}.arcade{width:min(1250px,100%);border:1px solid #247c91;border-radius:18px;overflow:hidden;background:#072039;box-shadow:0 18px 64px #0009;position:relative}.gamebar{display:flex;justify-content:space-between;align-items:center;height:53px;padding:5px 16px;background:linear-gradient(95deg,#082d49,#0a2440);border-bottom:1px solid #3c829585}.brand{display:flex;align-items:baseline;gap:5px;white-space:nowrap;font-size:18px;font-weight:1000;letter-spacing:1.3px;text-shadow:2px 2px #c73279}.brand b{color:#ff9dcd}.brand small{margin-left:5px;color:#88f5d9;font-size:10px;letter-spacing:2px;text-shadow:none}.hibiscus{color:#ff6eaf;font-size:25px;margin-right:4px}.rightbar{display:flex;align-items:center;gap:8px}.worldlabel{color:#ffe0aa;letter-spacing:1px;font-size:10px;font-weight:900;margin-right:8px}.iconbutton{height:33px;width:33px;border-radius:9px;border:1px solid #528caa;background:#103b5c;color:white;font-size:20px;line-height:1;cursor:pointer}.iconbutton:focus-visible,button:focus-visible{outline:3px solid white;outline-offset:2px}.gameframe{position:relative;aspect-ratio:16/9;background:#77d8f0;overflow:hidden;isolation:isolate}canvas{width:100%;height:100%;display:block;object-fit:contain;touch-action:none}.overlay{position:absolute;inset:0;z-index:5}.hidden{display:none!important}.splash{display:grid;grid-template-columns:47% 53%;background:#073b53}.heroart{background:url('assets/coral_cover.jpg') center center/cover no-repeat;position:relative}.heroart:after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,transparent 66%,#07334b 100%)}.splashpanel{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding:22px 5%;gap:9px;background:linear-gradient(100deg,#083952,#071d37)}.smallcaps{font-weight:1000;letter-spacing:2.1px;font-size:10px;color:#93f7d8}.splash h1,.dialogpanel h2{margin:1px 0;line-height:.92;font-size:clamp(38px,6vw,76px);letter-spacing:-2px;font-weight:1000;text-shadow:3px 4px #b43a75}.splash h1 em{font-style:normal;color:#ff93bd}.splashpanel p{max-width:450px;margin:1px 0;font-size:clamp(12px,1.2vw,15px);color:#d4edf2;line-height:1.45}.selectiontitle{font-size:10px;color:#ffd4a0;letter-spacing:1.7px;font-weight:1000}.characters{display:flex;gap:11px;width:100%;max-width:355px}.character{height:125px;flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;background:#113b55;border:2px solid #427d90;border-radius:12px;color:white;font-size:11px;letter-spacing:1px;font-weight:900;overflow:hidden;cursor:pointer;padding:3px 4px 7px;position:relative;transition:transform .14s}.character img{width:100%;max-height:95px;object-fit:contain;object-position:center}.character img.girlthumb{object-fit:contain;object-position:center bottom;height:100%;width:100%;max-height:96px}.character img.guythumb{object-fit:contain;object-position:center bottom;height:100%;width:100%;max-height:96px}.character.selected{border-color:#ffaad0;background:linear-gradient(135deg,#19728a,#703251);box-shadow:0 0 0 2px #ff71ab55}.character:hover{transform:translateY(-2px)}.character.selected:before{content:'✓';background:#ff6eac;position:absolute;right:5px;top:5px;padding:2px 5px;border-radius:50%;z-index:2}.primary{cursor:pointer;min-height:45px;border:0;border-radius:11px;background:linear-gradient(95deg,#ff66a7,#fa8e71);box-shadow:0 6px #a62f69;color:white;font:1000 14px 'Trebuchet MS',sans-serif;letter-spacing:1.1px;padding:9px 23px;white-space:nowrap}.primary span{margin-left:14px}.primary:active{transform:translateY(3px);box-shadow:0 3px #a62f69}.hint{font-size:9px;color:#86b6c7;letter-spacing:.5px;margin-top:3px}.modal{display:grid;place-items:center;background:#051c35df;backdrop-filter:blur(6px)}.dialogpanel{display:flex;align-items:center;flex-direction:column;text-align:center;gap:10px;padding:25px 40px;min-width:320px;max-width:90%;background:linear-gradient(155deg,#0d4962,#08213f);border:2px solid #63bdb8;border-radius:20px;box-shadow:0 20px 45px #0008}.dialogpanel h2{font-size:clamp(38px,6vw,66px);color:#fff4cc}.dialogpanel p{line-height:1.45;max-width:420px;color:#d2eef3;margin:0}.secondary{cursor:pointer;color:#d1fff4;background:#0e354e;border:1px solid #6ad5d2;border-radius:10px;padding:11px 20px;font-weight:bold;width:100%}.dialogpanel .primary{width:100%}.winicon{font-size:38px}.record{color:#9bffda;font-weight:900;letter-spacing:2px;font-size:12px}.footer{min-height:35px;padding:9px 14px;display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:9px;letter-spacing:1.1px;font-weight:900;color:#84c4ce}.desktophelp{font-size:9px;letter-spacing:.3px;color:#b3ccd2}.mobilehelp{display:none}.touchUI{position:absolute;left:0;right:0;bottom:7px;z-index:4;display:none;justify-content:space-between;padding:0 14px;pointer-events:none;touch-action:none}.directions,.actions{display:flex;align-items:flex-end;gap:8px;pointer-events:auto}.touchbtn{width:70px;height:63px;display:grid;place-items:center;border:2px solid #fff7;border-radius:18px;background:linear-gradient(145deg,#0b4069db,#153958d9);box-shadow:0 5px 0 #061727bb;color:#fff;font-size:25px;font-weight:1000;touch-action:none;user-select:none;pointer-events:auto;cursor:pointer}.touchbtn.run,.touchbtn.sprint{font-size:15px;letter-spacing:1px;background:linear-gradient(145deg,#147d88df,#095e71df)}.touchbtn.jump{width:87px;font-size:16px;line-height:1.1;background:linear-gradient(145deg,#fa7aa9df,#e0519cde)}.touchbtn.pressed{filter:brightness(1.3);transform:translateY(3px);box-shadow:0 2px #061727bb}@media(hover:none),(pointer:coarse){.touchUI{display:flex}.mobilehelp{display:block}.desktophelp{display:none}}@media(max-width:700px){body{padding:0}.arcade{border:0;border-radius:0}.gamebar{padding:5px 8px;height:44px}.brand{font-size:14px}.brand small{font-size:7px;letter-spacing:1px}.hibiscus{font-size:18px}.rightbar{gap:4px}.worldlabel{display:none}.iconbutton{height:29px;width:29px;font-size:16px}.footer{font-size:8px;padding:8px}.splash{grid-template-columns:41% 59%}.splashpanel{padding:8px 10px;gap:4px}.splash h1{font-size:clamp(29px,6.9vw,49px);letter-spacing:-.9px}.splashpanel p{font-size:9px;line-height:1.22}.smallcaps{font-size:8px}.selectiontitle{font-size:7px;letter-spacing:1px}.characters{gap:5px}.character{height:70px;font-size:7px;border-radius:6px;padding:1px 2px 3px}.character img.girlthumb,.character img.guythumb{max-height:50px}.primary{font-size:10px;min-height:30px;padding:5px 12px;box-shadow:0 3px #a62f69;border-radius:7px}.hint{display:none}.touchbtn{height:56px;width:60px;font-size:19px}.touchbtn.jump{width:75px}.touchUI{padding:0 8px}}@media(max-width:700px) and (orientation:portrait){.gameframe{height:345px;aspect-ratio:auto}.splashpanel{gap:6px}.splashpanel p{font-size:10px}.character{height:81px}.character img.girlthumb,.character img.guythumb{max-height:62px}.touchbtn{width:64px;height:59px}.touchbtn.jump{width:80px}}@media(max-height:510px) and (orientation:landscape){.gamebar{height:34px}.footer{display:none}.touchbtn{height:52px;width:55px}.touchbtn.jump{width:72px}.touchUI{bottom:5px}.splashpanel p{display:none}.character{height:66px}}

/* Version 0.5: responsive touch controller and portrait gameplay layout. */
.touchUI{position:absolute;z-index:4;left:0;right:0;bottom:44px;display:none;justify-content:space-between;padding:0 14px;pointer-events:none;touch-action:none}
.touchbtn{pointer-events:auto;min-width:55px;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.touchbtn.magic{background:linear-gradient(145deg,#9f4ce6f0,#693ac6e9);font-size:29px;display:flex;flex-direction:column;gap:0;line-height:1}
.touchbtn.magic small{font-size:9px;font-weight:900;letter-spacing:.3px}
@media (hover:none),(pointer:coarse){.touchUI{display:flex}}
@media (max-width:700px) and (orientation:portrait){
  html,body{width:100%;overflow-x:hidden}
  body{display:block;padding:0;margin:0}
  .arcade{width:100%;border:0;border-radius:0;box-shadow:none;overflow:visible}
  .gamebar{height:44px}
  .gameframe{width:100%;height:auto;aspect-ratio:1/1;overflow:hidden}
  .gameframe canvas{width:100%;height:100%;object-fit:fill}
  .touchUI{display:flex;position:relative;bottom:auto;left:auto;right:auto;min-height:96px;padding:9px 12px 12px;background:#071d33;align-items:center;justify-content:space-between;z-index:4}
  .touchUI .directions,.touchUI .actions{align-items:center;gap:8px}
  .touchbtn,.touchbtn.jump,.touchbtn.magic,.touchbtn.sprint{height:68px;width:68px;min-width:0;border-radius:16px;font-size:19px}
  .touchbtn.jump{width:78px;font-size:13px}
  .touchbtn.sprint{font-size:13px}
  .touchbtn.magic{width:64px;font-size:23px}
  .touchbtn.magic small{font-size:8px}
  .footer{height:auto;min-height:24px;padding:5px 10px;font-size:8px;letter-spacing:0;justify-content:center}
  .footer>span:first-child{display:none}
  .splash{display:block;background:linear-gradient(125deg,#124963,#071e39)}
  .splash .heroart{display:none}
  .splashpanel{width:100%;height:100%;padding:8px 13px;gap:5px;align-items:center;justify-content:center;text-align:center}
  .splash h1{font-size:clamp(27px,8.8vw,42px);line-height:.92;letter-spacing:-1px}
  .splashpanel p{display:none}
  .smallcaps{font-size:9px;letter-spacing:1px}
  .selectiontitle{font-size:9px;letter-spacing:1px}
  .characters{width:90%;max-width:300px;gap:9px}
  .character{height:94px;font-size:11px;border-radius:9px}
  .character img.girlthumb,.character img.guythumb{max-height:69px}
  .primary{font-size:13px;min-height:43px;padding:9px 15px}
  .hint{display:none}
  .dialogpanel{padding:12px 22px;gap:6px;min-width:0;width:90%;max-width:380px}
  .dialogpanel h2{font-size:37px}
  .dialogpanel p{font-size:12px}
  .dialogpanel .primary,.dialogpanel .secondary{min-height:35px;padding:6px}
}
@media (max-width:700px) and (orientation:portrait) and (max-width:345px){
  .touchUI{padding:8px 5px;min-height:82px}
  .touchUI .directions,.touchUI .actions{gap:4px}
  .touchbtn,.touchbtn.jump,.touchbtn.magic,.touchbtn.sprint{width:57px;height:60px}
  .touchbtn.jump{width:65px}.touchbtn.magic{width:55px}
  .splashpanel{gap:3px}.character{height:78px}.character img.girlthumb,.character img.guythumb{max-height:56px}
}
@media (max-height:550px) and (orientation:landscape) and (pointer:coarse){
  html,body{overflow:hidden;width:100%;height:100%}
  body{padding:0}
  .arcade{width:100vw;height:100dvh;border:0;border-radius:0}
  .gamebar{height:32px}
  .footer{display:none}
  .gameframe{height:calc(100dvh - 32px);width:100%;aspect-ratio:auto}
  .gameframe canvas{width:100%;height:100%;object-fit:fill}
  .touchUI{bottom:6px;left:0;right:0;padding:0 15px}
  .touchbtn,.touchbtn.jump,.touchbtn.magic,.touchbtn.sprint{height:54px;width:58px;font-size:15px}
  .touchbtn.jump{width:72px;font-size:13px}
  .splash{grid-template-columns:35% 65%}
  .splashpanel{gap:4px;padding:4px 10px}
  .splashpanel p{display:none}
  .character{height:70px}
  .dialogpanel{padding:8px 20px;gap:4px}
  .dialogpanel h2{font-size:33px}
}

/* Version 0.6. Mobile controls remain inside the available screen width. */
.brand { display:flex; align-items:center; gap:9px; text-shadow:none; letter-spacing:0; min-width:0; }
.brandlogo { height:51px; width:auto; max-width:122px; object-fit:contain; display:block; }
.brandlabel { color:#9ef9e5; font-size:11px; font-weight:1000; letter-spacing:2px; white-space:nowrap; }
.gamebar { height:62px; padding:4px 14px; }
.arcade { box-sizing:border-box; }
@media (max-width:700px) {
  .gamebar { height:52px; padding:3px 8px; gap:6px; }
  .brand { gap:5px; flex:0 1 auto; }
  .brandlogo { height:44px; max-width:80px; }
  .brandlabel { font-size:8px; letter-spacing:1px; }
  .iconbutton { width:33px; height:33px; flex:0 0 33px; font-size:17px; }
  .rightbar { gap:5px; flex-shrink:0; }
  .touchUI { max-width:100%; box-sizing:border-box; }
}
@media (max-width:700px) and (orientation:portrait) {
  html,body { width:100%;max-width:100%;margin:0;overflow-x:hidden; }
  .arcade { max-width:100%;overflow:hidden; }
  .gameframe { width:100%;aspect-ratio:1 / 1;height:auto; }
  .touchUI { position:relative; display:grid; grid-template-columns:minmax(0,2fr) minmax(0,3fr); column-gap:clamp(5px,1.7vw,10px); width:100%; padding:10px clamp(6px,2vw,12px); min-height:0; bottom:auto; overflow:hidden; align-items:center; justify-content:stretch; }
  .touchUI .directions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:clamp(4px,1vw,8px); width:100%; min-width:0; }
  .touchUI .actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:clamp(4px,1vw,8px); width:100%; min-width:0; }
  .touchUI .touchbtn, .touchUI .touchbtn.jump, .touchUI .touchbtn.magic, .touchUI .touchbtn.sprint { width:100%; min-width:0; max-width:100%; box-sizing:border-box; height:clamp(52px,17vw,68px); padding:0; border-radius:clamp(10px,3vw,16px); border-width:2px; line-height:1.1; }
  .touchUI .touchbtn { font-size:clamp(17px,5vw,23px); }
  .touchUI .touchbtn.sprint { font-size:clamp(10px,3vw,13px); letter-spacing:0; }
  .touchUI .touchbtn.jump { font-size:clamp(10px,3vw,13px); }
  .touchUI .touchbtn.magic { font-size:clamp(18px,5.5vw,23px); }
  .touchUI .touchbtn.magic small { font-size:clamp(6px,2vw,9px); letter-spacing:0; }
  .footer { min-height:22px; padding:4px 8px; }
  .desktophelp { display:none; }
}
@media (max-height:550px) and (orientation:landscape) and (pointer:coarse) {
  .gamebar { height:38px; }
  .brandlogo { height:34px; }
  .gameframe { height:calc(100dvh - 38px); }
  .touchUI { display:flex; position:absolute; left:0; right:0; bottom:8px; width:100%; padding:0 14px; }
  .touchUI .directions, .touchUI .actions {display:flex;width:auto;flex:0 0 auto;gap:8px;}
  .touchUI .touchbtn, .touchUI .touchbtn.jump, .touchUI .touchbtn.magic, .touchUI .touchbtn.sprint { width:clamp(42px,8vw,64px); height:clamp(42px,10vh,60px); border-radius:13px; padding:0; }
  .touchUI .touchbtn.jump { width:clamp(51px,9vw,72px); }
}


/* Added in v8: five-character selection grid */
.characters{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;width:100%;max-width:760px}
.character{height:132px}
.character img,.character img.herothumb,.character img.girlthumb,.character img.guythumb{object-fit:contain;object-position:center bottom;height:100%;width:100%;max-height:98px}
@media(max-width:900px){
  .characters{grid-template-columns:repeat(3,minmax(0,1fr));max-width:520px}
}
@media(max-width:700px){
  .characters{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;max-width:none}
  .character{height:82px;font-size:7px;border-radius:7px;padding:2px 2px 4px}
  .character img,.character img.herothumb,.character img.girlthumb,.character img.guythumb{max-height:58px}
}
@media(max-width:700px) and (orientation:portrait){
  .characters{grid-template-columns:repeat(3,minmax(0,1fr))}
  .character{height:88px}
  .character img,.character img.herothumb,.character img.girlthumb,.character img.guythumb{max-height:62px}
}
@media(max-height:510px) and (orientation:landscape){
  .characters{grid-template-columns:repeat(5,minmax(0,1fr));max-width:760px}
  .character{height:68px}
  .character img,.character img.herothumb,.character img.girlthumb,.character img.guythumb{max-height:48px}
}

/* Version 0.9: character skills, stage select, responsive menus and controls. */
.stage-picker{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;width:100%;max-width:460px}
.stage-option{padding:5px 2px;background:#113d5c;color:#fff4df;border:1.5px solid #4d8da7;border-radius:9px;font-weight:900;font-family:inherit;cursor:pointer;min-width:0;line-height:1.05}
.stage-option span{display:block;font-size:13px}.stage-option small{display:block;font-size:8px;letter-spacing:.4px;color:#b4f6eb;margin-top:3px}
.stage-option.chosen{border-color:#ff9dcf;background:#6a315d;box-shadow:inset 0 0 0 1px #ff99cb}
.stage-option:disabled{opacity:.48;cursor:not-allowed;filter:grayscale(.55)}
.chaptertop{width:100%;max-width:460px;display:flex;justify-content:space-between;align-items:center;gap:8px}
.record-badge{font-size:9px;color:#ffda87;white-space:nowrap}
.skill-info{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:center;width:100%;min-height:22px;font-size:9px;color:#abfaec}
.skill-info strong{color:#ffe5b4;font-size:10px}.skill-info span{font-weight:600;letter-spacing:.1px}
.splashpanel{gap:6px}.characters{max-width:475px}.character{height:103px;font-size:9px}
.character img,.character img.herothumb{max-height:78px}
/* Six fully visible touch actions, no sideways scroll. */
.touchUI .actions{gap:5px}.touchbtn.skill{background:linear-gradient(145deg,#6742a9,#a24fa8);font-size:22px;line-height:1}
.touchbtn.skill small{display:block;font-size:8px;line-height:1;letter-spacing:.1px}
@media(max-width:700px){
  .splash{display:block;overflow:auto;overscroll-behavior:contain}
  .splash .heroart{display:none}
  .splash .splashpanel{width:100%;min-height:100%;padding:9px 12px;gap:5px;justify-content:center;align-items:stretch}
  .splash h1{font-size:clamp(27px,7.5vw,39px)}
  .splashpanel p{font-size:9px;max-width:none}
  .characters{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));max-width:none;gap:4px}
  .character{height:76px;padding:1px 1px 4px;font-size:7px;letter-spacing:0}
  .character img,.character img.herothumb{height:54px;max-height:54px}
  .stage-picker{gap:4px;max-width:none}.stage-option span{font-size:11px}.stage-option small{font-size:7px}
  .skill-info{font-size:9px;min-height:19px}.skill-info strong{font-size:9px}
  .chaptertop{max-width:none}
  .touchUI{grid-template-columns:minmax(0,2fr) minmax(0,4fr)}
  .touchUI .actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
  .touchUI .directions{gap:4px}
  .touchUI .touchbtn,.touchUI .touchbtn.jump,.touchUI .touchbtn.magic,.touchUI .touchbtn.sprint,.touchUI .touchbtn.skill{width:100%;min-width:0;max-width:100%;font-size:clamp(10px,3vw,15px);padding:0;height:clamp(49px,16vw,65px)}
  .touchUI .touchbtn.magic,.touchUI .touchbtn.skill{font-size:19px}
  .touchUI .touchbtn.magic small,.touchUI .touchbtn.skill small{font-size:clamp(6px,1.7vw,8px)}
  .touchUI .touchbtn.sprint,.touchUI .touchbtn.jump{font-size:clamp(9px,2.6vw,12px)}
}
@media(max-height:510px) and (orientation:landscape){
  .splash{display:grid;grid-template-columns:25% 75%;overflow:auto}
  .splash .heroart{display:block}
  .splash .splashpanel{padding:5px 10px;min-height:0;gap:2px}
  .splash h1{font-size:27px}.splashpanel p{display:none}
  .character{height:58px}.character img,.character img.herothumb{max-height:40px;height:40px}
  .touchUI{display:flex}.touchUI .actions{display:flex;gap:5px}
  .touchUI .touchbtn.skill{width:clamp(42px,8vw,64px);height:clamp(42px,10vh,60px)}
}

/* Version 1.0: seven-character selection, accessible scrolling on short screens. */
.characters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));max-width:485px;gap:7px}
.character{height:87px;font-size:9px;padding:1px 1px 4px}
.character img,.character img.herothumb{width:100%;height:62px;max-height:62px;object-fit:contain;object-position:center bottom}
@media(max-width:700px){
  .splash{overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
  .splash .splashpanel{min-height:100%;height:auto;justify-content:flex-start;padding:10px 12px 14px;gap:5px}
  .characters{grid-template-columns:repeat(4,minmax(0,1fr));width:100%;max-width:none;gap:5px}
  .character{height:67px;font-size:8px;padding:1px 1px 3px}
  .character img,.character img.herothumb{height:45px;max-height:45px}
  .splashpanel p{font-size:9px}
}
@media(max-width:345px) and (orientation:portrait){
  .character{height:59px;font-size:7px}
  .character img,.character img.herothumb{height:40px;max-height:40px}
  .splash .splashpanel{padding:5px 8px 9px;gap:3px}
}
@media(max-height:510px) and (orientation:landscape){
  .splash{overflow-y:auto}
  .characters{grid-template-columns:repeat(7,minmax(0,1fr));max-width:none;gap:4px}
  .character{height:58px;font-size:7px}
  .character img,.character img.herothumb{height:40px;max-height:40px}
  .splash .splashpanel{justify-content:flex-start;gap:3px;padding:4px 9px}
}

/* Coral Crush Visual Edition, premium art-direction and responsive refinements */
.arcade{border-color:#5bbbc4;box-shadow:0 22px 72px #000a,0 0 36px #147db21c}
.gamebar{background:linear-gradient(115deg,#08243d,#10375a 55%,#08233d);border-bottom:1px solid #9bfce64b}
.brandlogo{filter:drop-shadow(0 3px 7px #ff8bc66e)}
.splashpanel{background:radial-gradient(ellipse at 85% 12%,#41408077,transparent 48%),linear-gradient(135deg,#0c4c61,#081e3d 78%)}
.splash h1{text-shadow:0 5px 0 #6f356c,3px 9px 12px #040c2c;letter-spacing:-2.1px}
.character{background:linear-gradient(160deg,#125776,#0b2d50 70%);border-color:#509eb7;box-shadow:inset 0 1px #ffffff21,0 3px 7px #0005}
.character[data-hero="girl"]{--character-color:#ff79b9}.character[data-hero="guy"]{--character-color:#80ccff}
.character[data-hero="bayli"]{--character-color:#ffd28e}.character[data-hero="aislinn"]{--character-color:#ffc2d5}
.character[data-hero="mushy"]{--character-color:#dba9ff}.character[data-hero="genspin"]{--character-color:#9f99f7}
.character[data-hero="sturang"]{--character-color:#6ef5ff}
.character.selected{border-color:var(--character-color,#ffc1e7);box-shadow:0 0 0 2px var(--character-color,#ffc1e7),0 0 17px #ff86db55,inset 0 2px #ffffff35}
.character:not(.selected):hover{border-color:var(--character-color,#8ee9d8)}
.primary{background:linear-gradient(120deg,#f85fa6,#fd9b81);box-shadow:0 5px 0 #912d73,0 0 15px #ee62ab36}
.iconbutton{transition:background .15s,transform .15s}.iconbutton:hover{background:#216584;transform:translateY(-1px)}
@media(max-width:700px){.splash h1{letter-spacing:-.4px}.gamebar{padding-right:6px}.character{box-shadow:inset 0 1px #ffffff20}}


/* Coral Crush 1.2 cinematic title: responsive artwork, real tappable controls. */
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.introSplash{position:relative;width:100%;display:none;overflow:hidden;background:#102c4c;isolation:isolate}
.intro-picture,.intro-picture img{display:block;width:100%;height:auto}
.arcade.intro-active{overflow:hidden}
.arcade.intro-active>.gamebar,.arcade.intro-active>.gameframe,.arcade.intro-active>.touchUI,.arcade.intro-active>.footer{display:none!important}
.arcade.intro-active>.introSplash{display:block}
.intro-play{position:absolute;left:29%;width:42%;bottom:3.6%;height:12.4%;z-index:3;cursor:pointer;border:0;border-radius:35px;background:transparent;touch-action:manipulation}
.intro-play:hover{background:#fff2;box-shadow:0 0 27px #fff9}
.intro-play:focus-visible{outline:4px solid #fffbc8;outline-offset:4px;box-shadow:0 0 30px #fff9}
.intro-audio-panel{position:absolute;top:12px;right:12px;display:flex;align-items:center;gap:8px;padding:5px 10px 5px 5px;background:#071d38cb;border:1px solid #fff7;border-radius:30px;backdrop-filter:blur(8px);z-index:4}
.intro-mute{width:36px;height:36px;display:grid;place-items:center;cursor:pointer;color:#fff;font-size:23px;background:linear-gradient(160deg,#f76cab,#943fbd);border:2px solid #fce0ff;border-radius:50%}
.intro-audio-panel input[type=range]{width:84px;accent-color:#ff80be;cursor:pointer}
.intro-audio-hint{position:absolute;bottom:1%;left:50%;transform:translateX(-50%);z-index:2;color:#fffae8;background:#0b2448bd;padding:4px 10px;border-radius:20px;font-size:clamp(9px,1.1vw,13px);font-weight:900;letter-spacing:.3px;white-space:nowrap;pointer-events:none;text-shadow:0 1px 4px #000a}
@media(max-width:700px) and (orientation:portrait){
  .intro-play{left:12%;width:76%;height:10%;bottom:2.1%;border-radius:50px}
  .intro-audio-panel{top:8px;right:8px;padding:4px 8px 4px 4px;gap:5px}
  .intro-mute{width:31px;height:31px;font-size:18px}
  .intro-audio-panel input[type=range]{width:55px}
  .intro-audio-hint{font-size:9px;bottom:.3%;padding:2px 8px}
}
@media(max-height:550px) and (orientation:landscape) and (pointer:coarse){
  .arcade.intro-active{height:auto;min-height:0;max-height:none;overflow:visible}
  .introSplash{height:auto}
  .intro-play{bottom:3.6%}
}

/* Five-world adventure selector and mobile-friendly end-of-world celebration */
.world-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;width:100%;max-width:490px}
.world-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-height:40px;padding:2px;border-radius:9px;border:1px solid #549cb6;background:linear-gradient(160deg,#194e76,#102746);color:#fffdf4;cursor:pointer;font-family:inherit}
.world-tab span{font-size:21px;line-height:1}.world-tab small{font-weight:1000;font-size:8px;letter-spacing:.6px}
.world-tab.chosen{border:2px solid #ffb6dd;background:linear-gradient(140deg,#8f387d,#1b7896);box-shadow:0 0 11px #fda2d650}
.world-tab:disabled{cursor:not-allowed;filter:grayscale(1);opacity:.4}
.stage-picker{grid-template-columns:repeat(5,minmax(0,1fr));max-width:490px;gap:5px}
.stage-option{height:41px;overflow:hidden}.stage-option span{font-size:12px}.stage-option small{font-size:7.5px;line-height:1.05;max-height:16px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:normal;letter-spacing:0}
.chaptertop{align-items:center}.record-badge{font-size:8px}
.splash{overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#8bcece #14435c}
.splashpanel{gap:6px}.splash h1{font-size:clamp(32px,5vw,64px)}
.boss-victory{background:radial-gradient(ellipse at 50% 35%,#faadcf88,#131b46e9 70%);backdrop-filter:blur(9px);z-index:9;overflow:auto}
.victory-panel{position:relative;width:min(520px,94%);max-height:97%;overflow:auto;padding:20px 24px 22px;display:flex;flex-direction:column;align-items:center;gap:7px;text-align:center;background:linear-gradient(145deg,#632a7df2,#0b4b77fa 55%,#083356fa);border:3px solid #ffe9ae;border-radius:26px;box-shadow:0 0 0 5px #fa9ad25c,0 24px 65px #000a,0 0 60px #e878d76c;animation:victoryBloom .5s cubic-bezier(.2,1.5,.42,1) both}
.victory-sparkles{color:#ffedac;font-size:24px;letter-spacing:15px;animation:victoryFloat 2s ease-in-out infinite alternate}
.victory-eyebrow{font-size:12px;font-weight:1000;letter-spacing:3px;color:#b0fff2}
.victory-trophy{font-size:48px;filter:drop-shadow(0 0 15px #ffe7a4);animation:victoryFloat 1s ease-in-out infinite alternate}
.victory-panel h2{font-size:clamp(35px,5vw,62px);line-height:.95;margin:1px 0;color:#fff2ad;letter-spacing:-1px;text-shadow:0 4px #a14b9e,0 0 17px #ffc4d5}
.victory-boss{font-size:15px;font-weight:1000;color:#fcd2f4;letter-spacing:1px}
.victory-medal{background:#f1c45f;color:#54235e;padding:7px 19px;border-radius:20px;font-size:13px;font-weight:1000;box-shadow:0 5px 0 #a86d5b}
.victory-panel p{font-size:13px;color:#e9feff;line-height:1.4;margin:4px 0;max-width:390px}
.victory-buttons{display:flex;gap:8px;width:100%;max-width:380px;margin-top:4px}.victory-buttons button{flex:1;min-width:0}.victory-buttons .secondary{color:#fff}
@keyframes victoryBloom{from{transform:scale(.7) translateY(40px);opacity:0}to{transform:scale(1) translateY(0);opacity:1}}
@keyframes victoryFloat{from{transform:translateY(0)}to{transform:translateY(-8px)}}
@media(max-width:700px){
 .splash{overflow-y:auto}.splashpanel{min-height:100%;gap:4px}.stage-option{height:37px;padding:3px 1px}
 .world-tab{min-height:35px}.world-tab span{font-size:17px}.world-tab small{font-size:7px}
 .chaptertop .selectiontitle{font-size:8px}.record-badge{font-size:7px}
 .victory-panel{padding:10px 12px;gap:4px;border-width:2px}.victory-sparkles{font-size:17px;letter-spacing:9px}
 .victory-trophy{font-size:31px}.victory-panel h2{font-size:36px}.victory-eyebrow{font-size:9px}.victory-boss{font-size:12px}.victory-medal{font-size:11px;padding:4px 12px}.victory-panel p{font-size:11px;margin:2px 0}.victory-buttons .primary,.victory-buttons .secondary{min-height:30px;font-size:10px;padding:5px 8px}
}
@media(max-width:700px) and (orientation:portrait){.splashpanel{justify-content:flex-start}.world-tabs{gap:3px}.world-tab{min-height:32px}.stage-option{height:35px}.victory-panel{max-height:98%}}
@media(max-height:510px) and (orientation:landscape){.victory-panel{max-height:96%;gap:3px;padding:7px 12px}.victory-trophy{font-size:25px}.victory-panel h2{font-size:30px}.victory-panel p{display:none}.victory-sparkles{display:none}}

.final-cast{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px;width:100%;max-width:430px;margin:1px 0}
.final-cast img{width:100%;height:48px;object-fit:contain;filter:drop-shadow(0 4px 3px #040b3766);animation:victoryFloat 1s ease-in-out infinite alternate}
.final-cast img:nth-child(2n){animation-delay:.4s}
/* Hide gameplay buttons on selection, allocate sufficient room for all seven heroes and world tabs. */
.arcade:has(#splash:not(.hidden)) .touchUI{display:none!important}
@media(max-width:700px) and (orientation:portrait){
 .arcade:has(#splash:not(.hidden)) .gameframe{height:570px;aspect-ratio:auto}
 .arcade:has(#splash:not(.hidden)) .splash{height:100%;overflow-y:auto}
 .arcade:has(#splash:not(.hidden)) .splashpanel{justify-content:flex-start;gap:5px;padding:10px 12px 13px}
 .arcade:has(#splash:not(.hidden)) .splash h1{font-size:clamp(35px,10vw,45px)}
 .arcade:has(#splash:not(.hidden)) .character{height:83px}
 .arcade:has(#splash:not(.hidden)) #startBtn{min-height:42px;font-size:12px}
}
@media(max-width:700px) and (orientation:landscape){.arcade:has(#splash:not(.hidden)) .gameframe{min-height:390px;aspect-ratio:auto}}


/* VERSION 1.5: animated character showroom, seven accurate heroes, responsive stage. */
.arcade:has(#splash:not(.hidden)) .gameframe{aspect-ratio:auto;min-height:720px;height:auto;overflow:visible}
.arcade:has(#splash:not(.hidden)) .splash{position:relative;inset:auto;min-height:720px;overflow:visible;display:block!important;background:linear-gradient(130deg,#093b5e,#08172f)}
.arcade:has(#splash:not(.hidden)) .splash .heroart{display:none!important}
.arcade:has(#splash:not(.hidden)) .splashpanel{box-sizing:border-box;display:flex;width:100%;max-width:none;height:auto;min-height:720px;padding:18px clamp(14px,2.5vw,35px) 23px;align-items:center;gap:10px;justify-content:flex-start;background:radial-gradient(circle at 70% 20%,#4f36774f,transparent 42%),linear-gradient(125deg,#0d4067,#081a39 75%);text-align:center}
.arcade:has(#splash:not(.hidden)) .splash h1{font-size:clamp(30px,4.5vw,54px);line-height:.92;margin:0}
.arcade:has(#splash:not(.hidden)) .splashpanel>p{max-width:790px;display:block;font-size:clamp(10px,1.15vw,14px);margin:0;color:#dbfafe}
.arcade:has(#splash:not(.hidden)) .splashpanel>.selectiontitle{font-size:13px;letter-spacing:2.8px;color:#ffe3a8}
.hero-picker-layout{width:min(990px,100%);display:grid;grid-template-columns:minmax(208px,30%) minmax(0,1fr);gap:14px;align-items:stretch}
.hero-picker-grid{display:flex;justify-content:center;align-items:stretch}
.hero-picker-grid .characters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;width:100%;max-width:none;align-content:center}
.hero-picker-grid .character{height:86px;min-height:0;padding:3px 2px 4px;font-size:10px;line-height:1.05;letter-spacing:.6px;border-radius:12px;box-shadow:inset 0 1px #ffffff35,0 3px 8px #0007;transition:transform .18s,border .18s,filter .18s}
.hero-picker-grid .character img,.hero-picker-grid .character img.herothumb{height:65px;max-height:65px;width:100%;object-fit:contain}
.hero-picker-grid .character:last-child{grid-column:1 / -1;width:49%;justify-self:center}
.hero-picker-grid .character:focus-visible{outline:3px solid #fff;outline-offset:2px}
.hero-showcase{position:relative;min-width:0;display:flex;flex-direction:column;align-items:center;overflow:hidden;isolation:isolate;border:2px solid #d0fbf5b5;border-radius:20px;background:linear-gradient(160deg,#245172,#452460);box-shadow:0 11px 35px #0009,inset 0 0 20px #ffffff2a}
.hero-showcase:before{content:'';position:absolute;inset:0;background:url('assets/hero_stage.webp') center center/cover no-repeat;z-index:-1}
.hero-showcase:after{content:'';position:absolute;inset:0;background:linear-gradient(0deg,#061838e8,transparent 44%,#081b476b);pointer-events:none;z-index:-1}
.showcase-eyebrow{position:absolute;top:8px;left:14px;right:14px;z-index:2;display:flex;justify-content:space-between;gap:10px;color:#fff8e2;font-size:12px;font-weight:1000;letter-spacing:1.2px;text-shadow:0 2px 8px #000}
#heroShowcase{width:100%;height:222px;object-fit:fill;display:block;touch-action:pan-y}
.showcase-name{font-size:clamp(19px,3vw,30px);line-height:1;letter-spacing:1.5px;font-weight:1000;color:#fffef3;text-shadow:0 3px 0 #5c2364,0 0 16px #ff91d7;margin-top:-2px}
.showcase-skill{margin-top:4px;font-size:12px;font-weight:1000;color:#aafdf8;letter-spacing:1.5px;text-shadow:0 2px 5px #000}
.power-preview{cursor:pointer;margin:9px 0 12px;color:white;border:1px solid #fff4c3;border-radius:24px;padding:9px 18px;background:linear-gradient(100deg,#e348a1,#963bd1);font-size:12px;font-weight:1000;letter-spacing:.7px;box-shadow:0 4px #462c72}
.power-preview:active{transform:translateY(3px);box-shadow:0 1px #462c72}
.arcade:has(#splash:not(.hidden)) .chaptertop,.arcade:has(#splash:not(.hidden)) .world-tabs,.arcade:has(#splash:not(.hidden)) .stage-picker{width:min(740px,100%);max-width:740px}
.arcade:has(#splash:not(.hidden)) .world-tab{min-height:53px}
.arcade:has(#splash:not(.hidden)) .stage-option{height:47px}
.arcade:has(#splash:not(.hidden)) .skill-info{width:auto;justify-content:center;text-align:center}
.arcade:has(#splash:not(.hidden)) #startBtn{min-width:min(360px,100%);font-size:15px;box-shadow:0 6px #8e2875,0 0 16px #fb67af50}
@media(max-width:700px) and (orientation:portrait){
 .arcade:has(#splash:not(.hidden)) .gameframe{height:auto!important;min-height:910px!important;aspect-ratio:auto!important}
 .arcade:has(#splash:not(.hidden)) .splash{min-height:910px;height:auto!important;overflow:visible!important}
 .arcade:has(#splash:not(.hidden)) .splashpanel{min-height:910px;height:auto!important;padding:12px 9px 20px;gap:9px}
 .arcade:has(#splash:not(.hidden)) .splash h1{font-size:clamp(33px,9vw,46px)}
 .arcade:has(#splash:not(.hidden)) .splashpanel>p{font-size:10px;line-height:1.25}
 .hero-picker-layout{display:flex;flex-direction:column-reverse;gap:8px}
 .hero-showcase{border-radius:17px}
 #heroShowcase{height:196px}
 .showcase-name{font-size:24px}.showcase-skill{font-size:11px}
 .power-preview{padding:7px 15px;font-size:10px;margin:7px 0 9px}
 .hero-picker-grid .characters{grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}
 .hero-picker-grid .character,.hero-picker-grid .character:last-child{grid-column:auto;width:100%;height:68px;padding:2px 1px 3px;font-size:clamp(5.5px,1.6vw,8px);border-radius:8px;letter-spacing:0}
 .hero-picker-grid .character img,.hero-picker-grid .character img.herothumb{height:46px;max-height:46px}
 .arcade:has(#splash:not(.hidden)) .world-tabs{gap:3px}
 .arcade:has(#splash:not(.hidden)) .world-tab{min-height:43px}
 .arcade:has(#splash:not(.hidden)) .stage-option{height:39px}
 .showcase-eyebrow{font-size:9px}
 .arcade:has(#splash:not(.hidden)) #startBtn{width:100%;min-width:0;max-width:470px}
}
@media(max-width:370px) and (orientation:portrait){
 .hero-picker-grid .character{font-size:5.5px;height:59px}
 .hero-picker-grid .character img,.hero-picker-grid .character img.herothumb{height:40px;max-height:40px}
 #heroShowcase{height:173px}
 .arcade:has(#splash:not(.hidden)) .splashpanel{gap:7px}
}
@media(max-height:550px) and (orientation:landscape){
 .arcade:has(#splash:not(.hidden)){height:auto;max-height:none;overflow:visible}
 .arcade:has(#splash:not(.hidden)) .gameframe{height:auto!important;min-height:600px!important;overflow:visible}
 .arcade:has(#splash:not(.hidden)) .splash{height:auto!important;min-height:600px;overflow:visible!important}
 .arcade:has(#splash:not(.hidden)) .splashpanel{height:auto;min-height:600px;padding:10px 15px}
 .hero-picker-layout{grid-template-columns:210px minmax(0,1fr)}
 .hero-picker-grid .character{height:60px;font-size:8px}
 .hero-picker-grid .character img,.hero-picker-grid .character img.herothumb{height:42px;max-height:42px}
 #heroShowcase{height:160px}
}
@media(prefers-reduced-motion:reduce){.hero-picker-grid .character{transition:none}}
/* The selector owns the game frame; never leave gameplay canvas above it. */
.arcade:has(#splash:not(.hidden)) .gameframe>#game{display:none!important}

/* v17: DOWN is a dedicated float control on phones and controllers. */
.touchbtn.down{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;background:linear-gradient(145deg,#1cb9cded,#2173b0ed);color:#eaffff;}
.touchbtn.down small{display:block;font-size:8px;letter-spacing:.4px;line-height:1;font-weight:1000;}
@media(max-width:700px) and (orientation:portrait){
 .touchUI{grid-template-columns:minmax(0,3fr) minmax(0,4.2fr);column-gap:4px;padding:8px 4px;}
 .touchUI .directions{grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;}
 .touchUI .actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;}
 .touchUI .touchbtn,.touchUI .touchbtn.jump,.touchUI .touchbtn.magic,.touchUI .touchbtn.sprint{height:clamp(48px,15vw,66px);font-size:clamp(11px,4vw,19px);border-radius:10px;}
 .touchUI .touchbtn.down small{font-size:clamp(6px,1.7vw,8px);}
 .touchUI .touchbtn.jump,.touchUI .touchbtn.sprint{font-size:clamp(9px,2.6vw,12px);}
 .touchUI .touchbtn.skill small,.touchUI .touchbtn.magic small{font-size:clamp(6px,1.7vw,9px);}
}
@media(max-height:550px) and (orientation:landscape) and (pointer:coarse){
 .touchUI .directions{display:flex;gap:5px;}
 .touchUI .actions{display:flex;gap:5px;}
 .touchUI .touchbtn,.touchUI .touchbtn.jump,.touchUI .touchbtn.magic,.touchUI .touchbtn.sprint{width:clamp(39px,7.2vw,59px);}
}

/* Version 2.0: eight selectable heroes, responsive character showcase. */
.hero-picker-grid .characters{grid-template-columns:repeat(2,minmax(0,1fr));}
.hero-picker-grid .character:last-child{grid-column:auto;width:100%;justify-self:auto;}
@media(max-width:700px) and (orientation:portrait){
 .hero-picker-grid .characters{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;}
 .hero-picker-grid .character,.hero-picker-grid .character:last-child{height:76px;font-size:clamp(6px,1.7vw,8px);}
 .hero-picker-grid .character img,.hero-picker-grid .character img.herothumb{height:53px;max-height:53px;}
}
@media(max-width:370px) and (orientation:portrait){
 .hero-picker-grid .character,.hero-picker-grid .character:last-child{height:68px;font-size:6px;}
 .hero-picker-grid .character img,.hero-picker-grid .character img.herothumb{height:45px;max-height:45px;}
}

/* Version 2.1: align the invisible interactive button with the painted PLAY NOW sign. */
.intro-play{left:28%;width:44%;height:14.2%;bottom:2.7%;border-radius:40px}
@media(max-width:700px) and (orientation:portrait){
  .intro-play{left:12.5%;width:75%;height:10.4%;bottom:5.0%;border-radius:48px}
}
