/* Catholic Comedy Bingo - Stained Glass & Cathedral Gold Theme */

:root {
    --bg-dark: #16121e;
    --bg-card: #231d2e;
    --parchment: #fcf9f2;
    --parchment-dark: #eee7d8;
    --gold: #d4af37;
    --gold-light: #f5e489;
    --gold-dark: #9a7b1c;
    --burgundy: #6b1d38;
    --burgundy-light: #8e2b4d;
    --marian-blue: #1e40af;
    --marian-light: #3b82f6;
    --stained-glass-red: #dc2626;
    --stained-glass-green: #16a34a;
    --text-dark: #2c1a0e;
    --text-light: #f3f4f6;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-gold: 0 0 15px rgba(212, 175, 55, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Stained Glass Header Banner */
.stained-glass-header {
    background: linear-gradient(135deg, var(--burgundy) 0%, #3b0764 50%, var(--marian-blue) 100%);
    border-bottom: 4px solid var(--gold);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.stained-glass-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle, rgba(212,175,55,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.brand-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-title h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.cross-icon {
    color: var(--gold);
    font-size: 1.6rem;
}

/* Common Container Layouts */
.main-container {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

/* Buttons & Badges */
.btn {
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #1a1005;
    font-weight: 700;
    border: 1px solid var(--gold-light);
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
}

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

.btn-secondary {
    background: #374151;
    color: var(--text-light);
    border-color: #4b5563;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
    color: white;
    border-color: #fca5a5;
}

.btn-large {
    padding: 0.85rem 1.5rem;
    font-size: 1.15rem;
    border-radius: 12px;
}

.badge {
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--gold);
    color: var(--gold-light);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* HOST VIEW STYLING */
.host-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.25rem;
}

@media (max-width: 1024px) {
    .host-grid {
        grid-template-columns: 1fr;
    }
}

.sidebar-card {
    background: var(--bg-card);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.qr-box {
    background: var(--parchment);
    border: 3px solid var(--gold);
    border-radius: 12px;
    padding: 0.75rem;
    text-align: center;
    color: var(--text-dark);
}

.qr-box svg {
    max-width: 180px;
    height: auto;
    margin: 0.25rem auto;
}

.join-url {
    font-size: 1rem;
    font-weight: 800;
    color: var(--burgundy);
    word-break: break-all;
}

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.control-group label {
    font-size: 0.8rem;
    color: var(--gold-light);
    font-weight: 600;
    text-transform: uppercase;
}

select, input[type="text"] {
    background: #110d18;
    border: 1px solid var(--gold-dark);
    color: var(--text-light);
    padding: 0.55rem;
    border-radius: 6px;
    font-size: 0.95rem;
}

.prompt-hero {
    background: linear-gradient(135deg, #2a1b3d 0%, #170d26 100%);
    border: 3px solid var(--gold);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-gold);
    position: relative;
    overflow: hidden;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.prompt-hero::after {
    content: '⛪';
    position: absolute;
    font-size: 10rem;
    opacity: 0.03;
    pointer-events: none;
}

.current-label {
    font-size: 1rem;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.current-prompt-text {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--parchment);
    line-height: 1.25;
    text-shadow: 0 4px 10px rgba(0,0,0,0.8);
    animation: promptPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes promptPop {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.prompt-counter {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: #a78bfa;
}

.history-section {
    margin-top: 1.25rem;
}

.section-title {
    font-size: 1.15rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.history-item {
    background: var(--bg-card);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-left: 4px solid var(--gold);
}

.history-num {
    background: var(--gold);
    color: #1a1005;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ==========================================================================
   PLAYER MOBILE VIEW STYLING (OPTIMIZED FOR READABILITY & BOX FIT)
   ========================================================================== */
.player-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.player-info-bar {
    background: var(--bg-card);
    border: 1px solid var(--gold-dark);
    border-radius: 12px;
    padding: 0.6rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.player-name-display {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-light);
}

.bingo-card-header {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    text-align: center;
    margin-bottom: 4px;
}

.bingo-letter {
    background: linear-gradient(180deg, var(--burgundy) 0%, var(--burgundy-light) 100%);
    color: var(--gold-light);
    font-size: 1.3rem;
    font-weight: 900;
    padding: 0.25rem;
    border-radius: 6px;
    border: 1px solid var(--gold);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.bingo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 4px;
    width: 100%;
    aspect-ratio: 1 / 1;
}

/* BINGO SQUARE - SIZED PERFECTLY FOR MOBILE READABILITY */
.bingo-square {
    background: var(--parchment);
    color: var(--text-dark);
    border: 1.5px solid var(--parchment-dark);
    border-radius: 6px;
    padding: 2px 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.66rem;
    font-weight: 600;
    line-height: 1.1;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.2s ease;
}

/* Character length modifier scaling */
.bingo-square.text-medium {
    font-size: 0.60rem;
    line-height: 1.08;
}

.bingo-square.text-long {
    font-size: 0.54rem;
    line-height: 1.05;
}

@media (min-width: 480px) {
    .bingo-square {
        font-size: 0.78rem;
        padding: 4px;
    }
    .bingo-square.text-medium {
        font-size: 0.70rem;
    }
    .bingo-square.text-long {
        font-size: 0.62rem;
    }
}

.bingo-square:active {
    transform: scale(0.95);
}

.bingo-square.marked {
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    border-color: var(--gold);
    color: #1c1007;
}

.bingo-square.marked::after {
    content: var(--stamp-symbol, '✝');
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    color: rgba(180, 20, 50, 0.45);
    pointer-events: none;
    animation: stampAnimation 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.4);
}

.bingo-square.free-space {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #1a1005;
    font-weight: 900;
    border-color: var(--gold-light);
    font-size: 0.75rem;
}

.bingo-square.free-space::after {
    content: '🙏';
    font-size: 1.6rem;
    opacity: 0.7;
}

@keyframes stampAnimation {
    0% { transform: translate(-50%, -50%) scale(2.5) rotate(-20deg); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}

.bingo-square.drawn-match {
    box-shadow: inset 0 0 0 2px var(--stained-glass-green);
    border-color: var(--stained-glass-green);
}

.bingo-claim-box {
    margin-top: 0.25rem;
    text-align: center;
}

.btn-bingo {
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
    color: white;
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: 2px;
    width: 100%;
    padding: 0.85rem;
    border-radius: 12px;
    border: 3px solid #fca5a5;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    transition: all 0.2s ease;
}

.btn-bingo.ready {
    animation: pulseBingo 1s infinite alternate;
}

@keyframes pulseBingo {
    0% { transform: scale(1); box-shadow: 0 0 12px #ef4444; }
    100% { transform: scale(1.02); box-shadow: 0 0 25px #ef4444; }
}

.stamp-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.stamp-option {
    font-size: 1.2rem;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
}

.stamp-option.active {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-card);
    border: 3px solid var(--gold);
    border-radius: 20px;
    padding: 1.75rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-gold);
}

.modal-card h2 {
    color: var(--gold-light);
    margin-bottom: 0.75rem;
    font-size: 1.6rem;
}
