:root{
  --bg:#070914;
  --panel:rgba(10,17,38,.88);
  --panel2:rgba(12,26,52,.90);
  --line:rgba(87,216,255,.28);
  --line-strong:rgba(87,216,255,.54);
  --text:#f4f8ff;
  --muted:#a8b6d8;
  --cyan:#50e3ff;
  --blue:#3f8cff;
  --purple:#ad6cff;
  --gold:#ffd96b;
  --green:#8dff81;
  --danger:#ff5d7a;
  --ink:#07101d;
  --shadow:0 24px 80px rgba(0,0,0,.44);
  --safe-top:env(safe-area-inset-top,0px);
  --safe-bottom:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box}
html,body{height:100%;overscroll-behavior:none}
body{
  margin:0;
  min-height:100dvh;
  overflow:hidden;
  touch-action:none;
  color:var(--text);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:
    radial-gradient(980px 540px at 50% -14%, rgba(80,227,255,.20), transparent 60%),
    radial-gradient(780px 580px at 100% 34%, rgba(173,108,255,.14), transparent 66%),
    radial-gradient(760px 520px at 0% 100%, rgba(255,217,107,.08), transparent 62%),
    #070914;
  -webkit-font-smoothing:antialiased;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.12;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='114' viewBox='0 0 132 114'%3E%3Cg fill='none' stroke='%2350e3ff' stroke-opacity='.28' stroke-width='1'%3E%3Cpath d='M33 1h66l33 56-33 56H33L0 57 33 1Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size:82px 71px;
  mask-image:radial-gradient(circle at center,#000 48%,transparent 100%);
}
button{font:inherit;color:inherit}
.game-shell{
  width:min(1440px,100vw);
  height:100dvh;
  margin:0 auto;
  padding:calc(10px + var(--safe-top)) 10px calc(10px + var(--safe-bottom));
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr) auto;
  gap:9px;
}
.topbar,.stat-strip article,.side-card,.board-card,.bottom-bar,.modal-card{
  border:1px solid var(--line);
  background:linear-gradient(180deg,rgba(14,27,56,.86),rgba(6,12,28,.92));
  box-shadow:var(--shadow), inset 0 0 0 1px rgba(255,255,255,.025);
}
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-radius:22px;
}
.brand{
  min-width:0;
  display:flex;
  gap:12px;
  align-items:center;
}
.brand-mark{
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  border-radius:16px;
  border:1px solid rgba(80,227,255,.42);
  color:var(--cyan);
  font-weight:900;
  background:radial-gradient(circle at 35% 28%,rgba(80,227,255,.24),rgba(8,18,37,.88));
  box-shadow:0 0 18px rgba(80,227,255,.20);
}
.kicker,.panel-kicker{
  margin:0 0 4px;
  color:#8fdcff;
  font-size:.70rem;
  line-height:1;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.14em;
}
h1,h2,h3,p{margin-top:0}
h1{
  margin:0;
  line-height:1;
  font-size:clamp(1.45rem,3.2vw,3rem);
  letter-spacing:.05em;
}
h2{
  margin:0 0 6px;
  font-size:clamp(1.15rem,2.3vw,1.5rem);
  line-height:1.05;
}
.top-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-shrink:0;
}
.icon-btn,.ghost-btn,.primary-btn{
  min-height:42px;
  padding:10px 13px;
  border-radius:14px;
  border:1px solid rgba(80,227,255,.26);
  background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.02)),rgba(8,17,35,.88);
  cursor:pointer;
  color:var(--text);
  font-weight:950;
  transition:transform .16s ease, filter .16s ease, border-color .16s ease;
}
.icon-btn{
  width:44px;
  padding:0;
}
.primary-btn{
  border:none;
  background:linear-gradient(135deg,var(--gold),#ffbd32);
  color:#170f03;
  box-shadow:0 10px 30px rgba(255,217,107,.25);
}
.icon-btn:hover,.ghost-btn:hover,.primary-btn:hover{
  transform:translateY(-1px);
  filter:brightness(1.08);
}
.ghost-btn.wide,.primary-btn{
  width:100%;
}
.ghost-btn:disabled{
  opacity:.45;
  cursor:not-allowed;
  transform:none;
}
.stat-strip{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:9px;
}
.stat-strip article{
  min-height:70px;
  border-radius:18px;
  padding:10px 12px;
}
.stat-strip span,.objective-row span,.seed-box span,.score-tip span{
  display:block;
  color:var(--muted);
  font-size:.72rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.12em;
}
.stat-strip strong,.objective-row strong,.seed-box strong,.score-tip strong{
  display:block;
  margin-top:4px;
  font-size:clamp(1.25rem,2.8vw,2rem);
  line-height:1;
}
.game-layout{
  min-height:0;
  display:grid;
  grid-template-columns:minmax(230px,280px) minmax(0,1fr) minmax(240px,300px);
  gap:10px;
}
.side-card,.board-card{
  min-height:0;
  border-radius:24px;
}
.side-card{
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.muted{
  margin:0;
  color:var(--muted);
  line-height:1.35;
  font-size:.92rem;
}
.objective-list{
  display:grid;
  gap:10px;
}
.objective-row{
  display:grid;
  grid-template-columns:48px minmax(0,1fr);
  gap:10px;
  align-items:center;
  padding:10px;
  border:1px solid rgba(255,255,255,.075);
  border-radius:16px;
  background:rgba(255,255,255,.025);
}
.objective-icon{
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);
  font-size:1.25rem;
}
.crown-icon{background:rgba(255,217,107,.16);color:var(--gold);text-shadow:0 0 16px rgba(255,217,107,.7)}
.chain-icon{background:rgba(173,108,255,.14);color:var(--purple);text-shadow:0 0 16px rgba(173,108,255,.7)}
.tile-icon{background:rgba(80,227,255,.13);color:var(--cyan);text-shadow:0 0 16px rgba(80,227,255,.7)}
.seed-box,.score-tip{
  margin-top:auto;
  padding:12px;
  border:1px solid rgba(255,255,255,.075);
  border-radius:16px;
  background:rgba(255,255,255,.025);
}
.seed-box strong,.score-tip strong{
  font-size:1rem;
  line-height:1.25;
}
.board-card{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  padding:10px;
}
.board-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:2px 4px 8px;
}
.mini-rule{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  justify-content:flex-end;
}
.mini-rule span{
  display:inline-flex;
  min-height:28px;
  align-items:center;
  padding:5px 9px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:999px;
  color:#dfeaff;
  background:rgba(255,255,255,.035);
  font-size:.76rem;
  font-weight:850;
}
.board-stage{
  position:relative;
  min-height:0;
  display:grid;
  place-items:center;
  overflow:hidden;
  border:1px solid rgba(80,227,255,.16);
  border-radius:22px;
  background:
    radial-gradient(420px 280px at 50% 42%, rgba(80,227,255,.09), transparent 64%),
    linear-gradient(180deg,rgba(255,255,255,.028),rgba(255,255,255,.006)),
    rgba(3,8,18,.78);
}
.board-stage.burst{
  animation:stagePulse .38s ease;
}
@keyframes stagePulse{
  0%{box-shadow:0 0 0 rgba(255,217,107,0)}
  50%{box-shadow:0 0 44px rgba(255,217,107,.22)}
  100%{box-shadow:0 0 0 rgba(255,217,107,0)}
}
.board{
  position:relative;
  width:min(100%, 720px);
  aspect-ratio:1 / .94;
  max-height:100%;
}
.cell{
  position:absolute;
  transform:translate(-50%,-50%);
  display:grid;
  place-items:center;
  clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);
  border:0;
  padding:0;
  background:
    linear-gradient(180deg,rgba(255,255,255,.035),rgba(255,255,255,.012)),
    rgba(9,16,32,.92);
  color:var(--text);
  cursor:pointer;
  transition:filter .16s ease, transform .16s ease, opacity .16s ease;
}
.cell::before{
  content:"";
  position:absolute;
  inset:4px;
  clip-path:inherit;
  border:2px solid rgba(134,154,180,.36);
  background:rgba(255,255,255,.015);
  transition:border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.cell.empty:hover::before,
.cell.hint::before{
  border-color:rgba(80,227,255,.75);
  box-shadow:0 0 24px rgba(80,227,255,.28);
  background:rgba(80,227,255,.06);
}
.cell.crown::after{
  content:"♛";
  position:absolute;
  z-index:2;
  color:rgba(255,217,107,.95);
  font-size:30%;
  text-shadow:0 0 18px rgba(255,217,107,.85);
  opacity:.92;
}
.cell.empty.crown::before{
  border-color:rgba(255,217,107,.60);
  box-shadow:0 0 20px rgba(255,217,107,.18);
  background:radial-gradient(circle at center,rgba(255,217,107,.13),rgba(255,217,107,.02) 62%);
}
.cell.disabled{
  cursor:not-allowed;
}
.tile{
  position:absolute;
  inset:6px;
  z-index:4;
  display:grid;
  place-items:center;
  clip-path:inherit;
  color:#f6fbff;
  font-size:42%;
  font-weight:1000;
  letter-spacing:.02em;
  text-shadow:0 2px 0 rgba(0,0,0,.25), 0 0 18px var(--tileGlow);
  background:
    radial-gradient(circle at 30% 24%,rgba(255,255,255,.26),rgba(255,255,255,.05) 25%,transparent 52%),
    linear-gradient(180deg,var(--tileHi),var(--tileLo));
  box-shadow:
    0 0 20px color-mix(in srgb, var(--tileGlow) 55%, transparent),
    inset 0 0 0 2px rgba(255,255,255,.12),
    inset 0 -10px 20px rgba(0,0,0,.18);
}
.tile::before{
  content:"";
  position:absolute;
  inset:6px;
  clip-path:inherit;
  border:2px solid color-mix(in srgb, var(--tileGlow) 80%, white 20%);
  opacity:.78;
}
.tile span{
  z-index:1;
}
.cell.just-placed .tile{
  animation:dropIn .28s cubic-bezier(.22,1.35,.36,1);
}
.cell.merge-source .tile{
  animation:mergeSource .22s ease forwards;
}
.cell.merge-dest .tile{
  animation:mergeDest .42s cubic-bezier(.22,1.45,.36,1);
}
.cell.crown-hit::before{
  animation:crownPulse .6s ease;
}
@keyframes dropIn{
  from{transform:scale(.52) rotate(-8deg);opacity:.2}
  to{transform:scale(1) rotate(0);opacity:1}
}
@keyframes mergeSource{
  to{transform:scale(.48);opacity:.16;filter:blur(2px)}
}
@keyframes mergeDest{
  0%{transform:scale(.72);filter:brightness(1)}
  55%{transform:scale(1.20);filter:brightness(1.5)}
  100%{transform:scale(1);filter:brightness(1)}
}
@keyframes crownPulse{
  0%{box-shadow:0 0 0 rgba(255,217,107,0)}
  50%{box-shadow:0 0 42px rgba(255,217,107,.55)}
  100%{box-shadow:0 0 0 rgba(255,217,107,0)}
}
.fx-layer{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:8;
}
.particle{
  position:absolute;
  width:8px;
  height:8px;
  border-radius:999px;
  background:var(--pColor);
  box-shadow:0 0 14px var(--pColor);
  animation:particleFly .72s ease-out forwards;
}
@keyframes particleFly{
  to{
    transform:translate(var(--dx),var(--dy)) scale(.2);
    opacity:0;
  }
}
.float-label{
  position:absolute;
  z-index:9;
  pointer-events:none;
  transform:translate(-50%,-50%);
  color:var(--labelColor);
  font-size:18px;
  font-weight:1000;
  text-shadow:0 0 18px var(--labelColor), 0 2px 0 rgba(0,0,0,.35);
  animation:floatUp .9s ease-out forwards;
}
@keyframes floatUp{
  to{transform:translate(-50%, -88px);opacity:0}
}
.toast{
  position:absolute;
  left:50%;
  top:14px;
  z-index:12;
  transform:translateX(-50%) translateY(-10px);
  padding:9px 13px;
  border:1px solid rgba(255,217,107,.36);
  border-radius:999px;
  background:rgba(9,12,24,.82);
  color:#fff8d1;
  font-weight:950;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
  box-shadow:0 12px 34px rgba(0,0,0,.34);
}
.toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}
.tip{
  margin:8px 4px 0;
  color:var(--muted);
  font-size:.90rem;
}
.tip span{
  color:var(--gold);
  font-weight:950;
}
.hand-card{
  gap:12px;
}
.hand{
  display:grid;
  gap:9px;
}
.hand-tile{
  position:relative;
  min-height:88px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  padding:10px;
  display:grid;
  grid-template-columns:64px minmax(0,1fr);
  gap:10px;
  align-items:center;
  background:rgba(255,255,255,.028);
  cursor:pointer;
  transition:transform .14s ease, border-color .14s ease, background .14s ease;
}
.hand-tile:hover{
  transform:translateY(-1px);
}
.hand-tile.selected{
  border-color:rgba(255,217,107,.70);
  background:rgba(255,217,107,.065);
  box-shadow:0 0 24px rgba(255,217,107,.16);
}
.hand-hex{
  width:62px;
  height:62px;
  display:grid;
  place-items:center;
  clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);
  background:linear-gradient(180deg,var(--tileHi),var(--tileLo));
  box-shadow:0 0 18px color-mix(in srgb, var(--tileGlow) 55%, transparent);
  font-weight:1000;
  font-size:1.55rem;
  text-shadow:0 0 14px var(--tileGlow);
}
.hand-copy strong{
  display:block;
  line-height:1.1;
}
.hand-copy span{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:.82rem;
}
.score-tip{
  margin-top:0;
}
.bottom-bar{
  min-height:54px;
  border-radius:18px;
  padding:8px 10px;
  display:grid;
  grid-template-columns:auto auto minmax(0,1fr);
  align-items:center;
  gap:9px;
}
.bottom-bar p{
  margin:0;
  color:var(--muted);
  font-weight:800;
  text-align:right;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.modal{
  border:none;
  padding:0;
  color:var(--text);
  background:transparent;
}
.modal::backdrop{
  background:rgba(1,4,12,.76);
  backdrop-filter:blur(6px);
}
.modal-card{
  width:min(580px,calc(100vw - 24px));
  border-radius:24px;
  padding:22px;
}
.modal-card h2{
  font-size:clamp(1.6rem,4vw,2.3rem);
  margin:.2rem 0 .6rem;
}
.modal-card li,.modal-card p{
  color:#d7e5ff;
  line-height:1.42;
}
.modal-card ul,.modal-card ol{
  padding-left:20px;
}
.modal-card menu,.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin:18px 0 0;
  padding:0;
  flex-wrap:wrap;
}
.final-score{
  font-size:clamp(2.2rem,7vw,4.5rem);
  line-height:1;
  font-weight:1000;
  color:var(--gold);
  text-shadow:0 0 24px rgba(255,217,107,.28);
  margin:6px 0 10px;
}

@media(max-width:1100px){
  .game-layout{
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto auto auto;
  }
  .objective-card{
    order:2;
  }
  .hand-card{
    order:3;
  }
  .board-card{
    order:1;
    min-height:min(76dvh,760px);
  }
  .objective-list{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .seed-box{
    margin-top:0;
  }
  .hand{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .hand-tile{
    grid-template-columns:1fr;
    justify-items:center;
    text-align:center;
    min-height:120px;
  }
  .score-tip{
    display:none;
  }
}
@media(max-width:760px){
  body{
    overflow:auto;
    touch-action:auto;
  }
  .game-shell{
    height:auto;
    min-height:100dvh;
    padding:7px;
    gap:7px;
  }
  .topbar{
    padding:10px;
    align-items:flex-start;
    gap:8px;
  }
  .brand-mark{
    width:40px;
    height:40px;
    border-radius:13px;
  }
  .top-actions{
    gap:5px;
  }
  .top-actions .ghost-btn{
    padding:8px 9px;
    min-height:38px;
    font-size:.82rem;
  }
  .icon-btn{
    width:38px;
    min-height:38px;
  }
  .stat-strip{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
  }
  .stat-strip article{
    min-height:58px;
    padding:9px;
  }
  .board-card{
    min-height:auto;
    padding:8px;
  }
  .board-top{
    flex-direction:column;
    gap:6px;
  }
  .mini-rule{
    justify-content:flex-start;
  }
  .board{
    width:100%;
    max-width:100%;
    aspect-ratio:1/.98;
  }
  .board-stage{
    min-height:calc(100vw - 28px);
  }
  .side-card{
    padding:11px;
    border-radius:18px;
  }
  .objective-list{
    grid-template-columns:1fr;
  }
  .objective-row{
    grid-template-columns:42px minmax(0,1fr);
    padding:8px;
  }
  .objective-icon{
    width:40px;
    height:40px;
  }
  .hand{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px;
  }
  .hand-tile{
    min-height:106px;
    padding:8px 5px;
    gap:6px;
  }
  .hand-hex{
    width:54px;
    height:54px;
    font-size:1.35rem;
  }
  .hand-copy span{
    display:none;
  }
  .primary-btn,.ghost-btn{
    min-height:40px;
  }
  .bottom-bar{
    grid-template-columns:1fr 1fr;
  }
  .bottom-bar p{
    grid-column:1/-1;
    text-align:center;
    white-space:normal;
  }
}
@media(max-width:420px){
  h1{
    font-size:1.1rem;
  }
  .kicker{
    font-size:.58rem;
  }
  .brand{
    gap:8px;
  }
  .top-actions .ghost-btn:nth-of-type(1){
    display:none;
  }
  .stat-strip strong{
    font-size:1.18rem;
  }
  .tip{
    font-size:.80rem;
  }
}
@media(max-height:620px) and (orientation:landscape){
  .game-shell{
    grid-template-columns:260px minmax(0,1fr) 270px;
    grid-template-rows:auto minmax(0,1fr) auto;
    grid-template-areas:
      "top top top"
      "left board right"
      "stats board bottom";
  }
  .topbar{grid-area:top}
  .stat-strip{grid-area:stats;grid-template-columns:1fr 1fr}
  .objective-card{grid-area:left;order:initial}
  .board-card{grid-area:board;order:initial;min-height:0}
  .hand-card{grid-area:right;order:initial}
  .bottom-bar{grid-area:bottom}
  .objective-list{grid-template-columns:1fr}
  .hand{grid-template-columns:1fr}
  .hand-tile{grid-template-columns:56px minmax(0,1fr);min-height:74px;text-align:left;justify-items:start}
  .hand-hex{width:54px;height:54px}
}
@media(prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}


/* Hex Crown Merge refresh v2 */
.seed-box strong{
  font-size:.95rem;
  line-height:1.35;
}
.board-stage{
  padding:8px;
}
.board{
  width:100%;
  height:100%;
  max-width:760px;
  max-height:720px;
  min-height:340px;
  aspect-ratio:auto;
}
.cell{
  filter:drop-shadow(0 10px 18px rgba(0,0,0,.18));
}
.cell::before{
  inset:3px;
  border-width:1.5px;
}
.cell.crown::after{
  font-size:clamp(10px, 1.5vw, 16px);
}
.tile{
  inset:4px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:1px;
  line-height:1;
  overflow:hidden;
}
.tile-rank{
  font-size:46%;
  font-weight:1000;
  line-height:.9;
}
.tile-flavor{
  font-size:15%;
  letter-spacing:.12em;
  text-transform:uppercase;
  opacity:.92;
  font-weight:900;
}
.tile-pips{
  font-size:16%;
  letter-spacing:.08em;
  opacity:.9;
}
.hand-hex{
  width:66px;
  height:66px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1px;
  clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);
  background:linear-gradient(180deg,var(--tileHi),var(--tileLo));
  box-shadow:0 0 18px color-mix(in srgb, var(--tileGlow) 55%, transparent);
  color:#f8fdff;
  text-shadow:0 0 14px var(--tileGlow);
}
.hand-rank{
  font-size:1.35rem;
  font-weight:1000;
  line-height:1;
}
.hand-pips{
  font-size:.64rem;
  line-height:1;
  opacity:.92;
  letter-spacing:.06em;
}
.hand-copy strong{
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:.84rem;
}
.float-label{
  font-size:17px;
}
@media(max-width:760px){
  .board{
    min-height:300px;
  }
  .hand-hex{
    width:54px;
    height:54px;
  }
  .hand-rank{
    font-size:1.15rem;
  }
  .hand-pips{
    font-size:.54rem;
  }
  .tile-rank{
    font-size:40%;
  }
  .tile-flavor{
    font-size:13%;
  }
  .tile-pips{
    font-size:13%;
  }
}
@media(max-width:420px){
  .seed-box strong{
    font-size:.85rem;
  }
  .tile-flavor{
    letter-spacing:.06em;
  }
}


/* Alignment fix v3: use pointy-top hexes so the board geometry matches the axial coordinate system */
.cell{
  clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
}
.cell::before{
  clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
}
.tile{
  clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
}
.tile::before{
  clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
}
.cell{
  overflow:visible;
}
.cell.empty:hover{
  transform:translate(-50%,-50%) scale(1.035);
}
.cell.filled{
  cursor:default;
}
.tile{
  inset:5px;
}
.tile-rank{
  letter-spacing:-.02em;
}
.tile-flavor{
  opacity:.88;
}


/* Number readability fix v4 */
.tile{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  padding-top:2px;
}
.tile-rank{
  font-size:58% !important;
  line-height:.92;
  font-weight:1000;
  letter-spacing:-.03em;
  color:#ffffff;
  text-shadow:
    0 2px 0 rgba(0,0,0,.4),
    0 0 18px rgba(255,255,255,.16),
    0 0 18px var(--tileGlow);
}
.tile-flavor{
  font-size:10% !important;
  line-height:1;
  font-weight:900;
  letter-spacing:.10em;
  text-transform:uppercase;
  opacity:.82;
  max-width:88%;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.tile-pips{
  font-size:11% !important;
  line-height:1;
  opacity:.88;
  letter-spacing:.03em;
}
.hand-hex{
  gap:2px;
}
.hand-rank{
  font-size:1.5rem;
  line-height:1;
  font-weight:1000;
  text-shadow:
    0 2px 0 rgba(0,0,0,.35),
    0 0 12px rgba(255,255,255,.18),
    0 0 18px var(--tileGlow);
}
.hand-pips{
  font-size:.62rem;
}
@media(max-width:760px){
  .tile-rank{
    font-size:52% !important;
  }
  .tile-flavor{
    font-size:9% !important;
    letter-spacing:.07em;
  }
  .tile-pips{
    font-size:10% !important;
  }
}
@media(max-width:420px){
  .tile-rank{
    font-size:48% !important;
  }
  .tile-flavor{
    font-size:8.5% !important;
  }
  .tile-pips{
    font-size:9% !important;
  }
}


/* Number readability fix v5 */
.tile{
  inset:6px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  font-size:initial;
}
.tile-rank{
  font-size:clamp(24px, 2.2vw, 34px) !important;
  line-height:1 !important;
  font-weight:1000 !important;
  letter-spacing:-0.04em !important;
  color:#ffffff !important;
  text-shadow:
    0 2px 0 rgba(0,0,0,.42),
    0 0 10px rgba(255,255,255,.25),
    0 0 18px var(--tileGlow) !important;
}
.tile-pips{
  font-size:clamp(10px, .8vw, 12px) !important;
  line-height:1 !important;
  font-weight:900;
  letter-spacing:.08em;
  opacity:.92 !important;
  color:rgba(255,255,255,.95);
  text-shadow:0 0 12px var(--tileGlow);
}
.tile-flavor{
  display:none !important;
}
.tile span{
  position:relative;
  z-index:2;
}
.hand-rank{
  font-size:1.55rem;
}
@media (max-width: 760px){
  .tile-rank{
    font-size:clamp(22px, 5vw, 30px) !important;
  }
  .tile-pips{
    font-size:10px !important;
  }
}


/* Pacing fix v6: smaller board, shorter runs, less overwhelming layout */
.board{
  max-width:620px;
  max-height:560px;
}
.board-stage{
  background:
    radial-gradient(360px 220px at 50% 42%, rgba(80,227,255,.08), transparent 66%),
    linear-gradient(180deg,rgba(255,255,255,.028),rgba(255,255,255,.006)),
    rgba(3,8,18,.78);
}
@media(max-width:760px){
  .board{
    max-width:100%;
    max-height:520px;
  }
  .board-stage{
    min-height:calc(92vw - 28px);
  }
}


/* Site-ready polish v7: compact board-fill mode and visual guide */
.board{max-width:560px;max-height:500px;}
.board-stage{min-height:430px;}
.guide-card{width:min(680px,calc(100vw - 24px));}
.guide-visuals{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:12px 0 14px;}
.guide-step{min-height:118px;border:1px solid rgba(80,227,255,.18);border-radius:16px;background:rgba(255,255,255,.035);display:flex;align-items:center;justify-content:center;gap:5px;flex-wrap:wrap;padding:10px;text-align:center;}
.guide-step strong{display:block;width:100%;font-size:.82rem;color:#dceaff;}
.guide-hex{width:42px;height:48px;clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);display:grid;place-items:center;font-weight:1000;color:#fff;box-shadow:0 0 18px rgba(80,227,255,.25);}
.guide-hex.trio{background:linear-gradient(180deg,#64ecff,#145d99);}
.guide-hex.merged{background:linear-gradient(180deg,#6ab6ff,#253fa9);box-shadow:0 0 18px rgba(106,182,255,.28);}
.guide-hex.crown{background:linear-gradient(180deg,#ffe17a,#9d6512);color:#241400;box-shadow:0 0 18px rgba(255,217,107,.35);}
.guide-plus{font-weight:1000;color:#8fdcff;}
@media(max-width:1100px){.board-card{min-height:min(68dvh,620px)}.board{max-width:560px;max-height:520px;}}
@media(max-width:760px){.board-stage{min-height:calc(84vw - 28px)}.guide-visuals{grid-template-columns:1fr}.guide-step{min-height:86px}.board{max-width:100%;max-height:450px;}.tile-rank{font-size:clamp(22px,5vw,30px)!important;}}
@media(max-height:620px) and (orientation:landscape){.board{max-width:500px;}.board-stage{min-height:0}.guide-visuals{grid-template-columns:repeat(3,1fr)}}



/* Mobile layout + feedback polish v8 */
.hud-pop{
  animation:hudPop .42s cubic-bezier(.18,1.45,.32,1);
}
@keyframes hudPop{
  0%{transform:scale(1);filter:brightness(1)}
  45%{transform:scale(1.16);filter:brightness(1.55);text-shadow:0 0 18px rgba(255,217,107,.48)}
  100%{transform:scale(1);filter:brightness(1)}
}
.shockwave{
  position:absolute;
  width:28px;
  height:28px;
  border-radius:999px;
  border:2px solid var(--ringColor);
  box-shadow:0 0 18px var(--ringColor);
  transform:translate(-50%,-50%) scale(.5);
  opacity:.8;
  animation:shockwaveOut .76s ease-out forwards;
  pointer-events:none;
}
.shockwave.strong{
  width:42px;
  height:42px;
  border-width:3px;
  animation-duration:.96s;
}
@keyframes shockwaveOut{
  to{transform:translate(-50%,-50%) scale(2.7);opacity:0}
}
.board-stage.mega-burst{
  animation:megaStagePulse .52s ease;
}
@keyframes megaStagePulse{
  0%{box-shadow:0 0 0 rgba(255,106,215,0)}
  45%{box-shadow:0 0 52px rgba(255,106,215,.28), inset 0 0 38px rgba(255,217,107,.12)}
  100%{box-shadow:0 0 0 rgba(255,106,215,0)}
}
.hand-tile.hand-fired{
  animation:handFire .42s ease;
}
@keyframes handFire{
  0%{transform:scale(1)}
  35%{transform:scale(1.05);filter:brightness(1.45)}
  100%{transform:scale(1)}
}
.hand-card{
  position:relative;
}
.hand-card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  border-radius:inherit;
  background:radial-gradient(420px 120px at 50% 0%, color-mix(in srgb, var(--selectedGlow, #50e3ff) 18%, transparent), transparent 70%);
  opacity:.72;
}
.hand-card > *{
  position:relative;
  z-index:1;
}

@media(max-width:760px){
  body{
    overflow:auto;
    touch-action:auto;
  }
  .game-shell{
    height:auto;
    min-height:100dvh;
    padding:4px;
    gap:5px;
  }
  .topbar{
    padding:6px 8px;
    border-radius:14px;
    align-items:center;
  }
  .brand-mark{
    width:30px;
    height:30px;
    border-radius:10px;
    font-size:.78rem;
  }
  .brand{
    gap:7px;
    min-width:0;
  }
  .brand .kicker{
    display:none;
  }
  h1{
    font-size:clamp(1rem,4.7vw,1.25rem);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .top-actions{
    gap:4px;
  }
  .top-actions .ghost-btn{
    min-height:30px;
    padding:6px 8px;
    border-radius:10px;
    font-size:.72rem;
  }
  .top-actions .icon-btn{
    width:31px;
    min-height:31px;
    border-radius:10px;
    font-size:.78rem;
  }

  .stat-strip{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:4px;
  }
  .stat-strip article{
    min-height:38px;
    padding:6px 6px;
    border-radius:12px;
  }
  .stat-strip span{
    font-size:.50rem;
    letter-spacing:.08em;
    margin-bottom:2px;
  }
  .stat-strip strong{
    font-size:clamp(.86rem,3.8vw,1.05rem);
  }

  .game-layout{
    gap:5px;
  }
  .board-card{
    order:1;
    padding:6px;
    border-radius:16px;
  }
  .board-top{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:6px;
    padding:0 2px 5px;
  }
  .board-top .panel-kicker,
  .mini-rule{
    display:none;
  }
  .board-top h2{
    margin:0;
    font-size:.92rem;
    line-height:1.1;
  }
  .board-stage{
    min-height:min(66vw, 330px) !important;
    border-radius:16px;
    padding:4px;
  }
  .board{
    min-height:250px !important;
    max-height:330px !important;
  }
  .tip{
    margin:5px 3px 0;
    font-size:.70rem;
    line-height:1.25;
  }

  .hand-card{
    order:2;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:6px;
    padding:7px;
    border-radius:16px;
  }
  .hand-card .panel-kicker,
  .hand-card h2,
  .score-tip{
    display:none !important;
  }
  .hand{
    grid-column:1 / -1;
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;
  }
  .hand-tile{
    min-height:62px;
    grid-template-columns:38px minmax(0,1fr);
    align-items:center;
    justify-items:start;
    text-align:left;
    gap:6px;
    padding:6px;
    border-radius:13px;
  }
  .hand-tile.selected{
    border-color:rgba(255,217,107,.82);
    box-shadow:0 0 18px rgba(255,217,107,.20), inset 0 0 18px rgba(255,217,107,.08);
  }
  .hand-hex{
    width:38px !important;
    height:42px !important;
    min-width:38px;
  }
  .hand-rank{
    font-size:1rem !important;
  }
  .hand-pips{
    display:none;
  }
  .hand-copy strong{
    font-size:.62rem;
    letter-spacing:.06em;
    line-height:1.05;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .hand-copy span{
    display:block !important;
    margin-top:2px;
    font-size:.56rem;
    line-height:1.05;
    opacity:.72;
  }
  #placeHintBtn,
  #undoBtn{
    min-height:34px;
    padding:7px 8px;
    border-radius:11px;
    font-size:.72rem;
  }

  .objective-card{
    order:3;
    padding:7px;
    border-radius:14px;
    gap:6px;
  }
  .objective-card h2,
  .objective-card > .muted,
  .objective-card > .panel-kicker{
    display:none;
  }
  .objective-list{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:5px;
  }
  .objective-row{
    grid-template-columns:1fr;
    gap:2px;
    padding:6px 4px;
    text-align:center;
    border-radius:11px;
  }
  .objective-icon{
    display:none;
  }
  .objective-row strong{
    font-size:.92rem;
  }
  .objective-row span{
    font-size:.48rem;
    letter-spacing:.07em;
  }
  .seed-box{
    margin-top:0;
    padding:7px 8px;
    border-radius:11px;
  }
  .seed-box span{
    font-size:.48rem;
  }
  .seed-box strong{
    font-size:.70rem;
    line-height:1.2;
  }

  .bottom-bar{
    min-height:0;
    padding:5px;
    gap:5px;
    border-radius:13px;
    grid-template-columns:1fr 1fr;
  }
  .bottom-bar .ghost-btn{
    min-height:32px;
    padding:7px 8px;
    border-radius:10px;
    font-size:.72rem;
  }
  .bottom-bar p{
    display:none;
  }

  .float-label{
    font-size:14px;
  }
  .shockwave{
    width:20px;
    height:20px;
  }
  .shockwave.strong{
    width:30px;
    height:30px;
  }
}

@media(max-width:420px){
  .game-shell{
    padding:3px;
  }
  .board-stage{
    min-height:min(62vw, 295px) !important;
  }
  .board{
    min-height:230px !important;
    max-height:300px !important;
  }
  .hand-tile{
    min-height:58px;
    grid-template-columns:34px minmax(0,1fr);
    padding:5px;
  }
  .hand-hex{
    width:34px !important;
    height:38px !important;
  }
  .hand-copy strong{
    font-size:.57rem;
  }
  .hand-copy span{
    font-size:.52rem;
  }
}
