* {
  box-sizing: border-box;
}

:root {
  --panel: rgba(9, 7, 26, 0.64);
  --panel-strong: rgba(9, 7, 26, 0.78);
  --stroke: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.7);
  --accent: #3d35ff;
  --accent-2: #a500ff;
  --accent-3: #ef2aa8;
  --button-gradient: linear-gradient(135deg, #3d35ff 0%, #8a00ff 48%, #ef2aa8 100%);
  --success: #7cff9b;
  --error: #ff7b90;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
}

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

body {
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: url("/assets/zagadki-bg.jpg") center / cover fixed no-repeat;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

.prize-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(2, 1, 9, 0.72), rgba(2, 1, 9, 0.94)),
    url("/assets/zagadki-bg.jpg") center / cover fixed no-repeat;
}

.prize-card {
  width: min(620px, 100%);
  padding: clamp(28px, 5vw, 44px);
  border-radius: 18px;
  text-align: center;
  background: rgba(5, 4, 15, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(18px);
}

.prize-card span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  padding: 0 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.prize-card h1 {
  margin: 0 0 12px;
  font-size: clamp(38px, 7vw, 68px);
  line-height: 0.94;
  font-weight: 950;
}

.prize-card p {
  max-width: 500px;
  margin: 0 auto 22px;
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(17px, 2.6vw, 22px);
  line-height: 1.5;
  font-weight: 800;
}

.prize-email {
  width: 100%;
  height: 58px;
  border-radius: 14px;
  padding: 0 17px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  background: rgba(8, 7, 24, 0.72);
  outline: none;
  font-size: 18px;
  font-weight: 850;
}

.prize-email:focus {
  border-color: rgba(69, 188, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(69, 188, 255, 0.16);
}

.prize-submit {
  width: 100%;
  margin-top: 12px;
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(2, 1, 9, 0.62), rgba(2, 1, 9, 0.94)),
    url("/assets/zagadki-bg.jpg") center / cover fixed no-repeat;
}

.lock-card {
  width: min(680px, 100%);
  padding: clamp(28px, 5vw, 48px);
  border-radius: 18px;
  text-align: center;
  background: rgba(5, 4, 15, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(18px);
}

.lock-card img {
  width: min(420px, 82vw);
  height: auto;
  display: block;
  margin: 0 auto 30px;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.48));
}

.lock-card span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  padding: 0 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lock-card h1 {
  margin: 0 0 12px;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.96;
  font-weight: 950;
}

.lock-card p {
  max-width: 560px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.68);
  white-space: pre-line;
  font-size: clamp(18px, 3vw, 25px);
  line-height: 1.5;
  font-weight: 800;
}

.ticket-float {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: min(720px, calc(100vw - 48px));
  padding: 13px 14px 13px 22px;
  border-radius: 18px;
  color: #fff;
  background: rgba(9, 7, 26, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.ticket-float span {
  min-width: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
  white-space: nowrap;
}

.ticket-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 130px;
  height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  background: var(--button-gradient);
  box-shadow: 0 14px 26px rgba(138, 0, 255, 0.24);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.ticket-btn:hover,
.ticket-btn:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 116px;
}

.brand-header {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.brand-logo {
  width: min(462px, 74vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.36));
}

.riddle-card {
  border: 1px solid var(--stroke);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.link-value {
  min-height: 31px;
  margin-top: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.riddle-card {
  border-radius: 18px;
  padding: 22px;
}

.stage-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.video-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.prize-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: help;
  outline: none;
}

.prize-badge:focus-visible {
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.45);
}

.ticket-stack {
  position: relative;
  display: inline-block;
  width: 47px;
  height: 34px;
  flex: 0 0 auto;
}

.ticket-icon {
  position: absolute;
  display: block;
  width: 38px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.34));
  transform-origin: 50% 50%;
}

.ticket-icon-back {
  left: 1px;
  top: 3px;
  opacity: 0.72;
  transform: rotate(-13deg) scale(0.92);
}

.ticket-icon-front {
  left: 8px;
  top: 2px;
  transform: rotate(6deg);
}

.prize-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 4;
  width: max-content;
  max-width: min(260px, calc(100vw - 32px));
  padding: 9px 11px;
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-align: center;
  background: rgba(8, 7, 18, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.prize-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 10px;
  height: 10px;
  background: rgba(8, 7, 18, 0.94);
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  transform: translate(-50%, -5px) rotate(45deg);
}

.prize-badge:hover .prize-tooltip,
.prize-badge:focus-visible .prize-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.answer-form {
  margin: 16px 0 0;
  max-height: 130px;
  opacity: 1;
  overflow: visible;
  transform: translateY(0);
  visibility: visible;
  transition:
    max-height 0.32s ease,
    margin-top 0.32s ease,
    opacity 0.26s ease,
    transform 0.32s ease,
    visibility 0s linear 0s;
}

.answer-form.road-answer-hidden {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(18px);
  visibility: hidden;
  transition:
    max-height 0.32s ease,
    margin-top 0.32s ease,
    opacity 0.26s ease,
    transform 0.32s ease,
    visibility 0s linear 0.32s;
}

.answer-form.road-answer-revealed {
  animation: answerReveal 0.48s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes answerReveal {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }

  65% {
    opacity: 1;
    transform: translateY(-3px) scale(1.01);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.answer-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 150px;
  gap: 10px;
  align-items: stretch;
}

.answer-input {
  width: 100%;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0 16px;
  outline: none;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.answer-input::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.answer-input:focus {
  border-color: rgba(0, 183, 255, 0.78);
  box-shadow: 0 0 0 4px rgba(0, 183, 255, 0.12);
}

.icon-btn,
.submit-btn {
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

.icon-btn {
  background: var(--button-gradient);
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 14px 26px rgba(138, 0, 255, 0.18);
}

.tooltip-holder {
  position: relative;
}

.tooltip-holder .icon-btn {
  width: 100%;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  filter: brightness(1.08);
}

.submit-btn {
  background: var(--button-gradient);
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 16px 28px rgba(138, 0, 255, 0.22);
}

.submit-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

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

.tooltip-text {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: 260px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(8, 7, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
  z-index: 30;
}

.tooltip-text a {
  display: inline-block;
  margin-top: 4px;
  color: #57d9ff;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.tooltip-text::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 100%;
  border-width: 8px 8px 0 8px;
  border-style: solid;
  border-color: rgba(8, 7, 24, 0.96) transparent transparent transparent;
}

.tooltip-holder:hover .tooltip-text,
.tooltip-holder:focus-within .tooltip-text {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.message {
  min-height: 22px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 800;
}

.message.error {
  color: var(--error);
}

.message.success {
  color: var(--success);
}

.video-top {
  display: block;
  margin-bottom: 14px;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.hidden {
  display: none !important;
}

.road-game {
  display: grid;
  gap: 14px;
}

.road-canvas-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: #070814;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.road-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  background: #070814;
}

.road-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  pointer-events: none;
}

.road-hud-box {
  min-width: 132px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
}

.road-hud-label {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.road-hud-value {
  display: block;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

.road-start-overlay,
.road-message-overlay {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 4;
  width: min(520px, calc(100% - 32px));
  padding: 22px;
  border-radius: 18px;
  text-align: center;
  color: #fff;
  background: rgba(8, 7, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
  transform: translate(-50%, -50%);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.road-start-overlay.hidden,
.road-message-overlay {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%);
}

.road-message-overlay.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.road-start-overlay h2,
.road-message-overlay h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 0.96;
  font-weight: 900;
}

.road-start-overlay p,
.road-message-overlay p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
}

.road-countdown {
  min-height: 68px;
  margin-top: 16px;
  font-size: clamp(52px, 8vw, 88px);
  line-height: 1;
  font-weight: 900;
  color: #fff;
}

.road-primary-btn {
  width: 100%;
  height: 56px;
  margin-top: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  color: #fff;
  background: var(--button-gradient);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 16px 28px rgba(138, 0, 255, 0.22);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.road-primary-btn:hover,
.road-primary-btn:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.road-primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.road-joystick {
  display: none;
  position: absolute;
  left: auto;
  right: 18px;
  bottom: 18px;
  z-index: 6;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.road-joystick.is-ready {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.road-joystick-ring {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.09) 48%, rgba(9, 7, 26, 0.86) 100%);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 0 26px rgba(255, 255, 255, 0.08),
    0 18px 38px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
}

.road-joystick-ring::before,
.road-joystick-ring::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.road-joystick-ring::before {
  width: 54%;
  height: 2px;
}

.road-joystick-ring::after {
  width: 2px;
  height: 54%;
}

.road-joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--button-gradient);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 0 14px rgba(255, 255, 255, 0.18),
    0 12px 24px rgba(138, 0, 255, 0.32);
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease;
}

@media (max-width: 960px) {
  .page {
    width: min(100% - 24px, 760px);
    padding-top: 58px;
  }

  .link-value {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 600px) {
  body {
    background-attachment: scroll;
    background-position: center top;
  }

  .ticket-float {
    left: 10px;
    right: 10px;
    bottom: 12px;
    transform: none;
    justify-content: space-between;
    width: auto;
    max-width: none;
    gap: 10px;
    padding: 8px 8px 8px 13px;
    border-radius: 16px;
  }

  body.road-game-active .ticket-float {
    display: none;
  }

  .ticket-float span {
    display: block;
    min-width: 0;
    color: rgba(255, 255, 255, 0.94);
    font-size: 11px;
    line-height: 1.12;
    letter-spacing: 0;
    white-space: normal;
  }

  .ticket-btn {
    min-width: 92px;
    height: 42px;
    padding: 0 13px;
    border-radius: 999px;
    font-size: 12px;
  }

  .page {
    width: calc(100% - 18px);
    padding-top: 54px;
    padding-bottom: 78px;
  }

  .brand-header {
    margin-bottom: 20px;
  }

  .brand-logo {
    width: min(360px, 86vw);
  }

  .riddle-card {
    border-radius: 15px;
    padding: 14px;
  }

  .answer-input-wrap {
    grid-template-columns: minmax(0, 1fr) 50px;
    gap: 8px;
  }

  .answer-input,
  .icon-btn,
  .submit-btn {
    height: 52px;
    border-radius: 11px;
  }

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

  .tooltip-text {
    right: -2px;
    width: min(240px, calc(100vw - 42px));
    max-width: calc(100vw - 42px);
    font-size: 12px;
  }

  .stage-badges {
    margin-bottom: 10px;
  }

  .video-frame {
    border-radius: 12px;
  }

  .road-canvas-wrap {
    border-radius: 12px;
  }

  .road-canvas-wrap canvas {
    aspect-ratio: 9 / 12;
  }

  .road-hud {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .road-hud-box {
    min-width: 0;
    padding: 8px 9px;
    border-radius: 11px;
  }

  .road-hud-value {
    font-size: 14px;
  }

  .road-start-overlay,
  .road-message-overlay {
    width: calc(100% - 24px);
    padding: 16px;
    border-radius: 16px;
  }

  .road-joystick {
    display: block;
    right: 10px;
    top: auto;
    bottom: 12px;
    width: 126px;
    height: 126px;
  }

  .road-joystick-knob {
    width: 62px;
    height: 62px;
  }
}

@media (max-width: 380px) {
  .page {
    width: calc(100% - 12px);
  }

  .brand-logo {
    width: min(330px, 88vw);
  }

  .answer-input-wrap {
    grid-template-columns: minmax(0, 1fr) 46px;
  }

  .answer-input,
  .icon-btn,
  .submit-btn {
    height: 50px;
  }
}
