:root {
  --bg: #061727;
  --bg-deep: #020812;
  --card: rgba(7, 25, 41, 0.92);
  --card-soft: rgba(10, 36, 58, 0.82);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f4fbff;
  --muted: #b7cad8;
  --muted-2: #7f98aa;
  --green: #39c35a;
  --green-deep: #1d8c38;
  --blue: #237ee7;
  --blue-deep: #0d4f9e;
  --yellow: #ffd94d;
  --red: #ff5f67;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  --radius: 28px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(47, 132, 255, 0.20), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(70, 202, 91, 0.16), transparent 28rem),
    linear-gradient(145deg, #071d30 0%, var(--bg-deep) 62%, #06101d 100%);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 18px 14px calc(18px + var(--safe-bottom));
}

.phone-frame {
  width: min(100%, 470px);
  min-height: min(860px, calc(100dvh - 36px - var(--safe-bottom)));
  max-height: calc(100dvh - 36px - var(--safe-bottom));
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border: 6px solid rgba(0, 0, 0, 0.86);
  border-radius: 34px;
  background:
    linear-gradient(160deg, rgba(12, 47, 76, 0.96), rgba(3, 15, 27, 0.98) 58%, rgba(3, 10, 18, 0.99)),
    var(--card);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.phone-frame::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  width: 84px;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.46);
  z-index: 3;
}

.screen {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 18px;
  overflow: hidden;
}

.scroll-screen {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.scroll-screen::-webkit-scrollbar {
  width: 7px;
}

.scroll-screen::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.hero {
  text-align: center;
  padding: 18px 6px 12px;
}

.welcome-simple {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

.welcome-simple h1 {
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  line-height: 1.1;
  margin-top: 10px;
}

.welcome-input-area {
  display: grid;
  gap: 8px;
}

.welcome-input-area label {
  font-weight: 750;
  font-size: 0.93rem;
  color: #f2f8fc;
}

.history-list {
  font-size: 0.85rem;
  color: var(--muted);
}

.history-list summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
  user-select: none;
}

.history-list ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item {
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--card-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
}

.history-title {
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.history-winner {
  color: var(--green);
}

.history-date {
  color: var(--muted-2);
  font-size: 0.78rem;
}

.history-detail {
  display: none;
  width: 100%;
  padding: 4px 0 0 0;
}

.history-detail.expanded {
  display: block;
}

.history-detail ol {
  margin: 4px 0 0;
  padding-left: 20px;
}

.history-detail li {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.contact-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 217, 77, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 217, 77, 0.12), rgba(35, 126, 231, 0.08)),
    rgba(4, 18, 31, 0.52);
}

.contact-card-title {
  margin: 0;
  font-weight: 850;
  letter-spacing: -0.01em;
}

.hero-mini {
  padding-top: 8px;
  text-align: center;
}

.kicker {
  color: var(--yellow);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  margin: 0 0 8px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 8.6vw, 3.15rem);
  line-height: 1.02;
  margin-bottom: 16px;
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.65);
}

h2 {
  font-size: clamp(1.42rem, 6vw, 2rem);
  line-height: 1.12;
  margin-bottom: 8px;
}

h3 {
  font-size: 1.08rem;
  margin-bottom: 10px;
}

.lead {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 18px;
}

.hero-visual {
  position: relative;
  min-height: 170px;
  display: grid;
  place-items: center;
  margin: 6px 0 14px;
}

.sun {
  width: 88px;
  height: 88px;
  position: absolute;
  top: 6px;
  right: 24px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #fff4a5, #ffd84a 45%, #f2a322 74%);
  box-shadow: 0 0 40px rgba(255, 214, 74, 0.45);
}

.pole-icon {
  position: relative;
  width: 124px;
  height: 152px;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.48));
}

.pole-icon::before,
.pole-icon::after {
  content: "";
  position: absolute;
  background: linear-gradient(90deg, #136d31, #35b84b, #a2e76f);
  border-radius: 999px;
}

.pole-icon::before {
  left: 56px;
  top: 18px;
  width: 12px;
  height: 128px;
}

.pole-icon::after {
  left: 22px;
  top: 42px;
  width: 82px;
  height: 12px;
}

.ring {
  position: absolute;
  width: 38px;
  height: 38px;
  border: 8px solid #65ce4e;
  border-radius: 50%;
  top: 64px;
  background: rgba(255, 217, 77, 0.08);
}

.ring-left {
  left: 6px;
}

.ring-right {
  right: 6px;
}

.ball-icon {
  position: absolute;
  width: 82px;
  height: 82px;
  bottom: 0;
  left: 50%;
  border-radius: 50%;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 44% 42%, #141414 0 9%, transparent 10%),
    radial-gradient(circle at 21% 23%, #121212 0 8%, transparent 9%),
    radial-gradient(circle at 72% 22%, #121212 0 8%, transparent 9%),
    radial-gradient(circle at 24% 75%, #121212 0 8%, transparent 9%),
    radial-gradient(circle at 74% 74%, #121212 0 8%, transparent 9%),
    radial-gradient(circle at 30% 25%, #ffffff, #d8e2ee 60%, #8d99a8 100%);
  box-shadow: inset -10px -16px 24px rgba(0, 0, 0, 0.28), 0 14px 24px rgba(0, 0, 0, 0.45);
}

.feature-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 18px;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.feature-list li {
  display: flex;
  gap: 10px;
  align-items: center;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 54px;
  border: 0;
  border-radius: 13px;
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
  letter-spacing: -0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 12px 24px rgba(0, 0, 0, 0.22);
  transition: transform 130ms ease, border-color 130ms ease, filter 130ms ease;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background: linear-gradient(180deg, #44cf62, #1f913e);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
}

.btn-full {
  grid-column: 1 / -1;
}

.btn-blue {
  background: linear-gradient(180deg, #2e8dff, #0757b9);
}

.btn-danger {
  background: linear-gradient(180deg, #ff6870, #b52c34);
}

.btn-small {
  min-height: 42px;
  padding: 0 12px;
  font-size: 0.92rem;
}

.btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(4, 18, 31, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 14px;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.field label,
.field-title {
  display: block;
  font-weight: 750;
  font-size: 0.93rem;
  margin-bottom: 7px;
  color: #f2f8fc;
}

.help-text {
  color: var(--muted-2);
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 7px 0 0;
}

input,
textarea {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: 0;
  padding: 13px 14px;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(73, 181, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(35, 126, 231, 0.22);
}

.team-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: grid;
  gap: 8px;
  padding-right: 2px;
  align-content: start;
}

.team-list-label {
  margin-top: 8px;
}

.team-choice {
  min-height: 52px;
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  padding: 7px 10px 7px 7px;
}

.team-choice[aria-pressed="true"] {
  border-color: rgba(68, 207, 98, 0.72);
  background: linear-gradient(90deg, rgba(49, 181, 72, 0.82), rgba(32, 124, 52, 0.52));
}

.team-choice:disabled {
  opacity: 0.40;
  cursor: not-allowed;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 1.24rem;
}

.team-meta strong,
.team-title {
  display: block;
  font-size: 0.98rem;
  line-height: 1.15;
}

.team-meta span,
.team-subtitle {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-meta .status-text {
  white-space: normal;
  word-break: break-word;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #bfffd0;
  background: rgba(57, 195, 90, 0.15);
  border: 1px solid rgba(57, 195, 90, 0.34);
}

.status-pill.waiting {
  color: #f8d679;
  background: rgba(255, 217, 77, 0.12);
  border-color: rgba(255, 217, 77, 0.28);
}

.status-pill.off {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.session-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.82rem;
}

.session-code {
  color: var(--yellow);
  font-weight: 850;
  word-break: break-all;
}

.scroll-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.joined-list {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 4px;
  margin-top: 10px;
  overflow-y: auto;
  align-content: start;
}

.joined-team {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.047);
  cursor: default;
}

.joined-team:not(.current) {
  cursor: pointer;
}

.joined-team.current {
  border-color: rgba(57, 195, 90, 0.52);
  background: rgba(57, 195, 90, 0.10);
}

.team-name {
  font-size: 0.88rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-name.members {
  white-space: normal;
  word-break: break-word;
}

.joined-team .avatar {
  width: 26px;
  height: 26px;
  font-size: 0.9rem;
}

.score-row,
.reveal-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.047);
}

.score-row.current {
  border-color: rgba(57, 195, 90, 0.52);
  background: rgba(57, 195, 90, 0.10);
}

.progress-wrap {
  margin: 8px 0 18px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 8px;
}

.progress-remaining {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #eee;
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #42d764, #a4f06b);
  transition: width 240ms ease;
}

.question-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.question-intro {
  padding: 12px 14px 0;
  text-align: center;
  font-size: clamp(0.85rem, 3.5vw, 1rem);
  line-height: 1.4;
  color: var(--muted);
  font-style: italic;
  text-wrap: balance;
}

.question-text {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 22px 14px 20px;
  text-align: center;
  font-size: clamp(1.45rem, 6.8vw, 2.2rem);
  line-height: 1.3;
  font-weight: 850;
  text-wrap: balance;
}

.options-grid {
  display: grid;
  gap: 9px;
  margin-top: auto;
  padding-bottom: 4px;
}

.answer-button {
  min-height: 58px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  border: 1px solid rgba(73, 156, 255, 0.72);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(30, 117, 215, 0.94), rgba(8, 66, 138, 0.94));
  text-align: left;
  cursor: pointer;
}

.answer-button .letter {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 1.28rem;
  font-weight: 950;
  background: linear-gradient(180deg, #3793ff, #1269d2);
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.answer-button .answer-text {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.2;
}

.answer-button.selected {
  border-color: rgba(255, 217, 77, 0.94);
  box-shadow: 0 0 0 3px rgba(255, 217, 77, 0.22);
}

.answer-button.correct {
  border-color: rgba(69, 227, 100, 0.94);
  background: linear-gradient(180deg, rgba(48, 170, 70, 0.96), rgba(20, 114, 42, 0.96));
}

.answer-button.wrong {
  border-color: rgba(255, 102, 111, 0.94);
  background: linear-gradient(180deg, rgba(190, 54, 61, 0.96), rgba(111, 28, 33, 0.96));
}

.wait-card {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 14px;
  flex: 1;
}

.loader-ball {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, #0f0f0f 0 9%, transparent 10%),
    radial-gradient(circle at 23% 25%, #0f0f0f 0 8%, transparent 9%),
    radial-gradient(circle at 76% 28%, #0f0f0f 0 8%, transparent 9%),
    radial-gradient(circle at 28% 78%, #0f0f0f 0 8%, transparent 9%),
    radial-gradient(circle at 75% 76%, #0f0f0f 0 8%, transparent 9%),
    linear-gradient(145deg, #ffffff, #aebdca);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.36);
}

.countdown-timer {
  font-size: 3.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--green);
  line-height: 1;
  margin: 4px 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.reveal-title {
  text-align: center;
  font-size: clamp(1.45rem, 7vw, 2.05rem);
  margin-bottom: 10px;
}

.correct-answer {
  color: #baffc8;
  text-align: center;
  font-size: 1.08rem;
  font-weight: 820;
  margin-bottom: 14px;
}

.explanation {
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
  margin: -4px 0 14px;
}

.reveal-list {
  display: grid;
  gap: 8px;
}

.reveal-points {
  font-weight: 950;
}

.reveal-points.plus {
  color: #7cff96;
}

.reveal-points.zero {
  color: var(--muted-2);
}

.countdown {
  margin-top: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

.trophy {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  margin: 16px auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.26), rgba(255, 217, 77, 0.15) 44%, rgba(255, 217, 77, 0.02) 70%);
  border: 2px solid rgba(255, 217, 77, 0.48);
  font-size: 4.4rem;
  filter: drop-shadow(0 17px 24px rgba(0, 0, 0, 0.35));
}

.winner-card {
  text-align: center;
  display: grid;
  place-items: center;
  gap: 10px;
  margin: auto 0;
}

.payout-card {
  gap: 12px;
}

.winner-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  padding: 12px 18px;
  color: white;
  background: linear-gradient(90deg, #1d8c38, #43c95f, #1d8c38);
  border-radius: 12px;
  font-size: 1.16rem;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.payout-summary {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
}

.payout-summary strong {
  font-size: 1rem;
}

.payout-summary span {
  color: var(--muted);
  font-weight: 700;
}

.confetti {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.confetti span {
  position: absolute;
  top: -18px;
  width: 9px;
  height: 16px;
  border-radius: 3px;
  background: var(--yellow);
  animation: confettiFall 3.9s linear infinite;
}

.confetti span:nth-child(3n) { background: #39c35a; }
.confetti span:nth-child(4n) { background: #237ee7; }
.confetti span:nth-child(5n) { background: #ff5f67; }
.confetti span:nth-child(1) { left: 8%; animation-delay: 0s; }
.confetti span:nth-child(2) { left: 18%; animation-delay: .7s; }
.confetti span:nth-child(3) { left: 28%; animation-delay: .2s; }
.confetti span:nth-child(4) { left: 40%; animation-delay: 1s; }
.confetti span:nth-child(5) { left: 51%; animation-delay: .35s; }
.confetti span:nth-child(6) { left: 63%; animation-delay: .9s; }
.confetti span:nth-child(7) { left: 74%; animation-delay: .15s; }
.confetti span:nth-child(8) { left: 84%; animation-delay: .65s; }
.confetti span:nth-child(9) { left: 92%; animation-delay: .45s; }

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translateY(900px) rotate(540deg); opacity: 0; }
}

.score-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
}

.score-row {
  grid-template-columns: 36px 42px 1fr auto;
  width: 100%;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  border-color: var(--line);
}

.score-row.rank-1 {
  background: linear-gradient(90deg, rgba(255, 217, 77, 0.18), rgba(57, 195, 90, 0.13));
  border-color: rgba(255, 217, 77, 0.38);
}

.rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: #dff0ff;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
}

.points {
  color: #eaffef;
  font-weight: 950;
  white-space: nowrap;
}

.live-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  justify-content: center;
  margin: 10px 0 0;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(57, 195, 90, 0.6);
  animation: pulse 1.7s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(57, 195, 90, 0.58); }
  70% { box-shadow: 0 0 0 12px rgba(57, 195, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(57, 195, 90, 0); }
}

.members-list {
  display: grid;
  gap: 9px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}

.members-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.052);
}

.error-box,
.message-box {
  border-radius: 15px;
  padding: 12px 13px;
  line-height: 1.42;
  margin-bottom: 12px;
}

.error-box {
  color: #ffe5e6;
  background: rgba(255, 95, 103, 0.15);
  border: 1px solid rgba(255, 95, 103, 0.35);
}

.message-box {
  color: #dfffe8;
  background: rgba(57, 195, 90, 0.12);
  border: 1px solid rgba(57, 195, 90, 0.30);
}

.message-box.soft {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 20px 10px;
}

.code-block {
  display: block;
  overflow-x: auto;
  white-space: pre;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  color: #d8efff;
  padding: 12px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.footer-mini {
  color: var(--muted-2);
  font-size: 0.78rem;
  text-align: center;
  margin: 12px 0 0;
}

.review-list {
  display: grid;
  gap: 20px;
  margin-top: 14px;
}

.review-question {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.review-q {
  font-weight: 600;
  font-size: 0.93rem;
  margin: 0 0 10px;
  line-height: 1.4;
}

.review-result {
  font-weight: 700;
  font-size: 0.88rem;
  margin: 8px 0 4px;
}

.review-result.correct {
  color: #39c35a;
}

.review-result.wrong {
  color: #ff6b6b;
}

.hidden {
  display: none !important;
}

.entry-cards {
  display: grid;
  gap: 10px;
}

.entry-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 6px 12px;
  align-items: center;
  min-height: 68px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  text-align: left;
  transition: border-color 120ms ease, background 120ms ease;
}

.entry-card[aria-pressed="true"] {
  border-color: rgba(68, 207, 98, 0.72);
  background: linear-gradient(180deg, rgba(49, 181, 72, 0.22), rgba(32, 124, 52, 0.15));
}

.entry-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 1.5rem;
  grid-row: span 2;
}

.entry-card-label {
  font-weight: 850;
  font-size: 1rem;
  align-self: end;
}

.entry-card-desc {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
  align-self: start;
}

.entry-card:active {
  transform: translateY(1px);
}

#entryAmountCreateField {
  margin-top: 12px;
}

#entry-amount-create {
  max-width: 180px;
}

.terms-box {
  margin-top: 12px;
}

.terms-accept {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 221, 112, 0.5);
  border-radius: 14px;
  background: rgba(255, 221, 112, 0.1);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.35;
}

.terms-accept input {
  width: auto;
  margin-top: 2px;
  accent-color: var(--accent);
}

.pot-info {
  text-align: center;
}

.confirm-team-box {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 2px 10px;
  align-items: center;
  margin-bottom: 16px;
}

.confirm-team-box .avatar {
  grid-row: span 2;
  font-size: 1.5rem;
}

.confirm-team-box .muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.pot-summary {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(68, 207, 98, 0.08);
  margin-bottom: 16px;
  font-size: 0.92rem;
}

@media (max-height: 720px) {
  .phone-frame {
    border-width: 4px;
    border-radius: 26px;
  }

  .screen {
    padding-top: 22px;
  }

  .hero-visual {
    min-height: 128px;
    margin-bottom: 8px;
  }

  .sun {
    width: 60px;
    height: 60px;
  }

  .pole-icon {
    transform: scale(0.78);
  }

  .feature-list {
    gap: 6px;
    margin: 8px 0 12px;
  }

  .question-text {
    min-height: 110px;
    font-size: clamp(1.2rem, 5.5vw, 1.6rem);
    padding: 12px 8px;
  }

  .answer-button {
    min-height: 50px;
  }

  .answer-button .answer-text {
    font-size: 0.96rem;
  }

  .trophy {
    width: 88px;
    height: 88px;
    font-size: 3.2rem;
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding: 10px 6px calc(10px + var(--safe-bottom));
  }

  .phone-frame {
    border-width: 3px;
    border-radius: 20px;
    min-height: min(700px, calc(100dvh - 20px - var(--safe-bottom)));
  }

  .screen {
    padding: 14px 10px 8px;
  }

  .hero-mini {
    padding-top: 2px;
  }

  .hero-mini .lead {
    margin-bottom: 10px;
    font-size: 0.88rem;
  }

  .form-stack {
    gap: 8px;
  }

  .team-choice {
    min-height: 40px;
    padding: 4px 8px 4px 4px;
  }

  .team-choice .avatar {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .team-meta strong {
    font-size: 0.84rem;
  }

  .team-meta span {
    font-size: 0.7rem;
  }

  .status-pill {
    min-height: 22px;
    font-size: 0.68rem;
    padding: 2px 6px;
  }

  textarea {
    min-height: 60px;
    padding: 10px 12px;
  }

  .field label,
  .field-title {
    font-size: 0.84rem;
    margin-bottom: 4px;
  }

  .session-bar {
    padding: 6px 8px;
    margin-bottom: 8px;
  }

  .hero-visual {
    min-height: 80px;
  }

  .sun {
    width: 48px;
    height: 48px;
    top: 4px;
    right: 12px;
  }

  .pole-icon {
    transform: scale(0.58);
    transform-origin: center bottom;
    width: 80px;
    height: 110px;
  }

  .ball-icon {
    width: 48px;
    height: 48px;
  }

  .feature-list {
    gap: 4px;
    margin: 6px 0 10px;
  }

  .feature-list li {
    font-size: 0.82rem;
  }

  h1 {
    font-size: clamp(1.4rem, 6.5vw, 1.9rem);
    margin-bottom: 8px;
  }

  h2 {
    font-size: clamp(1.05rem, 4.5vw, 1.3rem);
  }

  .kicker {
    font-size: 0.7rem;
    margin-bottom: 4px;
  }

  .question-text {
    min-height: 80px;
    padding: 8px 6px;
    font-size: clamp(1.05rem, 5vw, 1.35rem);
  }

  .options-grid {
    gap: 6px;
  }

  .answer-button {
    min-height: 42px;
    grid-template-columns: 36px 1fr;
  }

  .answer-button .letter {
    font-size: 1rem;
  }

  .answer-button .answer-text {
    font-size: 0.84rem;
    padding: 6px 8px;
  }

  .score-row {
    grid-template-columns: 24px 32px 1fr auto;
    gap: 5px;
    min-height: 40px;
    padding: 4px;
  }

  .rank {
    width: 22px;
    height: 22px;
    font-size: 0.78rem;
  }

  .points {
    font-size: 0.88rem;
  }

  .trophy {
    width: 60px;
    height: 60px;
    font-size: 2.2rem;
  }

  .winner-name {
    font-size: 0.92rem;
    padding: 8px 12px;
  }

  .winner-card {
    gap: 4px;
  }

  .joined-list {
    gap: 3px;
    margin-top: 6px;
    max-height: 210px;
  }

  .joined-team {
    min-height: 30px;
    padding: 2px 6px;
    gap: 4px;
    grid-template-columns: 26px 1fr auto;
  }

  .joined-team .avatar {
    width: 22px;
    height: 22px;
    font-size: 0.78rem;
  }

  .team-name {
    font-size: 0.8rem;
  }

  .reveal-row {
    min-height: 40px;
    padding: 4px;
    gap: 6px;
    grid-template-columns: 32px 1fr auto;
  }

  .reveal-row .avatar {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .btn {
    min-height: 44px;
    font-size: 0.92rem;
  }

  .actions {
    gap: 6px;
    margin-top: 8px;
  }

  .actions-row {
    gap: 6px;
    margin-top: 8px;
  }

  .actions-row .btn {
    min-height: 40px;
    font-size: 0.86rem;
  }

  .progress-wrap {
    margin: 4px 0 10px;
  }

  .reveal-title {
    font-size: clamp(1.1rem, 5vw, 1.4rem);
  }

  .correct-answer {
    font-size: 0.92rem;
    margin-bottom: 8px;
  }

  .explanation {
    font-size: 0.84rem;
  }

  .wait-card {
    gap: 8px;
  }

  .countdown-timer {
    font-size: 2.4rem;
  }

  .loader-ball {
    width: 56px;
    height: 56px;
  }
}

@media (min-width: 840px) {
  .phone-frame {
    width: min(100%, 500px);
  }
}

/* Game grid */
.game-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.game-grid.scroll-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 4px 4px;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  align-content: start;
}


.selected-game {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  text-align: left;
}
.selected-game:hover {
  border-color: var(--accent, #4a9eff);
}
.change-link {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--accent, #4a9eff);
  text-decoration: underline;
}
.game-card {
  display: block;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font: inherit;
  color: var(--text);
}
.game-card:hover {
  border-color: var(--accent, #4a9eff);
}
.game-card.selected {
  border-color: var(--accent, #4a9eff);
  background: rgba(74, 158, 255, 0.08);
}
.game-card-name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 2px;
}
.game-card-desc {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 20px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.modal-box p {
  font-size: 1rem;
  line-height: 1.5;
  margin: 0 0 20px;
  color: var(--text);
}
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.modal-actions.equal .btn {
  flex: 1;
  min-width: 0;
}

.contact-modal {
  text-align: left;
  max-width: 430px;
}

.modal-heading {
  margin-bottom: 10px;
}

.modal-heading h3,
.modal-heading .kicker {
  margin-bottom: 0;
}

.contact-lead {
  color: var(--muted);
  font-size: 0.92rem;
}

.contact-form {
  margin: 12px 0 16px;
}

.contact-form textarea {
  min-height: 120px;
}

.contact-actions {
  justify-content: stretch;
}

.contact-actions .btn {
  flex: 1;
}

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

.qr-screen h2 {
  margin: 0;
}

.qr-screen img {
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  border-radius: 12px;
  background: white;
  padding: 12px;
}

.qr-screen .help-text {
  max-width: 260px;
}
