:root {
    --bg-from: #fce4ec;
    --bg-to:   #ede7f6;
    --card-bg: rgba(255, 255, 255, 0.78);
    --card-shadow: rgba(0, 0, 0, 0.10);
    --text: #1a1a2e;
    --subtitle: #aaa;
    --border: rgba(210, 190, 230, 0.7);
    --btn-shadow: rgba(240, 100, 170, 0.4);
    --lucky-color: #c76dbe;
}

body.dark {
    --bg-from: #0f0f1a;
    --bg-to:   #1a0f2e;
    --card-bg: rgba(25, 25, 50, 0.82);
    --card-shadow: rgba(0, 0, 0, 0.5);
    --text: #e8e8f0;
    --subtitle: #666;
    --border: rgba(80, 80, 120, 0.5);
    --btn-shadow: rgba(200, 100, 220, 0.55);
    --lucky-color: #d49ed0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-from), var(--bg-to));
    color: var(--text);
    transition: background 0.4s, color 0.4s;
    padding: 100px 20px 60px;
}

/* ambient orbs */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
    opacity: 0.4;
}
body::before {
    width: 420px; height: 420px;
    top: -120px; left: -120px;
    background: radial-gradient(circle, #f48fb1, transparent 70%);
}
body::after {
    width: 360px; height: 360px;
    bottom: -90px; right: -90px;
    background: radial-gradient(circle, #ce93d8, transparent 70%);
}

/* ── Card ── */
.container {
    position: relative;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 48px 72px 52px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 24px 64px var(--card-shadow);
    z-index: 1;
    overflow: hidden;
}

/* subtle polka-dot texture inside card */
.container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(180,120,220,0.08) 1.5px, transparent 1.5px);
    background-size: 22px 22px;
    pointer-events: none;
}

/* ── Floating deco stars ── */
.deco {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}
.deco span {
    font-size: 18px;
    animation: floatStar 3s ease-in-out infinite;
    display: inline-block;
}
.deco span:nth-child(1) { animation-delay: 0s; }
.deco span:nth-child(2) { animation-delay: 0.4s; }
.deco span:nth-child(3) { animation-delay: 0.8s; }
.deco span:nth-child(4) { animation-delay: 1.2s; }
.deco span:nth-child(5) { animation-delay: 1.6s; }

@keyframes floatStar {
    0%, 100% { transform: translateY(0)   scale(1);    opacity: 0.7; }
    50%       { transform: translateY(-7px) scale(1.15); opacity: 1;   }
}

h1 {
    font-size: 2.1rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f06292, #ba68c8, #7986cb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 0.88rem;
    color: var(--subtitle);
    margin-bottom: 36px;
    letter-spacing: 0.5px;
}

/* ── Lucky message ── */
.lucky-msg {
    min-height: 24px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--lucky-color);
    margin-bottom: 20px;
    letter-spacing: 0.3px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.lucky-msg.show {
    opacity: 1;
    transform: translateY(0);
}

/* ── Balls ── */
.lotto-numbers {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    min-height: 68px;
    align-items: center;
}

.lotto-number {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 19px;
    font-weight: 800;
    opacity: 0;
    cursor: default;
    box-shadow: 0 6px 18px rgba(0,0,0,0.22), inset 0 -4px 8px rgba(0,0,0,0.18);
    animation: popIn 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* shine */
.lotto-number::after {
    content: '';
    position: absolute;
    top: 9px; left: 13px;
    width: 15px; height: 9px;
    background: rgba(255,255,255,0.55);
    border-radius: 50%;
    transform: rotate(-30deg);
    pointer-events: none;
}

/* wiggle on hover (after reveal) */
.lotto-number.revealed:hover {
    animation: wiggle 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg)  scale(1);    }
    20%       { transform: rotate(-10deg) scale(1.08); }
    40%       { transform: rotate(10deg)  scale(1.08); }
    60%       { transform: rotate(-6deg)  scale(1.04); }
    80%       { transform: rotate(6deg)   scale(1.04); }
}

/* number range colors */
.ball-yellow { background: radial-gradient(circle at 38% 32%, #ffe87c, #f9c74f 55%, #c8960c); color: #5a3e00; }
.ball-blue   { background: radial-gradient(circle at 38% 32%, #93cfff, #4895ef 55%, #1a5fb0); color: #fff; }
.ball-red    { background: radial-gradient(circle at 38% 32%, #ff9898, #e63946 55%, #9b1c27); color: #fff; }
.ball-gray   { background: radial-gradient(circle at 38% 32%, #d6d6d6, #6c757d 55%, #3a3f45); color: #fff; }
.ball-green  { background: radial-gradient(circle at 38% 32%, #96e6b8, #52b788 55%, #256940); color: #fff; }

@keyframes popIn {
    0%   { transform: scale(0) rotate(-180deg); opacity: 0; }
    65%  { transform: scale(1.2) rotate(12deg);  opacity: 1; }
    100% { transform: scale(1)   rotate(0deg);   opacity: 1; }
}

/* ── Button ── */
#generator-btn {
    padding: 14px 40px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #f06292, #ba68c8);
    color: #fff;
    border: none;
    border-radius: 50px;
    box-shadow: 0 6px 22px var(--btn-shadow);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s;
    letter-spacing: 0.4px;
}

#generator-btn:hover:not(:disabled) {
    transform: scale(1.06) translateY(-2px);
    box-shadow: 0 12px 32px var(--btn-shadow);
}

#generator-btn:active:not(:disabled) {
    transform: scale(0.96);
    box-shadow: 0 3px 10px var(--btn-shadow);
}

#generator-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Confetti ── */
.confetti-piece {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    user-select: none;
    transform: translate(-50%, -50%);
    animation: confettiBurst ease-out forwards;
}

@keyframes confettiBurst {
    0%   { transform: translate(-50%, -50%) scale(0.6) rotate(0deg);   opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.1) rotate(540deg); opacity: 0; }
}

/* ── Navigation ── */
.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.nav-logo {
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(135deg, #f06292, #ba68c8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-links {
    display: flex;
    gap: 24px;
}
.nav-links a {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--subtitle);
    text-decoration: none;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* ── Info cards ── */
#info-section {
    display: flex;
    gap: 16px;
    max-width: 720px;
    width: 100%;
    margin: 32px auto 0;
    flex-wrap: wrap;
    justify-content: center;
}
.info-card {
    flex: 1;
    min-width: 180px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px 20px;
    text-align: center;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.info-icon { font-size: 1.8rem; margin-bottom: 10px; }
.info-card h3 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.info-card p {
    font-size: 0.82rem;
    color: var(--subtitle);
    line-height: 1.6;
    margin: 0;
}

/* ── Footer ── */
.site-footer {
    width: 100%;
    max-width: 720px;
    margin: 48px auto 0;
    padding: 28px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 14px;
}
.footer-links a {
    font-size: 0.82rem;
    color: var(--subtitle);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--text); }
.footer-copy {
    font-size: 0.78rem;
    color: var(--subtitle);
}

/* ── Inquiry button (inside card) ── */
#inquiry-btn {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 28px;
    font-size: 0.88rem;
    font-weight: 700;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    color: var(--subtitle);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: 0.3px;
}
#inquiry-btn:hover {
    border-color: #ba68c8;
    color: #ba68c8;
    transform: translateY(-2px) scale(1.04);
}

/* ── Contact link ── */
#contact-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text);
    text-decoration: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px var(--card-shadow);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
    z-index: 10;
}
#contact-link:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 8px 24px var(--card-shadow);
}

/* ── Comments section ── */
#comments-section {
    width: 100%;
    max-width: 680px;
    margin: 40px auto 60px;
    padding: 36px 40px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 32px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 24px 64px var(--card-shadow);
}

#comments-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 24px;
    letter-spacing: 0.3px;
}

/* ── Theme toggle ── */
#theme-toggle {
    position: fixed;
    top: 18px; right: 18px;
    font-size: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 46px; height: 46px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
    z-index: 10;
}

#theme-toggle:hover {
    transform: rotate(25deg) scale(1.12);
}
