* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #2b2b2b;
  color: #f0f0f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.b3ta-header {
  width: 100%;
  max-width: 650px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: #1e1e1e;
  border-radius: 6px 6px 0 0;
  font-size: 13px;
  color: #aaa;
  border-bottom: 2px solid #ffcc00;
}

.b3ta-header .logo {
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
}

.b3ta-header .logo span {
  color: #ffcc00;
}

.b3ta-header .hint {
  font-size: 12px;
  color: #ccc;
}

/* App / Stage Container */
.stage-wrapper {
  width: 100%;
  max-width: 650px;
  background: #000;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  position: relative;
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 507 / 429;
  overflow: hidden;
  touch-action: manipulation;
}

/* Background image */
.stage-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  pointer-events: none;
}

/* Animated Mouth Overlay */
.mouth-overlay {
  position: absolute;
  left: 77.2%;
  top: 32.38%;
  width: 9.47%;
  height: 9.56%;
  display: none;
  pointer-events: none;
  z-index: 5;
  image-rendering: auto;
}

.mouth-overlay.active {
  display: block;
}

/* Vector Subtitle SVG Layer */
.subtitle-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: none;
}

.subtitle-layer.active {
  display: block;
}

/* Touch Keys Overlay */
.keys-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
}

.key-target {
  position: absolute;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 4px;
  transition: background 0.05s ease, box-shadow 0.05s ease;
}

/* Hover effect on desktop */
@media (hover: hover) {
  .key-target:hover {
    background: rgba(255, 255, 255, 0.15);
  }
}

/* Active key press feedback */
.key-target.active {
  background: rgba(255, 230, 0, 0.45);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6), 0 0 8px rgba(255, 230, 0, 0.9);
}

/* Controls / Info Bar at bottom */
.footer-info {
  width: 100%;
  max-width: 650px;
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #888;
  padding: 4px 6px;
}

.footer-info a {
  color: #aaa;
  text-decoration: none;
}

.footer-info a:hover {
  color: #ffcc00;
  text-decoration: underline;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #aaa;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #4caf50;
  border-radius: 50%;
  display: inline-block;
}
