/* Ship Tea Bingo — Scoped Styles */

.shiptea-bingo-wrapper {
    --st-ocean: #0077B6;
    --st-teal: #008080;
    --st-sunset: #FF6B35;
    --st-sand: #FFF1E6;
    --st-navy: #023E73;
    --st-white: #ffffff;

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 680px;
    margin: 2rem auto;
    padding: 0 1rem;
    box-sizing: border-box;
    color: var(--st-navy);
}

.shiptea-bingo-wrapper *, .shiptea-bingo-wrapper *::before, .shiptea-bingo-wrapper *::after {
    box-sizing: border-box;
}

/* Intro */
.shiptea-bingo-intro {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--st-sand), var(--st-white));
    border-radius: 16px;
    border: 2px solid var(--st-ocean);
}

.shiptea-bingo-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.shiptea-bingo-intro h2 {
    font-size: 1.8rem;
    color: var(--st-navy);
    margin: 0 0 0.75rem;
}

.shiptea-bingo-subtitle {
    font-size: 1.05rem;
    color: #555;
    margin: 0 0 2rem;
    line-height: 1.5;
}

/* Theme selector */
.shiptea-bingo-themes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    max-width: 600px;
    margin: 0 auto;
}

.shiptea-bingo-theme-btn {
    padding: 1rem;
    background: var(--st-white);
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    text-align: center;
    font-family: inherit;
}

.shiptea-bingo-theme-btn:hover {
    border-color: var(--st-ocean);
    transform: translateY(-2px);
}

.shiptea-bingo-theme-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.shiptea-bingo-theme-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--st-navy);
    display: block;
    margin-bottom: 0.25rem;
}

.shiptea-bingo-theme-desc {
    font-size: 0.75rem;
    color: #888;
    display: block;
    line-height: 1.3;
}

/* Toolbar */
.shiptea-bingo-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.shiptea-bingo-toolbar h3 {
    font-size: 1.2rem;
    color: var(--st-navy);
    margin: 0;
}

.shiptea-bingo-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.shiptea-bingo-action-btn {
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--st-white);
    border: 2px solid var(--st-ocean);
    color: var(--st-ocean);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}

.shiptea-bingo-action-btn:hover {
    background: var(--st-ocean);
    color: var(--st-white);
}

/* Bingo board */
.shiptea-bingo-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    background: var(--st-navy);
    padding: 4px;
    border-radius: 12px;
    overflow: hidden;
}

.shiptea-bingo-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px;
    font-size: 0.72rem;
    line-height: 1.25;
    background: var(--st-white);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    user-select: none;
    word-break: break-word;
    hyphens: auto;
    border: none;
    font-family: inherit;
    color: var(--st-navy);
}

.shiptea-bingo-cell:hover {
    background: #f0f8ff;
}

.shiptea-bingo-cell.stb-marked {
    background: var(--st-sunset);
    color: var(--st-white);
    font-weight: 700;
}

.shiptea-bingo-cell.stb-free {
    background: var(--st-sand);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: default;
}

.shiptea-bingo-cell.stb-free.stb-marked {
    background: var(--st-sunset);
    color: var(--st-white);
}

.shiptea-bingo-cell.stb-bingo-line {
    background: var(--st-teal);
    color: var(--st-white);
    animation: stb-pulse 0.6s ease-in-out 2;
}

@keyframes stb-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Celebration overlay */
.shiptea-bingo-celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2,62,115,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: stb-fadeIn 0.4s ease-out;
}

@keyframes stb-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.shiptea-bingo-celebration-inner {
    text-align: center;
    background: var(--st-white);
    padding: 3rem 2rem;
    border-radius: 20px;
    max-width: 400px;
    margin: 1rem;
}

.shiptea-bingo-celebration-emoji {
    font-size: 5rem;
    margin-bottom: 0.5rem;
    animation: stb-bounce 0.5s ease-in-out 3;
}

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

.shiptea-bingo-celebration h2 {
    font-size: 2.5rem;
    color: var(--st-sunset);
    margin: 0 0 0.5rem;
    letter-spacing: 4px;
}

.shiptea-bingo-celebration p {
    font-size: 1rem;
    color: #555;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

/* Share buttons */
.shiptea-bingo-share { margin-bottom: 1.5rem; }
.shiptea-bingo-share p { font-size: 0.9rem; color: #888; margin: 0 0 0.75rem; }

.shiptea-bingo-share-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.shiptea-bingo-share-btn {
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    color: var(--st-white);
    font-family: inherit;
}

.shiptea-bingo-share-btn:hover { opacity: 0.85; }
.shiptea-bingo-share-twitter { background: #1a1a1a; }
.shiptea-bingo-share-facebook { background: #1877F2; }
.shiptea-bingo-share-threads { background: #000000; }
.shiptea-bingo-share-tiktok { background: #010101; }
.shiptea-bingo-share-instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.shiptea-bingo-share-copy { background: var(--st-teal); }

/* Print styles */
@media print {
    body * { visibility: hidden; }

    .shiptea-bingo-wrapper,
    .shiptea-bingo-wrapper * {
        visibility: visible;
    }

    .shiptea-bingo-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 1cm;
    }

    .shiptea-bingo-toolbar .shiptea-bingo-actions { display: none; }
    .shiptea-bingo-celebration { display: none !important; }

    .shiptea-bingo-board {
        gap: 2px;
        padding: 2px;
        border: 2px solid #000;
        border-radius: 0;
    }

    .shiptea-bingo-cell {
        border: 1px solid #ccc;
        background: #fff !important;
        color: #000 !important;
        font-size: 0.65rem;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .shiptea-bingo-cell.stb-free {
        background: #eee !important;
    }

    .shiptea-bingo-cell.stb-marked {
        background: #fff !important;
        color: #000 !important;
    }

    .shiptea-bingo-toolbar h3 {
        font-size: 1.5rem;
        text-align: center;
        width: 100%;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .shiptea-bingo-intro { padding: 2rem 1.25rem; }
    .shiptea-bingo-intro h2 { font-size: 1.5rem; }
    .shiptea-bingo-themes { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .shiptea-bingo-cell { font-size: 0.65rem; padding: 4px; }
    .shiptea-bingo-toolbar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
    .shiptea-bingo-wrapper { padding: 0 0.5rem; }
    .shiptea-bingo-board { gap: 2px; padding: 2px; }
    .shiptea-bingo-cell { font-size: 0.58rem; padding: 3px; }
    .shiptea-bingo-actions { gap: 0.35rem; }
    .shiptea-bingo-action-btn { padding: 6px 10px; font-size: 0.75rem; }
}
