*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans Thai", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #2d1c5a 0, #120a2a 45%, #070213 100%);
  color: #f7f2ff;
}

.app-container {
  max-width: 460px;
  margin: 0 auto;
  padding: 16px 12px 32px;
}

/* HEADER */

.app-header {
  text-align: center;
  padding: 16px 12px 12px;
  border-radius: 24px;
  border: 1px solid rgba(212, 175, 55, 0.7);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
  background: radial-gradient(circle at top, #2d1c5a 0, #120a2a 50%, #0a0318 100%);
  margin-bottom: 12px;
}

.logo-placeholder {
  width: 120px;
  height: 120px;
  margin: 0 auto 8px;
  border-radius: 50%;
  border: 2px dashed rgba(212, 175, 55, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: rgba(247, 226, 164, 0.7);
}

/* ถ้าใส่ <img> โลโก้ จะเต็มพื้นที่นี้ */
.logo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  border: none;
}

.app-title {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fce9a9;
}

.app-subtitle {
  margin: 2px 0 6px;
  font-size: 16px;
  font-weight: 500;
  color: #f6d56a;
}

.app-tagline {
  margin: 0;
  font-size: 11px;
  color: rgba(247, 226, 164, 0.85);
}

/* DATE BAR */

.date-bar {
  margin: 10px auto 14px;
  padding: 8px 12px;
  border-radius: 18px;
  border: 1px solid rgba(212, 175, 55, 0.7);
  background: linear-gradient(90deg, rgba(38, 23, 79, 0.9), rgba(18, 10, 42, 0.9));
  text-align: center;
  font-size: 13px;
  color: #fce9a9;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.6);
}

/* MAIN */

.main-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* TIME CARD */

.time-card {
  padding: 10px 10px 12px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.7);
  background: radial-gradient(circle at top left, #26144d 0, #120a2a 50%, #090313 100%);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.7);
}

.special-card {
  border-width: 2px;
  border-color: #f1d27b;
  box-shadow: 0 0 20px rgba(255, 215, 128, 0.35);
}

.time-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.time-card-header h3 {
  margin: 0;
  font-size: 15px;
  color: #f7e8a4;
}

.time-range {
  margin: 0;
  font-size: 11px;
  color: rgba(247, 226, 164, 0.9);
}

/* BUTTON */

.action-button {
  width: 100%;
  margin: 2px 0 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  background: radial-gradient(circle at top, #f7e8a4 0, #e6c65c 45%, #c89a34 100%);
  color: #2a174a;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.7);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.action-button:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
  filter: brightness(0.95);
}

.special-button {
  box-shadow: 0 0 16px rgba(250, 230, 150, 0.8);
}

/* RESULT */

.result {
  margin-top: 4px;
  font-size: 12px;
}

.result-card {
  margin-top: 4px;
  padding: 8px 10px 9px;
  border-radius: 16px;
  border: 1px solid rgba(247, 226, 164, 0.7);
  background: radial-gradient(circle at top, #25164b 0, #120a2a 50%, #070213 100%);
}

.result-title {
  margin: 0 0 4px;
  font-size: 12px;
  color: #fce9a9;
}

.win6-line {
  margin: 2px 0 4px;
  font-size: 13px;
}

.win6-label {
  font-weight: 600;
  color: #f7e8a4;
}

.win6-value {
  font-weight: 700;
  font-size: 18px;
  color: #ffe8a3;
}

.digit-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 3px 0 5px;
}

.digit-pill {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(249, 225, 140, 0.7);
  background: radial-gradient(circle at top, rgba(249, 225, 140, 0.18), transparent 70%);
  font-size: 11px;
  color: #fcefd0;
}

.section-label {
  margin: 2px 0;
  font-weight: 500;
  font-size: 12px;
  color: #fce9a9;
}

.main-secondary-row {
  display: flex;
  gap: 8px;
  margin: 4px 0 6px;
}

.main-secondary-circle {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.circle-label {
  font-size: 11px;
  color: #fce9a9;
}

.circle-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #f1d27b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #ffe8a3;
  box-shadow: 0 0 10px rgba(241, 210, 123, 0.5);
}

.info-line {
  margin: 0;
  font-size: 10px;
  color: rgba(248, 234, 188, 0.9);
}

.info-line span.label {
  font-weight: 500;
}

.info-line.muted {
  color: rgba(244, 230, 189, 0.75);
  margin-top: 1px;
}

/* FOOTER */

.app-footer {
  margin-top: 18px;
  font-size: 10px;
  color: rgba(248, 234, 188, 0.8);
  line-height: 1.5;
  text-align: center;
}

/* MOBILE TWEAKS */

@media (min-width: 520px) {
  .app-container {
    max-width: 520px;
  }
}
