.xoracle-layer {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
}

.xoracle-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(121, 72, 155, .18), transparent 27%),
    radial-gradient(circle at 18% 18%, rgba(160, 115, 69, .07), transparent 19%),
    radial-gradient(circle at 82% 22%, rgba(113, 65, 147, .08), transparent 22%),
    rgba(0, 0, 2, .88);
  backdrop-filter: blur(5px);
}

.xoracle-backdrop::before,
.xoracle-backdrop::after {
  content: "";
  position: absolute;
  inset: -15%;
  pointer-events: none;
}

.xoracle-backdrop::before {
  background-image:
    radial-gradient(circle, rgba(255,255,255,.46) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(234,194,111,.34) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(177,121,207,.28) 0 1px, transparent 1.5px);
  background-size: 91px 91px, 137px 137px, 181px 181px;
  background-position: 12px 18px, 48px 63px, 93px 22px;
  opacity: .16;
  animation: xoracleStars 24s linear infinite;
}

.xoracle-backdrop::after {
  background:
    radial-gradient(circle at 50% 50%, rgba(118, 67, 150, .18), transparent 32%);
  filter: blur(42px);
  animation: xoracleMist 8s ease-in-out infinite alternate;
}

.xoracle {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100vw - 36px));
  min-height: 440px;
  box-sizing: border-box;
  padding: 50px 54px 32px;
  text-align: center;
  color: #f0e8da;

  background:
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 16%),
    radial-gradient(circle at 50% -8%, rgba(128, 72, 163, .24), transparent 35%),
    radial-gradient(circle at 50% 110%, rgba(183, 127, 59, .10), transparent 34%),
    linear-gradient(180deg, #17111b 0%, #0b0810 46%, #050406 100%);

  border: 1px solid rgba(188, 145, 75, .90);

  box-shadow:
    0 0 0 1px rgba(255, 230, 175, .05) inset,
    0 0 0 8px rgba(255,255,255,.008),
    0 0 38px rgba(108, 59, 145, .30),
    0 0 95px rgba(70, 39, 92, .24),
    0 34px 95px rgba(0,0,0,.84);

  animation: xoracleAppear .34s ease-out;
}

.xoracle::before {
  content: "";
  position: absolute;
  inset: 13px;
  pointer-events: none;
  border: 1px solid rgba(219, 177, 98, .18);
  box-shadow:
    inset 0 0 34px rgba(181, 124, 69, .035);
}

.xoracle::after {
  content: "";
  position: absolute;
  left: 46px;
  right: 46px;
  top: 28px;
  height: 1px;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(232, 190, 111, .14),
      rgba(247, 214, 145, .78),
      rgba(232, 190, 111, .14),
      transparent
    );
  box-shadow:
    0 374px 0 rgba(223, 181, 101, .14);
}

.xoracle-close {
  position: absolute;
  z-index: 5;
  top: 16px;
  right: 19px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: #837767;
  font: 25px/27px Georgia, "Times New Roman", serif;
  cursor: pointer;
  transition:
    color .18s ease,
    border-color .18s ease,
    text-shadow .18s ease,
    transform .18s ease;
}

.xoracle-close:hover {
  color: #f1d79c;
  border-color: rgba(190, 144, 70, .24);
  text-shadow: 0 0 11px rgba(231, 190, 102, .40);
  transform: scale(1.05);
}

.xoracle-symbol {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 7px;
  display: grid;
  place-items: center;

  color: #f2cf79;
  font-size: 34px;
  line-height: 1;

  text-shadow:
    0 0 8px rgba(246, 209, 121, .80),
    0 0 24px rgba(143, 80, 183, .75),
    0 0 48px rgba(108, 58, 145, .48);

  animation: xoraclePulse 3.4s ease-in-out infinite;
}

.xoracle-symbol::before,
.xoracle-symbol::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.xoracle-symbol::before {
  inset: 8px;
  border: 1px solid rgba(222, 177, 91, .34);
  transform: rotate(45deg);
  box-shadow:
    0 0 18px rgba(221, 169, 81, .08);
}

.xoracle-symbol::after {
  inset: 20px;
  border: 1px solid rgba(166, 107, 193, .34);
  transform: rotate(45deg);
  animation: xoracleRotate 16s linear infinite;
}

.xoracle h2 {
  margin: 5px 0 13px;

  color: #f1dcaa;

  font-family:
    Georgia,
    "Times New Roman",
    "DejaVu Serif",
    serif;

  font-size: 38px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: .18em;
  text-indent: .18em;

  text-shadow:
    0 1px 0 #000,
    0 0 13px rgba(232, 190, 105, .26),
    0 0 32px rgba(115, 66, 147, .20);
}

.xoracle-lead {
  max-width: 450px;
  margin: 0 auto 32px;

  color: #aaa0af;

  font-family:
    Georgia,
    "Times New Roman",
    "DejaVu Serif",
    serif;

  font-size: 17px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;

  text-shadow: 0 1px 0 #000;
}

.xoracle-question {
  display: block;
  width: min(460px, 100%);
  box-sizing: border-box;
  margin: 0 auto;
  padding: 15px 18px;

  border: 1px solid rgba(127, 97, 135, .90);
  border-bottom-color: #aa8145;
  border-radius: 0;
  outline: none;

  background:
    linear-gradient(180deg, rgba(255,255,255,.026), transparent),
    rgba(0,0,0,.54);

  color: #fbf2e4;
  caret-color: #efcc7c;
  text-align: center;

  font-family:
    Georgia,
    "Times New Roman",
    "DejaVu Serif",
    serif;

  font-size: 21px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.3;

  box-shadow:
    inset 0 0 22px rgba(0,0,0,.86),
    0 1px 0 rgba(255,255,255,.025),
    0 0 20px rgba(111, 67, 142, .09);

  transition:
    border-color .22s ease,
    box-shadow .22s ease,
    background .22s ease;
}

.xoracle-question::placeholder {
  color: #746a79;
  font-style: italic;
}

.xoracle-question:focus {
  border-color: #c89d58;
  background:
    linear-gradient(180deg, rgba(255,255,255,.037), transparent),
    rgba(0,0,0,.58);

  box-shadow:
    inset 0 0 22px rgba(0,0,0,.88),
    0 0 12px rgba(207, 164, 85, .13),
    0 0 32px rgba(122, 69, 157, .21);
}

.xoracle-ask {
  margin: 20px 0 0;
  padding: 11px 28px 12px;

  border: 1px solid #8c6938;
  border-radius: 0;

  color: #eed69b;

  background:
    linear-gradient(180deg, #302333 0%, #171019 100%);

  font-family:
    Georgia,
    "Times New Roman",
    "DejaVu Serif",
    serif;

  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: .08em;

  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    inset 0 -8px 22px rgba(0,0,0,.24),
    0 0 18px rgba(116, 68, 145, .13);

  transition:
    color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    transform .12s ease;
}

.xoracle-ask:hover {
  color: #ffe5aa;
  border-color: #c29850;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 0 18px rgba(213, 162, 83, .13),
    0 0 32px rgba(123, 69, 158, .21);
}

.xoracle-ask:active {
  transform: translateY(1px);
}

.xoracle-ask:disabled {
  cursor: wait;
  opacity: .52;
}

.xoracle-answer {
  position: relative;

  min-height: 90px;
  max-width: 500px;
  margin: 29px auto 0;
  padding: 0 16px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #f4e3b9;

  opacity: 0;
  transform: translateY(9px) scale(.985);
  filter: blur(2px);

  font-family:
    Georgia,
    "Times New Roman",
    "DejaVu Serif",
    serif;

  font-size: 28px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.32;

  text-shadow:
    0 0 9px rgba(240, 199, 106, .24),
    0 0 22px rgba(118, 67, 151, .20);

  transition:
    opacity .72s ease,
    transform .72s ease,
    filter .72s ease;
}

.xoracle-answer::before {
  content: "";
  position: absolute;
  inset: 6px 4%;
  z-index: -1;

  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(137, 78, 170, .12),
      transparent 68%
    );

  filter: blur(14px);
  opacity: 0;
  transition: opacity .7s ease;
}

.xoracle-answer.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.xoracle-answer.is-visible::before {
  opacity: 1;
}

.xoracle-note {
  margin: 21px 0 0;

  color: #6d6670;

  font-family:
    Georgia,
    "Times New Roman",
    "DejaVu Serif",
    serif;

  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
}

@keyframes xoraclePulse {
  0%, 100% {
    opacity: .79;
    transform: scale(.96);
  }

  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes xoracleRotate {
  from {
    transform: rotate(45deg);
  }

  to {
    transform: rotate(405deg);
  }
}

@keyframes xoracleStars {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(91px, 91px, 0);
  }
}

@keyframes xoracleMist {
  from {
    transform: scale(.92);
    opacity: .55;
  }

  to {
    transform: scale(1.08);
    opacity: .95;
  }
}

@keyframes xoracleAppear {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.985);
  }

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

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

  .xoracle {
    width: calc(100vw - 24px);
    min-height: 405px;
    padding: 42px 22px 27px;
  }

  .xoracle-symbol {
    width: 64px;
    height: 64px;
    font-size: 29px;
  }

  .xoracle h2 {
    font-size: 30px;
    letter-spacing: .13em;
    text-indent: .13em;
  }

  .xoracle-lead {
    margin-bottom: 26px;
    font-size: 15px;
  }

  .xoracle-question {
    font-size: 19px;
  }

  .xoracle-answer {
    min-height: 82px;
    margin-top: 24px;
    font-size: 23px;
  }

  .xoracle::after {
    left: 30px;
    right: 30px;
    box-shadow:
      0 340px 0 rgba(223, 181, 101, .12);
  }
}

@media (max-height: 620px) {
  .xoracle {
    min-height: 0;
    padding-top: 35px;
    padding-bottom: 22px;
  }

  .xoracle-symbol {
    width: 54px;
    height: 54px;
    font-size: 26px;
  }

  .xoracle-lead {
    margin-bottom: 18px;
  }

  .xoracle-answer {
    min-height: 62px;
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xoracle,
  .xoracle-symbol,
  .xoracle-symbol::after,
  .xoracle-backdrop::before,
  .xoracle-backdrop::after {
    animation: none;
  }

  .xoracle-answer,
  .xoracle-close,
  .xoracle-question,
  .xoracle-ask {
    transition: none;
  }
}

/* ============================================================
   ORACLE — BLUE / GOLD PREMIUM THEME
   ============================================================ */

.xoracle-backdrop {
  background:
    radial-gradient(circle at 50% 44%, rgba(38, 91, 150, .23), transparent 27%),
    radial-gradient(circle at 18% 18%, rgba(186, 143, 69, .07), transparent 20%),
    radial-gradient(circle at 82% 24%, rgba(43, 87, 144, .12), transparent 24%),
    linear-gradient(180deg, rgba(2, 7, 18, .95), rgba(0, 2, 8, .96));
}

.xoracle-backdrop::before {
  background-image:
    radial-gradient(circle, rgba(255,255,255,.48) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(235,198,115,.38) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(104,168,231,.32) 0 1px, transparent 1.5px);
  opacity: .18;
}

.xoracle-backdrop::after {
  background:
    radial-gradient(circle at 50% 50%, rgba(37, 91, 151, .23), transparent 34%);
}

.xoracle {
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 16%),
    radial-gradient(circle at 50% -10%, rgba(49, 105, 168, .32), transparent 36%),
    radial-gradient(circle at 50% 112%, rgba(192, 143, 62, .11), transparent 36%),
    linear-gradient(180deg, #0c182c 0%, #08111f 42%, #030812 100%);

  border-color: rgba(198, 157, 83, .94);

  box-shadow:
    0 0 0 1px rgba(255, 229, 169, .055) inset,
    0 0 0 8px rgba(255,255,255,.008),
    0 0 34px rgba(33, 91, 154, .32),
    0 0 86px rgba(18, 59, 108, .24),
    0 34px 95px rgba(0,0,0,.86);
}

.xoracle::before {
  border-color: rgba(222, 183, 109, .20);
  box-shadow:
    inset 0 0 34px rgba(42, 94, 149, .05);
}

.xoracle-symbol {
  color: #f3d282;
  text-shadow:
    0 0 8px rgba(247, 213, 132, .88),
    0 0 26px rgba(74, 145, 216, .72),
    0 0 54px rgba(29, 84, 142, .50);
}

.xoracle-symbol::before {
  border-color: rgba(229, 190, 106, .38);
}

.xoracle-symbol::after {
  border-color: rgba(83, 154, 222, .34);
}

.xoracle h2 {
  color: #f3dfad;
  text-shadow:
    0 1px 0 #000,
    0 0 13px rgba(232, 190, 105, .26),
    0 0 34px rgba(46, 115, 180, .23);
}

.xoracle-question {
  border-color: rgba(67, 111, 156, .88);
  border-bottom-color: #b98b43;

  background:
    linear-gradient(180deg, rgba(255,255,255,.024), transparent),
    rgba(2, 8, 18, .62);

  box-shadow:
    inset 0 0 22px rgba(0,0,0,.86),
    0 1px 0 rgba(255,255,255,.025),
    0 0 20px rgba(45, 103, 161, .12);
}

.xoracle-question:focus {
  border-color: #c89d58;

  box-shadow:
    inset 0 0 22px rgba(0,0,0,.88),
    0 0 11px rgba(208, 166, 86, .15),
    0 0 34px rgba(48, 119, 188, .23);
}

.xoracle-ask {
  border-color: #98743c;
  color: #f0dca7;

  background:
    linear-gradient(180deg, #173052 0%, #0a182b 100%);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    inset 0 -9px 24px rgba(0,0,0,.25),
    0 0 18px rgba(39, 104, 170, .16);
}

.xoracle-ask:hover {
  color: #ffe8ad;
  border-color: #d1a356;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07),
    0 0 16px rgba(217, 168, 83, .15),
    0 0 34px rgba(49, 123, 193, .25);
}

.xoracle-answer {
  color: #f6e6bd;

  text-shadow:
    0 0 9px rgba(240, 199, 106, .28),
    0 0 22px rgba(59, 131, 201, .23);
}

.xoracle-answer::before {
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(44, 111, 179, .15),
      transparent 68%
    );
}

/* Состояние, пока Оракул "думает". */
.xoracle.is-reading .xoracle-symbol {
  animation:
    xoracleOracleRead 1.5s ease-in-out infinite,
    xoraclePulse 3.4s ease-in-out infinite;
}

.xoracle.is-reading::before {
  animation: xoracleBlueBreath 1.55s ease-in-out infinite;
}

.xoracle.is-reading .xoracle-question,
.xoracle.is-reading .xoracle-ask {
  box-shadow:
    0 0 22px rgba(45, 113, 180, .18),
    inset 0 0 20px rgba(0,0,0,.84);
}

.xoracle-answer.is-waiting {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  color: #8da8c4;
  font-size: 17px;
  letter-spacing: .08em;
  text-shadow:
    0 0 14px rgba(70, 145, 214, .24);
  animation: xoracleWaiting 1.25s ease-in-out infinite;
}

.xoracle-answer.is-revealing {
  animation: xoracleReveal 1.15s cubic-bezier(.2,.7,.2,1) both;
}

@keyframes xoracleOracleRead {
  0%, 100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.55);
    text-shadow:
      0 0 10px rgba(249, 216, 136, .95),
      0 0 30px rgba(71, 150, 225, .88),
      0 0 64px rgba(34, 102, 170, .65);
  }
}

@keyframes xoracleBlueBreath {
  0%, 100% {
    box-shadow:
      inset 0 0 34px rgba(42, 94, 149, .05);
  }

  50% {
    box-shadow:
      inset 0 0 46px rgba(54, 126, 195, .14);
  }
}

@keyframes xoracleWaiting {
  0%, 100% {
    opacity: .50;
  }

  50% {
    opacity: .92;
  }
}

@keyframes xoracleReveal {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(.975);
    filter: blur(7px);
  }

  35% {
    opacity: .38;
    filter: blur(4px);
  }

  70% {
    opacity: .90;
    transform: translateY(0) scale(1.01);
    filter: blur(.8px);
    text-shadow:
      0 0 15px rgba(243, 206, 120, .42),
      0 0 38px rgba(65, 142, 215, .36);
  }

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