:root {
  --bg: #12121a;
  --card: #1e1e2b;
  --text: #ffffff;
  --muted: #9a9ab0;
  --accent: #ff2d78;
  --correct: #23c552;
  --wrong: #ff4d4d;
  --a: #e5484d;
  --b: #3e63dd;
  --c: #f5a524;
  --d: #30a46c;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  overscroll-behavior: none;
}

/* Phone width everywhere: on a tablet or a computer the page sits in a
   phone-shaped column in the middle rather than stretching across. */
#app {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100%;
  padding: max(20px, env(safe-area-inset-top)) 20px
    max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.screen[hidden] {
  display: none;
}

#screen-round {
  justify-content: flex-start;
}
/* On a phone the answers start at the top, under the thumb; in a desktop
   window that leaves them stranded up there, so centre them like the rest. */
@media (min-width: 600px) {
  #screen-round {
    justify-content: center;
  }
}

.logo {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 8px;
}
.logo span {
  color: var(--accent);
  margin-left: 6px;
}

/* ROXi, the game that was played under it, then its genre, on the final
   screen. */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
/* ROXi and the game logo at the same width, one above the other. */
.brand-logos {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.brand-roxi,
.brand-game {
  width: 150px;
}
.brand-genre {
  margin: 0;
  color: #c9c9dd;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}
.brand-genre[hidden] {
  display: none;
}

#share-button {
  margin-top: 6px;
}

.share-viewer {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: max(20px, env(safe-area-inset-top)) 20px
    max(20px, env(safe-area-inset-bottom));
  text-align: center;
}
.share-viewer[hidden] {
  display: none;
}
.share-viewer img {
  width: 100%;
  max-width: 400px;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 16px;
  /* the long press is the point: keep the browser's image menu available */
  -webkit-touch-callout: default;
  user-select: auto;
}
.share-viewer button.primary {
  max-width: 400px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  font-weight: 700;
}

.big {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
}
.muted {
  color: var(--muted);
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}

input {
  background: var(--card);
  border: 2px solid transparent;
  border-radius: 14px;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  padding: 16px;
  width: 100%;
}
input:focus {
  outline: none;
  border-color: var(--accent);
}
#code {
  text-transform: uppercase;
  letter-spacing: 8px;
  text-align: center;
  font-size: 30px;
}

button.primary {
  margin-top: 10px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 14px;
  padding: 18px;
  font-size: 18px;
  font-weight: 800;
  width: 100%;
}
button.primary:disabled {
  opacity: 0.5;
}
button.primary:active {
  transform: scale(0.98);
}

#ready-button {
  margin-top: 26px;
}

.error {
  color: var(--wrong);
  font-size: 15px;
  margin: 4px 0 0;
}

.round-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.timer {
  height: 6px;
  border-radius: 3px;
  background: var(--card);
  overflow: hidden;
  margin: 12px 0 4px;
}
.timer-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left center;
}

.question {
  color: var(--muted);
  font-size: 15px;
  margin: 6px 0;
}

.answers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 6px;
}

.answer {
  border: 0;
  border-radius: 16px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  padding: 22px 16px;
  min-height: 84px;
  text-align: left;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 12px;
}
.answer:active {
  transform: scale(0.98);
}
.answer:disabled {
  opacity: 0.45;
}
.answer .pill {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  display: grid;
  place-items: center;
  font-size: 15px;
}
.answer:nth-child(1) {
  background: var(--a);
}
.answer:nth-child(2) {
  background: var(--b);
}
.answer:nth-child(3) {
  background: var(--c);
}
.answer:nth-child(4) {
  background: var(--d);
}

.verdict {
  font-size: 90px;
  line-height: 1;
  font-weight: 800;
}
.verdict.correct {
  color: var(--correct);
}
.verdict.wrong {
  color: var(--wrong);
}

.gained {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}

.standings {
  list-style: none;
  padding: 0;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.standings li {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
}
.standings li.me {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.standings .who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.standings .rank {
  color: var(--muted);
  width: 26px;
}
.standings .pts {
  margin-left: auto;
  color: var(--accent);
  font-weight: 800;
}

.pulse {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  margin: 6px auto;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

.status {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
}
.status[hidden] {
  display: none;
}
