:root {
  color-scheme: dark;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh; /* accounts for mobile browser toolbars so there's no stray gap */
  background: #000;
  overflow: hidden;
  touch-action: none;
}

#face {
  display: block;
  width: 100vw;
  height: 100vh;
  width: 100dvw;
  height: 100dvh;
  background: #000;
}

#caption {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 8vh;
  padding: 0 8vw;
  text-align: center;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 4.2vmin;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  line-height: 1.35;
  transition: opacity 0.25s ease;
}

#hint {
  position: fixed;
  left: 0;
  right: 0;
  top: 6vh;
  text-align: center;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 3vmin;
  color: rgba(255, 255, 255, 0.45);
  transition: opacity 0.6s ease;
}

#hint.hidden {
  opacity: 0;
}

.panel-hidden {
  display: none !important;
}

#trainPanel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vw;
  z-index: 10;
  touch-action: auto;
}

.trainCard {
  max-width: 90vw;
  width: 480px;
  text-align: center;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #fff;
}

.trainCard h2 {
  font-size: 5.5vmin;
  margin-bottom: 3vh;
}

.trainHelp {
  font-size: 3.4vmin;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4vh;
  line-height: 1.4;
}

.trainBtnBig {
  display: block;
  width: 100%;
  padding: 3vh 4vw;
  margin-bottom: 2vh;
  font-size: 3.8vmin;
  border-radius: 12px;
  border: none;
  background: #ff9500;
  color: #000;
  font-weight: 600;
}

.trainBtnBig:disabled {
  background: #444;
  color: rgba(255, 255, 255, 0.5);
}

.trainStatus {
  min-height: 4vh;
  font-size: 3.2vmin;
  color: #ffd27a;
  margin: 1vh 0;
}

.trainSkip {
  margin-top: 2vh;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 3vmin;
  text-decoration: underline;
}

/* Corner controls.
   These were rendering at roughly 29x11px — far too small to hit on a phone, so tapping
   them simply missed. Padding plus a minimum size gives each one a ~44px touch target
   (the usual accessibility floor) without making the labels visually loud. */
#retrainLink,
#personaBtn,
#forgetBtn {
  position: fixed;
  z-index: 5;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.55);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 3.2vmin;
  line-height: 1;
  padding: 1.6vh 3.4vw;
  min-height: 44px;
  min-width: 56px;
  touch-action: manipulation;
}

#personaBtn {
  bottom: 1.2vh;
  left: 1.6vw;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(94, 200, 255, 0.14);
}

#retrainLink {
  bottom: 1.2vh;
  right: 1.6vw;
}

#forgetBtn {
  top: 1.2vh;
  right: 1.6vw;
}

/* Brief visual confirmation that a tap registered. */
#retrainLink:active,
#personaBtn:active,
#forgetBtn:active {
  background: rgba(255, 255, 255, 0.28);
}
