:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #1d1d1f;
  --text: #f5f5f7;
  --muted: #7d7d82;
  --fsu-garnet: #782f40;
  --fsu-gold: #ceb888;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--bg);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, img, video { -webkit-user-select: none; user-select: none; }

.app-shell {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% 34%, rgba(120, 47, 64, .16), transparent 36%),
    #000;
  display: flex;
  flex-direction: column;
  padding:
    max(14px, env(safe-area-inset-top))
    18px
    max(18px, env(safe-area-inset-bottom));
}

.app-header {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 62px;
}

.round-button {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  background: rgba(31,31,33,.94);
  color: white;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.round-button:active { transform: scale(.96); }

.x-icon {
  width: 23px;
  height: 23px;
  position: relative;
}
.x-icon::before,
.x-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: -2px;
  width: 3px;
  height: 28px;
  border-radius: 4px;
  background: #fff;
}
.x-icon::before { transform: rotate(45deg); }
.x-icon::after { transform: rotate(-45deg); }

.dots-icon {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #fff;
  position: relative;
}
.dots-icon::before,
.dots-icon::after {
  content: "";
  position: absolute;
  top: 0;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #fff;
}
.dots-icon::before { left: -9px; }
.dots-icon::after { left: 9px; }

.ticket-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(8px, 2vh, 20px);
}

.ticket-wrap {
  width: min(88vw, 355px);
  aspect-ratio: 1053 / 1115;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 26px 58px rgba(0,0,0,.6),
    0 0 28px rgba(120,47,64,.22);
  touch-action: none;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.ticket-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.reader-area {
  width: min(48vw, 190px);
  height: clamp(88px, 14vh, 122px);
  margin-top: clamp(10px, 2vh, 18px);
  display: grid;
  place-items: center;
  position: relative;
}

.reader-video {
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  background: transparent;
}

.reader-video:not([data-loaded="true"]) { opacity: 0; }

.reader-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #74747a;
  transition: opacity .2s ease;
}

.reader-fallback.hidden { opacity: 0; pointer-events: none; }

.phone-ring {
  width: 48px;
  height: 48px;
  border: 4px solid #0a84ff;
  border-radius: 999px;
  display: grid;
  place-items: center;
  animation: readerPulse 1.55s ease-in-out infinite;
}

.phone-shape {
  width: 22px;
  height: 34px;
  border: 3px solid #0a84ff;
  border-radius: 6px;
  position: relative;
  background: rgba(10,132,255,.23);
  overflow: hidden;
}

.phone-shape::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  background: rgba(10,132,255,.34);
  transform: rotate(45deg);
  left: 10px;
  top: 12px;
}

.phone-shape span {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 2px;
  border-radius: 5px;
  background: #0a84ff;
}

.reader-fallback p {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -.02em;
}

@keyframes readerPulse {
  0%, 100% { transform: scale(1); opacity: .92; }
  50% { transform: scale(1.06); opacity: 1; }
}

@media (max-height: 720px) {
  .ticket-stage { padding-top: 8px; }
  .ticket-wrap { width: min(76vw, 318px); }
  .reader-area { margin-top: 10px; height: 76px; }
  .phone-ring { width: 42px; height: 42px; }
  .reader-fallback p { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .phone-ring { animation: none; }
}
