:root {
  --bg: #101823;
  --panel: #f7fbff;
  --ink: #172331;
  --muted: #637184;
  --blue: #2787f5;
  --blue-dark: #1769c2;
  --gold: #ffbe3d;
  --green: #1fbf75;
  --red: #e45454;
  --line: rgba(23, 35, 49, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 190, 61, 0.28), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(39, 135, 245, 0.35), transparent 34rem),
    linear-gradient(135deg, #0d1420, #17283a 52%, #111924);
}

button {
  font: inherit;
}

.vk-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.game-card {
  position: relative;
  width: min(760px, 100%);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(238, 246, 255, 0.96)),
    var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(39, 135, 245, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 135, 245, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

.top-bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 76px;
  padding: 18px 22px;
}

.timer {
  width: 72px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(180deg, #29384a, #13202e);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22), 0 10px 24px rgba(18, 32, 46, 0.28);
}

.timer.is-warning {
  background: linear-gradient(180deg, #f27474, #ca3434);
}

.user-chip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(320px, 68vw);
  padding: 7px 12px 7px 7px;
  border: 1px solid rgba(39, 135, 245, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px rgba(39, 135, 245, 0.12);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  background: linear-gradient(145deg, #2787f5, #ffbe3d);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

.user-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 700;
}

.view {
  position: relative;
  z-index: 1;
  padding: 26px 56px 54px;
}

.menu-view {
  min-height: 520px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 42px;
}

.brand {
  text-align: center;
}

.brand-mark {
  width: 82px;
  height: 82px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 50%;
  color: #162235;
  font-size: 48px;
  font-weight: 900;
  background: linear-gradient(160deg, #fff2a6, var(--gold));
  box-shadow: 0 14px 30px rgba(255, 190, 61, 0.38), inset 0 -5px 0 rgba(128, 83, 0, 0.16);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 58px;
  line-height: 1;
  letter-spacing: 0;
}

.brand p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 19px;
  font-weight: 700;
}

.menu-actions {
  width: min(360px, 100%);
  display: grid;
  gap: 14px;
}

.primary-button,
.secondary-button,
.answer-button {
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}

.primary-button {
  color: #fff;
  background: linear-gradient(180deg, var(--blue), var(--blue-dark));
  box-shadow: 0 14px 26px rgba(39, 135, 245, 0.32), inset 0 -4px 0 rgba(0, 0, 0, 0.18);
}

.secondary-button {
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #eaf2fb);
  border: 1px solid rgba(39, 135, 245, 0.22);
  box-shadow: 0 10px 22px rgba(23, 35, 49, 0.08), inset 0 -3px 0 rgba(23, 35, 49, 0.08);
}

.primary-button:hover,
.secondary-button:hover,
.answer-button:hover {
  transform: translateY(-2px);
}

.primary-button:active,
.secondary-button:active,
.answer-button:active {
  transform: translateY(0);
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  color: var(--muted);
  font-weight: 800;
}

.question-title {
  min-height: 92px;
  margin-bottom: 28px;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0;
}

.answers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.answer-button {
  min-height: 96px;
  padding: 18px;
  border: 2px solid var(--line);
  color: var(--ink);
  text-align: left;
  line-height: 1.25;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 24px rgba(23, 35, 49, 0.08);
}

.answer-button.is-correct {
  border-color: var(--green);
  color: #0f7046;
  background: linear-gradient(180deg, #effff7, #ccf7e4);
  box-shadow: 0 0 0 4px rgba(31, 191, 117, 0.18), 0 16px 30px rgba(31, 191, 117, 0.22);
}

.answer-button.is-wrong {
  border-color: var(--red);
  color: #8d2929;
  background: linear-gradient(180deg, #fff3f3, #ffdada);
}

.answer-button:disabled {
  cursor: default;
}

.result-view {
  min-height: 520px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.result-badge {
  padding: 9px 16px;
  border-radius: 999px;
  color: #0d7045;
  font-weight: 900;
  background: #d6f8e8;
}

.result-view h2 {
  font-size: 38px;
  letter-spacing: 0;
}

.result-view p {
  max-width: 460px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.45;
}

.result-view .primary-button {
  width: min(360px, 100%);
  margin-top: 12px;
}

.is-hidden {
  display: none;
}

@media (max-width: 640px) {
  .vk-shell {
    padding: 12px;
  }

  .game-card {
    min-height: 94vh;
  }

  .top-bar {
    padding: 14px;
  }

  .view {
    padding: 18px 18px 34px;
  }

  h1 {
    font-size: 44px;
  }

  .question-title {
    min-height: 118px;
    font-size: 24px;
  }

  .answers-grid {
    grid-template-columns: 1fr;
  }
}
