@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&display=swap');
:root {
  --lime: #baff29;
  --bg: #111310;
  --muted: #777d70;
  --border: #30352a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: #f4f6ed;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
}
button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  font: inherit;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}
header {
  height: 88px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 5vw;
}
.logo {
  font-family: 'Russo One', Impact, sans-serif;
  font-style: italic;
  font-weight: 900;
  font-size: 39px;
  letter-spacing: -1px;
  text-decoration: none;
  color: #fff;
}
.logo span {
  color: var(--lime);
  margin-left: 5px;
}
.header-label,
.status,
.eyebrow,
.hero-tags,
.section-title,
footer,
.art-caption,
.art-number,
.score,
.arena-top,
.special {
  font-family: 'Russo One', 'Noto Sans JP', sans-serif;
  letter-spacing: 1.4px;
}
.header-label {
  font-size: 12px;
  color: #929889;
}
.status {
  margin-left: auto;
  font-size: 12px;
}
.status i,
.panel-note i {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--lime);
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 10px #baff2955;
}
.icon {
  border: 1px solid var(--border);
  background: transparent;
  color: #bbbfb4;
  padding: 10px 12px;
  font-size: 10px;
}
main {
  max-width: 1280px;
  margin: auto;
  padding: 0 5vw;
}
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 365px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero-copy {
  padding: 38px 0 32px;
}
.eyebrow {
  font-size: 11px;
  color: #989f8f;
}
.eyebrow span {
  color: var(--lime);
  margin-right: 20px;
}
h1 {
  font-size: clamp(40px, 4.5vw, 66px);
  line-height: 1.2;
  letter-spacing: -3px;
  margin: 22px 0 18px;
  font-weight: 900;
}
em {
  font-style: normal;
  color: var(--lime);
}
.hero p {
  color: #a2a89a;
  font-size: 12px;
  line-height: 1.9;
}
.hero-tags {
  display: flex;
  gap: 8px;
  margin-top: 23px;
}
.hero-tags span {
  padding: 5px 8px;
  border: 1px solid #3b4230;
  font-size: 10px;
  color: #c8cfbd;
}
.hero-art {
  position: relative;
  min-height: 340px;
  background: radial-gradient(ellipse at center, #8cae1420, transparent 65%);
  perspective: 700px;
}
.orbit {
  position: absolute;
  border: 1px solid #9acd2220;
  width: 420px;
  height: 220px;
  transform: rotate(-30deg);
  border-radius: 50%;
  left: -15px;
  top: 100px;
}
.orbit-two {
  width: 500px;
  height: 280px;
  left: -60px;
  top: 65px;
}
.disc {
  position: absolute;
  border-radius: 50%;
  transform: rotateX(48deg) rotateZ(-20deg);
}
.disc-front {
  width: 210px;
  height: 210px;
  top: 108px;
  left: 110px;
  background: repeating-radial-gradient(circle, #baff29 0 2px, #92c718 3px 5px);
  box-shadow:
    0 12px 0 #668c0a,
    0 22px 0 #304803,
    0 30px 40px #a7ef2c44,
    inset 0 0 0 10px #d5ff80;
}
.disc-front:before {
  content: '';
  position: absolute;
  width: 110px;
  height: 110px;
  background: linear-gradient(120deg, #dfff94, #92c929 60%, #608600);
  border-radius: 50%;
  left: 50px;
  top: 25px;
  box-shadow:
    0 16px 0 #79a719,
    0 20px 15px #263602;
  border: 2px solid #d6ff88;
}
.disc-front:after {
  content: 'P';
  position: absolute;
  font: bold italic 55px Impact;
  color: #4a6807;
  left: 88px;
  top: 40px;
}
.disc-back {
  width: 88px;
  height: 88px;
  top: 57px;
  left: 300px;
  background: #2c3028;
  border: 2px solid #c6f673;
  box-shadow:
    0 12px 0 #11180a,
    0 15px 20px #baff2940;
}
.speed-line {
  position: absolute;
  top: 140px;
  left: 220px;
  width: 150px;
  height: 80px;
  background: linear-gradient(145deg, transparent, #baff2922, transparent);
  transform: rotate(-40deg);
}
.art-caption {
  position: absolute;
  right: 0;
  bottom: 26px;
  color: #8c967b;
  font-size: 11px;
  line-height: 1.4;
}
.art-number {
  position: absolute;
  right: 0;
  top: 35px;
  color: var(--lime);
  font-size: 11px;
}
.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 36px;
  padding: 30px 0 35px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title h2 {
  font-size: 17px;
  margin: 0;
}
.section-title b {
  color: var(--lime);
  margin-right: 9px;
  font-size: 12px;
}
.section-title > span {
  font-size: 10px;
  letter-spacing: 0;
  color: var(--muted);
}
.mallets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.mallet {
  min-width: 0;
  position: relative;
  background: #191c16;
  border: 1px solid var(--border);
  color: #eee;
  padding: 12px 8px;
  text-align: left;
  transition: 0.2s;
}
.mallet:hover {
  background: #252b1d;
  transform: translateY(-2px);
}
.mallet.selected {
  border-color: var(--lime);
  background: linear-gradient(145deg, #baff2916, #171b13);
}
.mallet .check {
  position: absolute;
  right: 8px;
  top: 7px;
  color: var(--lime);
  font-size: 10px;
}
.mini-disc {
  width: 67px;
  height: 67px;
  border-radius: 50%;
  margin: 14px auto 19px;
  background: repeating-radial-gradient(
    circle,
    var(--c) 0 2px,
    color-mix(in srgb, var(--c), #000 28%) 3px 5px
  );
  transform: rotateX(40deg);
  box-shadow:
    0 7px 0 color-mix(in srgb, var(--c), #000 60%),
    0 12px 18px color-mix(in srgb, var(--c), transparent 85%);
  position: relative;
}
.mini-disc:after {
  content: '';
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: linear-gradient(120deg, #ffffff66, var(--c));
  box-shadow: 0 7px 0 color-mix(in srgb, var(--c), #000 35%);
  transform: translateY(-7px);
}
.mallet strong {
  display: block;
  font:
    800 21px 'Russo One',
    Impact,
    sans-serif;
  letter-spacing: 1px;
}
.mallet small {
  color: #848c7b;
  font-size: 9px;
}
.mallet-info {
  display: flex;
  gap: 16px;
  align-items: center;
  min-height: 62px;
  color: #949c8b;
  font-size: 10px;
}
.mallet-info strong {
  color: var(--lime);
  font:
    700 13px 'Russo One',
    sans-serif;
  letter-spacing: 1px;
  white-space: nowrap;
}
.stat-line {
  color: #c6ccbd;
  font-size: 9px;
  margin-top: 6px;
}
.stage-title {
  margin-top: 12px;
}
.stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stage {
  padding: 0;
  border: 1px solid var(--border);
  background: #191c16;
  color: #eee;
  text-align: left;
  overflow: hidden;
}
.stage.selected {
  border-color: var(--lime);
}
.stage-art {
  height: 66px;
  margin: 9px 12px;
  background:
    linear-gradient(90deg, transparent 49%, #ffffff22 50%, transparent 51%),
    repeating-linear-gradient(0deg, transparent 0 13px, #ffffff08 14px),
    repeating-linear-gradient(90deg, transparent 0 13px, #ffffff08 14px);
  border: 1px solid var(--c);
  box-shadow: inset 0 0 20px color-mix(in srgb, var(--c), transparent 90%);
  position: relative;
  transform: perspective(250px) rotateX(25deg);
}
.stage-art:after {
  content: '';
  position: absolute;
  left: calc(50% - 12px);
  top: calc(50% - 12px);
  height: 22px;
  width: 22px;
  border: 1px solid var(--c);
  border-radius: 50%;
}
.stage strong {
  font:
    700 14px 'Russo One',
    sans-serif;
  letter-spacing: 1px;
  display: block;
  padding: 0 12px;
}
.stage small {
  display: block;
  font-size: 8px;
  color: #9ca38f;
  padding: 5px 12px 12px;
}
.play-panel {
  background: #1d2118;
  border: 1px solid #353e29;
  padding: 24px;
}
.play-panel h2 {
  font:
    800 italic 42px/0.96 'Russo One',
    Impact,
    sans-serif;
  letter-spacing: -0.4px;
  margin: 15px 0;
}
.play-panel p {
  font-size: 10px;
  color: #a2ab93;
}
.primary {
  width: 100%;
  background: var(--lime);
  border: 0;
  color: #172006;
  font-weight: 900;
  padding: 17px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.primary:hover {
  background: #d2ff77;
}
.primary span {
  font-size: 20px;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font:
    10px 'Russo One',
    sans-serif;
  color: #79856a;
  margin: 19px 0;
}
.divider:before,
.divider:after {
  content: '';
  height: 1px;
  flex: 1;
  background: #37412d;
}
label {
  color: #aab59b;
  font-size: 9px;
}
.join-row {
  display: flex;
  margin-top: 7px;
  height: 42px;
}
.join-row input {
  width: 100%;
  min-width: 0;
  background: #14190f;
  border: 1px solid #3b452f;
  color: #eaf3df;
  padding: 12px;
  font-size: 12px;
  text-transform: uppercase;
}
.join-row button {
  background: #333e26;
  color: var(--lime);
  border: 1px solid #4a5a35;
  width: 45px;
  font-size: 22px;
}
.secondary {
  width: 100%;
  border: 1px solid #465237;
  background: none;
  padding: 12px;
  color: #d2dbc6;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  margin-top: 13px;
}
.panel-note {
  font-size: 9px;
  color: #7f8b72;
  margin-top: 18px;
}
#error {
  color: #ff9a83;
  min-height: 12px;
  margin-bottom: 0;
}
footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding: 20px 0;
  color: #68705e;
  font-size: 10px;
}
[hidden] {
  display: none !important;
}
#arena {
  max-width: 470px;
  margin: auto;
  padding: 14px;
}
.arena-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--lime);
  font-size: 12px;
}
.score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
}
.score b {
  font-size: 37px;
  padding: 0 8px;
}
.you {
  color: var(--lime);
}
.rival {
  color: #bb8aff;
}
.score-center {
  font-size: 10px;
  color: #939a8a;
}
.board-wrap {
  position: relative;
  width: min(100%, calc((100dvh - 245px) * 0.6));
  margin: auto;
}
canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  border-radius: 12px;
  border: 1px solid #566441;
  box-shadow: 0 0 40px #baff2909;
}
.controls {
  margin: 14px auto;
  max-width: 420px;
  text-align: center;
}
.special {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 13px;
  border: 1px solid var(--lime);
  color: var(--lime);
  background: #19230d;
  display: flex;
  justify-content: space-between;
}
.special span,
.special small {
  position: relative;
  z-index: 1;
}
.special small {
  font-size: 10px;
}
.special i {
  position: absolute;
  left: 0;
  bottom: 0;
  top: 0;
  background: #baff2922;
  width: 0;
}
.controls p {
  color: #939c87;
  font-size: 10px;
  line-height: 1.8;
}
.controls p span {
  color: #606a53;
  font-size: 9px;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #0b110ddd;
  text-align: center;
  padding: 25px;
  border-radius: 12px;
}
.overlay h2 {
  font:
    800 44px 'Russo One',
    sans-serif;
  color: var(--lime);
  margin: 0;
}
.overlay p {
  line-height: 1.8;
  color: #c5cfb9;
}
.flash {
  pointer-events: none;
  position: absolute;
  top: 43%;
  left: 0;
  right: 0;
  text-align: center;
  font:
    800 italic 36px 'Russo One',
    sans-serif;
  color: var(--lime);
  text-shadow: 0 0 20px #baff29;
  opacity: 0;
}
.flash.active {
  animation: flash 0.7s ease-out;
}
@keyframes flash {
  0% {
    opacity: 1;
    transform: scale(0.8);
  }
  30% {
    transform: scale(1.15);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--lime);
  color: #1b230f;
  padding: 12px 22px;
  display: none;
  z-index: 5;
  font-size: 12px;
}
@media (min-width: 1400px) {
  main {
    padding: 0 25px;
  }
  .hero {
    min-height: 400px;
  }
  .hero-copy {
    padding-top: 50px;
  }
  .hero-art {
    transform: scale(1.08);
  }
}
@media (max-width: 800px) {
  header {
    height: 68px;
    padding: 0 22px;
    gap: 15px;
  }
  .header-label {
    display: none;
  }
  main {
    padding: 0 22px;
  }
  .lobby-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .hero {
    min-height: 330px;
  }
  .hero-copy {
    position: relative;
    z-index: 1;
  }
  .hero .eyebrow {
    font-size: 9px;
    white-space: nowrap;
  }
  .hero .eyebrow span {
    margin-right: 10px;
  }
  .hero-art {
    margin-left: -100px;
    opacity: 0.7;
  }
  .disc-front {
    left: 50px;
    top: 120px;
    width: 180px;
    height: 180px;
  }
  .disc-front:before {
    left: 35px;
  }
  .disc-front:after {
    left: 73px;
  }
  .disc-back {
    left: 190px;
  }
  .art-caption {
    display: none;
  }
  .play-panel h2 br {
    display: none;
  }
  .play-panel h2 {
    font-size: 38px;
  }
  .play-panel {
    padding: 22px;
  }
  .hero-tags {
    gap: 4px;
  }
  .hero-tags span {
    font-size: 8px;
    padding: 5px;
  }
  .section-title > span {
    font-size: 9px;
  }
  footer {
    font-size: 8px;
  }
  .art-number {
    display: none;
  }
}
@media (max-width: 480px) {
  header {
    padding: 0 18px;
  }
  .logo {
    font-size: 33px;
  }
  .status {
    font-size: 9px;
  }
  .icon {
    font-size: 9px;
  }
  main {
    padding: 0 18px;
  }
  .hero {
    grid-template-columns: 1fr 0.55fr;
    min-height: 325px;
  }
  .hero-copy {
    padding-top: 26px;
  }
  h1 {
    font-size: 43px;
    margin-top: 29px;
  }
  .hero-art {
    margin-left: -125px;
    transform: scale(0.85);
    transform-origin: center right;
  }
  .hero p {
    font-size: 10px;
  }
  .hero .eyebrow {
    font-size: 8px;
  }
  .hero .eyebrow span {
    display: block;
    margin-bottom: 5px;
  }
  .mallets {
    gap: 7px;
  }
  .mallet {
    padding: 10px 7px;
  }
  .mini-disc {
    width: 55px;
    height: 55px;
  }
  .mini-disc:after {
    inset: 12px;
  }
  .mallet strong {
    font-size: 18px;
  }
  .mallet-info {
    gap: 10px;
  }
  .mallet-info strong {
    font-size: 11px;
  }
  .stage small {
    font-size: 8px;
    padding: 5px 7px 10px;
  }
  .stage strong {
    padding: 0 7px;
    font-size: 13px;
  }
  .stage-art {
    margin: 8px;
  }
  .lobby-grid {
    padding-top: 23px;
  }
  .hero-tags {
    margin-top: 20px;
  }
  .controls {
    margin-top: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
.board-wrap {
  min-width: min(100%, 240px);
}

/* Match setup and touch-first arena */
.rule-row {
  display: flex;
  gap: 12px;
}
.rule-row label {
  flex: 1;
  color: #b8c1ac;
  font-size: 11px;
}
.rule-row select {
  display: block;
  width: 100%;
  margin-top: 8px;
  background: #20281b;
  color: #eaf5dd;
  border: 1px solid #485638;
  padding: 12px 7px;
  font: inherit;
  border-radius: 5px;
}
.phone-panel {
  border: 1px solid #425130;
  padding: 16px;
  margin-bottom: 24px;
  color: #aab89a;
  font-size: 12px;
}
.phone-panel summary {
  cursor: pointer;
  color: var(--lime);
  font-weight: 700;
}
.phone-panel p {
  line-height: 1.8;
}
.phone-panel a {
  display: block;
  color: #baff29;
  padding: 8px 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.stage-art span {
  display: block;
  text-align: center;
  font-size: 35px;
  color: var(--c);
  text-shadow: 0 0 15px var(--c);
}
.art-orbit {
  border-radius: 50%;
  width: 70px;
  height: 70px;
  margin: 8px auto;
  transform: none;
  background: radial-gradient(circle, #bd8cff33, #111321);
}
.art-swarm {
  background:
    radial-gradient(circle at 20% 30%, #ffce76 0 2px, transparent 3px),
    radial-gradient(circle at 80% 70%, #ffce76 0 3px, transparent 4px),
    repeating-linear-gradient(45deg, #ff5bac11 0 4px, transparent 5px 13px);
}
.art-reactor {
  background: repeating-conic-gradient(#ff805733 0deg 10deg, transparent 10deg 30deg);
  border-radius: 9px;
}
.art-ice {
  background: repeating-linear-gradient(
    55deg,
    transparent 0 15px,
    #65e4ff30 16px 17px,
    transparent 18px 29px
  );
}
.stage-art:after {
  display: none;
}
.stages {
  grid-template-columns: repeat(3, 1fr);
}
.stage-hud {
  margin: 8px 0;
  text-align: center;
  font:
    10px 'Noto Sans JP',
    sans-serif;
  color: #b1bba4;
  min-height: 16px;
}
.score-center {
  font-size: 25px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.score-center.urgent {
  color: #ff8057;
  text-shadow: 0 0 12px #ff805766;
}
.special.ready {
  box-shadow: 0 0 22px #baff2944;
  background: #334a13;
}
.playing header {
  height: 52px;
}
.playing .header-label,
.playing .status {
  display: none;
}
.playing header .icon {
  margin-left: auto;
}
.playing .logo {
  font-size: 28px;
}
#arena {
  padding-top: 8px;
}
.playing .board-wrap {
  width: min(100%, calc((100dvh - 270px) * 0.6));
  min-width: min(100%, 205px);
}
.playing .circular .board-wrap {
  width: min(100%, calc(100dvh - 270px));
  min-width: min(100%, 240px);
}
.circular canvas {
  border-radius: 50%;
  border-color: transparent;
}
.circular .overlay {
  border-radius: 50%;
  padding: 45px;
}
.controls p {
  margin: 6px 0;
}
.playing .score {
  padding: 5px 8px;
}
.playing .controls {
  margin: 6px auto;
}
.playing .special {
  min-height: 48px;
  touch-action: manipulation;
}
.playing .arena-top .icon {
  min-height: 36px;
}
.playing {
  overscroll-behavior: none;
}
.stage small {
  line-height: 1.6;
}
.overlay h2 {
  font-size: 36px;
}
.overlay p {
  font-size: 12px;
}
.flash {
  font-size: 30px;
}
.stages .stage {
  min-height: 126px;
}
@media (max-width: 480px) {
  .rule-row {
    gap: 8px;
  }
  .rule-row label:first-child {
    flex: 1.8;
  }
  .stages {
    grid-template-columns: repeat(2, 1fr);
  }
  .stage-art {
    height: 70px;
  }
  .controls p span {
    display: none;
  }
  .playing .board-wrap {
    width: min(100%, calc((100dvh - 240px) * 0.6));
  }
  .playing .circular .board-wrap {
    width: min(100%, calc(100dvh - 240px));
  }
  .playing header {
    height: 44px;
  }
  .stage-hud {
    font-size: 9px;
  }
  .playing .score b {
    font-size: 30px;
  }
  .playing .score-center {
    font-size: 24px;
  }
}
/* Immersive match: the field owns the viewport, HUD floats above it. */
body.playing {
  overflow: hidden;
  background: #070b12;
}
.playing header {
  display: none;
}
.playing #arena {
  position: fixed;
  inset: 0;
  max-width: none;
  width: 100%;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  background: #070b12;
}
.playing #arena .board-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  z-index: 0;
}
.playing #arena canvas {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.playing #arena.circular .board-wrap {
  width: min(100vw, 100dvh);
  height: min(100vw, 100dvh);
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  min-width: 0;
}
.playing #arena.circular canvas {
  border-radius: 50%;
}
.playing .arena-top {
  position: absolute;
  z-index: 3;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  top: max(8px, env(safe-area-inset-top));
  pointer-events: none;
}
.playing .arena-top button {
  pointer-events: auto;
  background: #091018bb;
  backdrop-filter: blur(8px);
  border-color: #ffffff22;
}
.playing #mode-label {
  font-size: 9px;
  opacity: 0.7;
}
.playing .score {
  position: absolute;
  z-index: 2;
  top: calc(max(8px, env(safe-area-inset-top)) + 40px);
  left: 50%;
  transform: translateX(-50%);
  width: min(75%, 360px);
  padding: 3px 12px;
  background: #070b1280;
  border-radius: 10px;
  pointer-events: none;
}
.playing .score b {
  font-size: 30px;
}
.playing .score-center {
  font-size: 24px;
}
.playing .score .you,
.playing .score .rival {
  font-size: 10px;
}
.playing .controls {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 18px);
  z-index: 3;
  width: 86px;
  margin: 0;
  pointer-events: none;
}
.playing .special {
  pointer-events: auto;
  width: 86px;
  height: 70px;
  min-height: 0;
  border-radius: 15px;
  padding: 10px 5px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  background: #14200ed9;
  backdrop-filter: blur(8px);
  letter-spacing: 0;
}
.playing .special span {
  font-size: 9px;
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.playing .special small {
  font-size: 10px;
}
.playing .special:disabled {
  opacity: 0.7;
}
.playing .controls p {
  display: none;
}
.playing .stage-hud {
  position: absolute;
  z-index: 2;
  bottom: max(5px, env(safe-area-inset-bottom));
  left: 0;
  width: 100%;
  margin: 0;
  font-size: 9px;
  text-shadow: 0 1px 5px #000;
  pointer-events: none;
}
.playing .overlay {
  z-index: 4;
}
.playing .flash {
  z-index: 2;
}
.playing #arena.circular .overlay {
  border-radius: 50%;
}
.playing #arena:after {
  content: '指で移動 / 二本指タップで必殺技';
  position: absolute;
  z-index: 2;
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 20px);
  left: 16px;
  font-size: 10px;
  color: #d8e5c699;
  pointer-events: none;
  text-shadow: 0 1px 5px #000;
}
@media (min-aspect-ratio: 1/1) {
  .playing #arena:not(.circular) .board-wrap {
    width: min(100vw, 85dvh);
    left: 50%;
    transform: translateX(-50%);
  }
  .playing .controls {
    right: calc(50% - min(50vw, 42.5dvh) + 12px);
  }
  .playing #arena:after {
    left: calc(50% - min(50vw, 42.5dvh) + 16px);
  }
}
/* Neon overload / non-blocking skill and goal cinematics */
.match-sound {
  display: none;
}
.playing .match-sound {
  display: block;
  position: absolute;
  top: calc(max(8px, env(safe-area-inset-top)) + 42px);
  right: 10px;
  z-index: 5;
  background: #071019bb;
  color: #baff29;
  min-height: 35px;
  padding: 6px;
}
.cutin,
.goal-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  overflow: hidden;
}
.cutin {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 9px;
  --skill-color: #baff29;
}
.cutin:before {
  content: '';
  position: absolute;
  left: -20%;
  right: -20%;
  height: 155px;
  transform: skewY(-9deg);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--skill-color), #050716 78%) 20%,
    #050716ee 75%,
    transparent
  );
  border-block: 3px solid var(--skill-color);
  box-shadow:
    0 0 55px var(--skill-color),
    inset 0 0 30px var(--skill-color);
}
.cutin strong,
.cutin small,
.cutin span {
  position: relative;
  max-width: 94%;
  text-align: center;
}
.cutin strong {
  font:
    900 italic clamp(26px, 7vw, 65px) / 1 'Russo One',
    Impact,
    sans-serif;
  color: white;
  text-shadow:
    3px 3px 0 var(--skill-color),
    0 0 25px var(--skill-color);
  letter-spacing: 1px;
}
.cutin small {
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 5px;
  color: var(--skill-color);
}
.cutin span {
  font-size: 10px;
  letter-spacing: 6px;
  color: #fff;
}
.cutin.active {
  animation: cutin 1.15s both;
}
.goal-burst {
  display: grid;
  place-items: center;
  background: radial-gradient(
    ellipse at center,
    transparent 20%,
    color-mix(in srgb, var(--goal-color), transparent 70%) 100%
  );
  box-shadow: inset 0 0 100px var(--goal-color);
}
.goal-burst span {
  font:
    900 italic clamp(35px, 11vw, 90px) 'Russo One',
    Impact,
    sans-serif;
  color: #fff;
  text-align: center;
  text-shadow:
    0 0 20px var(--goal-color),
    4px 4px 0 var(--goal-color);
  transform: rotate(-7deg);
}
.goal-burst.active {
  animation: goal-explosion 1s ease-out both;
}
.playing .special.ready {
  box-shadow:
    0 0 22px #baff29aa,
    inset 0 0 15px #baff2955;
  border-color: #e4ffb1;
}
.stage-art {
  box-shadow:
    0 0 14px color-mix(in srgb, var(--c), transparent 65%),
    inset 0 0 28px color-mix(in srgb, var(--c), transparent 65%);
}
@keyframes cutin {
  0% {
    opacity: 0;
    transform: translateX(-100%) skewX(-15deg);
  }
  14% {
    opacity: 1;
    transform: translateX(0) skewX(0);
  }
  70% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}
@keyframes goal-explosion {
  0% {
    opacity: 0;
    transform: scale(1.3);
  }
  15% {
    opacity: 1;
    transform: scale(1);
  }
  60% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cutin.active,
  .goal-burst.active {
    animation: calm-cue 1.2s both !important;
  }
  @keyframes calm-cue {
    0%,
    80% {
      opacity: 1;
    }
    100% {
      opacity: 0;
    }
  }
}
/* Corner cut-ins keep the rally visible. */
.playing .cutin {
  inset: auto auto calc(110px + env(safe-area-inset-bottom)) 12px;
  width: min(75vw, 420px);
  height: 62px;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  overflow: visible;
  --cutin-direction: -1;
}
.playing .cutin.opponent {
  inset: calc(105px + env(safe-area-inset-top)) 12px auto auto;
  align-items: flex-end;
  --cutin-direction: 1;
}
.playing .cutin:before {
  left: -8px;
  right: -8px;
  height: 60px;
  transform: skewX(-15deg);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--skill-color), transparent 88%),
    #07101a33,
    transparent
  );
  border-block: 1px solid color-mix(in srgb, var(--skill-color), transparent 50%);
  box-shadow: 0 0 18px color-mix(in srgb, var(--skill-color), transparent 75%);
}
.playing .cutin strong {
  font-size: clamp(22px, 6vw, 38px);
  text-align: left;
  text-shadow:
    0 0 13px var(--skill-color),
    1px 1px 0 var(--skill-color);
  opacity: 0.88;
}
.playing .cutin.opponent strong {
  text-align: right;
}
.playing .cutin.active {
  animation: corner-cutin 1.3s both;
}
@keyframes corner-cutin {
  0% {
    opacity: 0;
    transform: translateX(calc(var(--cutin-direction) * 45px));
  }
  15%,
  75% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .playing .cutin.active {
    animation: calm-cue 1.3s both !important;
  }
}
.art-ridge {
  background: linear-gradient(
    135deg,
    #a38460 0 20%,
    #493e32 21% 40%,
    #8e7253 41% 55%,
    #2b2926 56% 75%,
    #796046 76%
  );
  clip-path: polygon(0 25%, 20% 0, 40% 25%, 65% 0, 100% 20%, 100% 100%, 0 100%);
}
/* Readable event timing: quick entry, long hold, gentle exit. */
.playing .cutin.active {
  animation: readable-cutin 2.8s both;
}
.goal-burst.active {
  animation: readable-goal 2.2s both;
}
.goal-burst {
  z-index: 4;
}
.cutin {
  z-index: 5;
}
@keyframes readable-cutin {
  0% {
    opacity: 0;
    transform: translateX(calc(var(--cutin-direction) * 30px));
  }
  8%,
  85% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(0);
  }
}
@keyframes readable-goal {
  0% {
    opacity: 0;
    transform: scale(1.15);
  }
  8%,
  65% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.03);
  }
}
@media (prefers-reduced-motion: reduce) {
  .playing .cutin.active {
    animation: calm-cue 2.8s both !important;
  }
  .goal-burst.active {
    animation: calm-cue 2.2s both !important;
  }
}
.goal-burst:before {
  content: '';
  position: absolute;
  inset: -40%;
  background: repeating-conic-gradient(
    from 12deg,
    transparent 0deg 12deg,
    #ffcc5522 13deg 17deg,
    transparent 18deg 30deg
  );
  mask-image: radial-gradient(transparent 12%, #000 45%);
  transform: rotate(0);
}
.goal-burst.active:before {
  animation: prize-rays 2.2s ease-out both;
}
.goal-burst span {
  position: relative;
  background: linear-gradient(100deg, #fff5ba, #ffbf43, #fff, #9cffff, #fff5ba);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px #fff7b5;
  filter: drop-shadow(0 0 18px #ffc94e);
}
@keyframes prize-rays {
  from {
    transform: rotate(-20deg) scale(0.7);
  }
  to {
    transform: rotate(30deg) scale(1.2);
  }
}
@media (prefers-reduced-motion: reduce) {
  .goal-burst.active:before {
    animation: none !important;
  }
}
.mallet-preview {
  display: block;
  width: 100%;
  height: 98px;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  touch-action: auto;
  margin: 0 auto 5px;
}
.mallet {
  overflow: hidden;
}
@media (max-width: 480px) {
  .mallet-preview {
    height: 76px;
  }
}
.mode-select {
  padding: 32px 0;
}
.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.mode-cards button {
  padding: 30px;
  text-align: left;
  border: 1px solid #536b32;
  background: linear-gradient(130deg, #24321a, #121811);
  color: #eaf6df;
}
.mode-cards b {
  display: block;
  font:
    800 32px 'Russo One',
    sans-serif;
  color: var(--lime);
}
.mode-cards span {
  display: block;
  font-size: 18px;
  margin: 14px 0;
}
.mode-cards small {
  color: #a6b697;
  font-size: 11px;
  line-height: 1.8;
}
.online-setup {
  max-width: 880px;
  margin: 0 auto;
  padding: 26px 24px 60px;
}
.wizard-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wizard-top > span {
  margin-left: auto;
  font:
    700 16px 'Russo One',
    sans-serif;
  color: var(--lime);
}
.wizard-steps {
  list-style: none;
  display: flex;
  padding: 24px 0;
  gap: 6px;
  counter-reset: steps;
}
.wizard-steps li {
  flex: 1;
  padding: 10px 5px;
  border-bottom: 2px solid #333d2a;
  font-size: 11px;
  color: #7b8970;
  text-align: center;
}
.wizard-steps li:before {
  counter-increment: steps;
  content: counter(steps) ' ';
  font-weight: bold;
}
.wizard-steps .current {
  color: var(--lime);
  border-color: var(--lime);
}
.wizard-steps .done {
  color: #c4d5ad;
  border-color: #6b854b;
}
.online-setup h1 {
  font-size: clamp(27px, 5vw, 42px);
  letter-spacing: -1px;
  margin: 30px 0 14px;
}
.online-setup p {
  color: #aabb98;
  line-height: 1.9;
  font-size: 12px;
}
.online-setup .primary {
  margin-top: 24px;
  min-height: 52px;
}
.room-entry {
  max-width: 470px;
}
.room-entry form {
  margin-top: 28px;
}
.room-entry .join-row {
  height: 52px;
}
.room-entry .join-row button {
  width: 85px;
  font-size: 14px;
}
.player-slots {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: #202a1988;
  padding: 16px;
  color: #cfdfbd;
  font-size: 11px;
  border: 1px solid #39472c;
}
.online-setup .stages {
  gap: 14px;
}
.online-setup .stage-art {
  height: 95px;
}
.online-setup .mallet-preview {
  height: 140px;
}
.choice-detail {
  min-height: 48px;
}
.waiting-card {
  padding: 40px 20px;
  text-align: center;
  border: 1px dashed #53643f;
  color: #b8c7a7;
  margin-top: 25px;
}
.stage-result {
  text-align: center;
  padding: 45px 20px;
  border: 1px solid var(--lime);
  background: radial-gradient(ellipse, #48651955, transparent);
  margin-top: 25px;
}
.stage-result strong {
  display: block;
  font:
    800 48px 'Russo One',
    sans-serif;
  color: var(--lime);
  margin: 15px 0;
}
.stage-result small {
  letter-spacing: 3px;
  color: #a2b38e;
}
#online-error {
  color: #ffac8f;
}
#online-status {
  color: var(--lime);
}
@media (max-width: 600px) {
  .mode-cards {
    grid-template-columns: 1fr;
  }
  .online-setup {
    padding: 15px 16px 40px;
  }
  .online-setup .mallets {
    grid-template-columns: 1fr 1fr;
  }
  .online-setup .mallet-preview {
    height: 105px;
  }
  .wizard-steps li {
    font-size: 10px;
  }
  .wizard-top {
    gap: 6px;
  }
  .wizard-top > span {
    font-size: 13px;
  }
  .online-setup .stages {
    grid-template-columns: 1fr 1fr;
  }
  .player-slots {
    padding: 12px;
    font-size: 10px;
  }
}
