:root {
  --bg: #16061c;
  --pink: #ff7ac8;
  --gold: #f4d27a;
  --violet: #7b5cff;
  --text: #f7ecff;
  --muted: #c9b3d8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 0%, #4a1460 0%, transparent 42%),
    radial-gradient(circle at 90% 80%, #2a0b58 0%, var(--bg) 55%);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}

#app,
.screen {
  min-height: 100svh;
}

.screen {
  width: min(430px, 100%);
  margin: 0 auto;
  padding: 28px 20px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.screen.splash {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100svh;
  padding: 10vh 22px calc(28px + env(safe-area-inset-bottom));
  justify-content: flex-start;
  align-items: center;
  gap: 28px;
  background:
    radial-gradient(ellipse at 50% 18%, #6b3cff55 0%, transparent 38%),
    radial-gradient(ellipse at 50% 100%, #3a1870 0%, transparent 46%),
    linear-gradient(#1a0a28, #07030f 55%, #12061c);
}

.splash-top {
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.splash button {
  margin-top: auto;
}

.screen.splash::before {
  content: "";
  position: absolute;
  inset: 8% 12% 22%;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, #c9a6ff22 0%, transparent 42%),
    linear-gradient(90deg, transparent 0 18%, #8b5cff22 18% 19%, transparent 19% 81%, #8b5cff22 81% 82%, transparent 82%);
  mask-image: radial-gradient(ellipse at 50% 55%, #000 40%, transparent 78%);
}

.sys-card p em {
  font-style: normal;
  color: #7ad4ff;
  font-weight: 600;
}

.fae-title,
.sys-card,
.splash button {
  position: relative;
  z-index: 1;
}

.fae-title {
  margin: 0;
  text-align: center;
  font-size: clamp(2rem, 9vw, 2.8rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #efe7ff;
  text-shadow: 0 0 28px #8b5cff;
}

.sys-card {
  width: 100%;
  border: 1px solid #7ec8ff99;
  border-radius: 18px;
  padding: 16px 16px 18px;
  background: #12344fd9;
  box-shadow: 0 0 0 1px #9fd4ff33, 0 16px 40px #0008;
  backdrop-filter: blur(8px);
}

.sys-card header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: #9fd4ff;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bang {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #3aa0e8;
  color: #072033;
  font-weight: 800;
  font-family: "Segoe UI", sans-serif;
}

.sys-card p {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  color: #d7ecff;
  line-height: 1.45;
}

.splash button {
  width: min(360px, 100%);
  background: linear-gradient(180deg, #9b5cff, #6b2ad8);
  color: #f4ecff;
  box-shadow: 0 10px 28px #4a18a866;
}

.splash button:disabled {
  opacity: 0.78;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.name-ask {
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8vh;
}

.ask-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.godmother-avatar {
  width: 72px;
  height: 124px;
  flex-shrink: 0;
  border-radius: 22px;
  overflow: hidden;
  border: 2px solid #d4b3ff;
  background: #12081c;
  box-shadow: 0 0 18px #8b5cff66;
}

.godmother-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

.ask-row p {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.3;
  color: #f4ecff;
}

#player-name {
  width: 100%;
  min-height: 54px;
  border: 1px solid #7ec8ff55;
  border-radius: 16px;
  padding: 0 16px;
  background: #0d1a2ee6;
  color: #eef6ff;
  font: 1rem "Segoe UI", sans-serif;
  outline: none;
}

#player-name::placeholder {
  color: #8aa7c4;
}

#player-name:focus {
  border-color: #9fd4ff;
  box-shadow: 0 0 0 3px #7ec8ff33;
}

.rhythm {
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ask-title {
  margin: 0 0 6px;
  font-size: 1.28rem;
  line-height: 1.2;
}

.ask-sub {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.86rem;
  line-height: 1.4;
  color: #c9d7ee;
}

.pact-row {
  display: flex;
  gap: 6px;
}

.splash button.pact {
  flex: 1;
  width: auto;
  margin: 0;
  min-height: 62px;
  padding: 8px 2px;
  border: 1px solid #7ec8ff44;
  border-radius: 14px;
  background: #0d1a2ecc;
  color: #eef6ff;
  box-shadow: none;
  font: 0.72rem "Segoe UI", sans-serif;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.pact b {
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
}

.pact span {
  display: block;
  color: #9fd4ff;
  font-size: 0.68rem;
}

.pact.is-on {
  background: #4a2480;
  border-color: #e0c6ff;
  box-shadow: 0 0 0 1px #e0c6ff88, 0 8px 18px #6b2ad866;
}

.time-label {
  margin: 4px 0 0;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.88rem;
  color: #c9d7ee;
}

.time-wheel {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  height: 150px;
}

.time-wheel::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50px;
  height: 50px;
  border-radius: 14px;
  background: #12344fd9;
  border: 1px solid #7ec8ff55;
  pointer-events: none;
}

.wheel {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 150px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.wheel::-webkit-scrollbar {
  display: none;
}

.wheel i,
.wheel b {
  display: grid;
  place-items: center;
  height: 50px;
  font-style: normal;
  font-weight: 600;
  font-size: 1.45rem;
  font-family: "Segoe UI", sans-serif;
  scroll-snap-align: center;
  color: #8aa0c0;
}

.wheel b {
  color: #f4ecff;
}

.time-colon {
  position: relative;
  z-index: 1;
  align-self: center;
  font-size: 1.6rem;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.brand {
  margin: 0;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--gold);
}

h1 {
  margin: 0;
  font-weight: 600;
  font-size: 2rem;
}

.lead,
.note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.note {
  font-size: 0.88rem;
}

.timer,
#ready-timer {
  margin: 8px 0 0;
  font-size: 4.5rem;
  text-align: center;
  color: var(--gold);
  line-height: 1;
}

#ready-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #14041455;
  text-align: center;
  padding: 20px;
  pointer-events: none;
}

#ready-overlay.hidden {
  display: none !important;
}

.ready-title {
  margin: 0;
  font-size: 1.4rem;
}

.ready-hint {
  margin: 8px 0 0;
  color: var(--muted);
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 52px;
  padding: 0 22px;
  font: inherit;
  font-size: 1rem;
  background: linear-gradient(90deg, var(--pink), var(--violet));
  color: #1a0618;
  font-weight: 700;
  cursor: pointer;
}

.fight-top {
  display: grid;
  gap: 10px;
}

.fight-top span {
  font-size: 0.82rem;
  color: var(--muted);
}

.bar {
  height: 10px;
  border-radius: 99px;
  background: #2a1433;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 100%;
}

.bar.you i {
  background: var(--gold);
}

.bar.foe i {
  background: var(--pink);
}

.stage {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #000;
}

video,
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px;
  background: linear-gradient(transparent, #140414f0);
  text-align: center;
}

#rep-count {
  margin: 0;
  font-size: 2.6rem;
  color: var(--gold);
}

.hud-label,
#status {
  margin: 0;
  color: var(--muted);
}

.actions {
  display: grid;
}

#btn-rep {
  background: transparent;
  border: 1px solid #d9a7ff66;
  color: var(--text);
}
