:root {
  --phone-w: 375px;
  --phone-h: 667px;
  --radius: 18px;

  --bg-black: #000;
  --bg-gray: #777;
  --bg-white: #fff;

  --text-light: rgba(255,255,255,0.92);
  --text-dark: rgba(0,0,0,0.86);
  --muted-light: rgba(255,255,255,0.65);
  --muted-dark: rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: #111;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
}

body {
  display: grid;
  place-items: center;
  overscroll-behavior: none;
}

.stage-wrap {
  width: min(100vw, 980px);
  height: min(100vh, 980px);
  display: grid;
  place-items: center;
  padding: 16px;
}

/* The actual phone canvas */
.stage {
  width: var(--phone-w);
  height: var(--phone-h);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;

  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  outline: 1px solid rgba(255,255,255,0.06);

  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;

  transform-origin: center;
}

/* Center text */
.hud {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px;
}

.state-title {
  font-size: 28px;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin-bottom: 10px;
}

.state-desc {
  font-size: 16px;
  line-height: 1.4;
  opacity: 0.9;
  max-width: 280px;
}

/* Bottom help overlay */
.help {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 12px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted-light);
}

.help-row { display: flex; gap: 8px; align-items: baseline; }

.k {
  display: inline-block;
  min-width: 44px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* STATES */
.stage.state-black {
  background: var(--bg-black);
  color: var(--text-light);
}

.stage.state-sms {
  background: var(--bg-gray);
  color: var(--text-light);
}

.stage.state-call {
  background: var(--bg-white);
  color: var(--text-dark);
}

/* Adjust help colors for white screen */
.stage.state-call .help {
  background: rgba(0,0,0,0.06);
  color: var(--muted-dark);
}
.stage.state-call .k {
  background: rgba(0,0,0,0.10);
  color: rgba(0,0,0,0.86);
}

/* Basic fallback scaling on tiny viewports */
@media (max-height: 740px), (max-width: 420px) {
  .stage { transform: scale(0.9); }
}
