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

/* ---- Variables ---- */
:root {
    --pink:        #ec4899;
    --pink-dark:   #be185d;
    --pink-light:  #fce7f3;
    --pink-soft:   #fbcfe8;
    --blue:        #3b82f6;
    --blue-dark:   #1d4ed8;
    --blue-light:  #eff6ff;
    --blue-soft:   #bfdbfe;
    --neutral:     #f1f5f9;
    --text:        #1e293b;
    --muted:       #64748b;
    --white:       #ffffff;
    --radius:      20px;
    --shadow:      0 24px 64px rgba(0, 0, 0, 0.08);
}

/* ---- Reset ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', Tahoma, sans-serif;
    font-size: 16px;
    background: linear-gradient(120deg, #a8d8f0 0%, #c5b8f5 40%, #f5a8d0 100%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* ---- Container ---- */
.container {
    width: min(620px, 94%);
    margin: 52px auto 72px;
    background: var(--white);
    border-radius: 28px;
    padding: 48px 52px;
    box-shadow: var(--shadow);
    text-align: center;
}

/* ---- Page header ---- */
.page-header {
    margin-bottom: 32px;
}

.page-header .emoji {
    font-size: 3.6rem;
    display: block;
    margin-bottom: 12px;
    line-height: 1;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--pink), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 400;
    margin-top: 4px;
}

p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* ---- Vote count badge ---- */
.vote-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--pink-light), var(--blue-light));
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 28px;
}

.vote-count strong {
    color: var(--text);
}

/* ---- Flash ---- */
.flash {
    background: #fefce8;
    color: #854d0e;
    border-left: 4px solid #facc15;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 0.93rem;
    font-weight: 600;
    text-align: left;
}

/* ---- Form ---- */
form {
    display: grid;
    gap: 20px;
    text-align: left;
}

.field-label {
    display: grid;
    gap: 8px;
    font-weight: 600;
    font-size: 0.93rem;
    color: var(--text);
}

input[type="text"],
input[type="password"],
select {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 0.97rem;
    font-family: inherit;
    width: 100%;
    color: var(--text);
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: var(--pink);
    box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.10);
    background: var(--white);
}

/* ---- Vote cards ---- */
.vote-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.vote-card input[type="radio"] {
    display: none;
}

.vote-card label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 22px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    background: #fafafa;
    transition: all 0.2s ease;
}

.vote-card label .card-emoji {
    font-size: 2.6rem;
    line-height: 1;
}

.vote-card.boy label:hover,
.vote-card input[type="radio"][value="boy"]:checked + label {
    border-color: var(--blue);
    background: var(--blue-light);
    color: var(--blue);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.18);
    transform: translateY(-3px);
}

.vote-card.girl label:hover,
.vote-card input[type="radio"][value="girl"]:checked + label {
    border-color: var(--pink);
    background: var(--pink-light);
    color: var(--pink);
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.18);
    transform: translateY(-3px);
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    text-decoration: none;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    padding: 13px 24px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 700;
    transition: transform 0.15s, box-shadow 0.15s;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--pink), var(--blue));
    color: var(--white);
}

.btn-danger {
    background: linear-gradient(135deg, var(--pink), var(--pink-dark));
    color: var(--white);
}

.btn-neutral {
    background: var(--neutral);
    color: #475569;
}

.btn-full {
    width: 100%;
}

/* ---- Topbar ---- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    text-align: left;
}

.topbar h1 {
    margin-bottom: 0;
}

/* ---- Inline row ---- */
.inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

/* ---- Info box ---- */
.info-box {
    background: linear-gradient(135deg, var(--pink-light), var(--blue-light));
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.portal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 18px;
}

.portal-card {
    text-decoration: none;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    padding: 22px 18px;
    text-align: left;
    color: var(--text);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.portal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.portal-icon {
    font-size: 2rem;
    line-height: 1;
    display: inline-block;
    margin-bottom: 10px;
}

.portal-card h2 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.portal-card p {
    font-size: 0.9rem;
    margin: 0;
}

.portal-actions {
    margin-top: 18px;
}

.portal-actions form {
    text-align: center;
}

/* ---- Stats band ---- */
.stats-band {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 28px 0;
}

.stat-card {
    flex: 1;
    min-width: 120px;
    background: linear-gradient(135deg, var(--pink-light), var(--blue-light));
    border-radius: 18px;
    padding: 22px 16px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--pink), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---- Reveal announcement ---- */
.reveal-announce {
    border-radius: 22px;
    padding: 36px 28px;
    margin-bottom: 32px;
    animation: popIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.reveal-announce.boy {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 2px solid var(--blue-soft);
}

.reveal-announce.girl {
    background: linear-gradient(135deg, #fdf2f8, #fce7f3);
    border: 2px solid var(--pink-soft);
}

.reveal-announce .big-emoji {
    font-size: 5rem;
    display: block;
    margin-bottom: 14px;
    line-height: 1;
}

.reveal-announce h2 {
    font-size: 2rem;
    font-weight: 800;
}

.reveal-announce.boy h2 { color: var(--blue); }
.reveal-announce.girl h2 { color: var(--pink); }

@keyframes popIn {
    0%   { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}

/* ---- Table ---- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 0.92rem;
}

thead tr {
    background: linear-gradient(135deg, var(--pink-light), var(--blue-light));
}

th {
    text-align: center;
    padding: 13px 12px;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

td {
    text-align: center;
    padding: 13px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text);
}

tbody tr:hover {
    background: #fafbff;
}

.result-good {
    color: #059669;
    font-weight: 700;
}

.result-bad {
    color: #e11d48;
    font-weight: 700;
}

/* ---- Divider ---- */
hr {
    border: none;
    border-top: 1px solid #f1f5f9;
    margin: 28px 0;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .container {
        margin: 16px auto 32px;
        padding: 28px 20px;
    }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }

    .vote-cards { gap: 10px; }
    .vote-card label { padding: 16px 10px; }
    .vote-card label .card-emoji { font-size: 2rem; }

    .stats-band { flex-direction: column; }

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

    .topbar { justify-content: center; text-align: center; }
}
