:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #5d6864;
  --line: #d8ded9;
  --paper: #F5F5F5;
  --white: #ffffff;
  --brand: #C4193E;
  --brand-dark: #8f102c;
  --brand-soft: #fae8ee;
  --accent: #f2b705;
  --accent-soft: #ffe17a;
  --danger: #b91524;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #df2a50, var(--brand));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 14px rgba(143, 16, 44, .2);
  color: var(--white);
  cursor: pointer;
  font-weight: 700;
  padding: 12px 18px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

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

.quiz-shell,
.admin-panel {
  width: min(1120px, 100%);
  background: var(--white);
  border: 2px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 20px 70px rgba(23, 33, 31, .12), 0 0 0 8px rgba(196, 25, 62, .08);
  position: relative;
}

.quiz-shell::before,
.admin-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(242, 183, 5, .55);
  border-radius: 5px;
  pointer-events: none;
  z-index: 2;
}

.quiz-shell {
  display: grid;
  grid-template-columns: minmax(280px, 42%) 1fr;
  min-height: 660px;
  overflow: hidden;
}

.visual {
  min-height: 100%;
  background: #111;
  position: relative;
}

.visual > img {
  width: 100%;
  height: 100%;
  min-height: 660px;
  display: block;
  object-fit: cover;
  object-position: center center;
}

.visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(196, 25, 62, .74), rgba(196, 25, 62, .22) 44%, rgba(24, 24, 24, .34)),
    linear-gradient(90deg, rgba(0, 0, 0, .22), transparent 62%);
}

.visual-label {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 30px;
  bottom: auto;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
  color: var(--white);
}

.brand-logo {
  display: block;
  width: min(220px, 100%);
  height: auto;
  min-height: 0;
  max-height: 80px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 18px;
}

.visual-label strong {
  color: var(--white);
  font-size: 30px;
  font-weight: 900;
  line-height: .95;
  max-width: 310px;
  text-transform: uppercase;
}

.visual-label span {
  display: inline-block;
  width: fit-content;
  max-width: 310px;
  background: var(--white);
  color: var(--brand);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
  padding: 8px 14px;
  transform: rotate(-2deg);
  text-transform: uppercase;
  text-shadow: none;
}

.quiz {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 5vw, 64px);
  position: relative;
  z-index: 3;
}

.eyebrow {
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.12;
}

h1 {
  font-size: 28px;
  max-width: 760px;
}

h2 {
  font-size: 28px;
}

.muted {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  margin: 22px 0 0;
}

.score {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 42px;
  margin: 24px 0 0;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}

.ticket {
  width: min(360px, 100%);
  margin-top: 24px;
  padding: 22px 22px 24px;
  position: relative;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--white);
  overflow: hidden;
  text-align: center;
}

.ticket::before,
.ticket::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .65), rgba(255, 255, 255, .65) 6px, transparent 6px, transparent 12px);
}

.ticket::before {
  left: 28px;
}

.ticket::after {
  right: 28px;
}

.ticket span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-soft);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ticket strong {
  display: block;
  font-size: 44px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.full-number {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 10px;
}

.progress {
  height: 10px;
  margin-bottom: 34px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf0ec;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width .25s ease;
}

.answers {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.answers button {
  min-height: 58px;
  background: linear-gradient(180deg, #fff, #fafaf7);
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
  padding-right: 46px;
  position: relative;
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.answers button.selected {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--white);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .34), 0 10px 22px rgba(143, 16, 44, .18);
}

.answers button.selected::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 10px;
  height: 18px;
  border-right: 3px solid var(--accent-soft);
  border-bottom: 3px solid var(--accent-soft);
  transform: translateY(-58%) rotate(45deg);
}

.nav,
.admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
}

.secondary,
.link-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
}

.contact-form,
.login-form {
  display: grid;
  gap: 18px;
}

.contact-form label,
.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.contact-form input,
.login-form input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 12px 14px;
}

.contact-form .consent {
  grid-template-columns: 22px 1fr;
  align-items: start;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

.contact-form .consent input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.contact-form .consent a {
  color: var(--brand);
  font-weight: 700;
}

.contact-form input:focus,
.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 183, 5, .2);
  outline: 0;
}

.error {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.error-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  color: var(--danger);
  font-weight: 700;
  list-style: none;
}

.error-list li::before {
  content: "- ";
}

.contact-error {
  margin-top: 2px;
}

.admin-panel {
  padding: clamp(22px, 5vw, 54px);
}

.admin-head,
.admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.login-form {
  max-width: 420px;
  margin-top: 28px;
}

.winner {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid rgba(242, 183, 5, .55);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(196, 25, 62, .08), rgba(242, 183, 5, .16));
}

.winner p {
  margin: 0 0 8px;
  color: var(--brand);
  font-weight: 800;
}

.winner span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.table-wrap {
  margin-top: 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
}

th {
  background: rgba(242, 183, 5, .14);
  color: var(--muted);
  font-size: 14px;
}

tr:last-child td {
  border-bottom: 0;
}

/* Mobile-first layout layer. Base styles target phones; wider screens opt in below. */
button {
  width: 100%;
}

.screen {
  align-items: start;
  padding: 10px;
}

.quiz-shell,
.admin-panel {
  width: 100%;
  box-shadow: 0 16px 46px rgba(23, 33, 31, .12), 0 0 0 5px rgba(196, 25, 62, .08);
}

.quiz-shell::before,
.admin-panel::before {
  inset: 7px;
}

.quiz-shell {
  grid-template-columns: 1fr;
  min-height: auto;
}

.visual,
.visual > img {
  height: 300px;
  min-height: 300px;
}

.visual-label {
  left: 16px;
  right: 16px;
  top: 18px;
  bottom: auto;
}

.brand-logo {
  width: min(210px, 100%);
  height: auto;
  min-height: 0;
  max-height: 80px;
  margin-bottom: 10px;
}

.visual-label strong {
  font-size: 24px;
  max-width: 260px;
}

.visual-label span {
  font-size: 15px;
  line-height: 1.15;
  max-width: 250px;
}

.quiz {
  min-height: 500px;
  padding: 28px 18px;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 24px;
}

.muted {
  font-size: 16px;
}

.progress {
  margin-bottom: 26px;
}

.answers {
  gap: 10px;
  margin-top: 24px;
}

.nav,
.admin-actions,
.admin-head {
  align-items: stretch;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
}

.admin-panel {
  padding: 28px 18px;
}

@media (min-width: 560px) {
  .screen {
    padding: 18px;
  }

  .quiz {
    padding: 36px 30px;
  }

  .visual,
  .visual > img {
    height: 360px;
    min-height: 360px;
  }

  .nav,
  .admin-actions,
  .admin-head {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
  }

  .nav button,
  .admin-actions button,
  .admin-head button {
    width: auto;
  }

  h1 {
    font-size: 34px;
  }
}

@media (min-width: 900px) {
  .screen {
    place-items: center;
    padding: 24px;
  }

  .quiz-shell,
  .admin-panel {
    width: min(1120px, 100%);
    box-shadow: 0 20px 70px rgba(23, 33, 31, .12), 0 0 0 8px rgba(196, 25, 62, .08);
  }

  .quiz-shell {
    grid-template-columns: minmax(280px, 42%) 1fr;
    min-height: 660px;
  }

  .visual,
  .visual > img {
    height: 100%;
    min-height: 660px;
  }

  .visual-label {
    left: 24px;
    right: 24px;
    top: 28px;
    bottom: auto;
  }

  .brand-logo {
    width: min(170px, 100%);
    height: auto;
    min-height: 0;
    max-height: 80px;
    margin-bottom: 18px;
  }

  .visual-label strong {
    font-size: 34px;
    max-width: 330px;
  }

  .visual-label span {
    font-size: 18px;
    max-width: 310px;
  }

  .quiz {
    min-height: 660px;
    padding: 64px;
  }

  .admin-panel {
    padding: 54px;
  }

  h1 {
    font-size: 46px;
  }

  h2 {
    font-size: 28px;
  }
}
