/* =========================
   VOCAB GAME: X-RAY
========================= */

.xray-game {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  font-family: "Fredoka", Arial, sans-serif;
  color: #000;
  overflow: hidden;
}

.xray-stage-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 8px solid #000;
  border-radius: 28px;
  background: #163845;
  box-shadow: 10px 10px 0 rgba(0,0,0,0.28);
}

.xray-lab-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22), transparent 28%),
    linear-gradient(90deg, #244b57 0 8%, #2f6672 8% 9%, transparent 9% 91%, #163845 91% 100%),
    #255560;
}

.xray-lab-bg::before {
  content: "";
  position: absolute;
  left: 18%;
  top: 7%;
  width: 64%;
  height: 8%;
  background: #d8d8d8;
  opacity: 0.65;
  clip-path: polygon(0 0, 100% 0, 94% 100%, 6% 100%);
}

.xray-lab-bg::after {
  content: "";
  position: absolute;
  left: 7%;
  bottom: 6%;
  width: 21%;
  height: 48%;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.35), transparent 35%),
    linear-gradient(180deg, #0d2632 0 20%, #184353 20% 23%, #0d2632 23% 100%);
  border-radius: 12px;
  opacity: 0.75;
}

.xray-machine-left,
.xray-machine-right {
  position: absolute;
  bottom: 7%;
  width: 170px;
  height: 230px;
  background: #143b49;
  border: 5px solid rgba(0,0,0,0.45);
  opacity: 0.65;
}

.xray-machine-left {
  left: 5%;
}

.xray-machine-right {
  right: 8%;
}

.xray-light {
  position: absolute;
  border-radius: 50%;
  background: rgba(54, 255, 245, 0.35);
  filter: blur(3px);
}

.xray-light-one {
  left: 8%;
  bottom: 4%;
  width: 220px;
  height: 160px;
}

.xray-light-two {
  right: 10%;
  bottom: 18%;
  width: 210px;
  height: 210px;
}

.xray-bubble {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7affff, #3675ff);
  box-shadow: 9px 12px 0 rgba(0, 47, 255, 0.45);
  animation: xrayFloat 3s ease-in-out infinite;
}

.xray-bubble-one {
  left: 10%;
  top: 17%;
}

.xray-bubble-two {
  right: 22%;
  top: 33%;
  animation-delay: 0.4s;
}

.xray-bubble-three {
  left: 30%;
  bottom: 27%;
  animation-delay: 0.8s;
}

@keyframes xrayFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-18px) scale(1.08); }
}

.xray-scanner-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(520px, 58vw);
  height: min(650px, calc(100vh - 180px));
  min-height: 460px;
  transform: translate(-50%, -50%);
  border: 7px solid #46fff8;
  border-radius: 28px;
  background: linear-gradient(135deg, #1fc5ff 0%, #5236d3 100%);
  box-shadow: 20px 20px 0 rgba(0,0,0,0.22), 0 0 28px rgba(70,255,248,0.85);
  overflow: visible;
  display: grid;
  place-items: center;
}

.xray-glow-frame {
  position: absolute;
  inset: 12px;
  border-radius: 20px;
  border: 4px solid rgba(255,255,255,0.22);
  pointer-events: none;
}

.xray-main-btn {
  position: absolute;
  right: -45px;
  top: -45px;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: linear-gradient(135deg, #51dfff, #1d78ff);
  color: white;
  border: 7px solid #0888f5;
  font-size: 17px;
  font-weight: 900;
  padding: 0;
  box-shadow: 0 8px 0 rgba(0,0,0,0.25), 0 0 22px rgba(74,238,255,0.65);
  z-index: 9;
}

.xray-hidden-shape,
.xray-answer-image,
.xray-ghost {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
}

.xray-hidden-shape {
  width: 68%;
  height: 68%;
  display: grid;
  place-items: center;
  opacity: 0;
  z-index: 3;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.xray-hidden-shape img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: brightness(0) saturate(0) opacity(0.55) drop-shadow(0 0 12px rgba(0,0,0,0.45));
  -webkit-user-drag: none;
  user-select: none;
}

.xray-hidden-shape.shape-show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.03);
}

.xray-answer-image {
  width: 74%;
  height: 74%;
  z-index: 6;
  display: grid;
  place-items: center;
  animation: xrayAnswerPop 0.35s ease forwards;
}

.xray-answer-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(8px 10px 0 rgba(0,0,0,0.26));
  -webkit-user-drag: none;
  user-select: none;
}

@keyframes xrayAnswerPop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.88); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.xray-ghost {
  width: 72%;
  height: 76%;
  z-index: 5;
  display: grid;
  place-items: center;
  transition: opacity 0.12s ease, filter 0.12s ease;
}

.xray-ghost-body {
  position: relative;
  width: 80%;
  height: 82%;
  background: #fffce8;
  border: 8px solid #000;
  border-radius: 48% 48% 18% 18% / 36% 36% 18% 18%;
  filter: drop-shadow(8px 10px 0 rgba(0,0,0,0.23));
  overflow: hidden;
}

.xray-ghost-body::before,
.xray-ghost-body::after {
  content: "";
  position: absolute;
  bottom: -30px;
  width: 34%;
  height: 82px;
  background: #fffce8;
  border: 8px solid #000;
  border-top: none;
  border-radius: 0 0 50% 50%;
}

.xray-ghost-body::before {
  left: -8px;
}

.xray-ghost-body::after {
  right: -8px;
}

.xray-eye {
  position: absolute;
  top: 27%;
  width: 42px;
  height: 78px;
  background: #000;
  border-radius: 50%;
  z-index: 2;
}

.xray-eye-left {
  left: 38%;
}

.xray-eye-right {
  right: 28%;
}

.xray-ghost-bottom {
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: -20px;
  height: 70px;
  background: #fffce8;
  border-radius: 50%;
  z-index: 3;
}

.xray-ghost.ghost-xray {
  opacity: 0.36;
  filter: hue-rotate(150deg) saturate(2) brightness(1.2);
}

.xray-ghost.ghost-xray .xray-ghost-body {
  background: rgba(200,255,255,0.65);
  border-color: #009dff;
}

.xray-ghost.ghost-hidden {
  opacity: 0;
  pointer-events: none;
}

.xray-scanner-card.quick-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(103,255,255,0.5), transparent);
  animation: xraySweep 0.45s ease forwards;
  border-radius: 20px;
  z-index: 7;
  pointer-events: none;
}

@keyframes xraySweep {
  from { transform: translateY(-100%); opacity: 0.2; }
  50% { opacity: 1; }
  to { transform: translateY(100%); opacity: 0; }
}

.xray-answer-banner {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 12;
  width: min(520px, 72%);
  background: #d3ff00;
  border: 7px solid #000;
  border-radius: 20px;
  padding: 14px 18px;
  text-align: center;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.3);
  animation: xrayBannerPop 0.3s ease forwards;
}

@keyframes xrayBannerPop {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.xray-answer-word {
  font-size: 34px;
  font-weight: 900;
}

.xray-answer-meta {
  font-size: 17px;
  font-weight: 900;
  margin-top: 4px;
}

.xray-side-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.xray-card {
  background: #bff1ea;
  border: 7px solid #000;
  border-radius: 24px;
  padding: 14px;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.25);
}

.xray-card h3 {
  margin: 0 0 8px;
  font-size: 23px;
}

.xray-card p {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
}

.xray-controls-card {
  display: grid;
  gap: 12px;
}

.xray-controls-card button {
  width: 100%;
  font-size: 18px;
  font-weight: 900;
}

.xray-reveal-btn {
  background: #d3ff00;
}

.xray-reveal-btn:disabled {
  opacity: 0.55;
  background: #aaa;
}

.xray-next-btn {
  background: #23d8ff;
}

.xray-preview-img-box {
  height: 160px;
  background: #fff;
  border: 6px solid #000;
  border-radius: 20px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 12px;
}

.xray-preview-img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

.xray-preview-word {
  background: #d3ff00;
  border: 5px solid #000;
  border-radius: 16px;
  padding: 10px;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
}

#xray-preview-meta {
  margin-top: 10px;
  text-align: center;
}

.xray-error-box {
  max-width: 560px;
  margin: 80px auto;
  background: #fff0a8;
  border: 7px solid #000;
  border-radius: 26px;
  padding: 28px;
  text-align: center;
  font-family: "Fredoka", Arial, sans-serif;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.25);
}

.xray-error-box h2 {
  font-size: 36px;
  margin-top: 0;
}

.xray-error-box p {
  font-size: 22px;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

@media (max-width: 950px) {
  .xray-game {
    grid-template-columns: 1fr;
  }

  .xray-side-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .xray-preview-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .xray-scanner-card {
    width: 76vw;
    height: 500px;
  }

  .xray-main-btn {
    right: -20px;
    top: -28px;
    width: 82px;
    height: 82px;
    font-size: 13px;
  }

  .xray-eye {
    width: 25px;
    height: 50px;
  }

  .xray-side-panel {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   X-RAY TEACHER MINI HINT
   Small private-looking text only; no big preview image.
========================================================= */

.xray-teacher-mini-card {
  padding: 10px 12px !important;
  background: rgba(191, 241, 234, 0.72) !important;
  opacity: 0.78;
}

.xray-teacher-mini-label {
  font-size: 10px;
  font-weight: 900;
  opacity: 0.55;
  margin-bottom: 6px;
  text-transform: lowercase;
}

.xray-teacher-mini-word {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  box-shadow: none !important;
}

.xray-teacher-mini-meta {
  margin-top: 4px !important;
  text-align: left !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  opacity: 0.62;
  line-height: 1.15 !important;
}

.xray-preview-card,
.xray-preview-img-box {
  display: none !important;
}
