* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  color: #ffffff;
  overflow: hidden;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 22px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

#js-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  margin: 0;
  padding: 14px 24px;
  background: #b42318;
  color: #ffffff;
  font-weight: 700;
}

#stage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000000;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

#stage audio { display: none; }

#screen {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
}

#screen.fill { object-fit: cover; }

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

#start { z-index: 5; background: #000000; }
#msg { z-index: 4; pointer-events: none; }
#msg .panel { pointer-events: auto; }

.panel {
  width: 100%;
  max-width: 760px;
  max-height: 100%;
  overflow: auto;
  padding: 28px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;
}

#start .panel { border: 1px solid rgba(255, 255, 255, 0.18); }

.panel h1 {
  margin: 0 0 14px;
  font-size: 32px;
  line-height: 1.2;
}

.panel p { margin: 0 0 12px; }
.panel .small { font-size: 18px; opacity: 0.75; }

.steps { margin: 0 0 14px; padding-left: 30px; }
.steps li { margin-bottom: 6px; }

.actions { margin-top: 18px; }

.status { margin: 16px 0 0; min-height: 1.4em; }

#picker { margin-top: 18px; }
.picker-title { font-weight: 600; }
#picker-list .btn { display: block; width: 100%; margin-top: 12px; text-align: left; }

.btn {
  min-height: 64px;
  padding: 0 28px;
  font: inherit;
  font-size: 22px;
  font-weight: 600;
  border-radius: 14px;
  cursor: pointer;
  color: #ffffff;
  -webkit-appearance: none;
  appearance: none;
}

.btn-primary { background: #c2410c; border: 2px solid #c2410c; color: #ffffff; }
.btn-secondary { background: transparent; border: 2px solid rgba(255, 255, 255, 0.5); color: #ffffff; }
.btn:focus { outline: 3px solid #ffffff; outline-offset: 2px; }
.btn[disabled] { opacity: 0.4; cursor: default; }

#controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 16px 24px;
  padding-left: calc(24px + env(safe-area-inset-left, 0px));
  padding-right: calc(24px + env(safe-area-inset-right, 0px));
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms linear, visibility 0s linear 200ms;
}

#controls.show {
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms linear, visibility 0s linear 0s;
}

#stats {
  margin: 0 0 12px;
  font-size: 18px;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#controls .row {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  margin-bottom: -14px;
}

#controls .row .btn { margin: 0 14px 14px 0; }

@media (prefers-reduced-motion: reduce) {
  #controls, #controls.show { transition: none; }
}
