/* ===================== BASE ===================== */
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background-color: #0b0207;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  font-family: 'Prompt', sans-serif;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 420px;
  max-width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: #12040a;
}

/* ===================== BACKGROUND ===================== */
.background_img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  object-fit: cover;
  pointer-events: none;
}

/* ไล่เงาขอบบน-ล่าง ให้ตัวหนังสืออ่านง่ายขึ้น */
.bg_vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 22%,
                            rgba(0,0,0,0) 70%, rgba(8,1,4,.85) 100%),
    radial-gradient(120% 60% at 50% 0%, rgba(255,140,40,.16) 0%, rgba(255,140,40,0) 60%);
}

/* ลำแสงทองเรืองหลังตัวละคร */
.bg_spotlight {
  position: absolute;
  top: 34%;
  left: 50%;
  width: 130%;
  height: 46%;
  transform: translateX(-50%);
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%,
              rgba(255, 190, 60, .30) 0%, rgba(255, 150, 30, 0) 70%);
  animation: spotlightPulse 6s ease-in-out infinite;
}

@keyframes spotlightPulse {
  0%, 100% { opacity: .7; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;  transform: translateX(-50%) scale(1.08); }
}

/* ===================== CONTENT ===================== */
.content {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0 26px;
  box-sizing: border-box;
}

/* ===================== LOGO ===================== */
.logo_top {
  width: 40%;
  margin-bottom: 16px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .7))
          drop-shadow(0 0 26px rgba(255, 175, 40, .45));
  animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0)    scale(1); }
  50%      { transform: translateY(-6px) scale(1.02); }
}

/* ===================== ACTION BUTTONS ===================== */
.action_container {
  display: flex;
  width: 94%;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.pill_btn {
  flex: 1 1 0;
  min-width: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  height: clamp(42px, 11.5vw, 50px);
  padding: 0 10px;
  box-sizing: border-box;

  border-radius: 999px;
  border: 3px solid transparent;
  background-origin: border-box;
  background-clip: padding-box, border-box;

  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;

  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .6),
    0 6px 18px rgba(0, 0, 0, .6),
    inset 0 2px 5px rgba(255, 255, 255, .3),
    inset 0 -4px 10px rgba(0, 0, 0, .35);

  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

/* ขอบทองไล่เฉด (ใช้ 2 ชั้น: พื้นปุ่ม + ขอบ) */
.pill_btn--enter {
  background-image:
    linear-gradient(180deg, #2fd07e 0%, #12a35c 45%, #0a6b4a 100%),
    linear-gradient(180deg, #FFF0B0 0%, #FFC53D 45%, #B87A12 100%);
}

.pill_btn--register {
  background-image:
    linear-gradient(180deg, #ff5f6d 0%, #e01030 48%, #8e0018 100%),
    linear-gradient(180deg, #FFF0B0 0%, #FFC53D 45%, #B87A12 100%);
  animation: btnPulse 2s ease-in-out infinite;
}

.pill_btn:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.1);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .6),
    0 10px 26px rgba(0, 0, 0, .6),
    0 0 28px rgba(255, 190, 60, .6),
    inset 0 2px 6px rgba(255, 255, 255, .45);
}

.pill_btn:active { transform: translateY(0) scale(.97); }

@keyframes btnPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.035); }
}

.pill_btn_icon {
  font-size: clamp(16px, 4.6vw, 20px);
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5));
}

.pill_btn_text {
  font-family: 'Prompt', sans-serif;
  font-weight: 800;
  font-size: clamp(14px, 4.4vw, 19px);
  line-height: 1;
  white-space: nowrap;

  color: #ffffff;
  text-shadow:
    -1.5px -1.5px 0 #4a0010,
     1.5px -1.5px 0 #4a0010,
    -1.5px  1.5px 0 #4a0010,
     1.5px  1.5px 0 #4a0010,
     0 2px 4px rgba(0, 0, 0, .6);
}

.pill_btn--enter .pill_btn_text {
  text-shadow:
    -1.5px -1.5px 0 #03301f,
     1.5px -1.5px 0 #03301f,
    -1.5px  1.5px 0 #03301f,
     1.5px  1.5px 0 #03301f,
     0 2px 4px rgba(0, 0, 0, .6);
}

/* แสงวิ่งบนปุ่ม */
.pill_btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -160%;
  width: 160%;
  height: 100%;

  background: linear-gradient(
      120deg,
      transparent 0%,
      rgba(255, 255, 255, .55) 50%,
      transparent 100%
  );

  filter: blur(10px);
  transform: skewX(-25deg);
  animation: shineSweep 2.6s linear infinite;

  z-index: 2;
  pointer-events: none;
}

@keyframes shineSweep {
  0%   { left: -160%; }
  60%  { left: 160%; }
  100% { left: 160%; }
}

/* ===================== CHARACTER ===================== */
.character_img {
  width: 95%;
  margin-top: -36px;
  margin-bottom: -38px;
  animation: floatGlow 4s ease-in-out infinite;
}

@keyframes floatGlow {
  0%, 100% {
    transform: translateY(0);
    filter: drop-shadow(0 14px 26px rgba(0, 0, 0, .6));
  }
  50% {
    transform: translateY(10px);
    filter: drop-shadow(0 10px 32px rgba(255, 190, 70, .5));
  }
}

/* ===================== FOOTER ===================== */
.footer_container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 90%;
  margin-top: 6px;
}

.footer_app {
  width: 57%;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6));
}

/* ===================== FLOATING LINE BUTTON ===================== */
.line_float_layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.line_float_band {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.line_float_btn {
  position: absolute;
  right: 12px;
  bottom: 18px;

  width: 86px;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;

  pointer-events: auto;
  cursor: pointer;
  text-decoration: none;

  animation: lineFloatBob 2.8s ease-in-out infinite;
  transition: transform .25s ease;
}

.line_float_btn:hover  { transform: scale(1.07); }
.line_float_btn:active { transform: scale(0.94); }

/* ไอคอน LINE */
.line_badge {
  position: relative;
  z-index: 2;

  width: 62px;
  height: 62px;
  box-sizing: border-box;
  border-radius: 24%;

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

  /* สีเดียวกับไอคอน จะได้ไม่เห็นรอยต่อตรงมุมโค้ง */
  background: #06C755;
  border: 3px solid #FFD24A;

  box-shadow:
    0 0 18px rgba(6, 199, 85, .65),
    0 6px 14px rgba(0, 0, 0, .55);
}

.line_badge_icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ป้ายข้อความ */
.line_label {
  position: relative;
  z-index: 2;

  padding: 3px 9px;
  border-radius: 999px;

  background: linear-gradient(180deg, #6bec7f 0%, #06C755 60%, #037a3b 100%);
  border: 2px solid #FFD24A;

  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;

  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55);

  box-shadow: 0 4px 10px rgba(0, 0, 0, .5);
}

.line_float_pulse {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 12px;
  width: 62px;
  height: 62px;
  border-radius: 24%;
  background: rgba(6, 199, 85, .55);
  animation: lineFloatPulse 2.2s ease-out infinite;
}

.line_float_pulse--2 { animation-delay: 1.1s; }

@keyframes lineFloatBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

@keyframes lineFloatPulse {
  0%   { transform: scale(1);   opacity: .6; }
  100% { transform: scale(1.7); opacity: 0;  }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 360px) {
  .pill_btn       { gap: 4px; padding: 0 8px; border-width: 2px; }
  .line_float_btn { width: 74px; right: 8px; bottom: 12px; }
  .line_badge     { width: 54px; height: 54px; }
  .line_float_pulse { width: 54px; height: 54px; left: 10px; top: 0; }
  .line_label     { font-size: 10px; padding: 2px 7px; }
}
