:root {
  --void: #07060b;
  --ink: #15111d;
  --ember: #ff6a2b;
  --bone: #e6d8bd;
}

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

html, body {
  height: 100%;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  background: var(--void);
  overflow: hidden;
}

#stage {
  height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 45%, #1a1424 0%, var(--void) 70%);
}

#screen {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: none;
  opacity: 0;
  transition: opacity 0.4s ease-out;
  box-shadow: 0 0 0 1px #000, 0 24px 80px rgba(0, 0, 0, 0.6);
}

.ready #screen { opacity: 1; }

#frame { position: relative; line-height: 0; }

.crt #frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px);
}

.note {
  color: var(--bone);
  font: 14px/1.5 ui-monospace, monospace;
  padding: 16px;
}

#rotate { display: none; }

@media (orientation: portrait) {
  .touch #frame { display: none; }
  .touch #rotate {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: var(--void);
    color: var(--bone);
    font: 600 15px/1.4 ui-monospace, monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    padding: 24px;
  }
}

.phone {
  width: 44px;
  height: 76px;
  border: 3px solid var(--bone);
  border-radius: 8px;
  box-shadow: 0 0 0 3px var(--void), 0 0 24px rgba(255, 106, 43, 0.4);
  animation: turn 2s ease-in-out infinite;
}

@keyframes turn {
  0%, 20% { transform: rotate(0deg); border-color: var(--bone); }
  55%, 100% { transform: rotate(-90deg); border-color: var(--ember); }
}

@media (prefers-reduced-motion: reduce) { .phone { animation: none; transform: rotate(-90deg); } }

/* fullscreen button in the page corner */
#fs {
  position: fixed;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: rgba(7, 6, 11, 0.55);
  border: 1px solid rgba(230, 216, 189, 0.25);
  color: var(--bone);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s, border-color 0.15s;
  z-index: 5;
}
#fs:hover, #fs:focus-visible { opacity: 1; border-color: var(--ember); outline: none; }
#fs svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
#fs.on svg { transform: rotate(180deg); }
.touch #fs { display: none; }
