html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #05080d;
  color: #f5f7fb;
  font-family: Arial, Helvetica, sans-serif;
}

button {
  font: inherit;
}

.site-back-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 54px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(135, 255, 237, 0.45);
  border-radius: 999px;
  color: #d9fdf7;
  background: rgba(5, 10, 16, 0.72);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.site-back-link:active {
  transform: translateY(1px);
}

.ad-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 280px;
  min-height: 420px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 14%, #152130 0%, #070a0f 56%, #020305 100%);
  touch-action: none;
  user-select: none;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.intro-panel {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 58px;
  z-index: 3;
  padding: 10px 10px 12px;
  border-radius: 14px;
  text-align: left;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(9, 15, 25, 0.88), rgba(4, 8, 13, 0.48));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 260ms ease, transform 260ms ease;
  pointer-events: none;
}

.intro-panel.is-hidden {
  opacity: 0;
  transform: translateY(-12px);
}

.intro-title {
  font-size: clamp(20px, 6.2vw, 30px);
  line-height: 1.05;
  font-weight: 900;
  word-break: keep-all;
  overflow-wrap: normal;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.7), 0 0 18px rgba(89, 229, 217, 0.32);
}

.intro-hint {
  margin-top: 8px;
  font-size: clamp(13px, 4vw, 17px);
  line-height: 1.25;
  color: #d9fdf7;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.light-button {
  position: absolute;
  left: 16px;
  bottom: 20px;
  z-index: 4;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(135, 255, 237, 0.7);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 231, 121, 0.55), rgba(117, 255, 239, 0.25) 38%, rgba(13, 34, 48, 0.9) 74%),
    linear-gradient(180deg, rgba(20, 38, 52, 0.92), rgba(5, 10, 16, 0.92));
  box-shadow: 0 0 28px rgba(91, 255, 238, 0.3), inset 0 0 18px rgba(255, 255, 255, 0.08);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.light-button.is-used {
  opacity: 0.42;
  filter: grayscale(0.55);
}

.light-bulb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%);
  background: url("assets/item-light-bulb-gold.png") center / contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(255, 224, 103, 0.82));
}

.result-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 18px;
  padding: 24px 18px 22px;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 197, 71, 0.22), rgba(9, 16, 25, 0.64) 42%, rgba(2, 3, 5, 0.92) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.74));
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.result-panel.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.result-copy {
  text-align: center;
  padding: 0 4px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.78);
}

.result-title {
  font-size: clamp(28px, 8.5vw, 42px);
  line-height: 1.05;
  font-weight: 900;
}

.result-body {
  margin: 10px auto 0;
  max-width: 330px;
  font-size: clamp(15px, 4.3vw, 20px);
  line-height: 1.25;
  color: #e6f9f5;
}

.cta-button {
  width: min(100%, 390px);
  min-height: 58px;
  margin: 0 auto;
  border: 0;
  border-radius: 999px;
  color: #07100f;
  background: linear-gradient(180deg, #fff0a3 0%, #ffc84e 50%, #ff9f24 100%);
  box-shadow: 0 14px 34px rgba(255, 180, 42, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-size: clamp(17px, 5vw, 22px);
  line-height: 1.1;
  font-weight: 900;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cta-button:active,
.light-button:active {
  transform: translateY(1px) scale(0.99);
}

@media (min-aspect-ratio: 3 / 4) {
  .ad-root {
    width: min(100vw, 430px);
    height: 100vh;
    margin: 0 auto;
    box-shadow: 0 0 70px rgba(0, 0, 0, 0.65);
  }
}
