﻿:root {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #22c55e;
  --accent-2: #16a34a;
  --ball: #1f2937;
  --ball-border: #374151;
  --ring: rgba(34, 197, 94, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: "Pretendard", "Noto Sans KR", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #1e293b 0%, var(--bg) 55%);
  color: var(--text);
}

.app {
  width: min(920px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 28px;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.03);
  backdrop-filter: blur(6px);
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 20px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.04s ease, filter 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

button:active { transform: translateY(1px); }

button:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.primary {
  background: var(--accent);
  color: #052e16;
}

.primary:hover { filter: brightness(1.05); }

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
}

.ghost:hover { background: rgba(255,255,255,0.04); }

.numbers-wrap {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 18px;
}

.label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-height: 62px;
}

.ball {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  background: var(--ball);
  border: 1px solid var(--ball-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  user-select: none;
}

.ball[data-range="1"] { background: #f59e0b; border-color: #fbbf24; color: #1f2937; }
.ball[data-range="2"] { background: #3b82f6; border-color: #60a5fa; }
.ball[data-range="3"] { background: #ef4444; border-color: #f87171; }
.ball[data-range="4"] { background: #10b981; border-color: #34d399; color: #064e3b; }
.ball[data-range="5"] { background: #8b5cf6; border-color: #a78bfa; }

.ball.bonus {
  outline: 3px solid rgba(255,255,255,0.2);
  position: relative;
}

.plus {
  font-weight: 900;
  opacity: 0.7;
  padding: 0 4px;
}

.meta {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.shortcuts {
  color: var(--muted);
  font-size: 12px;
  opacity: 0.9;
}

.history {
  margin-top: 20px;
}

.history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 10px;
}

.history h2 {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  font-weight: 700;
}

.history-meta {
  color: var(--muted);
  font-size: 12px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text);
}

.history-item .tag {
  color: var(--muted);
  margin-right: 4px;
  min-width: 44px;
}

footer {
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(17, 24, 39, 0.96);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.noscript {
  position: fixed;
  inset: auto 12px 12px;
  background: #7f1d1d;
  color: #fee2e2;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  font-size: 13px;
}

@media (max-width: 720px) {
  .app { padding: 22px; }
  .shortcuts { width: 100%; }
}

@media (max-width: 520px) {
  body { padding: 16px; }
  .ball {
    width: 50px;
    height: 50px;
    font-size: 18px;
  }
}
