:root {
  color-scheme: light;
}

* {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  box-sizing: border-box;
  vertical-align: top;
  -webkit-text-size-adjust: none;
}

html {
  font-size: 18px;
}

body {
  font-family: "Roboto", "Noto Sans KR", sans-serif;
  background-color: #f4f7f6;
  color: #333;
}

.container {
  width: 78%;
  margin: 20px auto;
  border-radius: 20px;
}

.header {
  text-align: center;
  margin-bottom: 40px;
}

.header h1 {
  color: #333;
  font-size: 2.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
  color: #666;
  font-size: 1.2em;
}

.lotto-section {
  width: 99%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 40px;
}

.generator-box {
  width: 100%;
  margin: 0 auto;
  background: linear-gradient(45deg, #1a237e, #0d47a1);
  border: 2px solid #ffd700;
  padding: 0 10px;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  h2 {
    margin: 5px 0;
    font-size: 50px;
    color: #feca57;
  }
}

.stats-box {
  width: 100%;
  margin: 0 auto;
  background: linear-gradient(45deg, #1a237e, #283593);
  border-radius: 15px;
  padding: 20px;
  color: white;
  box-shadow: 0 10px 25px rgba(26, 35, 126, 0.2);
}

.number-display {
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 35px 0;
  flex-wrap: wrap;
}

.lotto-ball {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 28px;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  animation: bounce 0.6s ease-in-out;
}

.ball-1 {
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
}
.ball-2 {
  background: linear-gradient(45deg, #feca57, #ff9ff3);
}
.ball-3 {
  background: linear-gradient(45deg, #48cae4, #0077b6);
}
.ball-4 {
  background: linear-gradient(45deg, #06ffa5, #00d2d3);
}
.ball-5 {
  background: linear-gradient(45deg, #ff9ff3, #f368e0);
}
.ball-6 {
  background: linear-gradient(45deg, #ff6348, #ff4757);
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.number-btn {
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(4, 1fr);
}

.btn {
  background: linear-gradient(45deg, #ffd700, #ffa500);
  color: #1a237e;
  border: none;
  padding: 12px 15px;
  border-radius: 15px;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 20px 6px 5px;
  white-space: nowrap;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover,
.btn1:hover {
  background: linear-gradient(45deg, #ffa500, #ff8c00);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active,
.btn1:active {
  transform: translateY(0);
}

.latest-draw-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  font-size: 20px;
  margin: 20px 0;
}

.stats-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.stat-item {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 10px;
  text-align: center;
}

.stat-number {
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9em;
  opacity: 0.8;
}

.analysis-section {
  width: 100%;
  background: #f8f9fa;
  border-radius: 15px;
  margin-top: 30px;
}

.chart-container {
  width: 100%;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 20px 15px 35px;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.frequency-bar {
  display: flex;
  align-items: center;
  margin: 8px 0;
}

.number-label {
  width: 30px;
  text-align: center;
  font-weight: bold;
}

.frequency-text {
  font-size: 0.9em;
  color: #666;
}

.analysis-grid {
  width: 95%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.analysis-item {
  width: 95%;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  text-align: center;
}

.analysis-item h3 {
  margin-bottom: 30px;
  color: #333;
  font-size: 24px;
}

.number-list {
  width: 65%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.number-api {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  box-shadow: 0 4px 8px rgba(255, 255, 255, 0.3);
  border-radius: 15px;
}

.number-tag {
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.sum-chart {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sum-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sum-label {
  width: 80px;
  font-size: 0.9em;
  font-weight: bold;
}

.sum-progress {
  flex: 1;
  height: 20px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  overflow: hidden;
}

.sum-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.sum-count {
  width: 100%;
  font-size: 0.9em;
  font-weight: bold;
  color: #333;
}

.data-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.data-input h3 {
  color: #333;
  margin-bottom: 15px;
}

.data-input input {
  width: 200px;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 10px;
  margin-right: 10px;
  font-size: 14px;
}

.data-input button {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
}

.data-input button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#frequencyChart.simple-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 5px;
  padding: 7px;
}

.frequency-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px 0;
}

.number-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 25px;
}

.bonus-wrapper {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.frequency-text {
  margin-top: 15px;
  font-size: 16px;
  color: #555;
  font-weight: 600;
}

.ball-10 {
  background-color: #fbc400;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
} /* 1~10 */
.ball-20 {
  background-color: #69c8f2;
} /* 11~20 */
.ball-30 {
  background-color: #ff7272;
} /* 21~30 */
.ball-40 {
  background-color: #aaa;
} /* 31~40 */
.ball-50 {
  background-color: #b0d840;
} /* 41~45 */

/* 모달 배경 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
/* 모달창 */
.modal-content {
  background: white;
  margin-top: 130px;
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
#modalMessage {
  margin: 20px auto 10px;
  color: #666;
  font-size: 20px;
  font-weight: bold;
  line-height: 2rem;
}

.btn1 {
  background: linear-gradient(45deg, #1a237e, #0d47a1);
  color: #fff;
  border: none;
  padding: 10px 17px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 10px 0;
}

/* 후원 카카오페이 송금 */

.pc-wing-banner {
  display: block;
  position: fixed;
  top: 125px;
  right: 5px;
  width: 200px;
  background: #fff;
  padding: 20px 15px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  border: 2px solid #f0f0f0;
  z-index: 100;
}

/* PC용 내용물 스타일 */
.pc-wing-banner h3 {
  text-align: center;
  font-size: 18px;
  margin: 0 0 10px;
  color: #333;
}
.wing-msg {
  font-size: 13px;
  color: #666;
  margin-bottom: 15px;
  line-height: 1.4;
}
.qr-box img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #eee;
}
.qr-box p {
  font-size: 12px;
  color: #999;
  margin: 5px 0 10px 0;
}
.wing-bank {
  font-size: 12px;
  background: #f8f9fa;
  padding: 8px;
  line-height: 1.5em;
  border-radius: 6px;
  margin-bottom: 10px;
  color: #555;
}
.btn-close {
  background: none;
  border: none;
  font-size: 13px;
  color: #aaa;
  cursor: pointer;
  text-decoration: underline;
}

/* 모바일용 박스: PC에서는 숨김 (display: none) */
.mobile-donation {
  display: none;
}

/* ******************************************************* */

@media (max-width: 1900px) {
  .header h1 {
    margin: 50px auto 5px;
  }

  .lotto-section {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  /* 2. 혹시 모르니 박스 너비 꽉 차게 */
  .generator-box,
  .stats-box,
  .chart-container {
    width: 90%;
    margin: 20px auto;
  }

  .generator-box {
    width: 90%;

    h2 {
      margin: 25px 0 10px;
      font-size: 50px;
      color: #feca57;
    }
  }

  .latest-draw-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-size: 28px;
    margin: 20px 0;
  }

  .lotto-ball {
    width: 100px;
    height: 100px;
    font-size: 40px;
  }

  number-list {
    width: 80%;
  }

  .number-btn {
    width: 100%;
    margin: 20px auto;
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(4, 1fr);
  }
}

/**************************************************************************************/
@media (max-width: 768px) {
  .container {
    width: 95%;
    margin: 30px auto;
  }

  .header {
    text-align: center;
    margin-bottom: 30px;
  }

  .header h1 {
    color: #333;
    font-size: 1.7em;
    margin-bottom: 10px;
  }

  .lotto-section {
    width: 100%;
    margin: 30px auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .generator-box {
    width: 100%;
    border-radius: 15px;
    padding: 20px 0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    h2 {
      font-size: 32px;
    }
  }

  .number-display {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 30px 0;
    flex-wrap: wrap;
  }

  .lotto-ball {
    width: 47px;
    height: 47px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 21px;
  }

  .number-btn {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn {
    padding: 7px 9px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px 7px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }

  .latest-draw-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-size: 26px;
    margin: 20px 0;
  }

  .stats-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin: 20px 0;
  }

  .stat-item {
    width: 100%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
  }

  .stat-number {
    font-size: 25px;
    font-weight: bold;
    margin-bottom: 5px;
  }

  .stat-label {
    font-size: 18px;
    opacity: 0.8;
  }

  .chart-container {
    width: 100%;
    border-radius: 5px;
    padding: 10px 15px;
    margin: 15px 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

    p {
      margin-bottom: 15px;
      color: #555;
      line-height: 1.6rem;
      font-size: 15px;
    }
  }

  .analysis-section {
    width: 100%;
    border-radius: 15px;
    padding: 5px;
    margin-top: 20px;
  }

  .analysis-grid {
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 20px 0;
  }

  .analysis-item h3 {
    margin-bottom: 30px;
    color: #333;
    font-size: 22px;
    font-weight: 800;
  }

  #frequencyChart.simple-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 1px;
    padding: 1px;
    border-radius: 1px;
  }

  .number-api {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
  }

  .stats-box {
    width: 100%;
    border-radius: 15px;
    padding: 3px;
    color: white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);

    h2 {
      margin: 10px;
    }
  }

  .number-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 16px;
  }

  /* 모달 배경 */
  .modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
  }

  /* 모달창 */
  .modal-content {
    background: white;
    padding: 20px 20px 10px;
    border-radius: 15px;
    text-align: center;
    width: 100%;
    max-width: 330px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  }
  #modalMessage {
    margin: 15px auto 5px;
    color: #555;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.8rem;
  }

  .btn1 {
    background: linear-gradient(45deg, #1a237e, #0d47a1);
    color: #fff;
    border: none;
    padding: 7px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px 0;
  }

  /* 후원 카카오페이 송금 */
  .pc-wing-banner {
    display: none;
  }

  .mobile-donation {
    display: block;
    width: 95%;
    margin: 30px auto;
    padding: 30px 20px;
    background: #ffffff;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
  }

  .mobile-donation h2 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
  }
  .mobile-donation .message {
    margin-bottom: 25px;
    line-height: 1.6;
    color: #666;
    font-size: 15px;
  }
  .mobile-donation .highlight {
    color: #ff9f43;
    font-weight: bold;
  }

  .btn-kakao-mobile {
    display: block;
    width: 100%;
    padding: 15px 0;
    background-color: #f7e600;
    color: #3a1d1d;
    font-weight: bold;
    text-decoration: none;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(247, 230, 0, 0.3);
  }

  .bank-info {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
  }
}
