@font-face {
  font-family: 'Hana2-R';
  src: url('https://cdn.jsdelivr.net/gh/fontbee/font@main/Hana/Hana2-R.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Hana2-M';
  src: url('https://cdn.jsdelivr.net/gh/fontbee/font@main/Hana/Hana2-M.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Hana2-B';
  src: url('https://cdn.jsdelivr.net/gh/fontbee/font@main/Hana/Hana2-B.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}

:root {
  --hana-mint: #00a39f;
  --hana-bright: #2dc396;
  --hana-deep: #008485;
  --bg-page: #ffffff;
  --bg-tint: #f2f9f9;
  --card-bg: #ffffff;
  --text: #333333;
  --muted: #7c9992;
  --border: #dbeeec;
  --bezel: #101314;

  --ball-yellow: #ffcc33;
  --ball-blue: #4fc3f7;
  --ball-red: #ff5c6c;
  --ball-gray: #9aa5b8;
  --ball-green: #7bd858;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2f2;
  font-family: 'Hana2-M', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Pretendard, Roboto, sans-serif;
  color: var(--text);
  padding: 24px;
}

/* ---------- iPhone frame ---------- */

.phone-shell {
  position: relative;
  width: 393px;
  aspect-ratio: 393 / 852;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  background: var(--bezel);
  border-radius: 54px;
  padding: 11px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.25),
    0 0 0 2px rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 43px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 20% 10%, rgba(0, 163, 159, 0.08), transparent 45%),
    radial-gradient(circle at 90% 75%, rgba(45, 195, 150, 0.06), transparent 50%),
    repeating-linear-gradient(0deg, rgba(0, 163, 159, 0.05) 0px, rgba(0, 163, 159, 0.05) 1px, transparent 1px, transparent 36px),
    repeating-linear-gradient(90deg, rgba(0, 163, 159, 0.05) 0px, rgba(0, 163, 159, 0.05) 1px, transparent 1px, transparent 36px),
    linear-gradient(180deg, var(--bg-tint), var(--bg-page));
}

.skyline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.skyline::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 163, 159, 0.10), rgba(0, 163, 159, 0.10)),
    repeating-linear-gradient(
      90deg,
      #d9efec 0px, #d9efec 22px,
      transparent 22px, transparent 27px
    );
  clip-path: polygon(
    0 100%, 0 60%, 5% 60%, 5% 35%, 10% 35%, 10% 65%, 15% 65%, 15% 25%,
    21% 25%, 21% 70%, 26% 70%, 26% 45%, 32% 45%, 32% 75%, 38% 75%,
    38% 15%, 44% 15%, 44% 55%, 50% 55%, 50% 80%, 56% 80%, 56% 30%,
    62% 30%, 62% 65%, 68% 65%, 68% 40%, 74% 40%, 74% 72%, 80% 72%,
    80% 20%, 86% 20%, 86% 60%, 91% 60%, 91% 50%, 96% 50%, 96% 76%,
    100% 76%, 100% 100%
  );
}

.dynamic-island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 28px;
  background: #000;
  border-radius: 16px;
  z-index: 6;
}

.status-bar {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 26px 2px;
  font-family: 'Hana2-B', -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
}

.nav-bar {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 8px 16px 6px;
  flex-shrink: 0;
}

.nav-title {
  font-family: 'Hana2-B', -apple-system, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text);
}

.app-content {
  position: relative;
  z-index: 3;
  flex: 1;
  overflow-y: auto;
  padding: 12px 22px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

h1 {
  margin: 0 0 6px;
  font-family: 'Hana2-B', -apple-system, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--hana-mint);
}

.subtitle {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.date-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.date-label {
  font-family: 'Hana2-B', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.date-field input[type="date"] {
  font-family: 'Hana2-M', -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  color-scheme: light;
}

.draw-date-display {
  align-self: flex-start;
  margin-top: 22px;
  margin-bottom: -4px;
  font-family: 'Hana2-B', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--hana-deep);
}

#generate-btn {
  width: 100%;
  padding: 14px 20px;
  font-family: 'Hana2-B', -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--hana-bright), var(--hana-mint));
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 163, 159, 0.30);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

#generate-btn:active {
  transform: scale(0.97);
  box-shadow: 0 4px 14px rgba(0, 163, 159, 0.25);
}

.result {
  margin-top: 22px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.set-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 163, 159, 0.06);
}

.set-label {
  width: 18px;
  font-weight: 800;
  color: var(--hana-deep);
  font-size: 13px;
  font-family: "SF Mono", "Consolas", monospace;
  flex-shrink: 0;
}

.auto-tag {
  flex-shrink: 0;
  font-family: 'Hana2-B', -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--hana-deep);
  border: 1px solid var(--border);
  background: var(--bg-tint);
  border-radius: 999px;
  padding: 3px 8px;
}

.balls {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.ball {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #0a0f1c;
  flex-shrink: 0;
  box-shadow:
    inset 0 -3px 4px rgba(0, 0, 0, 0.2),
    inset 0 2px 2px rgba(255, 255, 255, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.12);
}

.ball.yellow { background: var(--ball-yellow); }
.ball.blue { background: var(--ball-blue); }
.ball.red { background: var(--ball-red); }
.ball.gray { background: var(--ball-gray); }
.ball.green { background: var(--ball-green); }

.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.6);
  z-index: 6;
}
