:root {
  color-scheme: dark;
  font-family: Georgia, "Times New Roman", serif;
  color: #f5f4f8;
  background: #10121a;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(10, 12, 19, .72), rgba(11, 14, 23, .9)),
    url("background.png") center / cover fixed;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .58;
}

.shell {
  width: min(100% - 28px, 620px);
  margin: 0 auto;
  padding: 22px 0 42px;
}

.brand {
  margin: 0 auto 18px;
  text-align: center;
}

.brand-name {
  margin: 0;
  color: #81d9ff;
  font-size: 34px;
  font-style: italic;
  text-shadow: 0 0 18px rgba(49, 174, 255, .75);
}

.brand h1 {
  margin: 4px 0 0;
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 500;
}

.panel {
  padding: clamp(18px, 5vw, 28px);
  border: 1px solid rgba(95, 190, 255, .72);
  border-radius: 20px;
  background: rgba(15, 20, 30, .92);
  box-shadow: 0 0 24px rgba(24, 136, 255, .23);
}

.panel h2 {
  margin: 0 0 10px;
  font-size: clamp(21px, 5vw, 26px);
  line-height: 1.35;
}

.panel form > p,
.player-panel > p {
  margin: 0 0 20px;
  color: #d3d5df;
  line-height: 1.5;
}

.panel label {
  display: block;
  margin: 0 0 8px;
  color: #d8dbe5;
  font-size: 14px;
}

.panel input {
  width: 100%;
  min-height: 56px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #546173;
  border-radius: 12px;
  outline: none;
  background: #0c1018;
  color: #fff;
  font-size: 20px;
}

#room-code {
  font-size: 28px;
  letter-spacing: .3em;
  text-align: center;
}

.panel input:focus {
  border-color: #69c8ff;
  box-shadow: 0 0 0 3px rgba(76, 182, 255, .2);
}

.primary-button,
.quiet-button,
.back-button {
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid rgba(117, 204, 255, .8);
  border-radius: 12px;
  background: linear-gradient(135deg, #147fc1, #2053a7);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.panel form > .primary-button {
  width: 100%;
}

.quiet-button,
.back-button {
  min-height: 42px;
  border-color: rgba(207, 220, 237, .4);
  background: rgba(255, 255, 255, .06);
  font-size: 14px;
  font-weight: 400;
}

.back-button {
  margin: 0 0 18px;
  padding: 8px 12px;
}

.avatar-preview {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  margin: 0 auto 18px;
  overflow: hidden;
  border: 2px solid #69c8ff;
  border-radius: 50%;
  background: #0c1018;
  box-shadow: 0 0 20px rgba(49, 174, 255, .3);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.large-avatar {
  width: 142px;
  height: 142px;
  margin-bottom: 22px;
}

.player-panel {
  text-align: center;
}

.player-panel h2 {
  margin-bottom: 10px;
}

.muted {
  min-height: 1em;
  color: #b6c4d2;
}

.eyebrow {
  margin: 0 0 8px;
  color: #82d7ff;
  font-size: 14px;
}

.question-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.question-heading .eyebrow {
  margin: 0;
}

#question-text {
  margin-bottom: 20px;
}

.answer-list {
  display: grid;
  gap: 10px;
}

.answer-button {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(117, 204, 255, .55);
  border-radius: 12px;
  background: rgba(20, 44, 66, .72);
  color: #fff;
  font-size: 16px;
  line-height: 1.4;
  text-align: left;
}

.answer-button:hover:not(:disabled),
.answer-button.selected {
  border-color: #8bdcff;
  background: rgba(29, 109, 158, .62);
}

.answer-button .answer-letter {
  flex: 0 0 26px;
  color: #8bdcff;
  font-weight: 700;
}

.answer-status {
  min-height: 1.4em;
  margin: 16px 0 0;
  color: #9af0c3;
  text-align: center;
}

.answer-confirmation {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 18, .78);
  backdrop-filter: blur(7px);
  pointer-events: none;
}

.answer-confirmation__card {
  position: relative;
  isolation: isolate;
  width: min(520px, 100%);
  overflow: hidden;
  padding: clamp(30px, 7vw, 48px) clamp(22px, 6vw, 40px);
  border: 1px solid #70e8ff;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(12, 27, 52, .98), rgba(27, 16, 48, .98));
  box-shadow:
    0 0 20px rgba(37, 207, 255, .48),
    0 0 70px rgba(116, 87, 255, .3),
    inset 0 0 28px rgba(37, 147, 255, .12);
  text-align: center;
  animation: answer-confirmation-enter 520ms cubic-bezier(.16, 1, .3, 1) both;
}

.answer-confirmation__card::before {
  position: absolute;
  z-index: -1;
  inset: -50%;
  background: repeating-conic-gradient(
    from 8deg at 50% 50%,
    transparent 0deg 12deg,
    rgba(112, 232, 255, .12) 12.2deg 12.5deg,
    transparent 12.8deg 24deg
  );
  content: "";
  animation: answer-confirmation-rays 18s linear infinite;
}

.answer-confirmation__mark {
  display: block;
  margin-bottom: 12px;
  color: #ffd27b;
  font-size: 2rem;
  text-shadow: 0 0 16px rgba(255, 210, 123, .85);
  animation: answer-confirmation-mark 1.8s ease-in-out infinite alternate;
}

.answer-confirmation__card h2 {
  margin: 0;
  color: #a4efff;
  font-size: clamp(1.45rem, 5vw, 2rem);
  line-height: 1.35;
  text-shadow: 0 0 16px rgba(78, 210, 255, .65);
}

.answer-confirmation__card p {
  margin: 14px 0 0;
  color: #f5f4f8;
  font-size: clamp(1rem, 3.8vw, 1.2rem);
  line-height: 1.55;
}

@keyframes answer-confirmation-enter {
  from {
    opacity: 0;
    transform: translateY(26px) scale(.84);
    filter: brightness(1.8);
  }
  72% {
    opacity: 1;
    transform: translateY(-2px) scale(1.03);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes answer-confirmation-rays {
  to { transform: rotate(360deg); }
}

@keyframes answer-confirmation-mark {
  to {
    transform: scale(1.16) rotate(12deg);
    text-shadow: 0 0 24px rgba(255, 210, 123, 1);
  }
}

.leave-confirmation {
  position: fixed;
  inset: 0;
  width: min(520px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: inherit;
}

.leave-confirmation::backdrop {
  background: rgba(3, 7, 17, .78);
  backdrop-filter: blur(7px);
}

.leave-confirmation__card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(26px, 6vw, 40px);
  border: 1px solid #70e8ff;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(12, 27, 52, .98), rgba(27, 16, 48, .98));
  box-shadow:
    0 0 20px rgba(37, 207, 255, .48),
    0 0 70px rgba(116, 87, 255, .3),
    inset 0 0 28px rgba(37, 147, 255, .12);
  text-align: center;
  animation: leave-confirmation-enter 480ms cubic-bezier(.16, 1, .3, 1) both;
}

.leave-confirmation__card::before {
  position: absolute;
  z-index: -1;
  inset: -50%;
  background: repeating-conic-gradient(
    from 8deg at 50% 50%,
    transparent 0deg 12deg,
    rgba(112, 232, 255, .12) 12.2deg 12.5deg,
    transparent 12.8deg 24deg
  );
  content: "";
  animation: leave-confirmation-rays 18s linear infinite;
}

.leave-confirmation__mark {
  display: block;
  margin-bottom: 8px;
  color: #ffd27b;
  font-size: 2rem;
  text-shadow: 0 0 16px rgba(255, 210, 123, .85);
  animation: leave-confirmation-mark 1.8s ease-in-out infinite alternate;
}

.leave-confirmation__eyebrow {
  margin: 0 0 14px;
  color: #ffc15c;
  font-family: "Courier New", monospace;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .18em;
}

.leave-confirmation__card h2 {
  margin: 0;
  color: #a4efff;
  font-size: clamp(1.45rem, 5vw, 2rem);
  line-height: 1.35;
  text-shadow: 0 0 16px rgba(78, 210, 255, .65);
}

.leave-confirmation__card > p:not(.leave-confirmation__eyebrow):not(.leave-confirmation__status) {
  margin: 14px 0 0;
  color: #e6edf7;
  font-size: 1rem;
  line-height: 1.5;
}

.leave-confirmation__status {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: #a9ddff;
  font-size: .9rem;
}

.leave-confirmation__status[data-kind="error"] {
  color: #ffb1a6;
}

.leave-confirmation__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.leave-confirmation__button {
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid #70e8ff;
  border-radius: 999px;
  background: rgba(37, 207, 255, .12);
  color: #d7faff;
  font-weight: 700;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.leave-confirmation__button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(37, 207, 255, .24);
  box-shadow: 0 0 18px rgba(37, 207, 255, .38);
}

.leave-confirmation__button--confirm {
  border-color: #ff9a9a;
  background: rgba(208, 65, 103, .2);
  color: #ffdede;
}

.leave-confirmation__button--confirm:hover:not(:disabled) {
  background: rgba(208, 65, 103, .36);
  box-shadow: 0 0 18px rgba(255, 99, 139, .4);
}

.leave-confirmation__button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@keyframes leave-confirmation-enter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(.86);
    filter: brightness(1.7);
  }
  72% {
    opacity: 1;
    transform: translateY(-2px) scale(1.03);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes leave-confirmation-rays {
  to { transform: rotate(360deg); }
}

@keyframes leave-confirmation-mark {
  to {
    transform: scale(1.16) rotate(12deg);
    text-shadow: 0 0 24px rgba(255, 210, 123, 1);
  }
}

.status {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: #a9ddff;
  font-size: 14px;
  line-height: 1.45;
}

.status[data-kind="error"] {
  color: #ffb1a6;
}

.status[data-kind="success"] {
  color: #9af0c3;
}

.app-status {
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .answer-confirmation__card,
  .answer-confirmation__card::before,
  .answer-confirmation__mark,
  .leave-confirmation__card,
  .leave-confirmation__card::before,
  .leave-confirmation__mark {
    animation: none;
  }
}

@media (max-width: 480px) {
  .shell {
    width: min(100% - 20px, 620px);
    padding-top: 14px;
  }

  .question-heading {
    align-items: flex-start;
  }

  .answer-button {
    font-size: 15px;
  }
}
