:root {
  --primary-yellow: #fcd535;
  --header-yellow: #fcd535;
  --bg-color: #f4f6f8;
  --card-bg: #ffffff;
  --text-main: #212529;
  --text-muted: #868e96;
  --border-light: #edf2f7;

  --ball-yellow: #fbc400;
  --ball-blue: #69c8f2;
  --ball-red: #ff7272;
  --ball-gray: #aaaaaa;
  --ball-green: #b0d840;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Pretendard', 'Apple SD Gothic Neo',
    sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #e9ecef;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* =========================================
   🕊️ 스플래시(Splash) 화면 & 로고 스타일
========================================= */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #fffef5 0%, #fcd535 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition:
    opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.5s;
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  text-align: center;
  animation: splashPop 0.8s cubic-bezier(0.34, 1.4, 0.64, 1);
  padding: 0 20px;
}

@keyframes splashPop {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.splash-logo-wrap {
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-logo-img {
  width: 160px; /* 원하는 크기로 조절 (140px ~ 180px 추천) */
  height: auto;
  max-width: 80vw; /* 모바일 화면 폭을 넘지 않도록 안전장치 */
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.15));
}

.splash-fallback-logo {
  font-size: 60px;
}

.splash-title {
  font-size: 26px;
  font-weight: 900;
  color: #1f2421;
  letter-spacing: 1.2px;
}

.splash-sub {
  font-size: 13px;
  color: #5c4d1f;
  margin-top: 6px;
  margin-bottom: 24px;
  font-weight: 600;
}

.splash-loading-bar {
  width: 140px;
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  margin: 0 auto 20px;
  overflow: hidden;
}

.splash-loading-progress {
  width: 0%;
  height: 100%;
  background: #1f2421;
  border-radius: 4px;
  animation: splashLoad 1.4s ease-out forwards;
}

@keyframes splashLoad {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

.splash-verse {
  display: block;
  font-size: 11.5px;
  color: #796826;
  font-style: italic;
}

/* =========================================
   메인 모바일 프레임
========================================= */
.mobile-wrapper {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  overflow-x: hidden;
}

.app-header {
  background-color: var(--header-yellow);
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header.center-header {
  justify-content: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.header-title {
  font-size: 17px;
  font-weight: 900;
  color: #1f2421;
  letter-spacing: 0.5px;
}

.daily-verse-banner {
  background: #fffdf5;
  border-bottom: 1px solid #ffec99;
  padding: 8px 16px;
  font-size: 11.5px;
  color: #795548;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.verse-content {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
}

.verse-tag {
  font-weight: 700;
  color: #e67700;
  white-space: nowrap;
}

.app-content {
  padding: 14px 16px 90px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 18px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.winner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.draw-round {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.draw-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.draw-prize {
  text-align: right;
}

.prize-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.prize-main {
  font-size: 13px;
  font-weight: 700;
  color: #e03131;
}

.nav-arrow {
  background: #f8f9fa;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  color: #495057;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.sub-action-btn {
  background: #f1f3f5;
  border: none;
  border-radius: 12px;
  padding: 11px;
  font-size: 13px;
  font-weight: 700;
  color: #495057;
  cursor: pointer;
  transition: background 0.15s;
}

.sub-action-btn.highlight {
  background: #fff3bf;
  color: #d9480f;
}

.sub-action-btn:active {
  transform: scale(0.98);
}

.balls-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.balls-row.center {
  justify-content: center;
}

.lotto-ball {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: white;
  box-shadow:
    inset -2px -2px 4px rgba(0, 0, 0, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

.lotto-ball.sm {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

.plus-sign {
  font-size: 14px;
  font-weight: 800;
  color: #adb5bd;
  margin: 0 1px;
}

.c-yellow {
  background-color: var(--ball-yellow);
  color: #343a40;
}
.c-blue {
  background-color: var(--ball-blue);
}
.c-red {
  background-color: var(--ball-red);
}
.c-gray {
  background-color: var(--ball-gray);
}
.c-green {
  background-color: var(--ball-green);
}

.result-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.badge-tag {
  font-size: 11px;
  font-weight: 700;
  color: #2b8a3e;
  background: #ebfbee;
  padding: 3px 8px;
  border-radius: 6px;
}

.combinations-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.combo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #f8f9fa;
  border-radius: 12px;
}

.combo-label {
  font-size: 12px;
  font-weight: 700;
  color: #495057;
  min-width: 42px;
}

.rolling {
  animation: spin 0.08s infinite linear;
  filter: blur(0.6px);
  transform: scale(0.92);
}

@keyframes spin {
  0% {
    transform: translateY(-3px);
  }
  50% {
    transform: translateY(3px);
  }
  100% {
    transform: translateY(-3px);
  }
}

.pop-in {
  animation: pop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  background: var(--card-bg);
  padding: 14px 16px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: background 0.15s;
}

.menu-item:active {
  background: #f8f9fa;
}

.menu-icon {
  font-size: 20px;
  color: #f59f00;
  margin-right: 12px;
}

.menu-text {
  font-size: 14px;
  font-weight: 700;
  color: #343a40;
  flex: 1;
}

.menu-arrow {
  color: #adb5bd;
  font-size: 18px;
}

.bottom-action-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
  border-top: 1px solid #e9ecef;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
  z-index: 100;
}

.btn-secondary,
.btn-primary {
  border: none;
  border-radius: 14px;
  padding: 14px 0;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.btn-secondary {
  background: #e9ecef;
  color: #495057;
}
.btn-primary {
  background: var(--primary-yellow);
  color: #1f2421;
  box-shadow: 0 4px 10px rgba(252, 213, 53, 0.4);
}

.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  justify-content: center;
  align-items: flex-end;
}

.modal-backdrop.show {
  display: flex;
}

.modal-content {
  background: #ffffff;
  width: 100%;
  max-width: 440px;
  border-radius: 24px 24px 0 0;
  padding: 20px 20px 30px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.25s ease-out;
  max-height: 85vh;
  overflow-y: auto;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #868e96;
  cursor: pointer;
}

.modal-guide {
  background: #fff9db;
  border: 1px solid #ffe066;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: #d9480f;
  margin-bottom: 16px;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.grid-ball {
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f1f3f5;
  border: 1px solid #dee2e6;
  color: #495057;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s ease;
}

.grid-ball.excluded {
  background: #ff6b6b;
  border-color: #fa5252;
  color: #ffffff;
}

.modal-selected-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #495057;
  margin-bottom: 16px;
}

.reset-filter-btn {
  background: none;
  border: none;
  color: #868e96;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.modal-apply-btn {
  width: 100%;
  background: var(--primary-yellow);
  border: none;
  border-radius: 14px;
  padding: 15px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.lucky-popup-backdrop {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0);
  backdrop-filter: blur(0px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    backdrop-filter 0.35s ease;
}

.lucky-popup-backdrop.show {
  opacity: 1;
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
}

.lucky-card {
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  border-radius: 28px;
  padding: 26px 20px 22px;
  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(251, 196, 0, 0.4),
    0 0 30px rgba(252, 213, 53, 0.2);
  text-align: center;
  position: relative;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.38s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.lucky-popup-backdrop.show .lucky-card {
  transform: translateY(0) scale(1);
}

.lucky-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f8f9fa;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #adb5bd;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lucky-close-btn:hover {
  color: #495057;
  background: #e9ecef;
}

.lucky-icon-badge {
  width: 54px;
  height: 54px;
  background: #fff9db;
  font-size: 28px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(250, 176, 5, 0.2);
  animation: gentlePulse 2.2s infinite ease-in-out;
}

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

.lucky-title {
  font-size: 18px;
  font-weight: 800;
  color: #212529;
}

.bible-verse-box {
  background: #f8f9fa;
  border-left: 3.5px solid var(--primary-yellow);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0 20px;
  text-align: left;
}

.bible-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: #495057;
  font-style: italic;
}

.bible-ref {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #868e96;
  text-align: right;
  margin-top: 6px;
}

.lucky-balls-container {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 22px;
}

.lucky-balls-container .lotto-ball {
  width: 38px;
  height: 38px;
  font-size: 14px;
}

.lucky-btn-group {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
}

.lucky-card-btn {
  border: none;
  border-radius: 14px;
  padding: 13px 0;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.lucky-card-btn.primary {
  background: var(--primary-yellow);
  color: #1f2421;
  box-shadow: 0 4px 12px rgba(252, 213, 53, 0.4);
}

.lucky-card-btn.secondary {
  background: #f1f3f5;
  color: #495057;
}

.lucky-card-btn:active {
  transform: scale(0.97);
}

.period-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.tab-btn {
  background: #f1f3f5;
  border: none;
  border-radius: 10px;
  padding: 9px 4px;
  font-size: 12px;
  font-weight: 700;
  color: #495057;
  cursor: pointer;
}

.tab-btn.active {
  background: #212529;
  color: #ffffff;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
}

.history-item {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-round {
  font-size: 13px;
  font-weight: 800;
  color: #343a40;
}

.history-date {
  font-size: 11px;
  color: #868e96;
}

.map-guide-text {
  font-size: 13px;
  color: #495057;
  margin-bottom: 18px;
}

.map-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.map-choice-btn:active {
  background: #f8f9fa;
  transform: scale(0.99);
}

.map-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
}

.naver-badge {
  background: #03cf5d;
  color: white;
}
.google-badge {
  background: #4285f4;
  color: white;
}

.map-btn-texts strong {
  display: block;
  font-size: 14px;
  color: #212529;
}

.map-btn-texts small {
  font-size: 12px;
  color: #868e96;
}
