/* ==========================================================================
   Birth Bet — a bright, happy theme for guessing Luke's baby's arrival.
   Self-contained: does NOT load the death pool's style.css, so the cheerful
   colors never mix with the dark theme. Reuses the same class names as
   style.css so the mirrored markup/JS "just works" — only colors change.
   ========================================================================== */

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

:root {
    --bg-primary: #fff7fb;
    --bg-secondary: #ffffff;
    --bg-card: #fef3f8;
    --text-primary: #3a2e3a;
    --text-secondary: #8a7d88;
    --accent: #ff8fb1;        /* bubblegum pink */
    --accent-hover: #ff6f9c;
    --accent2: #7ec8ff;       /* baby blue */
    --accent3: #ffd66b;       /* sunny yellow */
    --accent4: #b799ff;       /* soft purple */
    --border: #f4d9e6;
    --success: #58d68d;
    --gold: #ffcf40;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(circle at 15% 20%, rgba(126, 200, 255, 0.25), transparent 40%),
        radial-gradient(circle at 85% 15%, rgba(255, 214, 107, 0.28), transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(183, 153, 255, 0.22), transparent 45%),
        var(--bg-primary);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ---------- Banner ---------- */
.banner {
    position: relative;
    background: linear-gradient(120deg, #ffb3d1 0%, #b799ff 45%, #7ec8ff 100%);
    padding: 2rem 2rem 2.5rem;
    text-align: center;
    box-shadow: 0 6px 24px rgba(255, 143, 177, 0.35);
    overflow: hidden;
}

.back-link {
    position: absolute;
    left: 1.25rem;
    top: 1.25rem;
    color: white;
    text-decoration: none;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.25);
    padding: 0.45rem 0.9rem;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(2px);
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.45);
    transform: translateY(-2px);
}

.banner-title {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    letter-spacing: 1px;
}

.banner-subtitle {
    font-size: 1.35rem;
    font-weight: 700;
    color: white;
    margin-top: 0.35rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.banner-content {
    display: flex;
    justify-content: center;
    margin-top: 1.75rem;
}

.banner-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.countdown-label-top {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.countdown-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.28);
    padding: 0.75rem 1rem;
    border-radius: 16px;
    min-width: 72px;
    backdrop-filter: blur(2px);
}

.countdown-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    margin-bottom: 0.4rem;
    font-variant-numeric: tabular-nums;
}

.countdown-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.countdown-separator {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    opacity: 0.8;
}

/* ---------- Layout ---------- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ---------- Winner banner ---------- */
.winner-section {
    background: linear-gradient(135deg, #fff2c2 0%, #ffe08a 100%);
    border: 3px solid var(--gold);
    border-radius: 18px;
    padding: 1.75rem;
    text-align: center;
    box-shadow: 0 0 40px rgba(255, 207, 64, 0.45);
    animation: pop 0.5s ease, glow 2.5s ease-in-out infinite;
}

.winner-label {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #b8860b;
}

.winner-name {
    font-size: 2.4rem;
    font-weight: 800;
    color: #7a5a00;
    margin: 0.35rem 0;
}

.winner-detail {
    font-size: 1.1rem;
    font-weight: 600;
    color: #a07b2c;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 207, 64, 0.4); }
    50% { box-shadow: 0 0 55px rgba(255, 207, 64, 0.75); }
}

@keyframes pop {
    0% { transform: scale(0.85); opacity: 0; }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* ---------- Baby announcement ---------- */
.birth-announcement {
    background: linear-gradient(135deg, #d5f5e3 0%, #cdeffd 100%);
    border: 2px solid var(--accent2);
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    animation: pop 0.5s ease;
}

.birth-announcement-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.birth-icon {
    font-size: 2.75rem;
    animation: bounce 1.4s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.birth-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #2e7d5b;
}

.birth-when {
    font-size: 1rem;
    font-weight: 600;
    color: #3a7d95;
}

/* ---------- Pool counter ---------- */
.pool-counter-section {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 18px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 14px rgba(255, 143, 177, 0.15);
}

.pool-counter h3 {
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.pool-amount {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--accent);
}

/* ---------- Table section ---------- */
.table-section {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 18px;
    padding: 1.75rem;
    box-shadow: 0 4px 14px rgba(255, 143, 177, 0.15);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.section-header h2 {
    font-size: 1.6rem;
    color: var(--text-primary);
    font-weight: 800;
}

/* Rules tooltip */
.rules-tooltip-container {
    position: relative;
}

.rules-tooltip-trigger {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.rules-tooltip-trigger:hover {
    transform: scale(1.15);
}

.rules-tooltip {
    display: none;
    position: absolute;
    top: 130%;
    left: 0;
    z-index: 50;
    background: var(--bg-secondary);
    border: 2px solid var(--accent);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    width: 300px;
    box-shadow: 0 8px 24px rgba(255, 143, 177, 0.3);
}

.rules-tooltip.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.rules-tooltip h4 {
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.rules-tooltip-list {
    list-style: none;
}

.rules-tooltip-list li {
    padding: 0.3rem 0 0.3rem 1.4rem;
    position: relative;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.rules-tooltip-list li:before {
    content: '🎀';
    position: absolute;
    left: 0;
}

.rules-tooltip-list li strong {
    color: var(--accent);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Buttons ---------- */
.btn {
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(120deg, var(--accent) 0%, var(--accent4) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 143, 177, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 143, 177, 0.55);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: #fbe7f0;
    transform: translateY(-2px);
}

/* ---------- Data table ---------- */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 0.9rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: var(--bg-card);
}

.data-table tr.winner-row {
    background: linear-gradient(90deg, rgba(255, 207, 64, 0.28), rgba(255, 207, 64, 0.1));
    font-weight: 700;
}

.data-table tr.winner-row:hover {
    background: linear-gradient(90deg, rgba(255, 207, 64, 0.38), rgba(255, 207, 64, 0.16));
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem !important;
    font-style: italic;
}

.diff-cell {
    color: var(--text-secondary);
}

.winner-badge {
    display: inline-block;
    margin-left: 0.4rem;
}

/* ---------- Modal ---------- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(120, 90, 130, 0.35);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-secondary);
    margin: 8% auto;
    padding: 2rem;
    border: 2px solid var(--accent);
    border-radius: 18px;
    width: 90%;
    max-width: 460px;
    position: relative;
    box-shadow: 0 20px 60px rgba(183, 153, 255, 0.4);
    animation: pop 0.3s ease;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1.1rem;
    top: 0.75rem;
    line-height: 1;
}

.close:hover {
    color: var(--accent);
}

.modal-content h2 {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.modal-note {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 143, 177, 0.2);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ---------- Floating emojis ---------- */
.floating-emojis {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-emoji {
    position: absolute;
    bottom: -60px;
    font-size: 2rem;
    animation: floatUp linear forwards;
    opacity: 0.85;
}

@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.85; }
    90% { opacity: 0.85; }
    100% { transform: translateY(-105vh) rotate(360deg); opacity: 0; }
}

/* ---------- Confetti celebration ---------- */
.celebrate-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
    align-items: center;
    justify-content: center;
}

.celebrate-overlay.active {
    display: flex;
}

.celebrate-text {
    font-size: 5rem;
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 4px 18px rgba(255, 143, 177, 0.6);
    animation: pop 0.5s ease, celebratePulse 1s ease-in-out;
}

@keyframes celebratePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.confetti-pieces {
    position: absolute;
    inset: 0;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    font-size: 1.75rem;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(540deg); opacity: 0.9; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .banner-title { font-size: 2.1rem; }
    .banner-subtitle { font-size: 1.1rem; }
    .container { padding: 1rem; }
    .countdown-item { min-width: 58px; padding: 0.6rem 0.7rem; }
    .countdown-value { font-size: 1.4rem; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .back-link { position: static; display: inline-block; margin-bottom: 0.75rem; }
}
