/* ripples.css */

/* --- page base --- */
html, body {
  margin: 0;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* --- app container --- */
#appBox {
  position: relative;
  width: min(720px, 100vw - 32px);
  aspect-ratio: 9 / 16;          /* tall box, tweak if you want */
  overflow: hidden;
  border-radius: 16px;
  background: #000;
  box-shadow: 0 18px 45px rgba(0,0,0,0.65);
}

/* --- stage: now relative to #appBox, NOT viewport --- */
.stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* background video fills the box */
.bg,
.bg > * {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* canvas stays in the box */
canvas#c {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* --- UI overlay (inside box) --- */
#ui {
  position: absolute;
  inset: auto 0 0 0;        /* bottom of the box */
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

.btn {
  background: rgba(20,20,22,.65);
  color: #cfcfd4;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  padding: .35rem .6rem;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .2s ease, color .2s ease, opacity .2s ease;
  opacity: .9;
}
.btn:hover {
  background: rgba(26,26,30,.8);
  color: #fff;
  opacity: 1;
}

#badge {
  font-weight: 600;
  font-size: 11px;
  color: #bbb;
  padding: .35rem .5rem;
  border-radius: 6px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.18);
}
#badge.on {
  color: #7fffb2;
  border-color: rgba(127,255,178,.45);
}

/* instruction + credit inside the box */
#instruction {
  position: absolute;
  left: 50%;
  bottom: 55%;
  transform: translateX(-50%);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255,255,255,0.85);
  text-align: center;
  letter-spacing: 0.4px;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

#credit {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  font-size: 11px;
  line-height: 1.2;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.45px;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}
