.oracle-contest {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(120px, 24%, 205px);
  grid-template-areas:
    "heading art"
    "footer art"
    "guide art"
    "manage art";
  column-gap: 1.15rem;
  align-items: start;
  overflow: hidden;
  margin-top: 1.1rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid rgba(175, 128, 57, .22);
  border-radius: 1.2rem;
  background: radial-gradient(circle at 100% 0%, rgba(244, 190, 97, .14), transparent 42%), linear-gradient(135deg, #fffefa, #fff);
  box-shadow: 0 10px 28px rgba(63, 43, 26, .055);
}
/* Иллюстрация занимает собственную ячейку и никогда не перекрывает текст или кнопки. */
.oracle-contest::before {
  content: "";
  grid-area: art;
  align-self: stretch;
  min-height: 126px;
  background: url("../img/oracles-crystal-ball.67250a37d375.webp") center / contain no-repeat;
  pointer-events: none;
}
.oracle-contest__heading { grid-area: heading; min-width: 0; }
.oracle-contest__footer { grid-area: footer; min-width: 0; }
.oracle-contest__guide { grid-area: guide; min-width: 0; }
.oracle-contest__manage { grid-area: manage; min-width: 0; }
.oracle-contest__heading, .oracle-contest__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .9rem;
}
.oracle-contest__heading { align-items: flex-start; }
.oracle-contest__icon, .oracle-contest-modal__icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: .85rem;
  color: #945f24;
  background: linear-gradient(145deg, #fff3d6, #fce2af);
  box-shadow: inset 0 0 0 1px rgba(154, 103, 43, .12);
}
.oracle-contest__copy { flex: 1; min-width: 0; }
.oracle-contest__copy h4 {
  margin: .1rem 0 .25rem;
  color: #2f302e;
  font-size: 1.09rem;
  font-weight: 800;
  line-height: 1.25;
}
.oracle-contest__copy > span, .oracle-contest__hint {
  color: #756c5f;
  font-size: .89rem;
}
.oracle-contest__footer { margin-top: 1rem; flex-wrap: wrap; }
.oracle-contest__hint strong { color: #33302a; }
.oracle-contest__hint .bi { color: #6c9451; }
.oracle-contest__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  border: 1px solid #3d4650;
  border-radius: .78rem;
  padding: .64rem .93rem;
  color: #fff;
  background: #323c47;
  font-size: .88rem;
  font-weight: 720;
  text-decoration: none;
  transition: background .18s ease, transform .18s ease;
}
.oracle-contest__cta:hover { background: #1f2c38; color: #fff; }
.oracle-contest__cta:active { transform: translateY(1px); }
.oracle-contest__cta:focus-visible, .oracle-contest-stepper button:focus-visible {
  outline: 3px solid #c48a3e;
  outline-offset: 3px;
}
.oracle-contest__guide {
  margin: .55rem 0 0;
  color: #756c5f;
  font-size: .8rem;
  line-height: 1.45;
}
.oracle-contest__manage { margin-top: .55rem; text-align: right; }
.oracle-contest-modal__content {
  border: 1px solid rgba(179, 133, 64, .21);
  border-radius: 1.35rem;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(34, 38, 42, .20);
}
.oracle-contest-modal__header {
  align-items: center;
  gap: .85rem;
  border-bottom: 1px solid #f0e9df;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(130deg, #fffaf0, #fff);
}
.oracle-contest-modal__header small {
  display: block;
  color: #887459;
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.oracle-contest-modal__header h2 {
  margin-top: .2rem;
  color: #292f35;
  font-size: 1.2rem;
  font-weight: 800;
}
.oracle-contest-modal__body { padding: 1.7rem 1.35rem 1.25rem; }
.oracle-contest-stepper {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 1rem;
  max-width: 370px;
  margin: 0 auto;
}
.oracle-contest-stepper button {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  align-self: center;
  display: grid;
  place-items: center;
  flex: 0 0 3.25rem;
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid #d8dbe0;
  border-radius: 1rem;
  background: white;
  color: #3b4753;
  font-size: 1.3rem;
  transition: background .15s ease;
}
.oracle-contest-stepper button:hover { background: #f7f3eb; }
.oracle-contest-stepper button:disabled { color: #b6bac0; background: #f8f8f8; }
.oracle-contest-stepper__field {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  flex: 1;
  padding: .75rem .5rem;
  border-radius: 1.05rem;
  background: linear-gradient(160deg, #fbf4e5, #fff9ed);
  border: 1px solid #f1dfb9;
}
.oracle-contest-stepper__field input {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  outline-offset: 5px;
  background: transparent;
  color: #303840;
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 850;
  line-height: 1.1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.oracle-contest-stepper__field input::-webkit-outer-spin-button,
.oracle-contest-stepper__field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.oracle-contest-modal__note {
  margin: 1.3rem 0 0;
  color: #7b7d80;
  font-size: .83rem;
  line-height: 1.5;
  text-align: center;
}
.oracle-contest-modal__note .bi { margin-right: .2rem; }
.oracle-contest-modal__footer {
  border-top: none;
  gap: .6rem;
  padding: .5rem 1.35rem 1.35rem;
}
.oracle-contest__open { max-width: 100%; }
.oracle-contest__cta:disabled { opacity: .65; cursor: not-allowed; background: #323c47; transform: none; }
.oracle-contest__cta--danger {
  border-color: #b52e35;
  background: transparent;
  color: #b52e35;
}
.oracle-contest__cta--danger:hover { background: #fff0f0; color: #98232a; }
.oracle-contest__cta--danger:disabled { background: transparent; color: #b52e35; }
.oracle-contest__open[data-oracle-submitting] .oracle-contest__cta:disabled { cursor: wait; }
.oracle-contest__open .oracle-contest__open-error { margin: .55rem 0 0; }
.oracle-contest__waiting {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  color: #756c5f;
  font-size: .85rem;
  line-height: 1.45;
}
.oracle-contest__waiting .spinner-border { flex-shrink: 0; margin-top: .13rem; }
.oracle-contest__error {
  margin: 0 0 .65rem;
  color: #a52a2a;
  font-size: .85rem;
  overflow-wrap: anywhere;
}
.oracle-contest-question {
  min-width: 0;
  padding: 0 0 1rem;
  margin: 0 0 1.1rem;
  border: 0;
  border-bottom: 1px solid #f0e9df;
}
.oracle-contest-question legend {
  float: none;
  width: auto;
  margin: 0 0 .85rem;
  color: #333a43;
  font-size: .94rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.oracle-contest-question p, .oracle-contest-actual-list p {
  margin: 0 0 .85rem;
  color: #333a43;
  font-size: .94rem;
  overflow-wrap: anywhere;
}
.oracle-contest-choices { display: grid; gap: .45rem; }
.oracle-contest-choices label {
  display: flex;
  align-items: center;
  gap: .6rem;
  border: 1px solid #ede9df;
  border-radius: .65rem;
  padding: .65rem .8rem;
  margin: 0;
  cursor: pointer;
}
.oracle-contest-choices .form-check-input { margin: 0; flex: 0 0 auto; }
.oracle-contest-field { font-size: .82rem; color: #756c5f; overflow-wrap: anywhere; }
.oracle-contest-field p { margin: .5rem 0; }
.oracle-contest-field .game-participants-list--compact {
  display: block;
  padding: 0;
  margin: .5rem 0;
}
.oracle-contest-actual-list { display: grid; gap: .55rem; margin-bottom: .8rem; }
.oracle-contest-actual-list > div {
  padding: .75rem;
  border-radius: .7rem;
  background: #fff6e8;
  color: #7b623d;
  overflow-wrap: anywhere;
}
.oracle-contest-actual-list .oracle-contest-actual-question { margin: 0 0 .3rem; font-weight: 700; }
.oracle-contest-results__answers {
  display: grid;
  gap: .2rem;
  margin-top: .3rem;
  font-size: .78rem;
  color: #756c5f;
}
.oracle-contest-results {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: grid;
  gap: .45rem;
}
.oracle-contest-results li {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem .8rem;
  border: 1px solid #edeff1;
  border-radius: .82rem;
  color: #3a414b;
}
.oracle-contest-results li.is-mine:not(.is-winner) { background: #f5f8fb; }
.oracle-contest-results__medal { color: #8994a3; }
.oracle-contest-results__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.oracle-contest-results__name small { color: #808994; }
.oracle-contest-personal__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}
.oracle-contest-personal__grid > div {
  display: grid;
  align-content: start;
  gap: .15rem;
  min-width: 0;
}
.oracle-contest-personal__grid strong {
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--bs-body-color);
  font-variant-numeric: tabular-nums;
}
.oracle-contest-personal__grid span {
  font-size: .875rem;
  color: var(--bs-secondary-color);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.oracle-contest-personal__note {
  margin: .8rem 0 0;
  color: #77756f;
  font-size: .78rem;
  line-height: 1.45;
}
.oracle-contest-personal__note a {
  color: #77562a;
  font-weight: 700;
}
.oracle-contest-modal__empty { margin: 1rem 0; text-align: center; color: #7b7d80; }
@media (max-width: 575.98px) {
  .oracle-contest { padding: 1rem; border-radius: 1rem; }
  .oracle-contest {
    grid-template-columns: minmax(0, 1fr) 76px;
    grid-template-areas:
      "heading art"
      "footer footer"
      "guide guide"
      "manage manage";
    column-gap: .55rem;
  }
  .oracle-contest::before { min-height: 80px; }
  .oracle-contest__heading { flex-wrap: wrap; gap: .65rem; }
  .oracle-contest__footer { align-items: stretch; }
  .oracle-contest__footer .oracle-contest__cta { width: 100%; }
  .oracle-contest__footer > form { width: 100%; }
  .oracle-contest__footer > form .oracle-contest__cta { width: 100%; }
  .oracle-contest__manage .oracle-contest__cta { width: 100%; }
  .oracle-contest-modal__header { padding: 1rem; }
  .oracle-contest-modal__body { padding: 1.5rem 1rem 1rem; }
  .oracle-contest-stepper { gap: .6rem; }
  .oracle-contest-stepper button { flex-basis: 3rem; width: 3rem; height: 3rem; }
  .oracle-contest-modal__footer { padding: .5rem 1rem 1rem; }
  .oracle-contest-modal__footer .oracle-contest__cta { flex: 1; }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .oracle-contest { grid-template-columns: minmax(0, 1fr) clamp(108px, 22%, 155px); }
  .oracle-contest::before { min-height: 115px; }
}

/* Итоги используют всю доступную ширину; форма прогноза сохраняет прежний размер. */
.oracle-contest-modal--finished {
  --bs-modal-width: 800px;
  --oracle-gold: #b68b36;
  --oracle-winner-bg: color-mix(in srgb, var(--oracle-gold) 12%, var(--bs-body-bg));
  --oracle-mine-bg: color-mix(in srgb, var(--bs-primary) 8%, var(--bs-body-bg));
}
.oracle-contest-modal--finished .modal-dialog {
  max-width: min(800px, calc(100% - 2rem));
  margin-inline: auto;
}
.oracle-contest-modal--finished .oracle-contest-modal__header {
  background: var(--bs-body-bg);
  border-color: var(--bs-border-color);
}
.oracle-contest-modal--finished .oracle-contest-modal__header h2 {
  color: var(--bs-body-color);
  font-size: 1.375rem;
}
.oracle-contest-modal--finished .oracle-contest-modal__header small {
  color: var(--bs-secondary-color);
}
.oracle-contest-modal--finished .oracle-contest-modal__body {
  padding: 1.25rem 1.5rem;
  color: var(--bs-body-color);
  font-size: 1rem;
  line-height: 1.5;
}
.oracle-outcome-summary {
  border: 1px solid var(--bs-border-color);
  border-radius: .9rem;
  overflow: hidden;
}
.oracle-outcome-summary__winner, .oracle-outcome-summary__mine {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
}
.oracle-outcome-summary__winner {
  background: var(--oracle-winner-bg);
}
.oracle-outcome-summary__winner > .bi {
  color: var(--oracle-gold);
  font-size: 1.65rem;
  flex: none;
}
.oracle-outcome-summary__mine {
  background: var(--oracle-mine-bg);
  border-top: 1px solid var(--bs-border-color);
}
.oracle-outcome-summary__names {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: .1rem;
  overflow-wrap: anywhere;
}
.oracle-outcome-summary__names span {
  color: var(--bs-secondary-color);
  font-size: .875rem;
}
.oracle-outcome-summary__names strong {
  font-size: 1.125rem;
  line-height: 1.3;
}
.oracle-outcome-summary__score {
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  line-height: 1.2;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.oracle-outcome-section {
  margin-top: 1.5rem;
  min-width: 0;
}
.oracle-outcome-section:first-child { margin-top: 0; }
.oracle-outcome-section h3 {
  font-size: 1.125rem;
  font-weight: 750;
  margin: 0 0 .75rem;
  overflow-wrap: anywhere;
}
.oracle-outcome-status {
  margin: 0 0 .75rem;
  color: var(--bs-secondary-color);
  overflow-wrap: anywhere;
}
.oracle-outcome-questions {
  list-style: none;
  padding: 0;
  margin: 0 0 .75rem;
}
.oracle-outcome-questions li {
  padding: .85rem 0;
  border-bottom: 1px solid var(--bs-border-color);
  overflow-wrap: anywhere;
}
.oracle-outcome-questions li:first-child { padding-top: 0; }
.oracle-outcome-questions h4 {
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 700;
  margin: 0 0 .65rem;
}
.oracle-outcome-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}
.oracle-outcome-comparison--actual-only { grid-template-columns: minmax(0, 1fr); }
.oracle-outcome-comparison > div {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: .2rem;
  padding: .65rem .8rem;
  border-radius: .6rem;
  border: 1px solid var(--bs-border-color);
}
.oracle-outcome-comparison:not(.oracle-outcome-comparison--actual-only) > div:first-child {
  background: var(--oracle-mine-bg);
}
.oracle-outcome-comparison span {
  color: var(--bs-secondary-color);
  font-size: .875rem;
}
.oracle-outcome-comparison strong {
  font-size: 1.25rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.oracle-outcome-questions p {
  margin: .55rem 0 0;
  color: var(--bs-secondary-color);
  font-size: .875rem;
}
.oracle-outcome-link {
  display: inline-block;
  color: var(--bs-link-color);
  font-size: .9375rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.oracle-outcome-link span { font-weight: 400; }
.oracle-outcome-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.35;
}
.oracle-outcome-table th, .oracle-outcome-table td {
  padding: .75rem .45rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--bs-border-color);
  overflow-wrap: anywhere;
  text-align: center;
}
.oracle-outcome-table th:first-child { width: 28%; text-align: left; }
.oracle-outcome-table th:last-child { width: 18%; }
.oracle-outcome-table thead th {
  color: var(--bs-secondary-color);
  font-size: .875rem;
  font-weight: 600;
}
.oracle-outcome-table__actual {
  background: var(--bs-tertiary-bg);
  font-weight: 700;
}
.oracle-outcome-table .is-mine { background: var(--oracle-mine-bg); }
.oracle-outcome-table .is-winner { background: var(--oracle-winner-bg); }
.oracle-outcome-table .is-winner .bi { color: var(--oracle-gold); }
.oracle-outcome-table__rank, .oracle-outcome-table__you {
  color: var(--bs-secondary-color);
  font-weight: 400;
  font-size: .875rem;
}
.oracle-outcome-table__score {
  font-size: 1.125rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.oracle-outcome-table__number { display: none; }
.oracle-outcome-personal {
  padding-top: 1rem;
  border-top: 1px solid var(--bs-border-color);
}
.oracle-outcome-personal .oracle-contest-personal__grid { margin-bottom: .8rem; }
.oracle-outcome-personal .oracle-outcome-link { margin: .3rem 1rem .3rem 0; }
.oracle-contest-modal--finished .oracle-contest-modal__footer {
  border-top: 1px solid var(--bs-border-color);
  padding: .65rem 1.5rem;
}
.oracle-contest-modal--finished .oracle-contest-modal__footer .btn {
  min-height: 44px;
  font-size: 1rem;
}
@media (max-width: 767.98px) {
  .oracle-contest-modal--finished .modal-dialog {
    max-width: calc(100% - 1rem);
  }
  .oracle-contest-modal--finished .oracle-contest-modal__body { padding: 1rem; }
  .oracle-contest-modal--finished .oracle-contest-modal__footer { padding: .5rem 1rem; }
  /* Один набор строк: имя и точность сверху, три ответа под ними. */
  .oracle-outcome-table, .oracle-outcome-table tbody { display: block; }
  .oracle-outcome-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .oracle-outcome-table tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--bs-border-color);
    padding: .5rem;
  }
  .oracle-outcome-table tbody th, .oracle-outcome-table tbody td {
    min-width: 0;
    border: 0;
    padding: .35rem;
  }
  .oracle-outcome-table tbody th:first-child {
    width: auto;
    grid-column: 1 / 3;
    grid-row: 1;
    align-self: center;
  }
  .oracle-outcome-table tbody td:not(:last-child) { grid-row: 2; }
  .oracle-outcome-table tbody .oracle-outcome-table__score {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
    align-self: center;
  }
  .oracle-outcome-table__number {
    display: block;
    font-weight: 400;
    font-size: .875rem;
    color: var(--bs-secondary-color);
    margin-bottom: .15rem;
  }
}
@media (max-width: 359.98px) {
  .oracle-contest-modal--finished .oracle-contest-modal__body { padding: .75rem; }
  .oracle-outcome-summary__winner, .oracle-outcome-summary__mine { padding: .7rem; gap: .5rem; }
  .oracle-outcome-summary__winner > .bi { font-size: 1.25rem; }
  .oracle-outcome-comparison > div { padding: .5rem; }
  .oracle-outcome-comparison strong { font-size: 1.125rem; }
  .oracle-outcome-personal .oracle-contest-personal__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
