:root {
  --bg: #070707;
  --panel: #111111;
  --line: #232323;
  --text: #f3f3f3;
  --muted: #a9a9a9;
  --accent: #7ce8ff;
  --ad-bar-height: 88px;
  --ad-bottom-pad: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
}

body {
  display: block;
}

.rb-app {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  height: 100dvh;
  background: #ffffff;
  border-left: 1px solid #1a1a1a;
  border-right: 1px solid #1a1a1a;
  position: relative;
  overflow: hidden;
}

.rb-lang {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 10px);
  right: 10px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid #303030;
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(5px);
}

.rb-lang span {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #9b9b9b;
}

.rb-lang select {
  width: 106px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid #3a3a3a;
  background: #111111;
  color: #ffffff;
  font-size: 11px;
  padding: 0 6px;
}

.google-translate-host {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.rb-screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  background: linear-gradient(180deg, #101010, #070707 35%, #060606);
  padding-bottom: calc(var(--ad-bar-height) + env(safe-area-inset-bottom) + var(--ad-bottom-pad));
}

.rb-screen.active {
  display: flex;
}

.rb-screen-intro {
  padding: calc(env(safe-area-inset-top) + 64px) 22px calc(env(safe-area-inset-bottom) + 82px);
  justify-content: center;
  align-items: center;
  background: #ffffff;
}

.rb-intro-copy {
  text-align: center;
  max-width: 330px;
}

.rb-question-mark {
  margin: 0 0 8px;
  font-size: clamp(96px, 26vw, 150px);
  line-height: 1;
  font-weight: 800;
  color: #0b0b0b;
  animation: rb-question-pulse 1.2s ease-in-out infinite;
  transform-origin: center;
}

.rb-intro-copy h1 {
  margin: 0;
  font-size: clamp(44px, 11.6vw, 64px);
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: #0b0b0b;
}

.rb-eyebrow {
  margin: 0;
  font-size: 11px;
  color: #8b8b8b;
  letter-spacing: 0.1em;
}

.rb-intro-subtitle {
  margin: 12px 0 0;
  font-size: 16px;
  color: #2d2d2d;
  letter-spacing: 0.02em;
}

.rb-bottom-btn {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(var(--ad-bar-height) + env(safe-area-inset-bottom) + var(--ad-bottom-pad) + 12px);
}

button {
  width: 100%;
  height: 46px;
  border: 1px solid #39444a;
  border-radius: 12px;
  background: linear-gradient(180deg, #1d2529, #111518);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

button.ghost {
  border-color: #2e2e2e;
  background: #0f0f0f;
  color: #d5d5d5;
}

.rb-image-wrap {
  flex: 1;
  min-height: 0;
  background: #000;
}

.rb-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rb-panel {
  border-top: 1px solid #1d1d1d;
  background: rgba(8, 8, 8, 0.96);
  padding: 14px;
}

.rb-panel h2 {
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1.25;
}

.rb-panel p {
  margin: 7px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #d7d7d7;
}

.rb-row-btn {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.rb-watch-ad-btn {
  margin-top: 12px;
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #3a3a3a;
  background: linear-gradient(180deg, #171717, #0d0d0d);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.rb-watch-ad-icon {
  display: inline-block;
  animation: rb-spin 1.2s linear infinite;
  color: #9fefff;
}

.rb-ad-popup {
  position: absolute;
  inset: 0;
  z-index: 56;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(4px);
}

.rb-ad-popup-card {
  width: min(330px, 100%);
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  text-align: center;
}

.rb-ad-popup-link {
  display: block;
  text-decoration: none;
}

.rb-ad-popup-visual {
  position: relative;
  height: 168px;
  border-radius: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.rb-ad-popup-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(230px, 82%);
  height: auto;
  animation: rb-logo-pulse 1.6s ease-in-out infinite;
}

.rb-spark {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f8f8f8;
  box-shadow: 0 0 9px rgba(255, 255, 255, 0.95);
  animation: rb-sparkle 1.3s ease-in-out infinite;
}

.rb-spark.s1 {
  top: 18%;
  left: 16%;
  animation-delay: 0s;
}

.rb-spark.s2 {
  top: 26%;
  right: 18%;
  animation-delay: 0.22s;
}

.rb-spark.s3 {
  bottom: 20%;
  left: 24%;
  animation-delay: 0.38s;
}

.rb-spark.s4 {
  bottom: 26%;
  right: 20%;
  animation-delay: 0.55s;
}

.rb-spark.s5 {
  top: 48%;
  left: 50%;
  animation-delay: 0.72s;
}

.rb-ad-popup-text {
  margin: 12px 0 0;
  font-size: 13px;
  color: #cfcfcf;
}

.rb-ad-popup-disclosure {
  margin: 8px 0 0;
  font-size: 11px;
  color: #a8a8a8;
  line-height: 1.4;
}

#btn-ad-rebirth {
  margin-top: 12px;
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #414141;
  background: linear-gradient(180deg, #1a1a1a, #0e0e0e);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.rb-loading {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.rb-loading-card {
  width: min(290px, 100%);
  border: 1px solid #2b2b2b;
  border-radius: 14px;
  background: linear-gradient(180deg, #121212, #0a0a0a);
  text-align: center;
  padding: 18px 14px;
}

.rb-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid #2f2f2f;
  border-top-color: #a5efff;
  display: block;
  animation: rb-spin 0.9s linear infinite;
}

.rb-loading-title {
  margin: 12px 0 0;
  font-size: 16px;
  font-weight: 700;
}

.rb-loading-sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: #bdbdbd;
}

@keyframes rb-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rb-question-pulse {
  0%, 100% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.12);
  }
}

@keyframes rb-logo-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.22));
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
    filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.46));
  }
}

@keyframes rb-sparkle {
  0%, 100% {
    opacity: 0.25;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.35);
  }
}

.rb-meta {
  font-size: 12px;
  color: var(--accent);
}

.rb-ad-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 24;
  height: calc(var(--ad-bar-height) + env(safe-area-inset-bottom) + var(--ad-bottom-pad));
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--ad-bottom-pad));
  border-top: 1px solid #232323;
  background: #ffffff;
}

.rb-legal-footer {
  width: 100%;
  max-width: 430px;
  margin: 0 auto 12px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: #111111;
  color: #d8d8d8;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 1px solid #222222;
}

.rb-legal-footer::-webkit-scrollbar {
  display: none;
}

.legal-link-btn {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: #aeefff;
  text-decoration: none;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}

.rb-legal-label {
  color: #bfbfbf;
}

.rb-dot {
  color: #707070;
}

.legal-modal {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.legal-modal-card {
  width: min(320px, 100%);
  border: 1px solid #333333;
  border-radius: 14px;
  background: #0f0f0f;
  padding: 14px;
  text-align: left;
}

.legal-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.legal-modal-body {
  margin: 9px 0 0;
  font-size: 13px;
  line-height: 1.52;
  color: #d1d1d1;
  white-space: pre-line;
}

#legal-modal-close {
  margin-top: 12px;
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #3a3a3a;
  background: #141414;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.rb-ad-link {
  display: grid;
  grid-template-columns: 30% 70%;
  width: 100%;
  height: var(--ad-bar-height);
}

.rb-ad-link img {
  display: block;
  width: 100%;
  height: 100%;
}

#rb-ad-image {
  object-fit: cover;
}

.rb-ad-logo {
  object-fit: contain;
  padding: 8px 10px;
  background: #ffffff;
  border-right: 1px solid #e6e6e6;
}

@media (min-width: 480px) {
  body {
    padding: 12px 0;
  }

  .rb-app {
    height: min(100dvh - 24px, 900px);
    border-radius: 22px;
    border: 1px solid #1f1f1f;
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55);
  }

  .rb-lang {
    top: 18px;
    right: 14px;
  }
}
