:root {
  font-family: "Noto Sans", "Segoe UI", sans-serif;
  --bg: #121212;
  --panel: #0c0c0c;
  --panel2: #1c1c1c;
  --text: #e9eaee;
  --muted: #c0c1c7;
  --body: #8e919b;
  --border: #ffffff1f;
  --accentText: #121212;
  color: var(--text);
  background: var(--bg);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f2f3;
    --panel: #e7e7e9;
    --panel2: #dcdcdf;
    --text: #17181b;
    --muted: #33353b;
    --body: #5d6068;
    --border: #0000001f;
    --accentText: #f2f2f3;
    color-scheme: light;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
header {
  padding: 22px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}
.brand {
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}
.brand span {
  color: var(--body);
  margin-left: 5px;
}
header > span {
  color: var(--body);
  font-size: 12px;
}
main {
  max-width: 1200px;
  margin: auto;
  padding: 32px;
}
.lobby {
  min-height: 70vh;
  display: grid;
  place-items: center;
}
.ticket {
  width: 100%;
  max-width: 440px;
  padding: 30px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
}
.ticket h1 {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin: 0 0 14px;
}
.ticket p {
  color: var(--body);
  font-size: 13px;
  line-height: 1.8;
}
.ticket label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 27px 0 9px;
}
.ticket input {
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  width: 100%;
}
.ticket input::placeholder {
  color: var(--body);
}
.ticket > button {
  background: var(--muted);
  color: var(--accentText);
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
}
.ticket #status {
  font-size: 12px;
  min-height: 40px;
  margin: 16px 0;
}
.ticket small {
  display: block;
  border-top: 1px solid var(--border);
  padding-top: 17px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--body);
}
footer {
  padding: 22px 32px;
  color: var(--body);
  text-align: center;
  font-size: 11px;
}
.stage-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 15px;
  font-size: 13px;
}
.stage-bar > span:first-child {
  color: var(--text);
  font-weight: 600;
}
.stage-bar > span:nth-child(2) {
  flex: 1;
  color: var(--body);
  font-size: 12px;
}
.stage-bar button,
#play {
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
}
.screen-wrap {
  position: relative;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
}
video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  inset: 0;
}
#play {
  position: absolute;
  z-index: 2;
  background: var(--muted);
  color: var(--accentText);
}
#stage:fullscreen {
  background: var(--bg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
#stage:fullscreen .screen-wrap {
  flex: 1;
  min-height: 0;
}
.stage-note {
  text-align: center;
  color: var(--body);
  font-size: 12px;
  line-height: 1.7;
}
#touch {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 5px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
#touch button {
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  border-radius: 8px;
  touch-action: none;
  min-height: 43px;
  min-width: 43px;
}
#touch button.pressed {
  background: var(--muted);
  color: var(--accentText);
}
.dpad,
.faces {
  display: grid;
  grid-template: repeat(3, 43px) / repeat(3, 43px);
  gap: 4px;
}
.up {
  grid-area: 1/2;
}
.left {
  grid-area: 2/1;
}
.down {
  grid-area: 3/2;
}
.right {
  grid-area: 2/3;
}
.faces button {
  border-radius: 50% !important;
}
.meta {
  display: flex;
  gap: 7px;
  align-items: center;
}
.meta button {
  font-size: 11px;
  padding: 5px 9px;
}
.meta button:nth-child(2),
.meta button:nth-child(3) {
  min-width: 55px !important;
}
@media (min-width: 1000px) and (pointer: fine) {
  #touch {
    display: none;
  }
}
@media (max-width: 760px) {
  header {
    padding: 20px;
  }
  .brand {
    font-size: 16px;
  }
  header > span {
    font-size: 10px;
  }
  main {
    padding: 20px;
  }
  .lobby {
    min-height: 65vh;
  }
  .ticket {
    padding: 24px;
  }
  .ticket h1 {
    font-size: 24px;
  }
  .stage-bar {
    flex-wrap: wrap;
  }
  .stage-bar > span:nth-child(2) {
    display: none;
  }
  #fullscreen {
    margin-left: auto;
  }
  .meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }
  .dpad,
  .faces {
    grid-template: repeat(3, 36px) / repeat(3, 36px);
    gap: 2px;
  }
  #touch button {
    min-height: 36px;
    min-width: 36px;
  }
  .meta button {
    min-width: 35px !important;
    padding: 5px;
    font-size: 10px;
  }
  .meta button:nth-child(2),
  .meta button:nth-child(3) {
    min-width: 38px !important;
  }
}
#room-code {
  letter-spacing: 0.12em;
  font-size: 20px;
  text-transform: uppercase;
}
.get-app {
  max-width: 440px;
  margin: 24px auto 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 12px;
  color: var(--body);
}
.get-app p {
  flex: 1 1 100%;
  margin: 0;
  line-height: 1.7;
}
.get-app strong {
  color: var(--text);
}
.get-app a {
  color: var(--accentText);
  background: var(--muted);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  text-decoration: none;
}
.get-app button {
  border: 0;
  background: none;
  color: var(--body);
  font-size: 12px;
  padding: 8px 4px;
}
