:root{
  --ink:#f6f8ff;
  --muted:#b9c4dd;
  --panel:rgba(8,14,34,.88);
  --panel-soft:rgba(14,24,50,.78);
  --line:rgba(190,211,255,.22);
  --cyan:#56e6ff;
  --violet:#8b72ff;
  --pink:#ff6cae;
  --yellow:#ffe05a;
  --shadow:0 16px 44px rgba(0,0,0,.32);
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:#0b1025}
body{font-family:system-ui,-apple-system,"Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;color:var(--ink);overflow-x:hidden}
button{font:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.link-burst-app{
  width:min(720px,100%);
  min-height:100vh;
  min-height:100dvh;
  margin:0 auto;
  padding:max(9px,env(safe-area-inset-top)) 10px max(14px,env(safe-area-inset-bottom));
  background:
    linear-gradient(to bottom,rgba(6,9,27,.12),rgba(6,9,27,.34)),
    url("../../link_burst_background_vertical.png") center 45%/cover fixed no-repeat;
}
.top-nav{display:flex;justify-content:space-between;gap:8px;margin-bottom:9px}
.nav-pill{
  border:1px solid rgba(255,255,255,.56);
  background:rgba(255,255,255,.94);
  color:#152040;
  border-radius:16px;
  min-height:42px;
  padding:8px 12px;
  font-size:12px;
  font-weight:1000;
  box-shadow:0 5px 14px rgba(0,0,0,.15)
}
.screen-heading{text-align:center;margin:7px 0 12px;text-shadow:0 3px 14px rgba(0,0,0,.45)}
.screen-heading h1{margin:0 0 4px;font-size:clamp(25px,7vw,36px);line-height:1.05}
.screen-heading p{margin:0;color:#e2e8f7;font-size:12px;font-weight:800;line-height:1.45}
.card{
  border:1px solid var(--line);
  border-radius:22px;
  background:var(--panel);
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px)
}
.btn{
  width:100%;
  min-height:52px;
  border:1px solid rgba(255,255,255,.22);
  border-radius:16px;
  padding:11px 14px;
  background:linear-gradient(180deg,#67ebff,#41a8ff);
  color:#06152d;
  font-weight:1000;
  box-shadow:0 5px 0 #1769bb,0 10px 20px rgba(0,0,0,.20)
}
.btn:active{transform:translateY(3px);box-shadow:0 2px 0 #1769bb,0 5px 12px rgba(0,0,0,.18)}
.btn.secondary{background:rgba(246,249,255,.95);color:#253454;box-shadow:0 4px 0 rgba(116,133,169,.72)}
.btn.violet{background:linear-gradient(180deg,#b29cff,#7867ed);color:#fff;box-shadow:0 5px 0 #5140b7}
.btn:disabled{opacity:.5;transform:none;box-shadow:none}
.stack{display:grid;gap:9px}

/* title */
.title-card{
  min-height:calc(100dvh - 70px);
  padding:22px 17px;
  display:grid;
  align-content:center;
  text-align:center;
  overflow:hidden;
  background:linear-gradient(to bottom,rgba(7,10,28,.04) 0%,rgba(7,10,28,.18) 43%,rgba(7,10,28,.76) 100%);
  border:1px solid rgba(255,255,255,.16);
  border-radius:30px;
  box-shadow:var(--shadow)
}
.title-logo{
  width:min(650px,100%);
  max-height:220px;
  object-fit:contain;
  margin:0 auto 6px;
  filter:drop-shadow(0 9px 19px rgba(0,0,0,.42))
}
.title-copy{
  width:min(480px,94%);
  margin:0 auto 18px;
  padding:9px 12px;
  border-radius:14px;
  background:rgba(7,12,31,.62);
  color:#fff;
  font-size:13px;
  font-weight:900;
  line-height:1.55
}
.title-actions{width:min(430px,100%);margin:0 auto}
.title-player{
  margin-top:10px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(8,16,38,.72);
  color:#e8f3ff;
  font-size:11px;
  font-weight:900
}

/* play type and modes */
.choice-grid{display:grid;gap:11px}
.choice-card{
  width:100%;
  text-align:left;
  padding:15px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:20px;
  background:rgba(9,17,39,.88);
  color:#fff;
  box-shadow:0 9px 24px rgba(0,0,0,.22)
}
.choice-card strong{display:block;font-size:21px;line-height:1.2}
.choice-card span{display:block;margin-top:5px;color:#bdc9e2;font-size:12px;font-weight:800;line-height:1.45}
.choice-card.solo{border-color:rgba(86,230,255,.55)}
.choice-card.versus{border-color:rgba(255,108,174,.48)}
.choice-card[disabled]{opacity:.62}
.mode-badge{
  display:inline-flex!important;
  width:max-content;
  margin:0 0 6px!important;
  padding:4px 7px;
  border-radius:999px;
  background:rgba(86,230,255,.14);
  color:#8ff0ff!important;
  font-size:9px!important;
  letter-spacing:.08em
}

/* player select */
.player-card{padding:14px}
.solo-player-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.solo-player-btn{
  min-width:0;
  min-height:74px;
  padding:10px 7px;
  display:grid;
  place-items:center;
  gap:3px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:16px;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-weight:1000
}
.solo-player-btn span{font-size:28px}
.solo-player-btn small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.solo-player-btn.selected{border-color:#65e9ff;background:rgba(66,185,255,.22);box-shadow:0 0 0 2px rgba(86,230,255,.14)}

/* rules */
.rules-wrap{display:grid;gap:9px}
.rule-card{padding:13px 14px}
.rule-card h2{margin:0 0 6px;font-size:18px;color:#fff}
.rule-card p{margin:0;color:#c6d2e8;font-size:12px;font-weight:750;line-height:1.55}
.rule-visual{display:flex;justify-content:center;margin:8px 0}
.rule-pair{display:grid;grid-template-columns:42px 42px;gap:4px}
.rule-pair i{display:grid;place-items:center;width:42px;height:42px;border-radius:10px;font-style:normal;font-weight:1000;color:#fff;border:1px solid rgba(255,255,255,.45)}
.rule-pair .pair-a{background:#278de8}
.rule-pair .pair-b{background:#ef4d72}
.control-demo{
  display:grid;
  grid-template-columns:repeat(6,24px);
  grid-template-rows:40px 40px;
  column-gap:0;
  row-gap:7px;
  justify-content:center;
  margin:9px 0 3px
}
.control-demo span{display:grid;place-items:center;width:48px;height:40px;border-radius:11px;background:#f4f7ff;color:#172746;font-weight:1000}
.control-demo .demo-left{grid-column:1 / 3;grid-row:1}
.control-demo .demo-right{grid-column:3 / 5;grid-row:1}
.control-demo .demo-rotate{grid-column:5 / 7;grid-row:1;background:#9c84ff;color:#fff}
.control-demo .demo-down{grid-column:2 / 4;grid-row:2}

/* play */
.link-burst-app.screen-play{
  height:100vh;
  height:100dvh;
  min-height:0;
  overflow:hidden;
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr) auto;
  gap:6px;
  padding-bottom:max(7px,env(safe-area-inset-bottom))
}
.screen-play .top-nav{margin:0}
.play-hud{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:7px;
  align-items:stretch
}
.score-panel{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:5px;
  min-width:0
}
.hud-box{
  min-width:0;
  padding:6px 7px;
  display:grid;
  align-content:center;
  border:1px solid rgba(255,255,255,.16);
  border-radius:13px;
  background:rgba(7,14,33,.84);
  text-align:center
}
.hud-box small{font-size:8px;letter-spacing:.09em;color:#aebbd4;font-weight:1000}
.hud-box strong{margin-top:2px;font-size:clamp(15px,4.8vw,22px);line-height:1;color:#fff;white-space:nowrap}
.hud-box.link strong{color:#71edff}
.next-panel{
  display:flex;
  gap:10px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent
}
.next-box{
  min-width:58px;
  padding:6px 7px;
  display:grid;
  gap:4px;
  place-items:center;
  border:1px solid rgba(255,255,255,.16);
  border-radius:13px;
  background:rgba(7,14,33,.84)
}
.next-box small{font-size:7px;color:#b8c4db;font-weight:1000}
.mini-piece{width:44px;height:21px;display:grid;grid-template-columns:1fr 1fr;gap:5px}
.mini-block{border-radius:5px;border:1px solid rgba(255,255,255,.32);box-shadow:inset 0 1px 4px rgba(255,255,255,.34)}
.mini-block.p0{grid-column:1}.mini-block.p1{grid-column:2}
.pause-btn{
  width:44px;
  min-width:44px;
  min-height:100%;
  padding:5px 4px;
  display:grid;
  place-items:center;
  align-content:center;
  gap:2px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:13px;
  background:rgba(7,14,33,.88);
  color:#eef5ff;
  box-shadow:none
}
.pause-btn strong{font-size:18px;line-height:1;letter-spacing:-.08em}
.pause-btn small{font-size:6px;font-weight:1000;letter-spacing:.08em;color:#aebbd4}
.pause-btn:active{transform:translateY(2px);background:rgba(21,33,67,.94)}


.board-stage{
  min-height:0;
  position:relative;
  display:grid;
  place-items:center;
  overflow:visible
}
.board-frame{
  position:relative;
  height:min(100%,68dvh);
  max-width:94vw;
  aspect-ratio:7/13;
  border:2px solid rgba(126,224,255,.64);
  border-radius:18px;
  padding:5px;
  background:rgba(3,8,24,.78);
  box-shadow:0 0 0 2px rgba(75,119,255,.12),0 0 28px rgba(65,171,255,.22),0 16px 38px rgba(0,0,0,.32);
  overflow:hidden
}
.board-frame.danger{border-color:#ff607e;box-shadow:0 0 0 2px rgba(255,73,108,.17),0 0 32px rgba(255,67,100,.36),0 16px 38px rgba(0,0,0,.32)}
.game-board{
  width:100%;height:100%;
  display:grid;
  grid-template-columns:repeat(7,1fr);
  grid-template-rows:repeat(13,1fr);
  gap:2px
}
.board-cell{
  min-width:0;min-height:0;
  position:relative;
  display:grid;
  place-items:center;
  border-radius:2px;
  background:rgba(103,146,204,.095);
}
.board-cell.danger-row{background:rgba(250,94,112,.10)}
.block{
  position:absolute;
  inset:1px;
  display:grid;
  place-items:center;
  border-radius:21%;
  border:1px solid rgba(255,255,255,.56);
  box-shadow:inset 0 2px 7px rgba(255,255,255,.35),inset 0 -5px 9px rgba(0,0,0,.15),0 2px 8px rgba(0,0,0,.24);
  overflow:hidden;
  transform:translateZ(0)
}
.block::before{
  content:"";
  position:absolute;
  inset:7% 9% auto 9%;
  height:24%;
  border-radius:999px;
  background:rgba(255,255,255,.25)
}
.block span{position:relative;z-index:1;font-size:clamp(9px,2.8vw,15px);font-weight:1000;color:rgba(255,255,255,.86);text-shadow:0 1px 3px rgba(0,0,0,.32)}
.c-blue{background:linear-gradient(145deg,#49c6ff,#1768e4)}
.c-red{background:linear-gradient(145deg,#ff7a9a,#e62f5d)}
.c-yellow{background:linear-gradient(145deg,#fff07a,#f2ae1d)}
.c-green{background:linear-gradient(145deg,#7bea9a,#21a65c)}
.c-purple{background:linear-gradient(145deg,#c99bff,#7845d3)}
.block.active{filter:saturate(1.16) brightness(1.09);box-shadow:inset 0 2px 7px rgba(255,255,255,.42),0 0 10px rgba(116,223,255,.35)}
.block.charged{
  z-index:3;
  animation:chainCharge .34s ease-in-out infinite alternate;
  filter:saturate(1.28) brightness(1.28);
  box-shadow:
    inset 0 2px 8px rgba(255,255,255,.62),
    0 0 0 2px rgba(255,255,255,.76),
    0 0 16px rgba(118,232,255,.82)
}
.block.falling{animation:blockDrop .11s ease-out}
.block.clearing{animation:blockClear .42s cubic-bezier(.18,.82,.25,1) forwards;z-index:4}
.board-frame.lock-flash{animation:lockPulse .18s ease-out}
.board-frame.burst-shake{animation:burstShake .42s ease-out}
.board-frame.chain-active{
  border-color:rgba(117,235,255,.96);
  box-shadow:0 0 0 2px rgba(86,230,255,.20),0 0 34px rgba(65,201,255,.34),0 16px 38px rgba(0,0,0,.32)
}
.board-frame.chain-strong{
  box-shadow:0 0 0 3px rgba(129,109,255,.25),0 0 42px rgba(118,90,255,.44),0 16px 38px rgba(0,0,0,.32)
}
.board-frame.chain-burst{
  border-color:#ffe46a;
  box-shadow:0 0 0 3px rgba(255,221,81,.24),0 0 52px rgba(255,173,45,.50),0 16px 38px rgba(0,0,0,.32)
}

.danger-label{
  position:absolute;
  top:6px;
  left:50%;
  transform:translateX(-50%);
  z-index:6;
  padding:3px 9px;
  border-radius:999px;
  background:rgba(189,18,53,.86);
  border:1px solid rgba(255,161,178,.75);
  color:#fff;
  font-size:9px;
  font-weight:1000;
  letter-spacing:.16em;
  opacity:0
}
.board-frame.danger .danger-label{opacity:1;animation:dangerPulse .8s ease-in-out infinite alternate}

.chain-banner{
  position:absolute;
  z-index:19;
  top:12px;
  left:50%;
  transform:translate(-50%,-12px) scale(.96);
  min-width:116px;
  padding:6px 13px 7px;
  border:1px solid rgba(129,232,255,.48);
  border-radius:999px;
  background:rgba(5,12,31,.88);
  box-shadow:0 7px 18px rgba(0,0,0,.28),0 0 18px rgba(83,218,255,.14);
  text-align:center;
  opacity:0;
  pointer-events:none;
  transition:opacity .16s ease,transform .16s ease,box-shadow .16s ease
}
.chain-banner.show{opacity:1;transform:translate(-50%,0) scale(1)}
.chain-banner small{display:block;color:#82ddf2;font-size:7px;font-weight:1000;letter-spacing:.18em;line-height:1}
.chain-banner strong{display:block;margin-top:2px;color:#fff;font-size:17px;font-weight:1000;line-height:1}
.chain-banner.hot{border-color:rgba(171,137,255,.65);box-shadow:0 7px 18px rgba(0,0,0,.28),0 0 24px rgba(130,92,255,.34)}
.chain-banner.burst{border-color:rgba(255,226,92,.78);box-shadow:0 7px 18px rgba(0,0,0,.28),0 0 30px rgba(255,181,49,.48)}
.chain-banner.burst small,.chain-banner.burst strong{color:#fff2a1}

.chain-flash{
  position:absolute;
  inset:0;
  z-index:14;
  pointer-events:none;
  opacity:0;
  border-radius:22px
}
.chain-flash.charge{animation:chainFlashCharge .38s ease-out}
.chain-flash.burst{animation:chainFlashBurst .42s ease-out}
.chain-flash.strong{filter:saturate(1.25)}
.chain-flash.max{filter:saturate(1.45) brightness(1.1)}

.particle-layer{position:absolute;inset:0;z-index:18;pointer-events:none;overflow:visible}
.clear-particle{
  position:absolute;
  width:8px;height:8px;
  margin:-4px 0 0 -4px;
  border-radius:3px;
  box-shadow:0 0 9px rgba(255,255,255,.82);
  animation:clearParticle var(--particle-life,520ms) cubic-bezier(.16,.72,.24,1) forwards
}

.link-fx{
  position:absolute;
  z-index:22;
  left:50%;top:46%;
  transform:translate(-50%,-50%);
  min-width:210px;
  pointer-events:none;
  text-align:center;
  opacity:0
}
.link-fx.show{animation:linkPop var(--link-duration,.9s) cubic-bezier(.18,.82,.22,1)}
.link-fx strong{
  display:block;
  font-size:clamp(34px,10vw,58px);
  line-height:.92;
  color:#fff;
  letter-spacing:-.035em;
  text-shadow:0 4px 0 #3157a4,0 0 24px rgba(91,231,255,.88),0 9px 22px rgba(0,0,0,.52)
}
.link-fx span{display:block;margin-top:7px;color:#fff2a8;font-size:16px;font-weight:1000;text-shadow:0 2px 9px #000}
.link-fx.strong strong{font-size:clamp(39px,11vw,64px);text-shadow:0 4px 0 #6745bc,0 0 28px rgba(156,122,255,.95),0 10px 24px rgba(0,0,0,.55)}
.link-fx.burst strong{color:#fff071;text-shadow:0 4px 0 #d26119,0 0 32px rgba(255,186,49,.98),0 10px 26px rgba(0,0,0,.56)}
.link-fx.continue{top:50%}
.link-fx.continue strong{font-size:clamp(27px,8vw,43px);color:#c7f7ff;text-shadow:0 3px 0 #385f9a,0 0 20px rgba(91,231,255,.76),0 7px 18px rgba(0,0,0,.48)}
.link-fx.continue span{font-size:10px;letter-spacing:.15em;color:#dbe8ff}
.split-fx{
  position:absolute;z-index:15;left:50%;top:48%;transform:translate(-50%,-50%);
  pointer-events:none;opacity:0;
  color:#dffaff;font-size:18px;font-weight:1000;letter-spacing:.16em;text-shadow:0 0 15px #4fe8ff
}
.split-fx.show{animation:splitPop .34s ease-out}
.score-pop{
  position:absolute;z-index:18;left:50%;top:57%;transform:translateX(-50%);
  pointer-events:none;opacity:0;color:#fff3a0;font-size:20px;font-weight:1000;text-shadow:0 2px 8px rgba(0,0,0,.65)
}
.score-pop.show{animation:scoreRise var(--score-duration,.75s) ease-out}

.controls{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  grid-template-rows:50px 50px;
  column-gap:0;
  row-gap:7px;
  width:min(390px,94vw);
  margin:0 auto
}
.control-btn[data-control="left"]{grid-column:1 / 3;grid-row:1}
.control-btn[data-control="right"]{grid-column:3 / 5;grid-row:1}
.control-btn[data-control="rotate"]{grid-column:5 / 7;grid-row:1}
.control-btn[data-control="down"]{grid-column:2 / 4;grid-row:2}
.control-btn{
  height:50px;
  min-height:50px;
  border:1px solid rgba(255,255,255,.44);
  border-radius:15px;
  background:linear-gradient(180deg,rgba(244,249,255,.98),rgba(205,220,242,.98));
  color:#192845;
  font-size:25px;
  font-weight:1000;
  box-shadow:0 4px 0 #7286a8,0 8px 16px rgba(0,0,0,.22);
  user-select:none
}
.control-btn.rotate{background:linear-gradient(180deg,#b9a6ff,#7e68ed);color:#fff;box-shadow:0 4px 0 #4f40a8,0 8px 16px rgba(0,0,0,.22)}
.control-btn:active,.control-btn.pressed{transform:translateY(3px);box-shadow:0 1px 0 #657999,0 4px 10px rgba(0,0,0,.18)}

/* result / ranking */
.result-card{padding:17px;text-align:center}
.result-kicker{font-size:10px;letter-spacing:.16em;color:#92e9ff;font-weight:1000}
.result-score{margin:4px 0 11px;font-size:clamp(58px,18vw,90px);font-weight:1000;line-height:.92;color:#fff;text-shadow:0 0 22px rgba(84,221,255,.37)}
.result-banner{margin-bottom:12px;padding:9px;border-radius:14px;background:rgba(86,230,255,.10);border:1px solid rgba(86,230,255,.3);font-weight:1000;color:#b9f5ff}
.result-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.result-stat{padding:9px 5px;border-radius:13px;background:rgba(255,255,255,.07)}
.result-stat small{display:block;color:#aebbd3;font-size:9px;font-weight:900}
.result-stat strong{display:block;margin-top:3px;font-size:19px}
.ranking-tabs{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-bottom:9px}
.ranking-tabs button{min-height:42px;border:1px solid rgba(255,255,255,.16);border-radius:13px;background:rgba(7,14,33,.82);color:#c8d4e9;font-weight:1000}
.ranking-tabs button.selected{border-color:#5ce9ff;background:rgba(55,175,231,.23);color:#fff}
.ranking-card{padding:12px}
.ranking-list{display:grid;gap:6px}
.ranking-row{
  display:grid;
  grid-template-columns:35px minmax(0,1fr) auto;
  gap:7px;
  align-items:center;
  padding:8px 9px;
  border-radius:13px;
  background:rgba(255,255,255,.07)
}
.ranking-row.current{outline:2px solid #ffe15e}
.rank-no{text-align:center;font-size:17px;font-weight:1000;color:#a8b6d0}
.rank-player{min-width:0;display:flex;align-items:center;gap:6px;font-weight:1000}
.rank-player span{font-size:21px}.rank-player strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rank-score{text-align:right}.rank-score strong{display:block;color:#fff;font-size:17px}.rank-score small{color:#aebbd3;font-size:8px;font-weight:900}
.ranking-empty{text-align:center;padding:28px 8px;color:#b7c3d9;font-weight:900}

/* quit */
.quit-backdrop{
  position:fixed;inset:0;z-index:9000;display:grid;place-items:center;padding:16px;
  background:rgba(5,9,24,.80);backdrop-filter:blur(5px)
}
.quit-card{width:min(360px,100%);padding:19px;text-align:center}
.quit-card h2{margin:0 0 8px;font-size:25px}.quit-card p{margin:0 0 14px;color:#c1cde3;font-size:12px;font-weight:800;line-height:1.5}

.pause-backdrop{
  position:fixed;inset:0;z-index:9100;display:grid;place-items:center;padding:16px;
  background:rgba(5,9,24,.84);backdrop-filter:blur(7px)
}
.pause-card{
  width:min(360px,100%);padding:22px 19px 19px;text-align:center;
  border-color:rgba(121,220,255,.30)
}
.pause-kicker{display:inline-block;margin-bottom:4px;color:#76e7ff;font-size:9px;font-weight:1000;letter-spacing:.18em}
.pause-card h2{margin:0 0 7px;font-size:28px}
.pause-card p{margin:0 0 14px;color:#c5d2e8;font-size:12px;font-weight:800;line-height:1.5}
.pause-summary{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:0 0 14px}
.pause-summary span{
  padding:9px 6px;border-radius:13px;background:rgba(255,255,255,.07);
  color:#9eacc6;font-size:8px;font-weight:1000;letter-spacing:.04em
}
.pause-summary strong{display:block;margin-top:2px;color:#fff;font-size:18px;line-height:1}


/* animations */
@keyframes blockDrop{0%{transform:translateY(-18%)}100%{transform:translateY(0)}}
@keyframes chainCharge{0%{transform:scale(1);filter:saturate(1.18) brightness(1.14)}100%{transform:scale(1.08);filter:saturate(1.42) brightness(1.55)}}
@keyframes blockClear{0%{transform:scale(1);filter:brightness(1.2)}38%{transform:scale(1.18);filter:brightness(2)}65%{transform:scale(.92);filter:brightness(1.65)}100%{transform:scale(.04);opacity:0}}
@keyframes chainFlashCharge{0%{opacity:0;background:radial-gradient(circle at center,rgba(114,234,255,.00),rgba(114,234,255,0))}45%{opacity:1;background:radial-gradient(circle at center,rgba(114,234,255,.18),rgba(114,234,255,0) 70%)}100%{opacity:0}}
@keyframes chainFlashBurst{0%{opacity:0;background:rgba(255,255,255,0)}18%{opacity:.88;background:rgba(255,255,255,.18)}42%{opacity:.62;background:radial-gradient(circle at center,rgba(255,232,107,.30),rgba(91,206,255,.10) 55%,transparent 78%)}100%{opacity:0}}
@keyframes clearParticle{0%{opacity:1;transform:translate(0,0) scale(1.1) rotate(0deg)}68%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) scale(.22) rotate(180deg)}}
@keyframes lockPulse{0%{box-shadow:0 0 0 2px rgba(86,230,255,.2),0 0 12px rgba(86,230,255,.1)}55%{box-shadow:0 0 0 3px rgba(255,255,255,.7),0 0 34px rgba(86,230,255,.65)}100%{box-shadow:0 0 0 2px rgba(75,119,255,.12),0 0 28px rgba(65,171,255,.22)}}
@keyframes burstShake{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}50%{transform:translateX(4px)}75%{transform:translateX(-2px)}}
@keyframes linkPop{0%{opacity:0;transform:translate(-50%,-50%) scale(.42)}12%{opacity:1;transform:translate(-50%,-50%) scale(1.14)}22%{transform:translate(-50%,-50%) scale(1)}74%{opacity:1;transform:translate(-50%,-50%) scale(1)}100%{opacity:0;transform:translate(-50%,-58%) scale(1.04)}}
@keyframes splitPop{0%{opacity:0;transform:translate(-50%,-50%) scale(.65)}30%{opacity:1}100%{opacity:0;transform:translate(-50%,-60%) scale(1.15)}}
@keyframes scoreRise{0%{opacity:0;transform:translate(-50%,8px) scale(.72)}18%{opacity:1;transform:translate(-50%,-2px) scale(1.14)}62%{opacity:1}100%{opacity:0;transform:translate(-50%,-34px) scale(1.02)}}
@keyframes dangerPulse{from{filter:brightness(.8)}to{filter:brightness(1.35)}}

html[data-hg-motion="reduced"] .block,
html[data-hg-motion="reduced"] .board-frame,
html[data-hg-motion="reduced"] .link-fx,
html[data-hg-motion="reduced"] .split-fx,
html[data-hg-motion="reduced"] .score-pop,
html[data-hg-motion="reduced"] .danger-label,
html[data-hg-motion="reduced"] .chain-banner,
html[data-hg-motion="reduced"] .chain-flash,
html[data-hg-motion="reduced"] .clear-particle{
  animation:none!important;
  transition:none!important
}
html[data-hg-motion="reduced"] .link-fx.show,
html[data-hg-motion="reduced"] .split-fx.show,
html[data-hg-motion="reduced"] .score-pop.show,
html[data-hg-motion="reduced"] .chain-banner.show{opacity:1!important}

@media(max-width:390px){
  .link-burst-app{padding-left:8px;padding-right:8px}
  .title-card{padding-left:13px;padding-right:13px}
  .score-panel{gap:4px}.play-hud{gap:5px}.next-panel{gap:3px;padding:4px}
  .hud-box{padding:5px 4px}.mini-piece{width:38px;height:18px}
  .controls{width:min(360px,94vw);grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:47px 47px;row-gap:5px;column-gap:0}
  .control-btn{height:47px;min-height:47px;font-size:23px}
}
@media(max-height:700px){
  .link-burst-app.screen-play{gap:4px;padding-top:5px}
  .play-hud{gap:4px}
  .hud-box{padding:4px 5px}.hud-box strong{font-size:15px}
  .next-panel{padding:3px}.mini-piece{width:34px;height:16px}
  .board-frame{height:min(100%,64dvh);padding:4px;border-radius:15px}
  .controls{width:min(350px,94vw);grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:43px 43px;row-gap:5px;column-gap:0}.control-btn{height:43px;min-height:43px;font-size:21px}
}


/* First play helper 2026-10-10 */
.play-tip{
  position:absolute;
  left:50%;
  bottom:7px;
  z-index:24;
  transform:translate(-50%,10px);
  width:max-content;
  max-width:92%;
  padding:7px 11px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.35);
  background:rgba(5,12,31,.88);
  color:#fff;
  font-size:10px;
  font-weight:1000;
  white-space:nowrap;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease,transform .2s ease;
  box-shadow:0 5px 14px rgba(0,0,0,.22);
}
.play-tip.show{opacity:1;transform:translate(-50%,0)}
html[data-hg-motion="reduced"] .play-tip{transition:none!important}


/* HUD best score 2026-10-10 */
.score-box em{
  display:block;
  margin-top:3px;
  color:#8fa0bd;
  font-style:normal;
  font-size:7px;
  font-weight:1000;
  letter-spacing:.04em;
  line-height:1;
}


/* Link Burst chain feedback 2026-10-11 */
/* Chain timing is intentionally readable: glow → burst → fall → next-link beat. */


/* Escalating LINK / COMBO spectacle 2026-10-11 */
.board-stage{
  isolation:isolate;
}
.board-stage::before,
.board-stage::after{
  content:"";
  position:absolute;
  inset:-8px;
  z-index:0;
  pointer-events:none;
  opacity:0;
  border-radius:28px;
}
.board-stage::before{
  background:radial-gradient(circle at center,rgba(94,225,255,.18),transparent 58%);
  filter:blur(10px);
}
.board-stage::after{
  border:2px solid rgba(255,255,255,.12);
  box-shadow:inset 0 0 28px rgba(255,255,255,.06);
}
.board-stage.chain-stage::before,
.board-stage.chain-stage::after{
  opacity:1;
}
.board-stage.fx-tier-2::before{background:radial-gradient(circle at center,rgba(82,218,255,.24),transparent 62%)}
.board-stage.fx-tier-3::before{background:radial-gradient(circle at center,rgba(126,126,255,.28),transparent 63%)}
.board-stage.fx-tier-4::before{background:radial-gradient(circle at center,rgba(168,105,255,.34),transparent 64%)}
.board-stage.fx-tier-5::before{background:radial-gradient(circle at center,rgba(255,102,201,.31),rgba(120,92,255,.18) 42%,transparent 68%)}
.board-stage.fx-tier-6::before{background:radial-gradient(circle at center,rgba(255,215,92,.34),rgba(255,111,160,.18) 44%,transparent 70%)}
.board-stage.fx-tier-7::before{background:radial-gradient(circle at center,rgba(255,236,130,.42),rgba(104,226,255,.22) 46%,rgba(255,98,206,.18) 65%,transparent 74%)}
.board-stage.fx-tier-8::before{
  background:
    radial-gradient(circle at 50% 48%,rgba(255,255,255,.52),rgba(255,227,113,.28) 30%,rgba(96,229,255,.20) 50%,rgba(255,82,204,.16) 68%,transparent 78%);
  animation:stageAuraMax .72s ease-in-out infinite alternate;
}
.board-stage.combo-heavy::after{
  border-color:rgba(255,240,173,.46);
  box-shadow:inset 0 0 34px rgba(255,236,159,.12),0 0 24px rgba(255,195,72,.10);
}

.chain-banner.fx-tier-4 strong{font-size:19px}
.chain-banner.fx-tier-5 strong{font-size:20px;color:#ffd4ff}
.chain-banner.fx-tier-6 strong{font-size:21px;color:#fff0a3}
.chain-banner.fx-tier-7 strong{font-size:22px;color:#fff7c6;text-shadow:0 0 12px rgba(255,224,95,.58)}
.chain-banner.fx-tier-8{
  transform:translate(-50%,0) scale(1.08);
  border-color:rgba(255,255,255,.88);
  background:linear-gradient(135deg,rgba(68,39,132,.95),rgba(154,49,125,.95),rgba(174,116,34,.95));
  box-shadow:0 8px 22px rgba(0,0,0,.34),0 0 34px rgba(255,213,89,.58);
}
.chain-banner.fx-tier-8 strong{font-size:23px;color:#fff}

.link-fx.fx-tier-2 strong{font-size:clamp(36px,10.5vw,60px)}
.link-fx.fx-tier-3 strong{font-size:clamp(39px,11vw,63px)}
.link-fx.fx-tier-4 strong{font-size:clamp(42px,11.5vw,66px)}
.link-fx.fx-tier-5 strong{font-size:clamp(45px,12vw,70px)}
.link-fx.fx-tier-6 strong{font-size:clamp(48px,12.5vw,74px)}
.link-fx.fx-tier-7 strong{font-size:clamp(51px,13vw,78px)}
.link-fx.fx-tier-8 strong{
  font-size:clamp(54px,14vw,84px);
  color:#fff9d7;
  text-shadow:
    0 4px 0 #a34c11,
    0 0 18px rgba(255,255,255,.92),
    0 0 38px rgba(255,213,86,.96),
    0 0 60px rgba(255,89,208,.52),
    0 11px 26px rgba(0,0,0,.58);
}
.link-fx.combo-heavy span{
  color:#fff;
  font-size:18px;
  text-shadow:0 0 10px rgba(255,225,102,.85),0 2px 9px #000;
}

.combo-fx{
  position:absolute;
  right:8px;
  top:21%;
  z-index:23;
  min-width:120px;
  padding:8px 11px;
  border-radius:16px;
  background:rgba(8,12,34,.88);
  border:1px solid rgba(255,255,255,.22);
  text-align:center;
  pointer-events:none;
  opacity:0;
  transform:translateX(14px) scale(.9);
}
.combo-fx.show{
  animation:comboPop .78s cubic-bezier(.18,.82,.22,1);
}
.combo-fx strong{
  display:block;
  color:#fff;
  font-size:18px;
  line-height:1;
  text-shadow:0 0 14px rgba(117,226,255,.72);
}
.combo-fx span{
  display:block;
  margin-top:4px;
  color:#bcd2eb;
  font-size:7px;
  font-weight:1000;
  letter-spacing:.12em;
}
.combo-fx.fx-tier-5,
.combo-fx.fx-tier-6{border-color:rgba(219,142,255,.66);box-shadow:0 0 24px rgba(163,97,255,.27)}
.combo-fx.fx-tier-7,
.combo-fx.fx-tier-8{
  border-color:rgba(255,232,117,.82);
  background:linear-gradient(135deg,rgba(77,39,130,.94),rgba(151,55,107,.94));
  box-shadow:0 0 30px rgba(255,202,75,.38);
}
.combo-fx.heavy strong{font-size:20px;color:#fff0a4}

.chain-flash.fx-tier-6.burst,
.chain-flash.fx-tier-7.burst,
.chain-flash.fx-tier-8.burst{
  animation-duration:.52s;
}
.chain-flash.fx-tier-8.burst{
  box-shadow:inset 0 0 80px rgba(255,255,255,.42);
}

.clear-particle.fx-tier-6,
.clear-particle.fx-tier-7,
.clear-particle.fx-tier-8{
  box-shadow:0 0 12px rgba(255,255,255,.96),0 0 24px rgba(255,230,117,.55);
}

.burst-ring{
  position:absolute;
  left:50%;
  top:50%;
  width:var(--ring-size,90%);
  aspect-ratio:1;
  border-radius:50%;
  transform:translate(-50%,-50%) scale(.12);
  border:3px solid rgba(137,232,255,.58);
  box-shadow:0 0 20px rgba(116,218,255,.36),inset 0 0 14px rgba(255,255,255,.16);
  opacity:0;
  animation:burstRing .72s var(--ring-delay,0ms) cubic-bezier(.16,.7,.18,1) forwards;
}
.burst-ring.fx-tier-5{border-color:rgba(214,135,255,.70);box-shadow:0 0 24px rgba(180,103,255,.42)}
.burst-ring.fx-tier-6{border-color:rgba(255,198,101,.78);box-shadow:0 0 28px rgba(255,177,71,.48)}
.burst-ring.fx-tier-7{border-color:rgba(255,239,150,.88);box-shadow:0 0 32px rgba(255,216,91,.58)}
.burst-ring.fx-tier-8{
  border-width:4px;
  border-color:rgba(255,255,255,.94);
  box-shadow:0 0 20px rgba(255,255,255,.82),0 0 38px rgba(255,221,92,.65),0 0 56px rgba(255,92,210,.36);
}

@keyframes comboPop{
  0%{opacity:0;transform:translateX(18px) scale(.76)}
  18%{opacity:1;transform:translateX(-4px) scale(1.08)}
  30%{transform:translateX(0) scale(1)}
  76%{opacity:1}
  100%{opacity:0;transform:translateX(-8px) scale(1.02)}
}
@keyframes burstRing{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.12)}
  18%{opacity:.9}
  100%{opacity:0;transform:translate(-50%,-50%) scale(1.06)}
}
@keyframes stageAuraMax{
  from{opacity:.76;filter:brightness(.98) saturate(1.05)}
  to{opacity:1;filter:brightness(1.18) saturate(1.28)}
}

html[data-hg-motion="reduced"] .board-stage::before,
html[data-hg-motion="reduced"] .board-stage::after,
html[data-hg-motion="reduced"] .combo-fx,
html[data-hg-motion="reduced"] .burst-ring{
  animation:none!important;
  transition:none!important;
}
html[data-hg-motion="reduced"] .combo-fx.show{opacity:1!important;transform:none!important}
html[data-hg-motion="reduced"] .burst-ring{display:none!important}


/* Link Burst pacing + pause 2026-10-11 */
@media(max-width:390px){
  .next-panel{gap:6px!important;padding:0!important}
  .next-box{min-width:48px;padding:5px 4px}
  .pause-btn{width:38px;min-width:38px}
}
@media(max-height:700px){
  .next-panel{gap:5px!important;padding:0!important}
  .next-box{min-width:46px;padding:4px}
  .pause-btn{width:36px;min-width:36px}
}


/* Shared player select + standardized quit 2026-10-11 */
.solo-list{
  display:grid;
  gap:8px;
  padding:12px;
}
.solo-choice{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  min-height:56px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.06);
  color:#fff;
  border-radius:16px;
  padding:11px 12px;
  text-align:left;
  font-weight:1000;
}
.solo-choice.selected{
  background:rgba(86,230,255,.15);
  border-color:#62e7ff;
  box-shadow:0 0 0 2px rgba(86,230,255,.10);
}
.solo-choice span{font-size:28px}
.solo-choice strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:17px;
}
.player-select-actions{margin-top:10px}

.btn.danger{
  background:linear-gradient(180deg,#ff7890,#e54361);
  color:#fff;
  box-shadow:0 5px 0 #9f2940,0 10px 20px rgba(0,0,0,.20);
}
.btn.danger:active{
  box-shadow:0 2px 0 #9f2940,0 5px 12px rgba(0,0,0,.18);
}
.quit-card .stack{gap:9px}


/* One-player roster workflow: compact selection without shared participant counts */
.solo-current-card{
  padding:18px 16px;
  border-color:rgba(98,231,255,.48);
}
.solo-current-caption{
  display:block;
  margin:0 0 2px;
  color:#a9ddec;
  font-size:12px;
  font-weight:900;
}
.solo-current-details{
  display:grid;
  gap:2px;
  min-width:0;
}
.mode-player-card{margin-bottom:12px}
.solo-current-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.solo-current-person{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.solo-current-icon{font-size:40px;line-height:1.15}
.solo-current-person strong{
  min-width:0;
  overflow-wrap:anywhere;
  color:#fff;
  font-size:clamp(19px,5vw,25px);
  line-height:1.3;
}
.solo-change-btn{
  flex:0 0 auto;
  min-width:76px;
  min-height:44px;
  border:1px solid rgba(118,224,255,.78);
  border-radius:13px;
  background:rgba(86,230,255,.16);
  color:#c5f8ff;
  font-weight:1000;
}
.solo-choice small{
  margin-left:auto;
  flex-shrink:0;
  color:#85efff;
  font-size:11px;
}
.solo-hint{
  margin:0;
  color:#d2dbea;
  font-size:12px;
  text-align:center;
  font-weight:800;
}
.solo-register{
  display:grid;
  gap:12px;
  padding:17px;
}
.solo-register-label{
  color:#e6f5ff;
  font-size:14px;
  font-weight:1000;
}
.solo-register input{
  width:100%;
  min-height:50px;
  border:1px solid rgba(255,255,255,.4);
  border-radius:13px;
  background:#fff;
  color:#1e2b43;
  padding:10px 12px;
  font:inherit;
  font-size:17px;
}
.solo-register-icons{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:8px;
}
.solo-icon-choice{
  display:grid;
  place-items:center;
  min-width:0;
  min-height:50px;
  border:1px solid rgba(255,255,255,.25);
  border-radius:12px;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-size:25px;
}
.solo-icon-choice.selected{
  border:2px solid #6feaff;
  background:rgba(86,230,255,.22);
}
.solo-register-error{
  margin:0;
  color:#ffc1ca;
  font-size:12px;
  font-weight:800;
  min-height:0;
}
.solo-register-error:empty{display:none}

/* Clear particles remain enhanced; landing squash is disabled. */
.clear-particle{
  width:10px;
  height:10px;
  margin:-5px 0 0 -5px;
  border-radius:29%;
  box-shadow:inset 0 1px 3px rgba(255,255,255,.6),0 0 7px rgba(255,255,255,.65);
}

/* 2026-10-11: clear top score row + NEXT/PAUSE in the unused right-side rail.
   Keep the board centered with the same 7:13 aspect and preserve touch controls. */
.screen-play{
  --lb-rail-width:clamp(48px,15vw,64px);
  --lb-side-gap:7px;
  --lb-app-padding:10px;
}
.screen-play .play-hud{
  display:block;
  min-width:0;
}
.screen-play .score-panel{
  grid-template-columns:minmax(0,1.85fr) minmax(0,1fr) minmax(0,1fr);
  gap:6px;
}
.screen-play .hud-box{
  min-height:62px;
  padding:7px 6px;
}
.screen-play .hud-box small{
  font-size:clamp(8px,2.3vw,11px);
  line-height:1.05;
}
.screen-play .hud-box strong{
  font-size:clamp(18px,5.2vw,25px);
  font-variant-numeric:tabular-nums;
}
.screen-play .score-box{
  text-align:left;
  padding:7px 10px;
}
.screen-play .score-box strong{
  font-size:clamp(26px,7.5vw,39px);
  letter-spacing:-.035em;
  overflow:hidden;
}
.screen-play .score-box em{font-size:clamp(7px,1.9vw,9px)}
.screen-play .board-frame{
  /* Reserve equal left/right space so the board stays centered, with a right rail.
     Width continues to come from the original 7:13 aspect ratio. */
  height:min(100%,68dvh,calc((100vw - 2 * var(--lb-app-padding) - 2 * (var(--lb-rail-width) + var(--lb-side-gap))) * 1.857142857));
}
.screen-play .next-panel{
  position:absolute;
  top:8px;
  right:0;
  left:auto;
  z-index:35;
  width:var(--lb-rail-width);
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:8px!important;
  padding:0!important;
  background:transparent;
  pointer-events:auto;
}
.screen-play .next-box{
  min-width:0;
  width:100%;
  min-height:54px;
  padding:6px 3px;
  gap:5px;
  border-radius:12px;
}
.screen-play .next-box small{font-size:9px;white-space:nowrap}
.screen-play .next-box > div{max-width:100%;min-width:0}
.screen-play .mini-piece{
  width:min(44px,100%);
  height:21px;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:3px;
}
.screen-play .pause-btn{
  width:100%;
  min-width:0;
  min-height:48px;
  padding:6px 2px;
  border-radius:12px;
}
.screen-play .pause-btn strong{font-size:23px}
.screen-play .pause-btn small{font-size:8px}

@media(max-width:390px){
  .screen-play{--lb-app-padding:8px}
  .screen-play .score-panel{gap:4px}
  .screen-play .score-box{padding:6px 8px}
  .screen-play .hud-box{min-height:56px}
  .screen-play .next-box{min-width:0;min-height:51px;padding:5px 2px}
  .screen-play .next-panel{gap:6px!important;top:5px}
}
@media(max-height:700px){
  .screen-play .board-frame{
    height:min(100%,64dvh,calc((100vw - 2 * var(--lb-app-padding) - 2 * (var(--lb-rail-width) + var(--lb-side-gap))) * 1.857142857));
  }
  .screen-play .hud-box{min-height:48px;padding:5px 6px}
  .screen-play .score-box strong{font-size:clamp(23px,6.8vw,33px)}
  .screen-play .next-box{min-height:45px;gap:2px}
  .screen-play .pause-btn{min-height:42px}
}

/* Play view: no top navigation; use the paused menu for navigation and settings. */
.link-burst-app.screen-play{
  grid-template-rows:auto minmax(0,1fr) auto;
}

/* NEXT: explicitly size the inner wrapper and each block so grid sizing cannot collapse. */
.screen-play .next-box{
  grid-template-columns:minmax(0,1fr);
  justify-items:stretch;
}
.screen-play .next-box small{justify-self:center}
.screen-play .next-box > [data-next-one],
.screen-play .next-box > [data-next-two]{
  display:block;
  width:100%;
  min-width:0;
  max-width:100%;
}
.screen-play .mini-piece{
  width:100%;
  max-width:48px;
  height:24px;
  margin:0 auto;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-template-rows:minmax(0,1fr);
  gap:3px;
}
.screen-play .mini-block{
  display:block;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  border-radius:5px;
}

/* Pause navigation remains scrollable on short screens; settings opens above the pause. */
.pause-card{
  max-height:calc(100dvh - 32px);
  overflow-y:auto;
}
.pause-main-actions{margin-bottom:9px}
.pause-nav-actions{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
}
.pause-nav-actions .btn{
  min-width:0;
  min-height:48px;
  padding:9px 6px;
  font-size:clamp(12px,3.1vw,15px);
  line-height:1.3;
}
.pause-nav-actions .pause-settings-btn{
  grid-column:1 / -1;
}
@media(max-height:700px){
  .screen-play .mini-piece{height:22px}
  .pause-card{padding:15px}
  .pause-card h2{font-size:24px}
  .pause-nav-actions .btn{min-height:44px}
}

/* Landing guide: a faint, static outline at the two eventual resting cells.
   Ghosts never receive touches or alter piece physics. */
.board-cell .block.ghost{
  opacity:.28;
  border:1px dashed rgba(255,255,255,.78);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12);
  filter:saturate(.72);
  pointer-events:none;
}
.board-cell .block.ghost::before{opacity:.3}
.board-cell .block.ghost span{opacity:.72}

/* 2026-10-11: expand the puzzle board and show NEXT as a vertical falling pair.
   Keep the 7x13 playfield and existing touch/action bindings unchanged. */
.link-burst-app.screen-play{
  gap:4px;
  padding-top:max(6px,env(safe-area-inset-top));
  padding-bottom:max(5px,env(safe-area-inset-bottom));
}
.screen-play .board-stage{
  display:grid;
  grid-template-columns:minmax(0,1fr) var(--lb-rail-width);
  grid-template-rows:minmax(0,1fr);
  column-gap:var(--lb-side-gap);
  align-items:start;
  justify-items:center;
  min-height:0;
}
.screen-play .board-frame{
  grid-column:1;
  grid-row:1;
  align-self:start;
  justify-self:center;
  /* Fill the stage vertically, limited only by the full left-hand column width. */
  height:min(100%,calc((100vw - 2 * var(--lb-app-padding) - var(--lb-rail-width) - var(--lb-side-gap)) * 1.857142857));
  max-width:100%;
  aspect-ratio:7/13;
}
.screen-play .next-panel{
  position:relative;
  grid-column:2;
  grid-row:1;
  top:auto;
  right:auto;
  left:auto;
  align-self:start;
  justify-self:stretch;
  z-index:35;
  width:100%;
  min-width:0;
  gap:8px!important;
}
.screen-play .next-box{
  min-height:0;
  padding:7px 4px 8px;
  gap:5px;
}
.screen-play .mini-piece{
  width:30px;
  max-width:100%;
  height:63px;
  margin:auto;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:repeat(2,minmax(0,1fr));
  gap:3px;
}
.screen-play .mini-block.p0{grid-column:1;grid-row:1}
.screen-play .mini-block.p1{grid-column:1;grid-row:2}
.screen-play .pause-btn{
  min-height:52px;
  margin-top:2px;
}
.screen-play .hud-box{min-height:57px;padding:5px 6px}
.screen-play .score-box{padding:5px 9px}
.screen-play .controls{
  grid-template-rows:repeat(2,46px);
  row-gap:5px;
}
.screen-play .control-btn{height:46px;min-height:46px}
/* The center of combo text follows the board rather than the sidebar. */
.screen-play .chain-banner,
.screen-play .combo-fx,
.screen-play .link-fx,
.screen-play .score-pop,
.screen-play .play-tip{
  left:calc(50% - (var(--lb-rail-width) + var(--lb-side-gap)) / 2);
}
@media(max-width:390px){
  .screen-play .mini-piece{width:28px;height:59px}
  .screen-play .next-box{padding:6px 3px 7px}
  .screen-play .controls{grid-template-rows:repeat(2,45px);row-gap:4px}
  .screen-play .control-btn{height:45px;min-height:45px}
}
@media(max-height:700px){
  .screen-play .board-frame{
    height:min(100%,calc((100vw - 2 * var(--lb-app-padding) - var(--lb-rail-width) - var(--lb-side-gap)) * 1.857142857));
  }
  .screen-play .mini-piece{width:25px;height:53px}
  .screen-play .next-box{padding:5px 3px 6px}
  .screen-play .next-panel{gap:5px!important}
  .screen-play .pause-btn{min-height:45px}
  .screen-play .hud-box{min-height:48px}
  .screen-play .controls{grid-template-rows:repeat(2,44px);row-gap:4px}
  .screen-play .control-btn{height:44px;min-height:44px}
}
@media(min-width:720px){
  .screen-play .board-stage{width:min(100%,640px);margin-inline:auto}
  .screen-play .board-frame{
    height:min(100%,calc((640px - var(--lb-rail-width) - var(--lb-side-gap)) * 1.857142857));
  }
}

/* Pre-game countdown: no gameplay input or clock until START completes. */
.lb-countdown-overlay{
  position:fixed;
  inset:0;
  z-index:8500;
  display:grid;
  align-content:center;
  justify-items:center;
  gap:10px;
  padding:24px;
  background:rgba(4,9,30,.76);
  -webkit-backdrop-filter:blur(5px);
  backdrop-filter:blur(5px);
  pointer-events:auto;
  text-align:center;
}
.lb-countdown-overlay span{
  font-size:clamp(13px,3vw,17px);
  font-weight:1000;
  letter-spacing:.22em;
  color:#b7eaff;
  text-shadow:0 3px 12px rgba(0,0,0,.6);
}
.lb-countdown-number{
  display:block;
  color:#fff;
  font-size:clamp(104px,32vw,170px);
  line-height:1.1;
  font-weight:1000;
  font-variant-numeric:tabular-nums;
  text-shadow:0 5px 0 #336bc1,0 0 34px rgba(82,227,255,.64),0 12px 24px rgba(0,0,0,.42);
}
.lb-countdown-number.go{
  font-size:clamp(48px,16vw,94px);
  color:#fff08c;
  text-shadow:0 4px 0 #cf7532,0 0 35px rgba(255,218,101,.62),0 12px 24px rgba(0,0,0,.42);
}
.lb-countdown-number.pulse{
  animation:lbCountdownPop .38s cubic-bezier(.18,1,.3,1) both;
}
@keyframes lbCountdownPop{
  0%{opacity:.25;transform:scale(.65)}
  60%{opacity:1;transform:scale(1.12)}
  100%{opacity:1;transform:scale(1)}
}
html[data-hg-motion="reduced"] .lb-countdown-number.pulse{
  animation:none!important;
}
@media(prefers-reduced-motion:reduce){
  .lb-countdown-number.pulse{animation:none}
}

/* NEXT uses the same marks as the falling blocks; PAUSE sits one button-space lower. */
.screen-play .mini-block{
  display:grid;
  place-items:center;
  font-style:normal;
}
.screen-play .mini-block span{
  display:block;
  font-size:clamp(12px,3.1vw,16px);
  font-weight:1000;
  line-height:1;
  color:rgba(255,255,255,.9);
  text-shadow:0 1px 3px rgba(0,0,0,.32);
}
.screen-play .pause-btn{
  margin-top:44px;
}
@media(max-width:390px){
  .screen-play .pause-btn{margin-top:46px}
}
@media(max-height:700px){
  .screen-play .pause-btn{margin-top:40px}
}

/* Play HUD: center the score inside its own panel. Keep SCORE/BEST visible. */
.screen-play .score-box{
  text-align:center;
  justify-items:center;
  align-content:center;
}
.screen-play .score-box strong{
  justify-self:center;
  max-width:100%;
  font-size:clamp(24px,6.3vw,38px);
  line-height:1.04;
  letter-spacing:-.04em;
}
.screen-play .score-box em{justify-self:center}

/* New visual-only LINK tiers: 3 LINK is celebratory; 5+ LINK is a bigger hit.
   Ordinary placements and 1–2 LINK retain their current calm effects. */
.link-fx.fx-link-3.show{
  animation:lbLinkBurst3 var(--link-duration,.9s) cubic-bezier(.17,.8,.25,1);
}
.link-fx.fx-link-5.show{
  animation:lbLinkBurst5 var(--link-duration,.9s) cubic-bezier(.16,.78,.2,1);
}
.link-fx.fx-link-3 strong{
  color:#f5eaff;
  text-shadow:0 4px 0 #6044b7,0 0 18px rgba(255,255,255,.84),0 0 36px rgba(177,128,255,.9),0 10px 24px rgba(0,0,0,.54);
}
.link-fx.fx-link-5 strong{
  color:#fff3a4;
  text-shadow:0 4px 0 #bb661e,0 0 18px rgba(255,255,255,.96),0 0 38px rgba(255,211,79,.95),0 0 52px rgba(255,114,208,.62),0 10px 24px rgba(0,0,0,.54);
}
.board-stage.chain-stage.fx-tier-3::before,
.board-stage.chain-stage.fx-tier-4::before{
  box-shadow:inset 0 0 28px rgba(145,126,255,.16),0 0 34px rgba(156,127,255,.16);
}
@keyframes lbLinkBurst3{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.46)}
  16%{opacity:1;transform:translate(-50%,-50%) scale(1.2)}
  27%{transform:translate(-50%,-50%) scale(.98)}
  78%{opacity:1}
  100%{opacity:0;transform:translate(-50%,-59%) scale(1.07)}
}
@keyframes lbLinkBurst5{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.36)}
  13%{opacity:1;transform:translate(-50%,-50%) scale(1.33)}
  24%{transform:translate(-50%,-50%) scale(.96)}
  36%{transform:translate(-50%,-50%) scale(1.07)}
  78%{opacity:1}
  100%{opacity:0;transform:translate(-50%,-60%) scale(1.10)}
}

/* 10,000-point milestones get a brief gold score-border pulse and a banner
   below the regular LINK announcement, without delaying the game. */
.screen-play .score-box.milestone-hit{
  border-color:rgba(255,234,142,.96);
  animation:lbScoreMilestoneGlow 1.4s ease-out both;
}
@keyframes lbScoreMilestoneGlow{
  0%{box-shadow:0 0 0 0 rgba(255,216,75,.18)}
  19%{box-shadow:0 0 0 3px rgba(255,230,112,.62),0 0 24px rgba(255,205,65,.68)}
  60%{box-shadow:0 0 0 2px rgba(255,230,112,.4),0 0 17px rgba(255,205,65,.36)}
  100%{box-shadow:0 0 0 0 rgba(255,216,75,0)}
}
.score-milestone{
  position:absolute;
  z-index:24;
  left:calc(50% - (var(--lb-rail-width) + var(--lb-side-gap))/2);
  top:68%;
  width:min(310px,83vw);
  padding:12px 13px 10px;
  text-align:center;
  border-radius:18px;
  border:2px solid rgba(255,237,135,.9);
  background:linear-gradient(135deg,rgba(68,33,122,.95),rgba(190,92,70,.94));
  box-shadow:0 0 24px rgba(255,194,63,.45),0 8px 18px rgba(0,0,0,.45);
  opacity:0;
  transform:translate(-50%,-50%) scale(.78);
  pointer-events:none;
}
.score-milestone strong{
  display:block;
  font-size:clamp(25px,7vw,37px);
  line-height:1.08;
  color:#fff3a2;
  text-shadow:0 2px 0 rgba(125,57,15,.9),0 0 15px rgba(255,212,73,.9);
  white-space:nowrap;
}
.score-milestone small{
  display:block;
  margin-top:4px;
  font-size:10px;
  font-weight:1000;
  letter-spacing:.12em;
  color:#f5eaff;
}
.score-milestone.show{
  animation:lbScoreMilestoneBanner 1.45s cubic-bezier(.17,.82,.26,1) both;
}
@keyframes lbScoreMilestoneBanner{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.68)}
  18%{opacity:1;transform:translate(-50%,-50%) scale(1.08)}
  32%{transform:translate(-50%,-50%) scale(1)}
  76%{opacity:1}
  100%{opacity:0;transform:translate(-50%,-62%) scale(1)}
}
html[data-hg-motion="reduced"] .link-fx.fx-link-3.show,
html[data-hg-motion="reduced"] .link-fx.fx-link-5.show,
html[data-hg-motion="reduced"] .score-box.milestone-hit,
html[data-hg-motion="reduced"] .score-milestone.show{
  animation:none!important;
}
html[data-hg-motion="reduced"] .score-box.milestone-hit{
  box-shadow:none;
  border-color:rgba(255,255,255,.16);
}
html[data-hg-motion="reduced"] .score-milestone.show{
  opacity:1;
  transform:translate(-50%,-50%);
}
@media(prefers-reduced-motion:reduce){
  .link-fx.fx-link-3.show,
  .link-fx.fx-link-5.show,
  .score-box.milestone-hit,
  .score-milestone.show{animation:none!important}
  .score-milestone.show{opacity:1;transform:translate(-50%,-50%)}
}

/* Compact HUD / free vertical room for the playfield (2026-10-11) */
/* The score itself remains centered. Put SCORE and BEST on one small header
   line to avoid an oversized three-row HUD. No board cell size/rule changes. */
.link-burst-app.screen-play{
  gap:3px;
}
.screen-play{
  --lb-rail-width:clamp(48px,14vw,60px);
}
.screen-play .play-hud{
  margin:0;
}
.screen-play .score-panel{
  align-items:stretch;
}
.screen-play .hud-box{
  height:48px;
  min-height:0;
  padding:4px 5px;
  align-content:center;
  border-radius:12px;
}
.screen-play .hud-box small{
  font-size:clamp(9px,2.45vw,10px);
  line-height:1;
}
.screen-play .hud-box strong{
  margin-top:2px;
  font-size:clamp(18px,5vw,23px);
  line-height:1;
}
.screen-play .score-box{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-rows:11px minmax(0,1fr);
  align-content:center;
  align-items:center;
  justify-items:stretch;
  padding:4px 7px;
  text-align:center;
}
.screen-play .score-box small{
  grid-column:1;
  grid-row:1;
  justify-self:start;
}
.screen-play .score-box em{
  grid-column:2;
  grid-row:1;
  justify-self:end;
  margin:0;
  font-size:clamp(7px,1.9vw,9px);
  line-height:1;
  white-space:nowrap;
}
.screen-play .score-box strong{
  grid-column:1 / -1;
  grid-row:2;
  justify-self:center;
  margin:0;
  max-width:100%;
  font-size:clamp(22px,6vw,30px);
  line-height:1;
  font-variant-numeric:tabular-nums;
}
/* Let the existing 7:13 board fill the taller middle grid row naturally.
   Do not stretch the 7x13 cells or overrule the height/width constraints. */
@media(max-width:390px){
  .screen-play .hud-box{
    height:45px;
    min-height:0;
    padding:3px 4px;
  }
  .screen-play .score-box{padding:3px 6px}
}
@media(max-height:700px){
  .screen-play .hud-box{
    height:42px;
    min-height:0;
    padding:3px 4px;
  }
  .screen-play .score-box{padding:3px 6px}
  .screen-play .score-box strong{font-size:clamp(20px,5.5vw,27px)}
}

/* Link Burst / console-style controller pad / 2026-10-11 */
/* Presentation only: leave all four data-control bindings and key repeat untouched.
   Dark brushed chassis / illuminated face buttons / 2-row rotary action button. */
.screen-play .controls{
  width:min(430px,100%);
  max-width:100%;
  margin:0 auto;
  padding:7px;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,.94fr);
  grid-template-rows:repeat(2,47px);
  gap:6px;
  border:1px solid rgba(164,190,240,.28);
  border-radius:20px;
  background:
    linear-gradient(160deg,rgba(40,56,88,.95),rgba(13,20,40,.94) 56%,rgba(7,13,29,.94)),
    repeating-linear-gradient(90deg,rgba(255,255,255,.025) 0 1px,transparent 1px 6px);
  box-shadow:
    0 7px 18px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(225,239,255,.20),
    inset 0 -2px 5px rgba(0,0,0,.38);
  -webkit-backdrop-filter:blur(5px);
  backdrop-filter:blur(5px);
  touch-action:manipulation;
}
.screen-play .control-btn{
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  padding:3px 4px 2px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1px;
  border-radius:12px;
  border:1px solid rgba(128,194,245,.48);
  background:linear-gradient(158deg,#364b70 0%,#243653 38%,#121e36 100%);
  color:#e6f7ff;
  font-size:clamp(24px,7vw,32px);
  font-weight:900;
  line-height:1;
  text-shadow:0 0 12px rgba(96,206,255,.30);
  box-shadow:
    0 3px 0 #090f22,
    0 5px 10px rgba(0,0,0,.28),
    inset 0 2px 0 rgba(230,248,255,.16),
    inset 0 -2px 6px rgba(3,11,28,.55);
  transition:transform .08s ease,box-shadow .08s ease,border-color .08s ease;
  user-select:none;
  -webkit-user-select:none;
  touch-action:none;
}
.screen-play .control-btn::after{
  display:block;
  font-size:9px;
  line-height:1;
  font-weight:900;
  letter-spacing:.13em;
  color:rgba(171,218,255,.82);
  text-shadow:none;
}
.screen-play .control-btn[data-control="left"]{
  grid-column:1;
  grid-row:1;
}
.screen-play .control-btn[data-control="left"]::after{content:"LEFT"}
.screen-play .control-btn[data-control="right"]{
  grid-column:2;
  grid-row:1;
}
.screen-play .control-btn[data-control="right"]::after{content:"RIGHT"}
.screen-play .control-btn[data-control="down"]{
  grid-column:1 / 3;
  grid-row:2;
  background:linear-gradient(158deg,#254d68,#183a56 44%,#10243d);
  border-color:rgba(90,220,243,.65);
  color:#c2f5ff;
  font-size:clamp(26px,7.8vw,34px);
}
.screen-play .control-btn[data-control="down"]::after{
  content:"DROP";
  color:rgba(148,235,249,.88);
}
.screen-play .control-btn[data-control="rotate"]{
  grid-column:3;
  grid-row:1 / 3;
  font-size:clamp(38px,11vw,52px);
  gap:5px;
  background:linear-gradient(150deg,#6656ac 0%,#3b307d 50%,#211e50 100%);
  border-color:rgba(192,168,255,.70);
  color:#f4edff;
  text-shadow:0 0 16px rgba(204,153,255,.56);
  box-shadow:
    0 3px 0 #171239,
    0 5px 12px rgba(0,0,0,.32),
    inset 0 2px 0 rgba(255,255,255,.23),
    inset 0 -3px 7px rgba(13,10,43,.58);
}
.screen-play .control-btn[data-control="rotate"]::after{
  content:"ROTATE";
  font-size:10px;
  letter-spacing:.11em;
  color:#e4d8ff;
}
.screen-play .control-btn:active,
.screen-play .control-btn.pressed{
  transform:translateY(3px);
  border-color:rgba(184,242,255,.88);
  box-shadow:0 1px 0 #070d1e,inset 0 2px 7px rgba(4,11,27,.38);
}
.screen-play .control-btn[data-control="rotate"]:active,
.screen-play .control-btn[data-control="rotate"].pressed{
  border-color:#eee0ff;
  box-shadow:0 1px 0 #171239,inset 0 2px 8px rgba(24,16,63,.48);
}
.screen-play .control-btn:focus-visible{
  outline:2px solid #9ae8ff;
  outline-offset:2px;
}
@media(hover:hover) and (pointer:fine){
  .screen-play .control-btn:hover{border-color:rgba(183,232,255,.83)}
  .screen-play .control-btn[data-control="rotate"]:hover{border-color:#d8c7ff}
}
@media(max-width:390px){
  .screen-play .controls{
    padding:6px;
    gap:5px;
    grid-template-rows:repeat(2,45px);
    border-radius:18px;
  }
  .screen-play .control-btn{border-radius:11px}
}
@media(max-height:700px){
  .screen-play .controls{
    padding:5px;
    gap:5px;
    grid-template-rows:repeat(2,44px);
  }
  .screen-play .control-btn::after{font-size:8px}
  .screen-play .control-btn[data-control="rotate"]::after{font-size:9px}
}
@media(prefers-reduced-motion:reduce){
  .screen-play .control-btn{transition:none}
}
/* Link Burst solo V-final: board-preserving arcade finish */
/* The final board, HUD and NEXT remain on the existing play screen. */
.link-burst-app.lb-game-finished .controls{filter:saturate(.48) brightness(.62);pointer-events:none}
.link-burst-app.lb-game-finished .pause-btn{opacity:.42;pointer-events:none}
.lb-solo-finale{
  position:fixed;inset:0;z-index:58;pointer-events:none;overflow:hidden;
  isolation:isolate;color:#fff;
}
.lb-finale-flash{
  position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(ellipse at 50% 45%,rgba(255,248,201,.6),rgba(255,211,101,.2) 35%,transparent 78%);
  animation:lb-final-flash .85s ease-out both;
}
.lb-finale-ring{
  position:absolute;left:50%;top:42%;
  width:min(85vw,520px);aspect-ratio:1;border-radius:50%;
  border:6px solid rgba(255,236,132,.73);
  box-shadow:0 0 22px #ffcf70,0 0 64px rgba(255,232,113,.45),inset 0 0 35px #ffe38a;
  animation:lb-final-ring 1.15s cubic-bezier(.12,.68,.3,1) both;
}
.lb-finale-sparks{position:absolute;inset:0;pointer-events:none}
.lb-finale-sparks i{
  position:absolute;left:var(--sx);top:var(--sy);width:9px;height:9px;
  background:#fff8bf;transform:rotate(45deg);
  box-shadow:0 0 0 2px rgba(255,212,110,.25),0 0 19px 4px rgba(255,215,102,.68);
  animation:lb-final-spark 1.55s var(--sd) ease-out both;
}
.lb-finale-head{
  position:absolute;left:50%;top:40%;
  width:min(94vw,690px);min-height:120px;
  transform:translate(-50%,-50%);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:5px;padding:16px 15px 18px;text-align:center;
  border-block:2px solid rgba(255,235,136,.83);
  background:linear-gradient(90deg,transparent,rgba(5,17,43,.88) 14%,rgba(17,28,57,.91) 82%,transparent);
  box-shadow:0 0 38px rgba(255,212,91,.23);
  animation:lb-final-head .68s cubic-bezier(.12,.8,.3,1.2) both;
}
.lb-finale-head small{
  font-size:clamp(9px,1.8vw,12px);font-weight:1000;
  letter-spacing:.25em;color:#99e9ff;
}
.lb-finale-head strong{
  display:block;max-width:100%;
  font-family:system-ui,"Arial Black",sans-serif;
  font-weight:1000;font-style:italic;letter-spacing:-.055em;line-height:1;
  font-size:clamp(41px,11vw,94px);
  color:#fff8db;
  -webkit-text-stroke:1px rgba(125,76,29,.5);
  text-shadow:3px 4px 0 #573471,0 0 10px #ffe478,0 0 36px rgba(255,196,73,.82);
}
.lb-finale-head span{
  display:inline-block;padding:3px 12px;
  border-radius:100px;background:rgba(255,221,106,.15);
  color:#ffe394;font-size:clamp(12px,2vw,18px);
  letter-spacing:.09em;font-weight:1000;
}
.lb-finale-actions{
  position:absolute;left:50%;bottom:max(6px,env(safe-area-inset-bottom));
  transform:translateX(-50%);
  width:min(94vw,440px);max-height:min(56dvh,410px);
  padding:12px;display:grid;gap:9px;
  border:1px solid rgba(255,227,124,.7);
  border-radius:19px;
  background:linear-gradient(155deg,rgba(35,55,91,.97),rgba(8,18,43,.98) 75%);
  box-shadow:0 0 24px rgba(255,209,103,.28),0 16px 32px rgba(0,0,0,.53),inset 0 1px 0 rgba(255,255,255,.18);
  overflow-y:auto;overscroll-behavior:contain;
  pointer-events:auto;
  animation:lb-final-actions .44s cubic-bezier(.18,.83,.27,1) both;
}
.lb-finale-score{display:grid;justify-items:center;gap:1px;text-align:center}
.lb-finale-score small{font-size:10px;font-weight:1000;letter-spacing:.22em;color:#a9e8ff}
.lb-finale-score strong{
  font-size:clamp(31px,6.5vw,46px);line-height:1.08;font-variant-numeric:tabular-nums;
  color:#fff5ce;text-shadow:0 0 16px rgba(255,210,93,.4);
}
.lb-finale-score span{font-size:clamp(9px,1.8vw,12px);font-weight:900;color:#c8d9f3}
.lb-finale-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.lb-finale-buttons button{
  min-width:0;min-height:48px;padding:8px 6px;border-radius:12px;
  border:1px solid rgba(190,233,255,.8);
  background:linear-gradient(160deg,#a3f2ff,#50b5ed 75%,#247da8);
  color:#102341;font-size:clamp(12px,2.7vw,15px);font-weight:1000;
  box-shadow:0 3px 0 #135d8c,inset 0 1px 0 rgba(255,255,255,.64);
}
.lb-finale-buttons button:first-child{
  background:linear-gradient(165deg,#fff4aa,#ffc363 80%,#db8d2a);
  border-color:#ffecc0;box-shadow:0 3px 0 #a95d2c,inset 0 1px 0 #fff6d1;
}
.lb-finale-links{display:flex;justify-content:center;flex-wrap:wrap;gap:8px}
.lb-finale-links button{
  min-height:35px;border:1px solid rgba(167,194,241,.46);
  border-radius:10px;background:rgba(23,40,75,.78);
  color:#e0ebff;font-size:11px;font-weight:900;padding:6px 10px;
}
.lb-finale-actions button:active{transform:translateY(2px);box-shadow:inset 0 1px 3px rgba(0,0,0,.2)}
.lb-finale-actions button:focus-visible{outline:3px solid #fff0a5;outline-offset:2px}
@keyframes lb-final-flash{
  0%{opacity:0}17%{opacity:.8}100%{opacity:0}
}
@keyframes lb-final-ring{
  0%{transform:translate(-50%,-50%) scale(.2);opacity:0}
  24%{opacity:.95}
  100%{transform:translate(-50%,-50%) scale(1.65);opacity:0}
}
@keyframes lb-final-spark{
  0%{opacity:0;transform:rotate(45deg) scale(.3) translateY(0)}
  27%{opacity:1}
  100%{opacity:0;transform:rotate(115deg) scale(.35) translateY(-75px)}
}
@keyframes lb-final-head{
  0%{opacity:0;transform:translate(-50%,-38%) scale(1.45);filter:brightness(2)}
  65%{opacity:1;transform:translate(-50%,-50%) scale(.97);filter:brightness(1.3)}
  100%{opacity:1;transform:translate(-50%,-50%) scale(1);filter:brightness(1)}
}
@keyframes lb-final-actions{
  0%{opacity:0;transform:translate(-50%,22px) scale(.94)}
  100%{opacity:1;transform:translate(-50%,0) scale(1)}
}
@media(max-height:700px){
  .lb-finale-head{top:34%;min-height:91px;padding:10px 12px}
  .lb-finale-head strong{font-size:clamp(32px,8vh,65px)}
  .lb-finale-actions{max-height:60dvh;padding:9px;gap:6px}
  .lb-finale-score strong{font-size:28px}
  .lb-finale-buttons button{min-height:43px}
}
@media(orientation:landscape) and (max-height:430px){
  .lb-finale-head{left:34%;top:42%;width:55vw}
  .lb-finale-actions{left:auto;right:8px;bottom:8px;transform:none;width:min(42vw,310px);max-height:calc(100dvh - 16px)}
  @keyframes lb-final-landscape-actions{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
  .lb-finale-actions{animation:lb-final-landscape-actions .35s ease-out both}
}
@media(prefers-reduced-motion:reduce){
  .lb-finale-head,.lb-finale-actions{animation:none}
  .lb-finale-flash,.lb-finale-ring,.lb-finale-sparks{display:none}
}
html[data-hg-motion="reduced"] .lb-finale-head,
html[data-hg-motion="reduced"] .lb-finale-actions{animation:none}
html[data-hg-motion="reduced"] .lb-finale-flash,
html[data-hg-motion="reduced"] .lb-finale-ring,
html[data-hg-motion="reduced"] .lb-finale-sparks{display:none}


/* Link Burst rankings: mode-scoped record editing */
.screen-ranking .ranking-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}
.screen-ranking .ranking-head>strong{
  min-width:0;
  font-size:clamp(15px,4vw,19px);
  line-height:1.35;
  font-weight:1000;
}
.screen-ranking .rank-edit-toggle{
  flex:0 0 92px;
  width:92px;
  min-width:92px;
  min-height:60px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  padding:7px 8px;
  border:1px solid rgba(106,216,255,.53);
  border-radius:13px;
  background:rgba(42,90,141,.28);
  color:#e5f7ff;
  font:inherit;
  font-size:14px;
  font-weight:1000;
  line-height:1.2;
  text-align:center;
}
.screen-ranking .rank-edit-toggle span{
  display:block;
  white-space:nowrap;
  overflow-wrap:normal;
  word-break:keep-all;
}
.screen-ranking .rank-edit-toggle:focus-visible,
.screen-ranking .rank-delete:focus-visible,
.screen-ranking .rank-clear:focus-visible{
  outline:3px solid #ffed8b;
  outline-offset:2px;
}
.screen-ranking .ranking-row.is-editing{
  grid-template-columns:35px minmax(0,1fr) auto auto;
  gap:6px;
}
.screen-ranking .rank-delete{
  min-width:48px;
  min-height:40px;
  padding:7px 8px;
  border:1px solid rgba(255,145,160,.58);
  border-radius:10px;
  background:rgba(155,39,63,.26);
  color:#ffdbdf;
  font:inherit;
  font-size:12px;
  font-weight:1000;
}
.screen-ranking .rank-clear{
  display:block;
  width:100%;
  margin:0 0 10px;
  min-height:47px;
  border:1px solid rgba(245,137,157,.54);
  background:rgba(162,46,71,.30);
  color:#ffe3e9;
}
@media(max-width:450px){
  .screen-ranking .ranking-row.is-editing{
    grid-template-columns:35px minmax(0,1fr) auto;
  }
  .screen-ranking .ranking-row.is-editing .rank-delete{
    grid-column:2/-1;
    width:100%;
    min-height:39px;
  }
}
@media(max-width:350px){
  .screen-ranking .ranking-head>strong{font-size:14px}
  .screen-ranking .rank-edit-toggle{flex-basis:84px;width:84px;min-width:84px;font-size:13px}
}

/* Link Burst score revision: preserve and label historical rankings */
.screen-ranking .ranking-rule-note{
  margin:11px 2px 2px;
  color:#afc4e6;
  font-size:11px;
  font-weight:750;
  line-height:1.5;
  text-align:center;
}
.screen-ranking .rank-score small{white-space:normal;line-height:1.25}



/* Link Burst solo controller accessibility layout (2026-10-14).
   Three narrow HUD cards use the unused LEFT rail, the original 7x13 board
   remains a fixed-aspect box in the CENTER, NEXT/PAUSE stay in the RIGHT rail.
   Only UI placement is changed: data hooks and game mechanics are unchanged. */
.link-burst-app.screen-play{
  --lb-stat-rail:clamp(47px,14vw,67px);
  --lb-rail-width:clamp(43px,12.5vw,57px);
  --lb-side-gap:4px;
  --lb-stage-board-offset:8px;
  grid-template-rows:minmax(0,1fr) auto;
  gap:4px;
}
.screen-play .board-stage{
  width:min(100%,640px);
  margin-inline:auto;
  display:grid;
  grid-template-columns:var(--lb-stat-rail) minmax(0,1fr) var(--lb-rail-width);
  grid-template-rows:minmax(0,1fr);
  gap:var(--lb-side-gap);
  align-items:start;
  min-width:0;
  min-height:0;
}
.screen-play .board-stage > .play-hud{
  position:relative;
  grid-column:1;
  grid-row:1;
  align-self:start;
  justify-self:stretch;
  z-index:4;
  display:block;
  width:100%;
  min-width:0;
  margin:0;
}
.screen-play .board-stage .score-panel{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-auto-rows:minmax(61px,auto);
  gap:8px;
  width:100%;
  min-width:0;
}
.screen-play .board-stage .hud-box{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  min-width:0;
  min-height:61px;
  height:auto;
  gap:5px;
  padding:7px 2px;
  border-radius:12px;
  text-align:center;
}
.screen-play .board-stage .hud-box small{
  max-width:100%;
  white-space:normal;
  font-size:clamp(8px,2vw,10px);
  line-height:1.16;
}
.screen-play .board-stage .hud-box strong{
  display:block;
  margin:0;
  font-size:clamp(19px,5vw,26px);
  line-height:1.05;
  max-width:100%;
  overflow-wrap:anywhere;
  font-variant-numeric:tabular-nums;
}
.screen-play .board-stage .score-box{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:8px 2px;
}
.screen-play .board-stage .score-box small,
.screen-play .board-stage .score-box strong,
.screen-play .board-stage .score-box em{
  display:block;
  margin:0;
  text-align:center;
  max-width:100%;
}
.screen-play .board-stage .score-box strong{
  font-size:clamp(14px,4vw,21px);
  letter-spacing:-.035em;
  line-height:1.1;
  overflow-wrap:anywhere;
}
.screen-play .board-stage .score-box em{
  font-size:clamp(8px,1.95vw,10px);
  line-height:1.2;
  font-style:normal;
  white-space:normal;
  overflow-wrap:anywhere;
}
.screen-play .board-stage > .board-frame{
  grid-column:2;
  grid-row:1;
  align-self:start;
  justify-self:center;
  max-width:100%;
  /* The taller control console reuses the freed 48px HUD row. The small
     offset keeps the board near its former physical dimensions. */
  height:min(
    max(0px,calc(100% - var(--lb-stage-board-offset))),
    calc((100vw - 2 * var(--lb-app-padding) - var(--lb-stat-rail) - var(--lb-rail-width) - 2 * var(--lb-side-gap)) * 1.857142857)
  );
  aspect-ratio:7 / 13;
}
.screen-play .board-stage > .next-panel{
  grid-column:3;
  grid-row:1;
  align-self:start;
  justify-self:stretch;
  width:100%;
  max-width:100%;
  min-width:0;
  margin:0;
  top:auto;
  right:auto;
  left:auto;
  gap:8px!important;
}
.screen-play .board-stage .pause-btn{
  min-height:clamp(65px,10dvh,90px);
  width:100%;
  margin-top:clamp(12px,4dvh,34px);
  padding:8px 2px;
}
.screen-play .board-stage .pause-btn strong{font-size:clamp(28px,6vw,37px)}
.screen-play .board-stage .pause-btn small{font-size:clamp(8px,2vw,11px)}
/* Keep combat captions and score effects centered over the shifted FIELD,
   not between the three new columns. */
.screen-play .board-stage :is(.chain-banner,.combo-fx,.link-fx,.score-pop,.play-tip){
  left:calc(50% + (var(--lb-stat-rail) - var(--lb-rail-width))/2);
}
.screen-play .controls{
  grid-template-rows:repeat(2,67px);
  width:min(430px,100%);
  margin:0 auto;
  flex:none;
}
.screen-play .controls .control-btn{
  height:100%;
  min-height:0;
}
@media(max-width:390px){
  .link-burst-app.screen-play{
    --lb-stage-board-offset:5px;
  }
  .screen-play .controls{grid-template-rows:repeat(2,65px)}
  .screen-play .board-stage .score-panel{gap:6px;grid-auto-rows:minmax(56px,auto)}
  .screen-play .board-stage .hud-box{min-height:56px;padding:5px 2px}
  .screen-play .board-stage .next-panel{gap:6px!important}
}
@media(max-height:700px){
  .link-burst-app.screen-play{--lb-stage-board-offset:0px}
  .screen-play .controls{grid-template-rows:repeat(2,65px)}
  .screen-play .board-stage .score-panel{gap:5px;grid-auto-rows:minmax(52px,auto)}
  .screen-play .board-stage .hud-box{min-height:52px;padding:5px 2px}
  .screen-play .board-stage .pause-btn{
    min-height:60px;
    margin-top:12px;
  }
}
@media(max-height:580px){
  .link-burst-app.screen-play{--lb-stage-board-offset:24px}
  .screen-play .board-stage .score-panel{grid-auto-rows:minmax(46px,auto);gap:4px}
  .screen-play .board-stage .hud-box{min-height:46px;padding:4px 2px}
  .screen-play .controls{grid-template-rows:repeat(2,53px);gap:5px;padding:5px}
  .screen-play .board-stage .pause-btn{min-height:52px;margin-top:5px}
}


/* Link Burst rule guide: tabs share the single official rules screen. */
.rules-tabs{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin:0 0 12px;
}
.rules-tab{
  min-width:0;
  min-height:54px;
  padding:10px 7px;
  border:2px solid rgba(171,197,242,.45);
  border-radius:15px;
  color:#e2eafa;
  background:rgba(13,25,52,.86);
  font-size:clamp(14px,4vw,19px);
  font-weight:1000;
  box-shadow:0 3px 0 rgba(0,0,0,.35);
}
.rules-tab.selected{
  color:#0a2341;
  border-color:#f5faff;
  background:linear-gradient(180deg,#fff59e,#ffc542);
  box-shadow:0 4px 0 #aa782c;
}
.rules-tab:focus-visible{outline:3px solid #b4edff;outline-offset:2px}
.rule-card p+p{margin-top:9px}

/* Recover playfield width lost when the upper HUD was moved into a LEFT rail.
   Fit the SAME 7:13 board between narrower but independent HUD / NEXT rails. */
.link-burst-app.screen-play{
  --lb-stat-rail:clamp(42px,12vw,56px);
  --lb-rail-width:clamp(42px,11.5vw,53px);
  --lb-side-gap:3px;
  --lb-app-padding:5px;
  padding-left:var(--lb-app-padding);
  padding-right:var(--lb-app-padding);
}
.screen-play .board-stage .hud-box small{font-size:clamp(8px,1.9vw,10px)}
.screen-play .board-stage .score-box em{font-size:clamp(8px,1.8vw,10px)}
.screen-play .board-stage > .board-frame{
  /* Height continues to follow the fixed ratio. No scaling or cropping. */
  max-width:100%;
  aspect-ratio:7 / 13;
}

/* Solo controls: keep all buttons INSIDE the decorated controller frame.
   Restore a strict two-row grid; allocate 1.30 of the former first-row
   height to ←/→ and 0.70 to DROP. ROTATE spans both rows.
   No negative top offset, no absolute overlap with board on desktop. */
.link-burst-app.screen-play{
  --lb-key-row:67px;
}
.screen-play .controls{
  grid-template-rows:calc(var(--lb-key-row) * 1.3) calc(var(--lb-key-row) * .7);
  margin:0 auto;
  position:relative;
  z-index:4;
}
.screen-play .controls .control-btn[data-control="left"],
.screen-play .controls .control-btn[data-control="right"]{
  position:static;
  height:100%;
  min-height:0;
}
.screen-play .controls .control-btn[data-control="rotate"]{
  grid-row:1 / 3;
  position:static;
  height:100%;
  min-height:0;
}
@media(max-width:390px){.link-burst-app.screen-play{--lb-key-row:65px}}
@media(max-height:700px){.link-burst-app.screen-play{--lb-key-row:65px}}
@media(max-height:580px){.link-burst-app.screen-play{--lb-key-row:53px}}
