:root {
  --bg: #f6f3ec;
  --card: #ffffff;
  --ink: #1e1b2e;
  --muted: #6b6878;
  --accent: #3b5bdb;
  --radius: 20px;
  --shadow: 0 10px 30px rgb(30 27 46 / 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, #ffe3e3 0, transparent 40%),
    radial-gradient(circle at 90% 10%, #dbe4ff 0, transparent 40%),
    var(--bg);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.top {
  text-align: center;
  margin-bottom: 8px;
}

.logo {
  font-size: 1.6rem;
  margin: 8px 0;
  letter-spacing: -0.02em;
}

.logo span {
  background: linear-gradient(90deg, #e03131, #f59f00, #2f9e44, #1971c2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[hidden] {
  display: none !important;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.task {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.score {
  margin: 16px 0 0;
  font-size: 1.1rem;
  color: var(--muted);
}

.score strong {
  font-size: 2.6rem;
  color: var(--ink);
}

.result-message {
  margin: 4px 0 0;
  font-weight: 500;
}

.btn {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 16px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
  transition: transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}

.btn + .btn {
  margin-top: 12px;
}

.btn--ghost {
  color: var(--ink);
  background: transparent;
  box-shadow: inset 0 0 0 2px rgb(30 27 46 / 0.15);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.start {
  text-align: center;
}

.start__title {
  margin: 0;
  font-size: 1.6rem;
}

.start__text {
  margin: 8px 0 8px;
  color: var(--muted);
  line-height: 1.5;
}

.status {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.progress {
  height: 6px;
  margin: 8px 0 16px;
  border-radius: 999px;
  background: #ece9f1;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #e03131, #f59f00, #2f9e44, #1971c2);
  background-size: 432px 100%;
  transition: width 0.4s ease;
}

.end {
  text-align: center;
}

.score--total strong {
  font-size: 3.4rem;
}

.round-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  text-align: left;
}

.round-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #efedf3;
}

.round-list__name {
  flex: 1;
}

.round-list__points {
  font-weight: 700;
}
.multi .start__title,
.multi .start__text,
.room {
  text-align: center;
}

.field {
  display: grid;
  gap: 6px;
  margin: 16px 0 12px;
}

.field__label {
  font-weight: 500;
  font-size: 0.9rem;
}

.field__input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e4e1ea;
  border-radius: 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #faf9fc;
}

.field__input:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.field__input--code {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e4e1ea;
}

.form-error {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: #c92a2a;
  font-weight: 500;
  text-align: center;
}

.link-button {
  display: block;
  margin: 8px auto 0;
  padding: 8px 12px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
}

.room-code {
  margin: 4px 0 0;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  padding-left: 0.25em;
}

.player-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  text-align: left;
}

.player-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f6f5f9;
}

.player-list li + li {
  margin-top: 8px;
}

.player-list .player-list__me {
  background: #e7ecff;
}

.player-list__name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.player-list__status {
  flex: none;
  color: var(--muted);
}

.leaderboard {
  margin-top: 20px;
}

.leaderboard__title {
  margin: 0;
  font-size: 1.1rem;
}

.topbar {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  text-align: center;
}

.topbar__back {
  justify-self: start;
  padding: 6px 2px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.topbar__title {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.hero {
  margin: 24px 0 24px;
  text-align: center;
}

.hero__icon {
  margin: 0;
  font-size: 3rem;
}

.hero__logo {
  display: block;
  margin: 0 auto;
  border-radius: 22px;
  box-shadow: 0 10px 24px rgb(30 27 46 / 0.15);
  animation: pop-in 0.4s ease-out;
}

.logo--big {
  margin: 4px 0;
  font-size: 2.6rem;
}

.hero__text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.tile-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s;
}

a.tile:active {
  transform: scale(0.98);
}

a.tile:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.tile__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 1.8rem;
  background: linear-gradient(135deg, #ffe3e3, #dbe4ff);
}

.tile__body {
  display: grid;
  gap: 2px;
  flex: 1;
}

.tile__title {
  font-weight: 700;
  font-size: 1.1rem;
}

.tile__text {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.tile__arrow {
  font-size: 1.6rem;
  color: var(--muted);
}

.tile--soon {
  background: transparent;
  box-shadow: inset 0 0 0 2px #e4e1ea;
  color: var(--muted);
}

.tile--soon .tile__icon {
  background: #ece9f1;
}

a.btn {
  text-align: center;
  text-decoration: none;
}
