/* One-screen play surface. Secondary controls remain accessible in a dialog. */
html:has(.compact-game),
body.compact-game {
  height: 100%;
  overflow: hidden;
}
.compact-game {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
}
.compact-game > header {
  height: 58px;
  flex: 0 0 58px;
  padding: 0 max(16px, calc((100% - 920px) / 2));
  gap: 12px;
}
.compact-game .brand-wordmark strong {
  font-size: 20px;
}
.compact-game .brand-wordmark small {
  font-size: 8px;
}
.compact-game .edition {
  display: none;
}
.compact-game .header-tools {
  gap: 8px;
}
.compact-game .language-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 12px;
}
.compact-game #sound {
  min-height: 40px;
  font-size: 12px;
}
.compact-game > main {
  width: 100%;
  max-width: 960px;
  flex: 1;
  min-height: 0;
  margin: 0 auto;
  padding: 12px 20px max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 44px minmax(0, 1fr) 48px;
  gap: 10px;
}
.compact-game .intro {
  margin: 0;
  min-width: 0;
}
.compact-game .intro .eyebrow,
.compact-game .mode {
  display: none;
}
.compact-game .intro > div {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
}
.compact-game h1 {
  font-size: 34px;
  margin: 0;
  line-height: 1.1;
  white-space: nowrap;
}
.compact-game .intro p {
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
}
.compact-game .quick-controls {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.compact-game .quick-controls .styles {
  display: flex;
  flex: 1;
  max-width: 320px;
  margin: 0;
  padding: 3px;
  gap: 3px;
}
.compact-game .styles button {
  font-size: 14px;
  text-align: center;
  padding: 5px 14px;
}
.compact-game #open-settings {
  margin-left: auto;
  border: 1px solid #544473;
  border-radius: 8px;
  background: #15151e;
  color: #eee5ff;
  padding: 0 14px;
  min-height: 44px;
  font-size: 14px;
}
.compact-game .workspace {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.compact-game .play-hint {
  margin: 0;
  color: #c6c1d5;
  font-size: 13px;
  text-align: center;
  line-height: 1.3;
}
.compact-game .game-card {
  display: grid;
  grid-template-rows: 46px 62px minmax(0, 1fr) 96px 44px 3px;
  flex: 1;
  min-height: 0;
  width: 100%;
  border-radius: 14px;
  order: 0;
}
.compact-game .stats {
  height: auto;
  padding: 0 20px;
  gap: 32px;
}
.compact-game .stats strong {
  font-size: 23px;
  line-height: 1;
}
.compact-game .stats > div > span {
  font-size: 10px;
  letter-spacing: 0.1em;
}
.compact-game .arena {
  height: auto;
  min-height: 0;
  touch-action: none;
}
.compact-game .lane-labels {
  top: 12px;
  font-size: 11px;
}
.compact-game .center-line {
  top: 36px;
}
.compact-game .pad-labels {
  display: none;
}
.compact-game .start-overlay {
  padding: 10px 20px;
  gap: 8px;
}
.compact-game .start-overlay .mini {
  font-size: 10px;
  letter-spacing: 0.08em;
}
.compact-game .start-overlay h2 {
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.05;
  margin: 0;
  max-width: 600px;
  text-wrap: balance;
}
.compact-game .start-overlay p {
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  max-width: 470px;
}
.compact-game .primary {
  min-height: 44px;
  padding: 10px 22px;
  font-size: 15px;
  min-width: 210px;
}
.compact-game .start-overlay small {
  font-size: 12px;
  margin: 0;
}
.compact-game .touch-controls {
  display: flex;
  align-items: stretch;
  padding: 8px 14px;
  gap: 14px;
}
.compact-game .touch-controls button {
  position: relative;
  flex: 1;
  width: auto;
  min-width: 0;
  min-height: 0;
  border-radius: 12px;
  font-size: 15px;
  padding: 6px 10px;
  transition: background 0.12s;
  isolation: isolate;
}
.compact-game .touch-controls small {
  font-size: 12px;
  margin-top: 3px;
}
.compact-game .finger-guide {
  display: none;
  position: absolute;
  top: 2px;
  left: calc(50% - 60px);
  font-size: 34px;
  line-height: 1;
  pointer-events: none;
  opacity: 0.45;
  transform: translateY(-4px);
  transition:
    transform 0.15s,
    opacity 0.15s;
}
.compact-game .show-finger .finger-guide {
  display: block;
}
.compact-game .show-finger {
  padding-left: 40px !important;
}
.compact-game .demo-tap .finger-guide {
  opacity: 1;
  transform: translateY(8px);
}
.compact-game .touch-controls .demo-tap {
  background: #e5b74e30;
  box-shadow: inset 0 0 0 2px var(--lime);
}
.compact-game .touch-controls .demo-tap[data-foot="R"] {
  background: #79bfff30;
  box-shadow: inset 0 0 0 2px var(--purple);
}
.compact-game .touch-controls .pressed {
  background: var(--lime);
  color: #171713;
}
.compact-game .touch-controls .pressed[data-foot="R"] {
  background: var(--purple);
  color: #171713;
}
.compact-game .transport {
  padding: 2px 14px;
  gap: 6px;
  flex-wrap: nowrap;
  font-size: 12px;
}
.compact-game .transport > span {
  font-size: 12px;
  width: auto;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.compact-game .transport button {
  min-height: 36px;
  padding: 4px 10px;
  flex: none;
  font-size: 12px;
}
.compact-game .sequence {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.compact-game .sequence > div:first-child {
  min-width: 100px;
  margin: 0;
  display: block;
}
.compact-game .sequence .eyebrow {
  font-size: 10px;
}
.compact-game .sequence strong {
  font-size: 12px;
  margin: 2px 0 0;
}
.compact-game .beats {
  gap: 4px;
  min-width: 0;
}
.compact-game .beat {
  padding: 3px 0;
  min-width: 0;
}
.compact-game .beat b {
  font-size: 17px;
}
.compact-game .beat small {
  font-size: 9px;
}
.compact-game .sequence-note,
.compact-game > footer {
  display: none;
}
.compact-game dialog {
  color: #f4f0ff;
  background: #101019;
  border: 1px solid #544473;
  border-radius: 16px;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0 20px 20px;
  overflow: auto;
  overscroll-behavior: contain;
}
.compact-game dialog::backdrop {
  background: #050508cc;
  backdrop-filter: blur(6px);
}
.compact-game .dialog-heading {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #101019;
  padding: 16px 0;
  border-bottom: 1px solid #302a43;
  margin-bottom: 14px;
}
.compact-game .dialog-heading h2 {
  font-size: 26px;
  margin: 0;
}
.compact-game .dialog-heading button {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #544473;
  border-radius: 8px;
  background: #211b30;
  font-size: 14px;
}
.compact-game dialog aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.compact-game dialog .settings {
  display: block;
  padding: 18px;
  order: 0;
}
.compact-game dialog .settings > .eyebrow {
  display: none;
}
.compact-game dialog .range-labels {
  display: flex;
  font-size: 12px;
}
.compact-game dialog .difficulty-label {
  display: block;
  font-size: 14px;
  margin: 16px 0 8px;
}
.compact-game dialog .hint,
.compact-game dialog .track-info {
  display: block;
  font-size: 13px;
  line-height: 1.5;
}
.compact-game dialog select {
  font-size: 16px;
  min-height: 44px;
}
.compact-game dialog .setting-title,
.compact-game dialog .click-option {
  font-size: 14px;
}
.compact-game dialog input[type="range"] {
  min-height: 30px;
  margin: 8px 0;
}
.compact-game dialog .instructions {
  order: 1;
  padding: 0 4px;
}
.compact-game dialog .instructions > p,
.compact-game dialog .instructions > .key-row,
.compact-game dialog .instructions > .tip,
.compact-game dialog .instructions > .eyebrow {
  display: flex;
  font-size: 14px;
  line-height: 1.5;
}
.compact-game dialog .coach {
  order: 2;
  margin: 0;
  padding: 14px;
}
.compact-game dialog .coach #guide-content {
  display: block;
}
.compact-game dialog .coach #dancer {
  height: 150px;
}
.compact-game dialog .coach p {
  font-size: 13px;
}
.compact-game dialog .scoring-help {
  font-size: 14px;
  line-height: 1.6;
}
.compact-game dialog .wave-panel {
  margin-top: 16px;
  border-radius: 8px;
}
.compact-game dialog .wave-panel > div {
  font-size: 12px;
}
@media (max-width: 600px) {
  .compact-game > header {
    height: 52px;
    flex-basis: 52px;
    padding-inline: 12px;
  }
  .compact-game .brand-wordmark strong {
    font-size: 16px;
  }
  .compact-game .brand-wordmark small {
    font-size: 7px;
  }
  .compact-game #sound {
    font-size: 11px;
    padding: 7px;
  }
  .compact-game .header-tools {
    gap: 3px;
  }
  .compact-game > main {
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    gap: 8px;
    grid-template-rows: auto 42px minmax(0, 1fr) 34px;
  }
  .compact-game .intro > div {
    gap: 4px;
    display: block;
  }
  .compact-game h1 {
    font-size: 28px;
  }
  .compact-game .intro p {
    font-size: 12px;
  }
  .compact-game #open-settings {
    font-size: 12px;
    padding: 0 10px;
    min-height: 42px;
  }
  .compact-game .quick-controls {
    gap: 8px;
  }
  .compact-game .styles button {
    font-size: 13px;
    padding: 4px 10px;
  }
  .compact-game .game-card {
    grid-template-rows: 42px 56px minmax(0, 1fr) 88px 42px 3px;
  }
  .compact-game .play-hint {
    font-size: 12px;
    line-height: 1.3;
  }
  .compact-game .start-overlay {
    padding: 8px 12px;
    gap: 6px;
  }
  .compact-game .start-overlay h2 {
    font-size: 30px;
  }
  .compact-game .start-overlay p {
    font-size: 13px;
  }
  .compact-game .start-overlay .mini {
    display: none;
  }
  .compact-game .start-overlay small {
    font-size: 11px;
  }
  .compact-game .touch-controls {
    gap: 8px;
    padding: 7px 8px;
  }
  .compact-game .transport {
    padding: 2px 8px;
    gap: 4px;
  }
  .compact-game .transport > span {
    font-size: 11px;
  }
  .compact-game .transport button {
    font-size: 11px;
    padding: 4px 6px;
  }
  .compact-game .sequence > div:first-child {
    display: none;
  }
  .compact-game .beat b {
    font-size: 16px;
  }
  .compact-game .beat small {
    font-size: 8px;
  }
  .compact-game .finger-guide {
    left: 12px;
    font-size: 32px;
  }
}
@media (max-height: 650px) {
  .compact-game .intro p {
    display: none;
  }
  .compact-game .game-card {
    grid-template-rows: 36px 48px minmax(0, 1fr) 72px 40px 3px;
  }
  .compact-game .start-overlay small {
    display: none;
  }
  .compact-game .start-overlay h2 {
    font-size: 26px;
  }
  .compact-game .start-overlay p {
    font-size: 12px;
  }
}
@media (max-height: 480px) {
  .compact-game > header {
    height: 44px;
    flex-basis: 44px;
  }
  .compact-game > main {
    grid-template-rows: 36px minmax(0, 1fr);
    gap: 6px;
    padding: 6px 12px;
  }
  .compact-game .intro,
  .compact-game .sequence {
    display: none;
  }
  .compact-game .quick-controls,
  .compact-game #open-settings {
    min-height: 36px;
  }
  .compact-game .game-card {
    grid-template-rows: 30px 44px minmax(0, 1fr) 60px 36px 3px;
  }
  .compact-game .stats strong {
    font-size: 18px;
  }
  .compact-game .stats > div {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .compact-game .start-overlay {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 4px 18px;
    text-align: left;
    align-content: center;
  }
  .compact-game .start-overlay h2 {
    font-size: 24px;
    grid-column: 1;
    grid-row: 1;
  }
  .compact-game .start-overlay p {
    grid-column: 1;
    grid-row: 2;
    font-size: 12px;
  }
  .compact-game .start-overlay .primary {
    grid-column: 2;
    grid-row: 1 / 3;
    min-width: 180px;
  }
  .compact-game .start-overlay .mini,
  .compact-game .start-overlay small {
    display: none;
  }
  .compact-game .finger-guide {
    font-size: 28px;
  }
  .compact-game .touch-controls {
    padding-block: 4px;
  }
  .compact-game .transport button {
    min-height: 32px;
  }
}

/* Finger Dance V2.1 gameplay feedback and round summary. */
.compact-game .stats {
  justify-content: space-between;
  gap: clamp(10px, 3vw, 32px);
}
.compact-game #overlay-text {
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  width: min(100%, 470px);
}
.compact-game #feedback.feedback-pop {
  animation: feedback-pop 0.32s ease-out;
}
.compact-game #combo.combo-pop {
  animation: combo-pop 0.25s ease-out;
  color: var(--lime);
}
.compact-game #new-record {
  width: max-content;
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--gold);
  background: #d8aa3b1f;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 0.12em;
  animation: record-pop 0.45s ease-out;
}
.compact-game .result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
}
.compact-game .result-grid span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 4px;
  border: 1px solid #ffffff1c;
  background: #00000024;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.compact-game .result-grid strong {
  color: var(--cream);
  font-size: 17px;
  letter-spacing: 0;
}
@keyframes feedback-pop {
  0% {
    transform: translate(-50%, -50%) scale(0.72);
    opacity: 0.25;
  }
  65% {
    transform: translate(-50%, -50%) scale(1.12);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}
@keyframes combo-pop {
  50% {
    transform: scale(1.24);
  }
}
@keyframes record-pop {
  0% {
    transform: scale(0.78);
    opacity: 0;
  }
  70% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@media (max-width: 520px) {
  .compact-game .stats {
    padding-inline: 10px;
  }
  .compact-game .stats strong {
    font-size: 18px;
  }
  .compact-game .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  .compact-game #feedback.feedback-pop,
  .compact-game #combo.combo-pop,
  .compact-game #new-record {
    animation: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .compact-game .finger-guide {
    transition: none;
    transform: none !important;
  }
  .compact-game .touch-controls button {
    transition: none;
  }
}

.compact-game .paused-note {
  display: none;
  color: #d9c8f7;
  font-size: 14px;
  line-height: 1.5;
}
.compact-game[data-game-state="paused"] .paused-note {
  display: block;
}
.compact-game[data-game-state="finished"] .start-overlay .mini {
  display: none;
}

/* The music and dancer belong to the live floor, outside the settings. */
.compact-game .wave-panel {
  padding: 5px 14px 0;
  background: linear-gradient(90deg, #e5b74e09, #a78bfa0b, #79bfff09);
  min-height: 0;
  overflow: hidden;
}
.compact-game .wave-panel > div {
  font-size: 9px;
  margin: 0;
  line-height: 12px;
}
.compact-game #waveform {
  height: 44px;
}
.compact-game .center-line {
  display: none;
}
.compact-game .dance-stage {
  position: absolute;
  left: 50%;
  top: 28%;
  bottom: 18%;
  width: 30%;
  max-width: 220px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse, #a78bfa16, transparent 70%);
}
.compact-game .dance-stage #guide-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.compact-game .dance-stage #dancer {
  width: 100%;
  height: calc(100% - 24px);
  max-height: 230px;
  min-height: 0;
  overflow: visible;
  filter: drop-shadow(0 8px 12px #0005);
}
.compact-game .dance-stage #dancer > text {
  display: none;
}
.compact-game .dance-stage #step-label {
  font-size: 10px;
  line-height: 14px;
  white-space: nowrap;
}
.compact-game .dance-stage p {
  font-size: 10px;
  line-height: 14px;
  color: #bcb5ca;
  margin: 0;
  white-space: nowrap;
}
.compact-game #feedback {
  top: 14%;
  font-size: 24px;
  line-height: 1.1;
}
.compact-game #feedback small {
  font-size: 11px;
  margin-top: 4px;
}
.compact-game #notes,
.compact-game .impact {
  z-index: 2;
}
.compact-game:not([data-game-state="playing"]) .arena {
  background:
    radial-gradient(ellipse at 23% 55%, #a78bfa20, transparent 60%), #111119;
}
.compact-game:not([data-game-state="playing"]) .dance-stage {
  left: 21%;
  top: 12%;
  bottom: 12%;
  width: 38%;
  max-width: 260px;
}
.compact-game:not([data-game-state="playing"]) .lane-labels,
.compact-game:not([data-game-state="playing"]) .impact {
  visibility: hidden;
}
.compact-game .start-overlay {
  left: 41%;
  padding: 10px 18px 10px 6px;
  background: transparent;
}
.compact-game .start-overlay h2 {
  font-size: clamp(22px, 3.5vw, 38px);
}
.compact-game .start-overlay .primary {
  min-width: 0;
  width: 100%;
  max-width: 260px;
  padding: 10px 8px;
}
.compact-game .start-overlay .mini {
  display: none;
}
@media (max-width: 600px) {
  .compact-game #waveform {
    height: 38px;
  }
  .compact-game .start-overlay {
    padding-right: 10px;
    gap: 8px;
  }
  .compact-game .start-overlay h2 {
    font-size: 25px;
  }
  .compact-game .start-overlay p {
    font-size: 12px;
  }
  .compact-game .start-overlay small {
    display: none;
  }
  .compact-game .start-overlay .primary {
    font-size: 13px;
  }
  .compact-game .dance-stage p,
  .compact-game .dance-stage #step-label {
    font-size: 9px;
  }
  .compact-game[data-game-state="playing"] .dance-stage p {
    display: none;
  }
}
@media (max-height: 650px) {
  .compact-game #waveform {
    height: 32px;
  }
  .compact-game .dance-stage p {
    display: none;
  }
  .compact-game .start-overlay h2 {
    font-size: 23px;
  }
  .compact-game .start-overlay p {
    font-size: 11px;
  }
  .compact-game #feedback {
    top: 8%;
    font-size: 20px;
  }
  .compact-game #feedback small {
    font-size: 10px;
  }
}
@media (max-height: 480px) {
  .compact-game .wave-panel {
    padding-top: 2px;
  }
  .compact-game #waveform {
    height: 30px;
  }
  .compact-game .start-overlay {
    display: flex;
    left: 32%;
    padding: 4px 12px;
    gap: 5px;
  }
  .compact-game:not([data-game-state="playing"]) .dance-stage {
    left: 17%;
    width: 28%;
    top: 0;
    bottom: 0;
  }
  .compact-game .start-overlay h2 {
    font-size: 22px;
  }
  .compact-game .start-overlay .primary {
    min-height: 36px;
    padding: 6px 12px;
  }
  .compact-game .dance-stage #step-label {
    display: none;
  }
  .compact-game .dance-stage #dancer {
    height: 100%;
  }
}

@media (max-height: 480px) {
  .compact-game #feedback small {
    display: none;
  }
  .compact-game .dance-stage {
    top: 36%;
    bottom: 16%;
  }
}
