:root {
  color-scheme: dark;
  --rg-bg: #050608;
  --rg-panel: rgba(8, 10, 16, .74);
  --rg-line: rgba(255, 255, 255, .12);
  --rg-text: #f5f7f8;
  --rg-muted: rgba(238, 244, 247, .58);
  --rg-cyan: #4cf4ff;
  --rg-magenta: #ff4fd8;
  --rg-amber: #ffc857;
  --rg-violet: #9878ff;
  --rg-green: #76ffb7;
  --rg-danger: #ff5570;
  --rg-safe-top: env(safe-area-inset-top, 0px);
  --rg-safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--rg-bg); overscroll-behavior: none; }
body { min-height: 100svh; overflow: hidden; color: var(--rg-text); }
button, a { font: inherit; }
button { color: inherit; }

.rgx-app {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(76,244,255,.09), transparent 32%),
    radial-gradient(circle at 82% 78%, rgba(255,79,216,.08), transparent 34%),
    #050608;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.rgx-app::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .28;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, #000 0 35%, transparent 84%);
}
.rgx-app[data-flash="1"]::after {
  position: absolute; inset: 0; z-index: 50; content: ""; pointer-events: none;
  background: rgba(255,255,255,.85); animation: rgxFlash .16s ease-out both;
}

.rgx-bg, .rgx-game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.rgx-bg { z-index: 0; opacity: .86; }
.rgx-game { z-index: 2; }

.rgx-topbar {
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: calc(64px + var(--rg-safe-top));
  padding: calc(10px + var(--rg-safe-top)) clamp(12px, 2.5vw, 28px) 10px;
  border-bottom: 1px solid var(--rg-line);
  background: linear-gradient(180deg, rgba(5,6,8,.91), rgba(5,6,8,.44));
  backdrop-filter: blur(16px) saturate(120%);
}
.rgx-brand { display: flex; align-items: baseline; gap: 9px; letter-spacing: -.03em; }
.rgx-brand b { font-size: clamp(1rem, 2.8vw, 1.38rem); font-weight: 950; }
.rgx-brand span { color: var(--rg-muted); font-size: .62rem; font-weight: 850; letter-spacing: .14em; }
.rgx-live { display: flex; align-items: center; gap: 10px; justify-self: center; }
.rgx-live span { color: var(--rg-muted); font-size: .56rem; font-weight: 850; letter-spacing: .13em; }
.rgx-live b { min-width: 5.5ch; text-align: center; font-size: .78rem; letter-spacing: .08em; }
.rgx-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--rg-cyan); box-shadow: 0 0 16px var(--rg-cyan); }
.rgx-actions { display: flex; justify-self: end; gap: 8px; }
.rgx-icon-btn {
  display: grid; place-items: center; width: 38px; aspect-ratio: 1; border: 1px solid var(--rg-line); border-radius: 50%;
  background: rgba(255,255,255,.035); cursor: pointer; transition: background .18s ease, transform .18s ease, border-color .18s ease;
}
.rgx-icon-btn:hover, .rgx-icon-btn:focus-visible { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.28); transform: translateY(-1px); outline: none; }
.rgx-demo-link {
  position: absolute; z-index: 16; top: calc(71px + var(--rg-safe-top)); left: 14px; color: rgba(255,255,255,.44); text-decoration: none;
  font-size: .56rem; font-weight: 850; letter-spacing: .13em; transition: color .2s ease;
}
.rgx-demo-link:hover, .rgx-demo-link:focus-visible { color: #fff; outline: none; }

.rgx-stage { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(circle at 50% 48%, rgba(76,244,255,.075), rgba(152,120,255,.035) 38%, rgba(4,5,8,.96) 76%), #05070b; }
.rgx-stage::after {
  position: absolute; inset: 0; z-index: 3; content: ""; pointer-events: none;
  background: radial-gradient(circle at 50% 48%, transparent 0 40%, rgba(5,6,8,.25) 72%, rgba(5,6,8,.8) 100%);
}
.rgx-scoreline {
  position: absolute; z-index: 7; top: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  padding: 7px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 999px; background: rgba(0,0,0,.26); backdrop-filter: blur(10px);
  color: rgba(255,255,255,.72); font-size: .58rem; font-weight: 850; letter-spacing: .12em; white-space: nowrap;
}
.rgx-scoreline strong { color: #fff; font-size: .7rem; }
.rgx-resonance { position: absolute; z-index: 7; right: 14px; top: 52px; width: 3px; height: 29%; min-height: 90px; background: rgba(255,255,255,.08); overflow: hidden; }
.rgx-resonance i { position: absolute; inset: auto 0 0; height: 0%; background: linear-gradient(0deg, var(--rg-magenta), var(--rg-cyan)); box-shadow: 0 0 16px var(--rg-cyan); transition: height .2s ease; }
.rgx-resonance span { position: absolute; right: 9px; bottom: 0; writing-mode: vertical-rl; transform: rotate(180deg); color: rgba(255,255,255,.35); font-size: .5rem; letter-spacing: .12em; }

.rgx-event {
  position: absolute; z-index: 10; top: 50%; left: 50%; transform: translate3d(-50%, -50%, 0) scale(.9); width: min(90vw, 760px); text-align: center;
  pointer-events: none; opacity: 0; will-change:transform,opacity; contain:paint; backface-visibility:hidden;
}
.rgx-event.is-visible { animation: rgxEvent 1.15s cubic-bezier(.16,.82,.2,1) both; }
.rgx-event small { display: block; margin-bottom: 6px; color: var(--rg-cyan); font-size: .58rem; font-weight: 900; letter-spacing: .22em; }
.rgx-event b { display: block; font-size: clamp(2.2rem, 10vw, 7.4rem); line-height: .88; letter-spacing: -.075em; text-shadow: 0 0 34px rgba(76,244,255,.25); }
.rgx-event span { display: block; margin-top: 10px; color: rgba(255,255,255,.62); font-size: .72rem; font-weight: 780; letter-spacing: .14em; }

.rgx-intro, .rgx-over, .rgx-panel {
  position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: clamp(18px, 5vw, 44px); background: rgba(3,4,6,.72); backdrop-filter: blur(18px) saturate(125%);
}
.rgx-intro { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.rgx-intro button { touch-action: manipulation; }
.rgx-intro[hidden], .rgx-over[hidden], .rgx-panel[hidden] { display: none; }
.rgx-intro-inner { width: min(100%, 780px); text-align: center; }
.rgx-kicker { margin: 0 0 14px; color: var(--rg-cyan); font-size: .61rem; font-weight: 900; letter-spacing: .2em; }
.rgx-title { position: relative; margin: 0; font-size: clamp(4.6rem, 20vw, 12rem); line-height: .8; font-weight: 950; letter-spacing: -.105em; }
.rgx-title::after { position: absolute; left: 51%; top: -9%; width: 1px; height: 118%; content: ""; background: linear-gradient(transparent, rgba(255,255,255,.45), transparent); transform: rotate(7deg); }
.rgx-subtitle { margin: 18px 0 0; color: rgba(255,255,255,.78); font-size: clamp(.92rem, 3vw, 1.25rem); font-weight: 820; letter-spacing: .2em; }
.rgx-intro-copy { max-width: 39rem; margin: 26px auto 0; color: var(--rg-muted); font-size: clamp(.8rem, 2.7vw, 1rem); line-height: 1.8; }
.rgx-starts { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 27px; }
.rgx-primary, .rgx-secondary {
  min-height: 48px; padding: 0 19px; border-radius: 999px; cursor: pointer; font-weight: 900; letter-spacing: .08em; transition: transform .18s ease, background .18s ease, color .18s ease;
}
.rgx-primary { border: 0; background: #f7f8f8; color: #08090b; }
.rgx-secondary { border: 1px solid var(--rg-line); background: rgba(255,255,255,.035); color: #fff; }
.rgx-primary:hover, .rgx-secondary:hover, .rgx-primary:focus-visible, .rgx-secondary:focus-visible { transform: translateY(-2px); outline: none; }
.rgx-primary:active, .rgx-secondary:active { transform: translateY(0) scale(.98); }
.rgx-intro-meta { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 20px; color: rgba(255,255,255,.34); font-size: .55rem; font-weight: 800; letter-spacing: .11em; }

.rgx-controls {
  position: relative; z-index: 13; padding: 8px clamp(10px, 2.8vw, 28px) calc(10px + var(--rg-safe-bottom)); border-top: 1px solid var(--rg-line);
  background: linear-gradient(0deg, rgba(5,6,8,.98), rgba(5,6,8,.76)); backdrop-filter: blur(18px) saturate(120%);
}
.rgx-rule-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; max-width: 760px; margin: 0 auto; }
.rgx-rule {
  position: relative; min-width: 0; min-height: 51px; padding: 7px 5px; overflow: hidden; border: 1px solid rgba(255,255,255,.09); border-radius: 10px;
  background: rgba(255,255,255,.035); color: rgba(255,255,255,.54); cursor: pointer; transition: border-color .18s ease, color .18s ease, transform .18s ease, background .18s ease;
}
.rgx-rule::before { position: absolute; inset: auto 10px 5px; height: 1px; content: ""; background: currentColor; opacity: .28; transform: scaleX(0); transition: transform .2s ease; }
.rgx-rule b { display: block; overflow: hidden; font-size: clamp(.69rem, 2.3vw, .86rem); font-weight: 930; letter-spacing: .08em; text-overflow: ellipsis; }
.rgx-rule span { display: block; margin-top: 3px; color: rgba(255,255,255,.34); font-size: .48rem; font-weight: 800; letter-spacing: .06em; }
.rgx-rule[disabled] { opacity: .26; cursor: not-allowed; }
.rgx-rule:not([disabled]):hover, .rgx-rule:not([disabled]):focus-visible { border-color: rgba(255,255,255,.28); color: #fff; outline: none; transform: translateY(-1px); }
.rgx-rule[aria-pressed="true"] { color: #fff; border-color: rgba(76,244,255,.58); background: linear-gradient(180deg, rgba(76,244,255,.13), rgba(255,255,255,.045)); box-shadow: inset 0 0 22px rgba(76,244,255,.06); }
.rgx-rule[aria-pressed="true"]::before { transform: scaleX(1); }
.rgx-help { display: flex; justify-content: center; gap: 14px; margin-top: 7px; color: rgba(255,255,255,.29); font-size: .49rem; font-weight: 760; letter-spacing: .08em; white-space: nowrap; }

.rgx-over-inner, .rgx-panel-inner {
  width: min(100%, 560px); max-height: min(84svh, 680px); overflow: auto; padding: clamp(22px, 5vw, 38px); border: 1px solid rgba(255,255,255,.13); border-radius: 18px;
  background: linear-gradient(180deg, rgba(16,18,25,.94), rgba(7,8,11,.97)); box-shadow: 0 34px 100px rgba(0,0,0,.48);
}
.rgx-over small, .rgx-panel-eyebrow { color: var(--rg-cyan); font-size: .58rem; font-weight: 900; letter-spacing: .17em; }
.rgx-over h2, .rgx-panel h2 { margin: 8px 0 10px; font-size: clamp(2.1rem, 9vw, 4.5rem); line-height: .95; letter-spacing: -.065em; }
.rgx-over p, .rgx-panel p { color: var(--rg-muted); line-height: 1.75; }
.rgx-over-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 24px 0; }
.rgx-over-stats div { padding: 13px 8px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; text-align: center; }
.rgx-over-stats b { display: block; font-size: 1.15rem; }
.rgx-over-stats span { display: block; margin-top: 3px; color: rgba(255,255,255,.38); font-size: .48rem; font-weight: 800; letter-spacing: .1em; }
.rgx-over-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rgx-over-actions > * { flex: 1 1 120px; }
.rgx-inspiration { display: grid; gap: 8px; margin: 18px 0 0; }
.rgx-inspiration article { display: grid; grid-template-columns: 5.4rem 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.08); }
.rgx-inspiration b { font-size: .72rem; letter-spacing: .08em; }
.rgx-inspiration span { color: var(--rg-muted); font-size: .72rem; line-height: 1.55; }
.rgx-panel-close { float: right; width: 34px; aspect-ratio: 1; border: 1px solid var(--rg-line); border-radius: 50%; background: transparent; cursor: pointer; }
.rgx-panel-close:focus-visible { outline: 2px solid var(--rg-cyan); outline-offset: 2px; }

.rgx-toast {
  position: absolute; z-index: 30; left: 50%; bottom: calc(86px + var(--rg-safe-bottom)); transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  padding: 9px 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(3,4,6,.86); color: rgba(255,255,255,.83);
  font-size: .58rem; font-weight: 850; letter-spacing: .08em; transition: opacity .18s ease, transform .18s ease;
}
.rgx-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.rgx-install[hidden] { display: none; }
.rgx-app.is-shaking { animation: rgxShake .24s linear; }

@keyframes rgxFlash { from { opacity: .8; } to { opacity: 0; } }
@keyframes rgxEvent { 0% { opacity:0; transform:translate3d(-50%,-50%,0) scale(.82); } 18%,68% { opacity:1; transform:translate3d(-50%,-50%,0) scale(1); } 100% { opacity:0; transform:translate3d(-50%,-54%,0) scale(1.035); } }
@keyframes rgxShake { 0%,100%{transform:translate(0)} 20%{transform:translate(-3px,2px)} 40%{transform:translate(3px,-2px)} 60%{transform:translate(-2px,-1px)} 80%{transform:translate(2px,1px)} }

@media (min-width: 900px) {
  .rgx-app { grid-template-rows: auto minmax(0, 1fr) auto; }
  .rgx-controls { padding-bottom: 14px; }
  .rgx-rule { min-height: 57px; }
  .rgx-help { font-size: .54rem; }
}

@media (max-width: 520px) {
  .rgx-topbar { grid-template-columns: 1fr auto; }
  .rgx-live { position: absolute; left: 50%; bottom: -21px; transform: translateX(-50%); }
  .rgx-brand span { display: none; }
  .rgx-scoreline { top: 28px; }
  .rgx-demo-link { top: calc(69px + var(--rg-safe-top)); font-size: .49rem; }
  .rgx-resonance { top: 64px; right: 9px; height: 24%; }
  .rgx-rule { min-height: 48px; border-radius: 9px; }
  .rgx-rule span { font-size: .43rem; }
  .rgx-help { gap: 9px; font-size: .43rem; }
  .rgx-intro { align-items: end; padding-bottom: calc(104px + var(--rg-safe-bottom)); }
  .rgx-intro-copy { font-size: .77rem; }
  .rgx-intro-meta { display: none; }
}



/* Short landscape / tablet start-screen guard: the primary action must never sit below the playable viewport. */
@media (max-height: 900px) {
  .rgx-intro { align-items: center; padding: 10px 18px 84px; }
  .rgx-intro-inner { width: min(100%, 860px); }
  .rgx-kicker { margin-bottom: 7px; font-size: .55rem; }
  .rgx-title { font-size: clamp(3.4rem, 16vh, 7.4rem); }
  .rgx-subtitle { margin-top: 8px; font-size: clamp(.75rem, 2.2vh, 1rem); }
  .rgx-intro-copy { max-width: 46rem; margin-top: 12px; font-size: clamp(.68rem, 1.75vh, .88rem); line-height: 1.5; }
  .rgx-intro-meta { display: none; }
  .rgx-starts {
    position: absolute; z-index: 24; left: 50%; bottom: max(8px, var(--rg-safe-bottom)); transform: translateX(-50%);
    width: min(96%, 780px); margin: 0; padding: 7px; flex-wrap: nowrap; overflow-x: auto;
    border: 1px solid rgba(255,255,255,.10); border-radius: 999px;
    background: rgba(4,6,10,.82); backdrop-filter: blur(16px) saturate(130%); box-shadow: 0 10px 34px rgba(0,0,0,.34);
  }
  .rgx-starts > button { flex: 0 0 auto; min-height: 46px; }
  .rgx-primary { min-width: 190px; }
}

@media (max-height: 620px) {
  .rgx-intro { padding-bottom: 78px; }
  .rgx-title { font-size: clamp(3rem, 18vh, 5.2rem); }
  .rgx-intro-copy:not([data-challenge-copy]) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .rgx-bg { display: none; }
}

@media (max-width: 520px) {
  .rgx-scoreline { gap: 8px; padding-inline: 9px; font-size: .49rem; }
  .rgx-scoreline strong { font-size: .61rem; }
}

/* RE:GENESIS AAA pass: richer HUD, audio matrix, responsive density and cinematic depth. */
.rgx-app { --rg-accent: var(--rg-cyan); --rg-intensity: 0; }
.rgx-app[data-mode="link"] { --rg-accent: var(--rg-magenta); }
.rgx-app[data-mode="fuse"] { --rg-accent: var(--rg-amber); }
.rgx-app[data-mode="break"] { --rg-accent: var(--rg-violet); }
.rgx-stage::before {
  position:absolute; inset:0; z-index:1; content:""; pointer-events:none; opacity:.34;
  background:
    repeating-linear-gradient(180deg, transparent 0 3px, rgba(255,255,255,.012) 3px 4px),
    linear-gradient(90deg, transparent 0 49.85%, rgba(255,255,255,.035) 50%, transparent 50.15%),
    radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--rg-accent) 13%, transparent), transparent 48%);
  mix-blend-mode:screen;
}
.rgx-stage-frame { position:absolute; inset:13px; z-index:6; pointer-events:none; opacity:.46; }
.rgx-stage-frame i { position:absolute; width:34px; height:34px; border-color:color-mix(in srgb, var(--rg-accent) 62%, white 12%); filter:drop-shadow(0 0 7px color-mix(in srgb, var(--rg-accent) 40%, transparent)); }
.rgx-stage-frame i:nth-child(1){left:0;top:0;border-left:1px solid;border-top:1px solid}
.rgx-stage-frame i:nth-child(2){right:0;top:0;border-right:1px solid;border-top:1px solid}
.rgx-stage-frame i:nth-child(3){left:0;bottom:0;border-left:1px solid;border-bottom:1px solid}
.rgx-stage-frame i:nth-child(4){right:0;bottom:0;border-right:1px solid;border-bottom:1px solid}
.rgx-world-rail {
  position:absolute; z-index:7; left:18px; top:50%; transform:translateY(-50%); display:grid; gap:10px;
  color:rgba(255,255,255,.32); font:800 .49rem/1 ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing:.16em;
  writing-mode:vertical-rl;
}
.rgx-world-rail b { color:var(--rg-accent); font-size:.56rem; text-shadow:0 0 12px color-mix(in srgb,var(--rg-accent) 55%,transparent); }
.rgx-scoreline { border-color:color-mix(in srgb,var(--rg-accent) 18%,rgba(255,255,255,.08)); box-shadow:0 8px 34px rgba(0,0,0,.20), inset 0 0 18px color-mix(in srgb,var(--rg-accent) 5%,transparent); }
.rgx-resonance { box-shadow:0 0 0 1px rgba(255,255,255,.025),0 0 22px color-mix(in srgb,var(--rg-accent) 12%,transparent); }
.rgx-resonance i { background:linear-gradient(0deg,var(--rg-magenta),var(--rg-accent)); }
.rgx-rule[aria-pressed="true"] { border-color:color-mix(in srgb,var(--rg-accent) 65%,white 8%); background:linear-gradient(180deg,color-mix(in srgb,var(--rg-accent) 14%,transparent),rgba(255,255,255,.04)); box-shadow:inset 0 0 22px color-mix(in srgb,var(--rg-accent) 7%,transparent),0 0 18px color-mix(in srgb,var(--rg-accent) 7%,transparent); }

.rgx-audio-button[data-muted="1"] { opacity:.48; }
.rgx-audio-button[data-muted="1"]::after { content:""; position:absolute; width:18px; height:1px; background:var(--rg-danger); transform:rotate(-42deg); }
.rgx-audio-popover {
  position:absolute; z-index:40; right:clamp(10px,2.5vw,28px); top:calc(58px + var(--rg-safe-top)); width:min(92vw,330px);
  padding:14px; border:1px solid rgba(255,255,255,.13); border-radius:16px;
  background:linear-gradient(180deg,rgba(12,16,23,.97),rgba(4,6,10,.96)); box-shadow:0 24px 70px rgba(0,0,0,.5),0 0 38px color-mix(in srgb,var(--rg-accent) 9%,transparent);
  backdrop-filter:blur(22px) saturate(135%);
}
.rgx-audio-popover[hidden] { display:none; }
.rgx-audio-popover > p { margin:10px 2px 0; color:rgba(255,255,255,.34); font:760 .52rem/1.55 ui-monospace,monospace; letter-spacing:.11em; }
.rgx-audio-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.rgx-audio-head > span { color:rgba(255,255,255,.45); font-size:.55rem; font-weight:900; letter-spacing:.18em; }
.rgx-audio-head button,
.rgx-audio-strip > button {
  display:flex; align-items:center; gap:7px; min-height:36px; padding:0 10px; border:1px solid rgba(255,255,255,.13); border-radius:999px;
  background:rgba(255,255,255,.045); color:#fff; cursor:pointer;
}
.rgx-audio-head button i,
.rgx-audio-strip > button i { width:7px; height:7px; border-radius:50%; background:var(--rg-green); box-shadow:0 0 11px var(--rg-green); }
.rgx-audio-head button[aria-pressed="false"] i,
.rgx-audio-strip > button[aria-pressed="false"] i { background:var(--rg-danger); box-shadow:0 0 10px var(--rg-danger); }
.rgx-audio-head button b,.rgx-audio-strip > button b { font-size:.58rem; letter-spacing:.11em; }
.rgx-audio-head button small,.rgx-audio-strip > button small { color:rgba(255,255,255,.5); font-size:.5rem; }
.rgx-volume-row { display:grid; grid-template-columns:52px minmax(0,1fr) 30px; gap:10px; align-items:center; min-height:40px; }
.rgx-volume-row > span,.rgx-audio-strip label > span { color:rgba(255,255,255,.52); font-size:.52rem; font-weight:900; letter-spacing:.12em; }
.rgx-volume-row output,.rgx-audio-strip output { color:#fff; font:850 .58rem/1 ui-monospace,monospace; text-align:right; }
.rgx-volume-row input,.rgx-audio-strip input { width:100%; height:28px; margin:0; accent-color:var(--rg-accent); cursor:pointer; }

.rgx-bootline { display:flex; align-items:center; justify-content:center; gap:10px; margin:17px auto 0; color:rgba(255,255,255,.33); font-size:.52rem; font-weight:850; letter-spacing:.14em; }
.rgx-bootline i { width:22px; height:1px; background:linear-gradient(90deg,transparent,var(--rg-accent),transparent); opacity:.65; }
.rgx-audio-strip {
  display:grid; grid-template-columns:auto minmax(120px,1fr) minmax(120px,1fr); align-items:center; gap:11px;
  width:min(100%,620px); margin:14px auto 0; padding:8px 10px; border:1px solid rgba(255,255,255,.1); border-radius:14px;
  background:rgba(5,8,13,.63); box-shadow:inset 0 0 30px color-mix(in srgb,var(--rg-accent) 4%,transparent); backdrop-filter:blur(12px);
}
.rgx-audio-strip label { display:grid; grid-template-columns:44px minmax(0,1fr) 28px; gap:7px; align-items:center; }
.rgx-panel-audio { margin:20px 0; padding:13px; border:1px solid rgba(255,255,255,.09); border-radius:14px; background:rgba(0,0,0,.16); }

.rgx-intro { background:radial-gradient(circle at 50% 40%,color-mix(in srgb,var(--rg-accent) 12%,transparent),transparent 32%),rgba(3,4,6,.76); }
.rgx-intro-inner { position:relative; }
.rgx-intro-inner::before { content:"RE:GENESIS // WORLD BOOT"; display:block; margin:0 auto 15px; color:rgba(255,255,255,.19); font:800 .48rem/1 ui-monospace,monospace; letter-spacing:.3em; }
.rgx-title { text-shadow:-2px 0 color-mix(in srgb,var(--rg-magenta) 28%,transparent),2px 0 color-mix(in srgb,var(--rg-cyan) 34%,transparent),0 0 54px rgba(76,244,255,.13); }
.rgx-title::before { content:"再生"; position:absolute; inset:0; color:transparent; -webkit-text-stroke:1px rgba(255,255,255,.08); transform:translate(5px,3px); filter:blur(.3px); pointer-events:none; }
.rgx-primary { box-shadow:0 10px 26px rgba(0,0,0,.22),0 0 26px rgba(255,255,255,.05); }
.rgx-starts .rgx-primary { min-width:210px; }

@media (min-width: 900px) and (min-height: 700px) {
  .rgx-stage-frame { inset:18px; }
  .rgx-world-rail { left:24px; }
  .rgx-intro-copy { max-width:43rem; }
}

@media (max-width: 760px) {
  .rgx-world-rail { display:none; }
  .rgx-stage-frame { inset:8px; opacity:.32; }
  .rgx-audio-strip { grid-template-columns:1fr 1fr; max-width:430px; }
  .rgx-audio-strip > button { grid-column:1 / -1; justify-content:center; }
  .rgx-bootline { gap:7px; font-size:.46rem; }
  .rgx-bootline i { width:12px; }
}

@media (max-width: 520px) {
  .rgx-actions { gap:5px; }
  .rgx-icon-btn { width:35px; }
  .rgx-audio-popover { right:7px; top:calc(55px + var(--rg-safe-top)); width:min(95vw,325px); }
  .rgx-audio-strip { width:min(100%,360px); gap:7px; padding:7px; }
  .rgx-audio-strip label { grid-template-columns:38px minmax(0,1fr) 24px; gap:5px; }
  .rgx-bootline span:nth-of-type(3), .rgx-bootline i:nth-of-type(2) { display:none; }
}

@media (max-height: 700px) and (orientation: landscape) {
  .rgx-topbar { min-height:calc(50px + var(--rg-safe-top)); padding-top:calc(6px + var(--rg-safe-top)); padding-bottom:6px; }
  .rgx-demo-link { top:calc(54px + var(--rg-safe-top)); }
  .rgx-controls { padding-top:5px; padding-bottom:calc(6px + var(--rg-safe-bottom)); }
  .rgx-rule { min-height:43px; }
  .rgx-help { display:none; }
  .rgx-scoreline { top:7px; padding:5px 9px; }
  .rgx-resonance { top:38px; height:30%; }
  .rgx-intro-inner::before { display:none; }
  .rgx-bootline { margin-top:8px; }
  .rgx-audio-strip-intro { position:absolute; left:50%; top:4px; transform:translateX(-50%); width:min(72vw,620px); margin:0; opacity:.95; }
  .rgx-intro-copy { margin-top:9px; }
}

@media (max-height: 540px) and (orientation: landscape) {
  .rgx-audio-strip-intro { display:none; }
  .rgx-title { font-size:clamp(2.8rem,17vh,4.5rem); }
  .rgx-subtitle { margin-top:5px; }
  .rgx-bootline { margin-top:6px; }
  .rgx-intro { padding-top:5px; }
  .rgx-rule span { display:none; }
  .rgx-rule { min-height:36px; }
}

/* RE:GENESIS desktop command-deck correction + responsive intro hierarchy. */
.rgx-intro-inner {
  width:min(94vw,1180px);
  max-width:none;
}
.rgx-intro-identity { min-width:0; }
.rgx-intro-command {
  min-width:0;
  padding:clamp(16px,2vw,24px);
  border:1px solid rgba(255,255,255,.11);
  border-radius:20px;
  background:linear-gradient(180deg,rgba(10,14,21,.78),rgba(4,6,10,.67));
  box-shadow:0 24px 80px rgba(0,0,0,.38), inset 0 0 50px color-mix(in srgb,var(--rg-accent) 4%,transparent);
  backdrop-filter:blur(18px) saturate(125%);
}
.rgx-command-label { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; color:rgba(255,255,255,.35); font:800 .5rem/1 ui-monospace,monospace; letter-spacing:.16em; }
.rgx-command-label b { color:var(--rg-accent); font-size:.54rem; }
.rgx-intro-command .rgx-bootline { margin:0 0 14px; justify-content:flex-start; }
.rgx-intro-command .rgx-starts { position:static; transform:none; width:100%; margin:0; padding:0; border:0; border-radius:0; background:none; box-shadow:none; backdrop-filter:none; overflow:visible; justify-content:flex-start; }
.rgx-intro-command .rgx-audio-strip { position:static; transform:none; width:100%; max-width:none; margin:14px 0 0; opacity:1; }
.rgx-intro-command .rgx-intro-meta { justify-content:flex-start; margin-top:14px; }

@media (min-width: 900px) {
  .rgx-intro { padding:clamp(26px,4vw,58px); }
  .rgx-intro-inner {
    display:grid;
    grid-template-columns:minmax(0,1.2fr) minmax(390px,.8fr);
    align-items:center;
    gap:clamp(42px,6vw,92px);
    text-align:left;
  }
  .rgx-kicker { margin-bottom:16px; }
  .rgx-title { font-size:clamp(6.2rem,11vw,10.5rem); }
  .rgx-subtitle { margin-top:18px; }
  .rgx-intro-copy { margin:24px 0 0; max-width:38rem; }
  .rgx-intro-inner::before { display:none; }
  .rgx-intro-command .rgx-starts { flex-wrap:wrap; }
  .rgx-intro-command .rgx-starts > button { flex:1 1 135px; }
  .rgx-intro-command .rgx-starts .rgx-primary { flex-basis:100%; min-width:0; min-height:58px; font-size:1rem; }
  .rgx-intro-command .rgx-audio-strip { grid-template-columns:1fr; }
  .rgx-intro-command .rgx-audio-strip > button { justify-content:center; }
  .rgx-intro-command .rgx-audio-strip label { grid-template-columns:52px minmax(0,1fr) 32px; }
}

@media (min-width: 900px) and (max-height: 760px) {
  .rgx-intro { padding:14px clamp(24px,3vw,44px); align-items:center; }
  .rgx-intro-inner { gap:clamp(28px,4vw,58px); }
  .rgx-title { font-size:clamp(4.8rem,13vh,7.2rem); }
  .rgx-kicker { margin-bottom:8px; }
  .rgx-subtitle { margin-top:9px; font-size:.9rem; }
  .rgx-intro-copy { margin-top:13px; font-size:.78rem; line-height:1.52; }
  .rgx-intro-command { padding:14px 16px; }
  .rgx-intro-command .rgx-bootline { margin-bottom:9px; }
  .rgx-intro-command .rgx-starts .rgx-primary { min-height:50px; }
  .rgx-intro-command .rgx-audio-strip { margin-top:9px; padding:6px 8px; gap:6px; }
  .rgx-intro-command .rgx-intro-meta { display:none; }
  .rgx-audio-strip-intro { position:static; left:auto; top:auto; transform:none; width:100%; margin:9px 0 0; opacity:1; }
}

@media (max-width: 899px) {
  .rgx-intro-inner { display:block; width:min(100%,760px); text-align:center; }
  .rgx-intro-command { width:min(100%,620px); margin:20px auto 0; padding:13px; }
  .rgx-intro-command .rgx-bootline { justify-content:center; }
  .rgx-intro-command .rgx-starts { justify-content:center; }
  .rgx-intro-command .rgx-audio-strip { grid-template-columns:1fr 1fr; }
  .rgx-intro-command .rgx-audio-strip > button { grid-column:1/-1; justify-content:center; }
  .rgx-intro-command .rgx-intro-meta { justify-content:center; }
}

@media (max-width: 899px) and (max-height: 760px) and (orientation: landscape) {
  .rgx-intro { align-items:center; padding:8px 12px; }
  .rgx-intro-inner { display:grid; grid-template-columns:minmax(0,1.05fr) minmax(330px,.95fr); gap:18px; text-align:left; max-width:980px; }
  .rgx-title { font-size:clamp(3.2rem,18vh,5.4rem); }
  .rgx-kicker { margin-bottom:5px; }
  .rgx-subtitle { margin-top:5px; font-size:.76rem; }
  .rgx-intro-copy { margin-top:8px; font-size:.68rem; line-height:1.45; }
  .rgx-intro-command { margin:0; padding:10px; }
  .rgx-command-label { margin-bottom:7px; }
  .rgx-intro-command .rgx-bootline { justify-content:flex-start; margin-bottom:7px; }
  .rgx-intro-command .rgx-starts { flex-wrap:wrap; justify-content:flex-start; }
  .rgx-intro-command .rgx-starts > button { min-height:42px; flex:1 1 90px; }
  .rgx-intro-command .rgx-starts .rgx-primary { flex-basis:100%; }
  .rgx-intro-command .rgx-audio-strip { display:grid; grid-template-columns:1fr 1fr; margin-top:7px; padding:5px 7px; }
  .rgx-intro-command .rgx-audio-strip > button { grid-column:1/-1; min-height:30px; }
  .rgx-intro-command .rgx-intro-meta { display:none; }
}

@media (max-width: 620px) {
  .rgx-intro { align-items:start; padding:18px 12px calc(18px + var(--rg-safe-bottom)); }
  .rgx-title { font-size:clamp(4.4rem,23vw,7rem); }
  .rgx-intro-copy { margin-top:17px; }
  .rgx-intro-command { margin-top:16px; border-radius:16px; }
  .rgx-intro-command .rgx-starts { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
  .rgx-intro-command .rgx-starts .rgx-primary { grid-column:1/-1; width:100%; }
  .rgx-intro-command .rgx-starts > button { width:100%; min-height:48px; }
  .rgx-intro-command .rgx-audio-strip { grid-template-columns:1fr; }
  .rgx-intro-command .rgx-audio-strip > button { grid-column:auto; }
  .rgx-intro-command .rgx-intro-meta { display:none; }
}

/* RE:GENESIS PHASE A / clear-playfield HUD pass: persistent information stays outside the board. */
.rgx-app { --rg-beat:0; }
.rgx-stage { box-shadow:inset 0 0 calc(22px + 18px * var(--rg-beat)) color-mix(in srgb,var(--rg-accent) 9%,transparent); }
.rgx-stage-frame { filter:brightness(calc(1 + var(--rg-beat) * .16)); }
.rgx-stage-frame i { transition:border-color .08s linear,filter .08s linear,opacity .08s linear; opacity:calc(.58 + var(--rg-beat) * .2); }

/* The header owns all persistent HUD. Nothing below this deck may cover the playfield. */
.rgx-topbar {
  grid-template-areas:"brand live actions" "hud hud hud";
  row-gap:7px;
  padding-bottom:8px;
}
.rgx-brand { grid-area:brand; color:inherit; text-decoration:none; min-width:0; }
.rgx-live { grid-area:live; position:static; left:auto; bottom:auto; transform:none; }
.rgx-actions { grid-area:actions; }
.rgx-hud-deck {
  grid-area:hud;
  display:none;
  grid-template-columns:minmax(300px,.92fr) minmax(330px,1.08fr);
  align-items:center;
  gap:8px;
  width:min(100%,980px);
  margin:0 auto;
}
.rgx-app[data-playing="1"] .rgx-hud-deck { display:grid; }
.rgx-scoreline {
  position:static; inset:auto; transform:none;
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); align-items:center; gap:0;
  width:100%; min-width:0; padding:7px 10px;
  border:1px solid rgba(255,255,255,.085); border-radius:12px;
  background:rgba(1,4,8,.58); backdrop-filter:blur(10px);
  color:rgba(255,255,255,.55); font-size:.51rem; font-weight:850; letter-spacing:.09em; white-space:nowrap;
}
.rgx-scoreline span { min-width:0; text-align:center; overflow:hidden; text-overflow:ellipsis; }
.rgx-scoreline strong { color:#fff; font-size:.63rem; font-variant-numeric:tabular-nums; }

.rgx-next-rail {
  position:static; inset:auto; transform:none;
  width:100%; min-width:0; display:grid; grid-template-columns:auto minmax(150px,1.25fr) minmax(118px,.9fr) minmax(118px,.9fr); align-items:stretch; gap:4px; padding:5px 7px;
  border:1px solid rgba(255,255,255,.085); border-radius:12px;
  background:rgba(1,4,8,.58); box-shadow:inset 0 0 22px color-mix(in srgb,var(--rg-accent) 3%,transparent);
  backdrop-filter:blur(10px); pointer-events:none;
}
.rgx-next-title { align-self:center; color:rgba(255,255,255,.38); font:900 .46rem/1 ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing:.16em; }
.rgx-next-item { display:grid; grid-template-columns:15px minmax(0,1fr); gap:5px; align-items:center; min-height:46px; padding:3px 6px; border-left:1px solid rgba(255,255,255,.055); }
.rgx-next-item b { align-self:start; padding-top:4px; color:rgba(255,255,255,.25); font:850 .42rem/1 ui-monospace,monospace; letter-spacing:.06em; }
.rgx-next-item.is-primary { background:linear-gradient(90deg,color-mix(in srgb,var(--rg-accent) 6%,transparent),transparent 72%); }
.rgx-next-item.is-primary b { color:var(--rg-accent); }
.rgx-next-piece { --next-cell:17px; display:grid; place-content:center; align-self:center; justify-self:stretch; width:100%; min-height:42px; }
.rgx-next-item.is-primary .rgx-next-piece { --next-cell:21px; }
.rgx-next-piece i {
  display:grid; place-items:center; width:100%; max-width:none; aspect-ratio:1; justify-self:center; align-self:center;
  border:1px solid color-mix(in srgb,var(--nc) 72%,white 15%); border-radius:3px;
  background:linear-gradient(145deg,color-mix(in srgb,var(--nc) 88%,white 8%),color-mix(in srgb,var(--nc) 58%,black 34%));
  box-shadow:inset 0 0 7px rgba(255,255,255,.14),0 0 7px color-mix(in srgb,var(--nc) 24%,transparent);
  color:#080b0f; font:950 .4rem/1 ui-monospace,monospace; font-style:normal;
}

/* SOUND LINK is feedback, not furniture: no persistent card on the board. */
.rgx-sync-pop {
  position:absolute; z-index:11; left:50%; top:40%; transform:translate3d(-50%,-50%,0) scale(.9);
  width:min(88vw,620px); text-align:center; pointer-events:none; opacity:0;
  will-change:transform,opacity; contain:paint; backface-visibility:hidden;
}
.rgx-sync-pop small { display:block; margin-bottom:5px; color:var(--rg-accent); font:900 .55rem/1 ui-monospace,monospace; letter-spacing:.22em; text-shadow:0 0 10px color-mix(in srgb,var(--rg-accent) 72%,transparent); }
.rgx-sync-pop b { display:block; color:#fff; font-size:clamp(1.8rem,7vw,4.8rem); line-height:.9; font-weight:950; letter-spacing:-.055em; text-shadow:0 0 14px color-mix(in srgb,var(--rg-accent) 58%,white 18%); }
.rgx-sync-pop span { display:block; margin-top:8px; color:rgba(255,255,255,.74); font:850 clamp(.52rem,1.7vw,.72rem)/1.2 ui-monospace,monospace; letter-spacing:.12em; }
.rgx-sync-pop.is-visible { animation:rgxSyncPop .56s cubic-bezier(.16,.82,.2,1) both; }
/* POP_EFFECT_COMPOSITOR_ONLY: SOUND LINK wash animates opacity only; no blur or giant shadow repaint. */
.rgx-app[data-sound-link="linked"] .rgx-stage::before { animation:rgxSoundWash .42s ease-out both; }
.rgx-app[data-sound-link="perfect"] .rgx-stage::before { animation:rgxPerfectWash .5s ease-out both; }
.rgx-app[data-sound-link] .rgx-stage-frame { opacity:.86; filter:none; }
.rgx-panel-link { display:grid; place-items:center; text-decoration:none; }

@keyframes rgxSyncPop {
  0% { opacity:0; transform:translate3d(-50%,-50%,0) scale(.86); }
  20% { opacity:1; transform:translate3d(-50%,-50%,0) scale(1.035); }
  66% { opacity:1; transform:translate3d(-50%,-50%,0) scale(1); }
  100% { opacity:0; transform:translate3d(-50%,-54%,0) scale(1.025); }
}
@keyframes rgxSoundWash { from { opacity:.62; } to { opacity:.34; } }
@keyframes rgxPerfectWash { from { opacity:.78; } to { opacity:.34; } }

/* The remaining persistent in-stage meter hugs the edge and never crosses the spawn/play path. */
.rgx-resonance { top:14px; right:7px; height:24%; min-height:72px; opacity:.72; }

@media (max-width: 760px) {
  .rgx-topbar { grid-template-columns:1fr auto 1fr; row-gap:5px; padding-left:10px; padding-right:10px; }
  .rgx-hud-deck { grid-template-columns:1fr; gap:4px; width:100%; }
  .rgx-scoreline { padding:6px 5px; border-radius:10px; font-size:.46rem; }
  .rgx-scoreline strong { font-size:.58rem; }
  .rgx-next-rail { grid-template-columns:auto minmax(0,1.2fr) minmax(0,.9fr) minmax(0,.9fr); padding:4px 5px; border-radius:10px; }
  .rgx-next-item { min-height:34px; grid-template-columns:11px minmax(0,1fr); padding:1px 2px; }
  .rgx-next-piece { --next-cell:14px; min-height:30px; }
  .rgx-next-item.is-primary .rgx-next-piece { --next-cell:16px; }
  .rgx-next-piece i { font-size:.36rem; }
  .rgx-sync-pop { top:37%; }
}

@media (max-width: 420px) {
  .rgx-topbar { grid-template-columns:1fr auto 1fr; }
  .rgx-brand span,.rgx-live span { display:none; }
  .rgx-live { gap:5px; }
  .rgx-live b { min-width:4.4ch; font-size:.7rem; }
  .rgx-actions { gap:4px; }
  .rgx-icon-btn { width:34px; }
  .rgx-scoreline { letter-spacing:.055em; }
  .rgx-next-title { font-size:.4rem; letter-spacing:.1em; }
  .rgx-next-item b { font-size:.38rem; }
  .rgx-sync-pop b { font-size:clamp(1.65rem,9vw,3.2rem); }
}

@media (max-height: 620px) and (orientation: landscape) {
  .rgx-topbar { row-gap:3px; padding-bottom:4px; }
  .rgx-hud-deck { grid-template-columns:minmax(270px,.9fr) minmax(330px,1.1fr); gap:5px; }
  .rgx-scoreline { padding:4px 6px; }
  .rgx-next-rail { grid-template-columns:auto minmax(0,1.15fr) minmax(0,.92fr) minmax(0,.92fr); padding:3px 5px; }
  .rgx-next-item { min-height:30px; }
  .rgx-next-piece { --next-cell:12px; min-height:26px; }
  .rgx-next-item.is-primary .rgx-next-piece { --next-cell:14px; }
  .rgx-next-piece i { font-size:.32rem; }
  .rgx-sync-pop { top:42%; }
}

@media (prefers-reduced-motion: reduce) {
  .rgx-sync-pop.is-visible { animation:none; opacity:1; filter:none; transform:translate(-50%,-50%); }
  .rgx-app[data-sound-link] .rgx-stage::before { animation:none; opacity:.48; }
  .rgx-stage-frame { transition:none; }
}


/* RE:GENESIS layout contract / run 63: the playable board must never visually collide with persistent controls. */
.rgx-stage {
  isolation:isolate;
  contain:layout paint;
  border-bottom:1px solid rgba(255,255,255,.055);
}
.rgx-controls {
  position:relative;
  z-index:20;
  flex:none;
  box-shadow:0 -14px 34px rgba(0,0,0,.34);
}
.rgx-app[data-playing="1"] .rgx-stage-frame { inset:clamp(9px,1.5vh,16px); }

/* Keep a visible neutral gutter between the last playable row and the rule deck on every form factor. */
@media (max-width:760px) and (orientation:portrait) {
  .rgx-stage::after { background:radial-gradient(circle at 50% 46%,transparent 0 38%,rgba(5,6,8,.28) 72%,rgba(5,6,8,.86) 100%); }
  .rgx-controls { padding-top:9px; }
}
@media (max-height:620px) and (orientation:landscape) {
  .rgx-controls { box-shadow:0 -9px 24px rgba(0,0,0,.32); }
}
@supports (height:100dvh) {
  .rgx-app { height:100dvh; }
}


/* RE:GENESIS run 64: board-first controls, compact rule deck, predictive landing aid. */
.rgx-controls {
  padding:6px clamp(8px,2vw,18px) calc(7px + var(--rg-safe-bottom));
  background:linear-gradient(0deg,rgba(5,6,8,.99),rgba(5,6,8,.86));
}
.rgx-rule-strip { max-width:520px; gap:6px; }
.rgx-rule {
  min-height:50px; padding:5px 3px 4px; border-radius:13px;
  display:grid; place-items:center; align-content:center; gap:2px;
}
.rgx-rule svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; opacity:.9; filter:drop-shadow(0 0 7px currentColor); }
.rgx-rule svg rect { fill:currentColor; fill-opacity:.08; }
.rgx-rule b { font-size:.55rem; line-height:1; letter-spacing:.09em; }
.rgx-rule span,.rgx-help { display:none!important; }
.rgx-rule::before { inset:auto 12px 3px; }
.rgx-rule[aria-pressed="true"] { box-shadow:inset 0 0 18px color-mix(in srgb,var(--rg-accent) 7%,transparent),0 0 12px color-mix(in srgb,var(--rg-accent) 7%,transparent); }
@media (max-width:520px) {
  .rgx-controls { padding-top:5px; }
  .rgx-rule-strip { gap:5px; }
  .rgx-rule { min-height:48px; border-radius:12px; }
  .rgx-rule svg { width:19px; height:19px; }
  .rgx-rule b { font-size:.51rem; }
}
@media (max-height:620px) and (orientation:landscape) {
  .rgx-controls { padding:4px 10px calc(4px + var(--rg-safe-bottom)); }
  .rgx-rule-strip { max-width:460px; }
  .rgx-rule { min-height:40px; grid-template-columns:auto auto; gap:5px; }
  .rgx-rule svg { width:16px; height:16px; }
  .rgx-rule b { font-size:.48rem; }
}


/* RE:GENESIS run 65: mobile performance + visual-viewport control deck hardening. */
.rgx-app {
  height:var(--rg-visual-vh,100dvh);
  min-height:0;
}
.rgx-stage {
  box-shadow:inset 0 0 22px color-mix(in srgb,var(--rg-accent) 7%,transparent);
}
.rgx-stage-frame {
  filter:none;
}
.rgx-stage-frame i {
  opacity:.66;
  transition:opacity .07s linear,border-color .07s linear;
}
.rgx-controls {
  padding:3px clamp(7px,1.8vw,14px) calc(4px + var(--rg-safe-bottom));
  box-shadow:0 -8px 20px rgba(0,0,0,.28);
}
.rgx-rule-strip { max-width:500px; gap:5px; }
.rgx-rule {
  min-height:44px;
  padding:4px 2px 3px;
  border-radius:11px;
  gap:1px;
}
.rgx-rule svg {
  width:17px;
  height:17px;
  filter:none;
}
.rgx-rule b {
  font-size:.48rem;
  line-height:1;
}
.rgx-rule[aria-pressed="true"] {
  box-shadow:inset 0 0 12px color-mix(in srgb,var(--rg-accent) 8%,transparent);
}
@media (max-width:520px) {
  .rgx-controls { padding:3px 6px calc(4px + var(--rg-safe-bottom)); }
  .rgx-rule-strip { gap:4px; }
  .rgx-rule { min-height:42px; border-radius:10px; }
  .rgx-rule svg { width:16px; height:16px; }
  .rgx-rule b { font-size:.45rem; }
}
@media (max-height:620px) and (orientation:landscape) {
  .rgx-controls { padding:2px 7px calc(3px + var(--rg-safe-bottom)); }
  .rgx-rule-strip { max-width:440px; gap:4px; }
  .rgx-rule { min-height:38px; grid-template-columns:auto auto; gap:4px; border-radius:9px; }
  .rgx-rule svg { width:14px; height:14px; }
  .rgx-rule b { font-size:.44rem; }
}


/* PERFORMANCE_GOVERNOR_V1: visual systems degrade before gameplay/input simulation. */
.rgx-app[data-performance-tier="balanced"] .rgx-stage-frame i { filter:drop-shadow(0 0 4px color-mix(in srgb,var(--rg-accent) 28%,transparent)); }
.rgx-app[data-performance-tier="reduced"] .rgx-topbar,
.rgx-app[data-performance-tier="reduced"] .rgx-controls,
.rgx-app[data-performance-tier="critical"] .rgx-topbar,
.rgx-app[data-performance-tier="critical"] .rgx-controls { backdrop-filter:none; }
.rgx-app[data-performance-tier="reduced"] .rgx-stage-frame i,
.rgx-app[data-performance-tier="critical"] .rgx-stage-frame i { filter:none; }
.rgx-app[data-performance-tier="critical"] .rgx-bg { opacity:.28; }

/* RE:GENESIS PHASE B / VS CPU + NOISE + opponent abstraction. */
.rgx-mode-select { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px!important; }
.rgx-mode-select > .rgx-mode-choice { min-width:0!important; min-height:66px!important; padding:9px 11px!important; text-align:left; display:grid; grid-template-columns:auto 1fr; grid-template-rows:auto auto; column-gap:9px; align-items:center; border-radius:12px; }
.rgx-mode-choice > span { grid-row:1/3; display:grid; place-items:center; width:34px; aspect-ratio:1; border:1px solid rgba(255,255,255,.15); border-radius:50%; color:var(--rg-accent); font:950 .6rem/1 ui-monospace,monospace; }
.rgx-mode-choice > b { align-self:end; font-size:.78rem; letter-spacing:.08em; }
.rgx-mode-choice > small { align-self:start; color:rgba(255,255,255,.42); font:760 .44rem/1.3 ui-monospace,monospace; letter-spacing:.06em; }
.rgx-mode-choice.is-disabled { opacity:.38; cursor:not-allowed; }
.rgx-cpu-difficulty { display:grid; grid-template-columns:auto repeat(4,1fr); align-items:center; gap:5px; margin-top:8px; }
.rgx-cpu-difficulty > span { color:rgba(255,255,255,.38); font:850 .45rem/1 ui-monospace,monospace; letter-spacing:.12em; }
.rgx-cpu-difficulty button { min-height:30px; padding:0 6px; border:1px solid rgba(255,255,255,.09); border-radius:8px; background:rgba(255,255,255,.03); color:rgba(255,255,255,.48); cursor:pointer; font:850 .43rem/1 ui-monospace,monospace; letter-spacing:.06em; }
.rgx-cpu-difficulty button[aria-pressed="true"] { color:#fff; border-color:color-mix(in srgb,var(--rg-accent) 58%,white 8%); background:color-mix(in srgb,var(--rg-accent) 13%,transparent); }

.rgx-opponent[hidden], .rgx-battle-bridge[hidden] { display:none!important; }
.rgx-opponent { position:absolute; z-index:8; right:clamp(12px,3vw,42px); top:clamp(34px,7vh,76px); width:clamp(132px,18vw,230px); padding:8px; border:1px solid rgba(255,255,255,.11); border-radius:14px; background:rgba(3,6,10,.78); box-shadow:0 18px 54px rgba(0,0,0,.38),inset 0 0 24px rgba(76,244,255,.035); backdrop-filter:blur(10px); pointer-events:none; }
.rgx-opponent header,.rgx-opponent footer { display:flex; align-items:center; justify-content:space-between; gap:7px; color:rgba(255,255,255,.45); font:820 .45rem/1 ui-monospace,monospace; letter-spacing:.08em; }
.rgx-opponent header b { color:var(--rg-cyan); font-size:.5rem; }
.rgx-opponent canvas { display:block; width:100%; aspect-ratio:8/14; max-height:min(37vh,320px); margin:7px 0; border-radius:8px; background:#03060a; }
.rgx-opponent footer b,.rgx-opponent footer strong { color:#fff; font-size:.48rem; }
.rgx-battle-bridge { position:absolute; z-index:9; left:50%; top:18px; transform:translateX(-50%); display:flex; align-items:center; gap:7px; padding:6px 9px; border:1px solid rgba(255,255,255,.09); border-radius:999px; background:rgba(3,6,10,.72); backdrop-filter:blur(8px); color:rgba(255,255,255,.38); font:830 .43rem/1 ui-monospace,monospace; letter-spacing:.08em; pointer-events:none; }
.rgx-battle-bridge b { color:var(--rg-danger); font-size:.56rem; }
.rgx-battle-bridge strong { color:var(--rg-cyan); font-size:.52rem; }
.rgx-battle-bridge i { width:1px; height:12px; background:rgba(255,255,255,.12); }
.rgx-app[data-battle="1"] .rgx-world-rail { opacity:.34; }
.rgx-app[data-battle="1"] .rgx-resonance { opacity:.52; }

/* NOISE is identifiable without relying on color; Canvas renders a graphite sealed shell and N/crack glyph. */
.rgx-app[data-battle="1"] .rgx-stage { background:radial-gradient(circle at 48% 48%,rgba(76,244,255,.07),rgba(152,120,255,.045) 42%,rgba(4,5,8,.97) 78%),#05070b; }

@media (max-width:899px) and (orientation:portrait) {
  .rgx-opponent { top:8px; right:10px; width:104px; padding:5px; border-radius:10px; }
  .rgx-opponent canvas { margin:4px 0; max-height:92px; }
  .rgx-opponent header,.rgx-opponent footer { font-size:.36rem; }
  .rgx-opponent footer strong { display:none; }
  .rgx-battle-bridge { top:8px; left:10px; transform:none; display:grid; grid-template-columns:auto auto; gap:3px 6px; border-radius:9px; padding:5px 7px; }
  .rgx-battle-bridge i { display:none; }
  .rgx-cpu-difficulty { grid-template-columns:repeat(4,1fr); }
  .rgx-cpu-difficulty > span { grid-column:1/-1; }
}
@media (max-height:620px) and (orientation:landscape) {
  .rgx-opponent { top:6px; right:8px; width:98px; padding:4px; border-radius:9px; }
  .rgx-opponent canvas { margin:3px 0; max-height:96px; }
  .rgx-opponent header,.rgx-opponent footer { font-size:.34rem; }
  .rgx-opponent footer strong { display:none; }
  .rgx-battle-bridge { left:auto; right:112px; top:7px; transform:none; padding:4px 7px; }
  .rgx-mode-select > .rgx-mode-choice { min-height:48px!important; padding:5px 7px!important; }
  .rgx-mode-choice > span { width:26px; font-size:.48rem; }
  .rgx-mode-choice > b { font-size:.62rem; }
  .rgx-mode-choice > small { font-size:.35rem; }
  .rgx-cpu-difficulty { margin-top:5px; }
  .rgx-cpu-difficulty button { min-height:25px; font-size:.37rem; }
}
@media (max-width:520px) {
  .rgx-mode-select { gap:6px!important; }
  .rgx-mode-select > .rgx-mode-choice { min-height:58px!important; padding:7px 8px!important; }
  .rgx-mode-choice > span { width:29px; }
  .rgx-mode-choice > b { font-size:.68rem; }
  .rgx-mode-choice > small { font-size:.37rem; }
}
@media (prefers-reduced-motion:reduce) {
  .rgx-opponent,.rgx-battle-bridge { backdrop-filter:none; }
}

/* EQUAL_VS_BOARDS_V2: classic arcade versus composition, two equal 8x14 fields. */
.rgx-player-marker { display:none; }
.rgx-app[data-battle="1"] .rgx-topbar {
  grid-template-areas:"brand live actions" "hud hud hud" "battle battle battle";
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  row-gap:4px;
}
.rgx-app[data-battle="1"] .rgx-battle-bridge {
  position:static; inset:auto; transform:none; grid-area:battle;
  display:flex; justify-self:center; align-items:center; gap:9px;
  margin:0; padding:4px 11px; min-height:24px;
  border-radius:8px; background:rgba(4,7,12,.66);
  backdrop-filter:none; font-size:.52rem;
}
.rgx-app[data-battle="1"] .rgx-battle-bridge i { display:block; }
.rgx-app[data-battle="1"] .rgx-world-rail,
.rgx-app[data-battle="1"] .rgx-resonance { display:none; }
.rgx-app[data-battle="1"] .rgx-player-marker {
  display:flex; position:absolute; z-index:9; pointer-events:none;
  top:calc(var(--rg-battle-board-top,42px) - 29px);
  left:var(--rg-battle-p1-left,10px);
  width:var(--rg-battle-board-width,160px);
  min-width:0; height:22px; align-items:center; justify-content:space-between; gap:4px;
  color:rgba(255,255,255,.86);font:900 clamp(.5rem,1.7vw,.72rem)/1 ui-monospace,monospace;
  letter-spacing:.09em; white-space:nowrap;
}
.rgx-app[data-battle="1"] .rgx-player-marker b {
  color:var(--rg-cyan); font-size:.85em; overflow:hidden; text-overflow:ellipsis;
}
.rgx-app[data-battle="1"] .rgx-opponent {
  position:absolute; z-index:8; right:auto; bottom:auto;
  left:var(--rg-battle-p2-left,200px);
  top:var(--rg-battle-board-top,42px);
  width:var(--rg-battle-board-width,160px);height:var(--rg-battle-board-height,280px);
  min-width:0; padding:0; margin:0; border:0; border-radius:0;
  background:transparent; box-shadow:none; backdrop-filter:none; pointer-events:none;
}
.rgx-app[data-battle="1"] .rgx-opponent canvas {
  display:block; width:100%; height:100%; max-width:none; max-height:none;
  aspect-ratio:8/14; margin:0; border-radius:4px;
  background:rgba(3,6,10,.98); box-shadow:0 0 0 1px rgba(76,244,255,.28),0 0 19px rgba(76,244,255,.065);
}
.rgx-app[data-battle="1"] .rgx-opponent header {
  position:absolute; top:-29px; left:0; width:100%; min-height:22px;
  display:flex; justify-content:space-between; align-items:center; gap:4px;
  font:900 clamp(.5rem,1.7vw,.72rem)/1 ui-monospace,monospace; letter-spacing:.09em;
  color:rgba(255,255,255,.86);
}
.rgx-app[data-battle="1"] .rgx-opponent header b { color:var(--rg-magenta); font-size:.85em; }
.rgx-app[data-battle="1"] .rgx-opponent footer {
  position:absolute; left:0; top:calc(100% + 7px); bottom:auto;
  display:flex; justify-content:space-between; gap:4px; width:100%;
  font:850 clamp(.42rem,1.5vw,.65rem)/1 ui-monospace,monospace;
  letter-spacing:.06em; color:rgba(255,255,255,.68);
}
.rgx-app[data-battle="1"] .rgx-opponent footer strong,
.rgx-app[data-battle="1"] .rgx-opponent footer b {font-size:inherit; color:#fff;}
.rgx-app[data-battle="1"] .rgx-event { top:22px; width:min(62vw,350px); }
.rgx-app[data-battle="1"] .rgx-event b { font-size:clamp(.9rem,3.2vw,1.45rem); letter-spacing:-.025em; text-shadow:none; }
.rgx-app[data-battle="1"] .rgx-event small,
.rgx-app[data-battle="1"] .rgx-event span { font-size:.43rem; margin:2px 0; letter-spacing:.04em; }
.rgx-app[data-battle="1"] .rgx-sync-pop { top:24px; width:min(55vw,290px); }
.rgx-app[data-battle="1"] .rgx-sync-pop b {font-size:clamp(.85rem,3vw,1.3rem); text-shadow:none;}
.rgx-app[data-battle="1"] .rgx-sync-pop small,
.rgx-app[data-battle="1"] .rgx-sync-pop span {font-size:.39rem;margin:2px 0;}
/* Portrait phone: prioritize identical legible arenas; sacrifice decoration before cells. */
@media (max-width:600px) and (orientation:portrait) {
  .rgx-app[data-battle="1"] .rgx-topbar { padding:calc(6px + var(--rg-safe-top)) 7px 5px; row-gap:3px; }
  .rgx-app[data-battle="1"] .rgx-hud-deck {gap:3px;}
  .rgx-app[data-battle="1"] .rgx-scoreline { padding:4px 2px; font-size:.42rem; }
  .rgx-app[data-battle="1"] .rgx-scoreline strong {font-size:.53rem;}
  .rgx-app[data-battle="1"] .rgx-next-rail {padding:2px 4px;}
  .rgx-app[data-battle="1"] .rgx-next-item {min-height:29px;}
  .rgx-app[data-battle="1"] .rgx-next-piece {--next-cell:12px;min-height:27px;}
  .rgx-app[data-battle="1"] .rgx-next-item.is-primary .rgx-next-piece {--next-cell:15px;}
  .rgx-app[data-battle="1"] .rgx-battle-bridge { min-height:23px; font-size:.46rem; padding:3px 8px; gap:7px; }
  .rgx-app[data-battle="1"] .rgx-opponent header,
  .rgx-app[data-battle="1"] .rgx-player-marker {font-size:.57rem;}
  .rgx-app[data-battle="1"] .rgx-opponent footer {font-size:.45rem;}
}
/* Short landscape: maximize vertical playable area. Both boards must remain equal. */
@media (max-height:620px) and (orientation:landscape) {
  .rgx-app[data-battle="1"] .rgx-topbar { padding:calc(3px + var(--rg-safe-top)) 9px 3px; row-gap:2px; }
  .rgx-app[data-battle="1"] .rgx-hud-deck { grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); gap:4px; }
  .rgx-app[data-battle="1"] .rgx-scoreline {font-size:.39rem; padding:3px 3px;}
  .rgx-app[data-battle="1"] .rgx-scoreline strong {font-size:.45rem;}
  .rgx-app[data-battle="1"] .rgx-next-rail {padding:2px 4px;}
  .rgx-app[data-battle="1"] .rgx-next-item {min-height:24px;}
  .rgx-app[data-battle="1"] .rgx-next-piece {--next-cell:10px;min-height:22px;}
  .rgx-app[data-battle="1"] .rgx-next-item.is-primary .rgx-next-piece {--next-cell:12px;}
  .rgx-app[data-battle="1"] .rgx-battle-bridge {min-height:18px; padding:1px 8px; font-size:.39rem;}
  .rgx-app[data-battle="1"] .rgx-player-marker,
  .rgx-app[data-battle="1"] .rgx-opponent header {font-size:.52rem;}
  .rgx-app[data-battle="1"] .rgx-opponent footer {font-size:.43rem;}
}
@media (prefers-reduced-motion:reduce) {
  .rgx-app[data-battle="1"] .rgx-opponent canvas {box-shadow:0 0 0 1px rgba(76,244,255,.3);}
}
/* Keep CPU scoring visible on small screens where the old mini-card hid it. */
.rgx-app[data-battle="1"] .rgx-opponent footer strong { display:inline!important; }
/* Both boards receive the same subtle stage vignette. */
.rgx-app[data-battle="1"] .rgx-stage::after { opacity:.2; }

/* RE:GENESIS NETWORK_V1: responsive standalone lobby and small scoreboard. */
.rgx-profile{display:grid;gap:4px;margin:9px 0;padding:9px 10px;border:1px solid rgba(140,166,204,.35);border-radius:10px;background:rgba(7,15,26,.60)}
.rgx-profile label{font-weight:850;font-size:.72rem;letter-spacing:.12em;color:#b7edff}
.rgx-profile input,.rgx-lobby-entry input{width:100%;min-height:42px;padding:8px 11px;border:1px solid rgba(127,205,255,.48);border-radius:7px;color:#fff;background:rgba(0,0,0,.40);font:inherit}
.rgx-profile small{color:#9eafc8;font-size:.65rem}
.rgx-top10{margin:9px 0;padding:11px;border:1px solid rgba(140,166,204,.32);border-radius:11px;background:rgba(2,10,20,.74);color:#e8f5ff}
.rgx-top10-header,.rgx-top10-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;font-size:.68rem;letter-spacing:.04em}
.rgx-top10-header b{color:#72edff;letter-spacing:.1em}.rgx-top10-header small,.rgx-top10-foot{color:#a4b3c7}
.rgx-top10 ol{display:grid;grid-template-columns:1fr;gap:1px;max-height:180px;overflow:auto;margin:7px 0;padding:0;list-style:none;scrollbar-width:thin}
.rgx-top10 li{display:grid;grid-template-columns:2rem minmax(0,1fr) auto;gap:8px;align-items:center;min-height:21px;font-size:.75rem}
.rgx-top10 li strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
.rgx-top10 li span{font-variant-numeric:tabular-nums;color:#a2cbdb}.rgx-top10 li b{font-variant-numeric:tabular-nums}.rgx-top10 li.is-me{color:#74fff0}
.rgx-result-ranking{display:flex;flex-wrap:wrap;justify-content:center;gap:7px 18px;margin:10px auto;padding:9px 12px;border:1px solid rgba(134,218,255,.42);background:rgba(0,9,18,.70);font-size:.77rem;color:#c9e5fb}.rgx-result-ranking b{color:#77fce9}
.rgx-lobby{position:absolute;inset:0;z-index:31;display:grid;align-items:center;justify-items:center;padding:clamp(10px,3vw,28px);background:rgba(1,4,12,.97);overflow:auto;color:#e9f5ff}.rgx-lobby[hidden]{display:none!important}
.rgx-lobby-inner{width:min(100%,660px);max-height:100%;overflow:auto;padding:clamp(14px,3vw,25px);border:1px solid rgba(106,227,255,.42);background:#081322;box-shadow:0 14px 48px rgba(0,0,0,.5)}
.rgx-lobby h2{font-size:clamp(1.35rem,3vw,2rem);letter-spacing:.09em;color:#fff;margin:.3rem 0}.rgx-lobby p{font-size:.84rem;color:#b1c1d3}
.rgx-lobby-code{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:11px 0;padding:12px;border:1px solid rgba(119,244,248,.4)}
.rgx-lobby-code strong{font-size:clamp(1.3rem,4vw,2rem);letter-spacing:.13em;color:#79f6fc}.rgx-lobby-code button{margin-left:auto}
.rgx-lobby-entry{display:grid;grid-template-columns:auto minmax(100px,1fr) auto;gap:9px;align-items:end;margin:11px 0}.rgx-lobby-entry label{display:grid;gap:3px;font-size:.7rem}.rgx-lobby-entry button{min-height:42px}
.rgx-lobby-players{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:12px 0}.rgx-lobby-players>div{display:grid;gap:6px;padding:12px;border:1px solid rgba(109,186,209,.35)}.rgx-lobby-players b{font-size:.71rem;color:#8deaff}.rgx-lobby-players span{font-size:.75rem;overflow-wrap:anywhere}
.rgx-lobby-actions{display:flex;flex-wrap:wrap;gap:9px;justify-content:center}.rgx-lobby-actions button{min-height:44px;min-width:140px}.rgx-lobby-status{overflow-wrap:anywhere}
.rgx-starts [hidden]{display:none!important}
@media(max-width:640px){.rgx-lobby-entry{grid-template-columns:1fr 1fr}.rgx-lobby-entry label{grid-column:1/-1;grid-row:1}.rgx-lobby-entry button{grid-row:2}.rgx-lobby-players{grid-template-columns:1fr}.rgx-profile{margin:4px 0;padding:6px}.rgx-top10{margin:5px 0;padding:7px}.rgx-top10 ol{max-height:120px}}
@media(max-height:620px){.rgx-top10 ol{max-height:65px}.rgx-profile small{display:none}.rgx-intro-command .rgx-top10{padding:5px;margin:3px 0}}
@media(prefers-reduced-motion:reduce){.rgx-lobby *, .rgx-top10 *{animation:none!important;transition:none!important}}

.rgx-top10 li.rgx-rank-empty { display:block; padding:8px 2px; text-align:center; color:#9bdaf0; font-size:.75rem; }
.rgx-lobby [hidden]{display:none!important}

/* RGX_SOLO_SPEED_CURVE_V1 / multi-device menu and online lobby layout */
.rgx-solo-difficulty{min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:5px;margin:9px 0;padding:10px;border:1px solid rgba(112,233,255,.32);border-radius:10px;background:rgba(7,17,32,.8);text-align:left}
.rgx-solo-difficulty>span{color:#b9eaff;font:850 .65rem/1.2 ui-monospace,monospace;letter-spacing:.1em}
.rgx-solo-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;min-width:0}
.rgx-solo-options button{min-width:0;min-height:44px;border:1px solid rgba(150,193,216,.28);border-radius:8px;background:rgba(255,255,255,.05);color:#a9bfd0;font:850 .7rem/1.2 ui-monospace,monospace;cursor:pointer}
.rgx-solo-options button[aria-pressed=true]{border-color:#67f4ef;color:#fff;background:rgba(23,175,173,.23);box-shadow:inset 0 0 0 1px rgba(103,244,239,.15)}
.rgx-solo-options button:focus-visible,.rgx-lobby button:focus-visible,[data-back-to-menu]:focus-visible{outline:2px solid #90fff0;outline-offset:3px}
.rgx-solo-difficulty>small{font-size:.64rem;color:#8eacc0;overflow-wrap:anywhere;line-height:1.45}
.rgx-lobby,.rgx-lobby-inner,.rgx-lobby-entry,.rgx-lobby-code,.rgx-lobby-players{min-width:0;box-sizing:border-box}
.rgx-lobby{inset:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));align-items:safe center}
.rgx-lobby-inner{width:min(100%,800px);max-width:100%;max-height:min(100%,calc(100dvh - 20px));overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;border-radius:12px}
.rgx-lobby-entry>*{min-width:0;max-width:100%}
.rgx-lobby-entry button,.rgx-lobby-actions button,.rgx-lobby-code button{min-height:44px;white-space:normal;overflow-wrap:anywhere}
.rgx-lobby-code strong{min-width:0;overflow-wrap:anywhere;font-size:clamp(1rem,4vw,1.8rem);letter-spacing:clamp(0px,.7vw,2px)}
.rgx-lobby-actions{margin-top:12px}
.rgx-lobby-actions [data-rgx-back]{order:-1}
@media(max-width:600px) and (orientation:portrait){
  .rgx-lobby-inner{padding:12px;max-height:100%;}
  .rgx-lobby-entry{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
  .rgx-lobby-entry label,.rgx-lobby-entry button{grid-column:1;grid-row:auto;width:100%}
  .rgx-lobby-entry [data-rgx-create]{order:1}.rgx-lobby-entry label{order:2}.rgx-lobby-entry [data-rgx-join]{order:3}
  .rgx-lobby-code{display:grid;grid-template-columns:minmax(0,1fr);gap:7px}
  .rgx-lobby-code button{width:100%;margin:0}
  .rgx-lobby-players{grid-template-columns:1fr}
  .rgx-lobby-actions{display:grid;grid-template-columns:minmax(0,1fr)}
  .rgx-lobby-actions button{width:100%;min-width:0}
}
@media(max-height:520px) and (orientation:landscape){
  .rgx-lobby{align-items:start;padding:5px 9px}
  .rgx-lobby-inner{padding:9px 12px;max-height:calc(100dvh - 10px)}
  .rgx-lobby h2{font-size:1.15rem;margin:2px 0}
  .rgx-lobby p{margin:4px 0;font-size:.68rem}
  .rgx-lobby-entry{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);gap:6px;margin:6px 0}
  .rgx-lobby-entry label{grid-column:auto;grid-row:auto}
  .rgx-lobby-entry button{grid-row:auto;min-height:42px}
  .rgx-lobby-code{margin:6px 0;padding:6px;gap:5px}
  .rgx-lobby-players{margin:6px 0;gap:6px}
  .rgx-lobby-players>div{padding:6px}
  .rgx-lobby-actions{margin-top:6px}
  .rgx-solo-difficulty{margin:4px 0;padding:6px}
  .rgx-solo-options button{min-height:38px}
}
@media(max-width:380px){.rgx-lobby-inner{padding:9px}.rgx-solo-difficulty>small{font-size:.57rem}}

/* BREAK_TOP_DOWN_V3: ability meter and ready state follow the gameplay state, not a timer. */
.rgx-rule[data-rule="BREAK"]{position:relative;isolation:isolate;}
.rgx-rule[data-rule="BREAK"]::after{content:attr(data-charge);position:absolute;top:2px;right:5px;font:800 9px/1 ui-monospace,monospace;color:#c4b4ff;letter-spacing:.04em;opacity:.8;pointer-events:none;}
.rgx-rule[data-rule="BREAK"]{background-image:linear-gradient(90deg,rgba(152,120,255,.16) var(--break-charge,0%), transparent var(--break-charge,0%));}
.rgx-rule[data-rule="BREAK"][data-ready="true"]{opacity:1;border-color:#b9a4ff;color:#fff;background:linear-gradient(135deg,rgba(152,120,255,.35),rgba(255,79,216,.24));box-shadow:0 0 20px rgba(152,120,255,.42),inset 0 0 16px rgba(152,120,255,.16);animation:rgxBreakReadyPulse 1.6s ease-in-out infinite;}
.rgx-rule[data-rule="BREAK"][data-ready="true"]::after{content:'READY';color:#fff;opacity:1;}
@keyframes rgxBreakReadyPulse{0%,100%{box-shadow:0 0 9px rgba(152,120,255,.23)}50%{box-shadow:0 0 27px rgba(152,120,255,.66),inset 0 0 12px rgba(255,79,216,.15)}}
@media(prefers-reduced-motion:reduce){.rgx-rule[data-rule="BREAK"][data-ready="true"]{animation:none}}

/* RE:GENESIS START_SCREEN_TYPE_SYSTEM_V2: premium WORLD CONTROL typography + command deck polish. */
.rgx-app{
  --rg-display-font:"Bahnschrift","DIN Alternate","Arial Narrow","Roboto Condensed","Noto Sans JP",system-ui,sans-serif;
  --rg-tech-font:ui-monospace,"SFMono-Regular","Cascadia Mono","Roboto Mono",Consolas,monospace;
  --rg-readable-font:Inter,"Noto Sans JP",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.rgx-intro-command{
  position:relative;
  overflow:hidden;
  border-color:rgba(116,231,255,.19);
  border-radius:22px;
  background:
    linear-gradient(135deg,rgba(76,244,255,.035),transparent 23%),
    radial-gradient(circle at 86% 12%,rgba(76,244,255,.055),transparent 27%),
    linear-gradient(180deg,rgba(8,14,22,.91),rgba(3,8,14,.88));
  box-shadow:0 26px 90px rgba(0,0,0,.44),inset 0 0 0 1px rgba(255,255,255,.015),inset 0 0 56px rgba(76,244,255,.025);
}
.rgx-intro-command::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.46;
  background:
    linear-gradient(90deg,var(--rg-accent),transparent 19%) top left/44% 1px no-repeat,
    linear-gradient(180deg,var(--rg-accent),transparent 40%) top left/1px 24% no-repeat,
    linear-gradient(270deg,var(--rg-accent),transparent 22%) bottom right/42% 1px no-repeat,
    linear-gradient(0deg,var(--rg-accent),transparent 40%) bottom right/1px 22% no-repeat;
}
.rgx-command-label,
.rgx-intro-command .rgx-bootline,
.rgx-solo-difficulty>span,
.rgx-profile label,
.rgx-top10-header,
.rgx-top10-foot,
.rgx-cpu-difficulty>span{
  font-family:var(--rg-tech-font);
  font-variant-numeric:tabular-nums;
  text-rendering:geometricPrecision;
}
.rgx-command-label{
  position:relative;
  z-index:1;
  margin-bottom:12px;
  padding-bottom:10px;
  border-bottom:1px solid rgba(132,219,245,.12);
  color:rgba(212,235,245,.60);
  font-size:clamp(.55rem,.9vw,.66rem);
  font-weight:800;
  letter-spacing:.22em;
}
.rgx-command-label span{color:rgba(218,235,244,.64)}
.rgx-command-label b{
  color:#68f6ff;
  font-size:clamp(.58rem,1vw,.72rem);
  font-weight:900;
  letter-spacing:.18em;
  text-shadow:0 0 13px rgba(76,244,255,.30);
}
.rgx-intro-command .rgx-bootline{
  position:relative;
  z-index:1;
  gap:11px;
  margin:0 0 14px;
  color:rgba(182,204,217,.48);
  font-size:clamp(.5rem,.82vw,.61rem);
  font-weight:760;
  letter-spacing:.15em;
}
.rgx-intro-command .rgx-bootline i{
  width:28px;
  flex:none;
  background:linear-gradient(90deg,transparent,rgba(76,244,255,.7),transparent);
}
.rgx-mode-select{
  position:relative;
  z-index:1;
  gap:9px!important;
}
.rgx-mode-select > .rgx-mode-choice,
.rgx-mode-select > .rgx-install{
  position:relative;
  overflow:hidden;
  min-height:68px!important;
  border:1px solid rgba(139,178,201,.22);
  border-radius:14px;
  background:linear-gradient(145deg,rgba(13,22,32,.91),rgba(7,12,19,.94));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025),inset 0 0 22px rgba(76,244,255,.018);
  font-family:var(--rg-display-font);
  transition:transform .16s ease,border-color .16s ease,background .16s ease,box-shadow .16s ease,color .16s ease;
}
.rgx-mode-select > .rgx-mode-choice::after,
.rgx-mode-select > .rgx-install::after{
  content:"";
  position:absolute;
  right:0;
  bottom:0;
  width:34px;
  height:1px;
  background:linear-gradient(90deg,transparent,var(--rg-accent));
  opacity:.55;
  pointer-events:none;
}
.rgx-mode-select > .rgx-mode-choice:not([disabled]):hover,
.rgx-mode-select > .rgx-install:not([disabled]):hover{
  transform:translateY(-1px);
  border-color:rgba(103,244,239,.45);
  box-shadow:inset 0 0 28px rgba(76,244,255,.035),0 8px 22px rgba(0,0,0,.18);
}
.rgx-mode-choice > span{
  grid-row:1/3;
  width:auto;
  min-width:39px;
  height:36px;
  padding:0 11px 0 2px;
  border:0;
  border-right:1px solid rgba(139,211,232,.25);
  border-radius:0;
  color:#52f4ff;
  font-family:var(--rg-display-font);
  font-size:clamp(.66rem,1.1vw,.82rem);
  font-weight:900;
  letter-spacing:.02em;
}
.rgx-mode-choice > b{
  align-self:end;
  color:#f4f8fb;
  font-family:var(--rg-display-font);
  font-size:clamp(.88rem,1.35vw,1.08rem);
  font-weight:760;
  line-height:1;
  letter-spacing:.075em;
  text-rendering:geometricPrecision;
}
.rgx-mode-choice > small{
  align-self:start;
  margin-top:4px;
  color:rgba(183,204,218,.48);
  font-family:var(--rg-tech-font);
  font-size:clamp(.38rem,.72vw,.49rem);
  font-weight:760;
  line-height:1.25;
  letter-spacing:.075em;
}
.rgx-mode-select > .rgx-primary.rgx-mode-choice{
  border-color:rgba(255,255,255,.78);
  background:
    linear-gradient(135deg,#fff 0%,#f6f8fa 68%,#eaf6f8 100%);
  box-shadow:0 8px 30px rgba(0,0,0,.18),inset 0 0 0 1px rgba(255,255,255,.75),0 0 24px rgba(76,244,255,.07);
}
.rgx-mode-select > .rgx-primary.rgx-mode-choice > span{
  color:#11cfe0;
  border-right-color:rgba(13,104,124,.18);
}
.rgx-mode-select > .rgx-primary.rgx-mode-choice > b{color:#0a1118}
.rgx-mode-select > .rgx-primary.rgx-mode-choice > small{color:rgba(24,42,56,.49)}
.rgx-mode-select > .rgx-install{
  display:grid;
  place-items:center;
  min-width:0;
  padding:0 14px;
  color:#f3f7fa;
  font-family:var(--rg-display-font);
  font-size:clamp(.92rem,1.55vw,1.15rem);
  font-weight:720;
  letter-spacing:.11em;
}
.rgx-solo-difficulty,
.rgx-profile,
.rgx-top10{
  position:relative;
  z-index:1;
  margin:10px 0 0;
  border:1px solid rgba(102,211,244,.30);
  border-radius:13px;
  background:linear-gradient(180deg,rgba(5,17,29,.84),rgba(3,11,20,.77));
  box-shadow:inset 0 0 28px rgba(76,244,255,.018);
}
.rgx-solo-difficulty{gap:9px;padding:12px 13px 11px}
.rgx-solo-difficulty>span,
.rgx-profile label,
.rgx-top10-header b{
  color:#aeeeff;
  font-size:clamp(.62rem,1vw,.76rem);
  font-weight:900;
  letter-spacing:.12em;
}
.rgx-solo-options{gap:7px}
.rgx-solo-options button{
  min-height:48px;
  border-color:rgba(145,183,208,.24);
  border-radius:10px;
  background:linear-gradient(180deg,rgba(19,31,45,.92),rgba(11,21,33,.92));
  color:#a9bfd0;
  font-family:var(--rg-display-font);
  font-size:clamp(.68rem,1.1vw,.82rem);
  font-weight:760;
  letter-spacing:.035em;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}
.rgx-solo-options button[aria-pressed=true]{
  border-color:#57f5f0;
  color:#fff;
  background:linear-gradient(180deg,rgba(16,87,101,.80),rgba(6,60,72,.84));
  box-shadow:0 0 0 1px rgba(87,245,240,.14),0 0 18px rgba(76,244,255,.10),inset 0 0 19px rgba(103,244,239,.06);
}
.rgx-solo-difficulty>small{
  color:rgba(166,194,211,.72);
  font-family:var(--rg-readable-font);
  font-size:clamp(.56rem,.88vw,.67rem);
  font-weight:500;
  line-height:1.4;
  letter-spacing:.015em;
}
.rgx-profile{gap:8px;padding:12px 13px}
.rgx-profile input{
  min-height:52px;
  padding:9px 14px;
  border:1px solid rgba(113,209,244,.55);
  border-radius:9px;
  background:rgba(0,5,11,.77);
  color:#fff;
  font-family:var(--rg-display-font);
  font-size:clamp(1rem,2.1vw,1.34rem);
  font-weight:660;
  letter-spacing:.04em;
  box-shadow:inset 0 0 18px rgba(76,244,255,.022);
}
.rgx-profile input:focus{
  outline:none;
  border-color:#6df8ff;
  box-shadow:0 0 0 2px rgba(109,248,255,.11),inset 0 0 20px rgba(76,244,255,.03);
}
.rgx-profile small{
  margin-top:-2px;
  color:rgba(153,178,193,.48);
  font-family:var(--rg-readable-font);
  font-size:.54rem;
  line-height:1.35;
}
.rgx-top10{padding:11px 13px 10px}
.rgx-top10-header{
  padding-bottom:8px;
  border-bottom:1px solid rgba(107,198,226,.12);
  font-size:clamp(.54rem,.86vw,.66rem);
  letter-spacing:.06em;
}
.rgx-top10-header small{color:rgba(182,205,219,.70);font-weight:640;letter-spacing:.04em}
.rgx-top10 ol{gap:0;margin:4px 0 5px;max-height:184px}
.rgx-top10 li{
  min-height:31px;
  grid-template-columns:2.15rem minmax(0,1fr) auto;
  gap:8px;
  border-bottom:1px solid rgba(107,198,226,.075);
  font-family:var(--rg-readable-font);
  font-size:clamp(.68rem,1vw,.8rem);
}
.rgx-top10 li:last-child{border-bottom:0}
.rgx-top10 li span{
  color:rgba(164,195,214,.78);
  font-family:var(--rg-tech-font);
  font-weight:680;
  font-variant-numeric:tabular-nums;
}
.rgx-top10 li strong{
  color:#eaf3f8;
  font-weight:720;
  letter-spacing:.015em;
}
.rgx-top10 li b{
  color:#eff8ff;
  font-family:var(--rg-display-font);
  font-size:1.02em;
  font-weight:760;
  font-variant-numeric:tabular-nums;
  letter-spacing:.01em;
}
.rgx-top10 li.is-me strong,
.rgx-top10 li.is-me b{color:#65fff3;text-shadow:0 0 11px rgba(101,255,243,.13)}
.rgx-top10-foot{
  padding-top:4px;
  color:rgba(175,198,213,.66);
  font-size:clamp(.54rem,.85vw,.65rem);
  font-weight:650;
  letter-spacing:.035em;
}
.rgx-cpu-difficulty{
  position:relative;
  z-index:1;
  grid-template-columns:auto repeat(4,minmax(0,1fr));
  gap:7px;
  margin-top:10px;
}
.rgx-cpu-difficulty>span{padding-right:3px;color:rgba(181,207,220,.61);font-size:.52rem;letter-spacing:.11em}
.rgx-cpu-difficulty button{
  min-height:34px;
  border-color:rgba(147,180,199,.18);
  border-radius:9px;
  background:linear-gradient(180deg,rgba(13,21,30,.84),rgba(7,13,20,.84));
  color:rgba(181,200,211,.62);
  font-family:var(--rg-tech-font);
  font-size:.46rem;
  font-weight:820;
  letter-spacing:.05em;
}
.rgx-cpu-difficulty button[aria-pressed=true]{
  border-color:#55eee9;
  color:#fff;
  background:linear-gradient(180deg,rgba(15,83,94,.82),rgba(7,56,66,.85));
  box-shadow:0 0 15px rgba(76,244,255,.09),inset 0 0 15px rgba(76,244,255,.05);
}
@media(max-width:899px){
  .rgx-intro-command{width:min(100%,650px);padding:14px;margin-top:17px}
  .rgx-command-label{font-size:.58rem}
  .rgx-intro-command .rgx-bootline{font-size:.51rem}
}
@media(max-width:620px){
  .rgx-intro-command{padding:11px;border-radius:17px}
  .rgx-intro-command .rgx-starts{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .rgx-intro-command .rgx-starts .rgx-primary{grid-column:auto}
  .rgx-mode-select>.rgx-mode-choice,.rgx-mode-select>.rgx-install{min-height:61px!important;padding:7px 8px!important;border-radius:12px}
  .rgx-mode-choice>span{min-width:33px;height:32px;padding-right:8px;font-size:.64rem}
  .rgx-mode-choice>b{font-size:.76rem;letter-spacing:.055em}
  .rgx-mode-choice>small{font-size:.34rem;letter-spacing:.045em}
  .rgx-mode-select>.rgx-install{font-size:.82rem;letter-spacing:.08em}
  .rgx-solo-difficulty,.rgx-profile,.rgx-top10{border-radius:11px}
  .rgx-solo-difficulty{padding:10px}
  .rgx-solo-options button{min-height:44px;font-size:.65rem}
  .rgx-profile{padding:10px}
  .rgx-profile input{min-height:48px;font-size:1rem}
  .rgx-top10{padding:9px 10px}
  .rgx-top10 li{min-height:28px;font-size:.68rem}
  .rgx-cpu-difficulty{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
  .rgx-cpu-difficulty>span{grid-column:1/-1;padding:0;font-size:.46rem}
  .rgx-cpu-difficulty button{min-height:31px;font-size:.39rem}
}
@media(max-width:380px){
  .rgx-intro-command{padding:9px}
  .rgx-command-label{font-size:.51rem;letter-spacing:.15em}
  .rgx-command-label b{font-size:.54rem}
  .rgx-intro-command .rgx-bootline{gap:7px;font-size:.45rem;letter-spacing:.09em}
  .rgx-intro-command .rgx-bootline i{width:16px}
  .rgx-mode-select>.rgx-mode-choice,.rgx-mode-select>.rgx-install{min-height:57px!important;padding:6px!important}
  .rgx-mode-choice>span{min-width:29px;padding-right:6px}
  .rgx-mode-choice>b{font-size:.7rem}
  .rgx-mode-choice>small{font-size:.31rem}
  .rgx-solo-difficulty>small{font-size:.52rem}
}
@media(max-height:620px) and (orientation:landscape){
  .rgx-intro-command{padding:9px 10px;border-radius:14px}
  .rgx-command-label{margin-bottom:6px;padding-bottom:6px;font-size:.48rem}
  .rgx-intro-command .rgx-bootline{margin-bottom:6px;font-size:.43rem}
  .rgx-mode-select{gap:5px!important}
  .rgx-mode-select>.rgx-mode-choice,.rgx-mode-select>.rgx-install{min-height:45px!important;padding:4px 6px!important;border-radius:9px}
  .rgx-mode-choice>span{min-width:28px;height:27px;padding-right:5px;font-size:.52rem}
  .rgx-mode-choice>b{font-size:.61rem}
  .rgx-mode-choice>small{margin-top:2px;font-size:.29rem}
  .rgx-solo-difficulty,.rgx-profile,.rgx-top10{margin-top:5px;padding:6px 7px;border-radius:8px}
  .rgx-solo-difficulty{gap:4px}
  .rgx-solo-options button{min-height:32px;font-size:.52rem;border-radius:7px}
  .rgx-profile{gap:4px}
  .rgx-profile input{min-height:36px;padding:5px 8px;font-size:.78rem}
  .rgx-profile small{display:none}
  .rgx-top10-header{padding-bottom:4px;font-size:.48rem}
  .rgx-top10 ol{margin:2px 0;max-height:58px}
  .rgx-top10 li{min-height:19px;font-size:.54rem}
  .rgx-top10-foot{font-size:.45rem}
  .rgx-cpu-difficulty{margin-top:5px;gap:4px}
  .rgx-cpu-difficulty button{min-height:25px;font-size:.34rem}
}
@media(prefers-reduced-motion:reduce){
  .rgx-mode-select>.rgx-mode-choice,.rgx-mode-select>.rgx-install{transition:none}
}

/* REGENESIS_LOGO_IDENTITY_V1: approved circular-thumbnail logo integration. */
.rgx-logo-lockup {
  display:grid;
  place-items:center;
  width:100%;
  margin:clamp(-14px,-1.2vw,-4px) 0 clamp(-10px,-.6vw,-2px);
}
.rgx-game-logo {
  display:block;
  width:min(100%,520px);
  height:auto;
  aspect-ratio:1;
  object-fit:contain;
  filter:drop-shadow(0 0 18px rgba(76,244,255,.12)) drop-shadow(0 0 24px rgba(255,79,216,.08));
}
.rgx-title-sr {
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}
@media (min-width:900px) {
  .rgx-game-logo { width:min(100%,540px); }
}
@media (max-width:620px) {
  .rgx-logo-lockup { margin:-10px 0 -4px; }
  .rgx-game-logo { width:min(82vw,390px); }
}
@media (max-height:760px) and (orientation:landscape) {
  .rgx-game-logo { width:min(54vh,340px); }
}
@media (max-height:620px) and (orientation:landscape) {
  .rgx-game-logo { width:min(48vh,280px); }
}
