:root {
  --purple: #63309a;
  --purple-dark: #4c237f;
  --purple-soft: #efe2f8;
  --mint: #18c77f;
  --ink: #25222b;
  --muted: #8d819d;
  --line: #dfd2ea;
  --surface: #ffffff;
  font-family: Arial, Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #f5eff9;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.top-panel {
  width: min(100%, 383px);
  min-height: 76px;
  padding: 8px 18px 16px;
  color: white;
  background: var(--purple);
  border-bottom-left-radius: 50% 16px;
  border-bottom-right-radius: 50% 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}

.wallet {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(41, 12, 75, 0.35);
  font-weight: 700;
}

.coin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: #ffbd21;
  line-height: 1;
}

.badge {
  grid-column: 1;
  justify-self: start;
  font-weight: 700;
  font-size: 14px;
}

.icon-button {
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  color: var(--purple);
  background: white;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.game-card {
  width: min(100%, 383px);
  min-height: calc(100vh - 76px);
  padding: 18px 18px 28px;
  background: var(--surface);
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  direction: ltr;
  color: #5b4d68;
  font-weight: 700;
}

.timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 88px;
  height: 30px;
  padding: 0 10px;
  color: white;
  background: var(--purple);
  border-radius: 999px;
}

.join-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8fd;
}

.join-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.join-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 8px;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: white;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--purple);
}

.join-row button,
.question-form button,
.guess-panel button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--purple);
  font-weight: 800;
  cursor: pointer;
}

.versus-bar {
  position: relative;
  margin: 20px 0 18px;
  min-height: 52px;
  display: grid;
  grid-template-columns: 62px 1fr 62px;
  align-items: center;
}

.names {
  height: 36px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: white;
  background: #242c2e;
  direction: ltr;
  font-size: 11px;
}

.names strong {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--mint);
  font-size: 13px;
}

.avatar-wrap {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: white;
  z-index: 1;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 3px solid #eadcf4;
  background: #f1eef5;
  font-size: 28px;
}

.secret-player {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 6px;
}

.secret-player img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #ebedf2, #d9d2e5);
}

.secret-player span {
  min-width: 172px;
  min-height: 32px;
  padding: 7px 18px;
  border-radius: 999px;
  text-align: center;
  color: #4a424f;
  background: #e5e5e5;
}

.hint {
  min-height: 20px;
  margin: 38px 0 6px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.question-stage {
  text-align: center;
}

.question-stage span {
  color: #a79bad;
  font-size: 14px;
}

.question-stage h1 {
  min-height: 92px;
  margin: 8px 0 18px;
  color: var(--purple);
  font-size: 34px;
  line-height: 1.14;
  letter-spacing: 0;
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}

.answer-grid button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  color: var(--purple);
  background: var(--purple-soft);
  font-weight: 800;
  cursor: pointer;
}

.question-form,
.guess-panel {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 8px;
  margin-top: 10px;
}

.finish-button {
  width: 100%;
  min-height: 54px;
  margin-top: 18px;
  border: 0;
  border-radius: 18px;
  color: white;
  background: var(--purple);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.is-hidden {
  display: none;
}

@media (max-width: 420px) {
  .app-shell {
    display: block;
  }

  .top-panel,
  .game-card {
    width: 100%;
  }

  .question-stage h1 {
    font-size: 32px;
  }

  .question-form,
  .guess-panel {
    grid-template-columns: 1fr;
  }
}
