
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

:root {
    color-scheme: light;
    --bg-start: #f6d365;
    --bg-end: #fda085;
    --text: #1f2937;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(255, 255, 255, 0.6);
    --shadow: rgba(15, 23, 42, 0.2);
    --accent: #ff6b6b;
    --accent-glow: rgba(255, 107, 107, 0.6);
    --ball-bg: rgba(255, 255, 255, 0.6);
    --ball-border: rgba(31, 41, 55, 0.6);
    --ball-text: #111827;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg-start: #0f172a;
    --bg-end: #1e293b;
    --text: #f8fafc;
    --card-bg: rgba(15, 23, 42, 0.7);
    --card-border: rgba(148, 163, 184, 0.2);
    --shadow: rgba(0, 0, 0, 0.5);
    --accent: #60a5fa;
    --accent-glow: rgba(96, 165, 250, 0.6);
    --ball-bg: rgba(148, 163, 184, 0.2);
    --ball-border: rgba(248, 250, 252, 0.6);
    --ball-text: #f8fafc;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
    color: var(--text);
    transition: background 0.4s ease, color 0.4s ease;
    flex-direction: column;
    gap: 28px;
    padding: 80px 16px 48px;
}

.page-toggle {
    position: fixed;
    top: 22px;
    right: 24px;
    z-index: 10;
}

.container {
    text-align: center;
    background: var(--card-bg);
    padding: 36px 40px 42px;
    border-radius: 18px;
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 40px var(--shadow);
    backdrop-filter: blur(12px);
    max-width: 620px;
    width: min(90vw, 620px);
}

.lotto {
    width: min(90vw, 820px);
    display: grid;
    gap: 20px;
}

.lotto-history {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 24px 28px;
    box-shadow: 0 20px 40px var(--shadow);
    backdrop-filter: blur(12px);
}

.lotto-history h2 {
    margin: 0 0 12px;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
}

.lotto-history ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.lotto-history li {
    font-weight: 600;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid var(--card-border);
    padding: 8px 12px;
    border-radius: 10px;
}

h1 {
    margin: 0;
    font-size: clamp(1.5rem, 2.4vw, 2.1rem);
    margin-bottom: 28px;
}

.theme-toggle {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    transition: transform 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.2);
}

.lotto-numbers {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

lotto-number.lotto-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ball-bg);
    color: var(--ball-text);
    border: 2px solid var(--ball-border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(15, 23, 42, 0.25);
}

.inquiry {
    width: min(90vw, 620px);
}

.inquiry-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 28px 32px 34px;
    box-shadow: 0 20px 40px var(--shadow);
    backdrop-filter: blur(12px);
}

.inquiry-card h2 {
    margin: 0 0 10px;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
}

.inquiry-card p {
    margin: 0 0 24px;
    opacity: 0.85;
}

.inquiry-card form {
    display: grid;
    gap: 14px;
}

.inquiry-card label {
    display: grid;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

.inquiry-card input,
.inquiry-card textarea {
    font-family: inherit;
    font-size: 1rem;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.35);
    color: var(--text);
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

html[data-theme="dark"] .inquiry-card input,
html[data-theme="dark"] .inquiry-card textarea {
    background: rgba(15, 23, 42, 0.6);
}

.inquiry-card input:focus,
.inquiry-card textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.form-btn {
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-glow), 0 0 24px var(--accent-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 18px var(--accent-glow), 0 0 32px var(--accent-glow);
}

.comments {
    width: min(90vw, 820px);
}

.comments-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 28px 32px 34px;
    box-shadow: 0 20px 40px var(--shadow);
    backdrop-filter: blur(12px);
}

.comments-card h2 {
    margin: 0 0 18px;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
}

.animal-test {
    width: min(90vw, 820px);
}

.animal-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 28px 32px 34px;
    box-shadow: 0 20px 40px var(--shadow);
    backdrop-filter: blur(12px);
}

.animal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.animal-header h2 {
    margin: 0 0 6px;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
}

.animal-header p {
    margin: 0;
    opacity: 0.85;
}

.animal-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(200px, 1fr);
    gap: 20px;
    align-items: start;
    margin-bottom: 12px;
}

.webcam-wrap {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.25);
    min-height: 220px;
    display: grid;
    place-items: center;
}

.webcam-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

.file-btn {
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-glow), 0 0 24px var(--accent-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.file-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 18px var(--accent-glow), 0 0 32px var(--accent-glow);
}

#animal-file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.label-container {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.labels-wrap h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.animal-note {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.7;
}

#generate-btn {
    padding: 14px 30px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-glow), 0 0 24px var(--accent-glow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 18px var(--accent-glow), 0 0 32px var(--accent-glow);
}

@media (max-width: 520px) {
    .page-toggle {
        top: 16px;
        right: 16px;
    }

    .animal-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .animal-grid {
        grid-template-columns: 1fr;
    }
}
