/* full stylesheet for Bingo Caller UI */

:root{
    --bg: #0f1724;
    --card: #0f1724;
    --muted: #94a3b8;
    --accent: #7c3aed;
    --accent-2: #06b6d4;
    --called: #10b981;
    --cell-bg: #0b1220;
    --glass: rgba(255,255,255,0.03);
}

*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:Inter,ui-sans-serif,system-ui,Segoe UI,Roboto,"Helvetica Neue",Arial}
body{background:linear-gradient(180deg,#071023 0%, #081226 60%);color:#e6eef8;display:flex;align-items:center;justify-content:center;padding:24px}

.container{width:100%;max-width:1100px}

.header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
.header h1{margin:0;font-size:1.6rem;color:#fff;letter-spacing:0.6px}
.controls{display:flex;gap:8px;align-items:center}
.select{padding:8px 10px;border-radius:8px;border:1px solid rgba(255,255,255,0.06);background:var(--cell-bg);color:inherit}
.btn{padding:8px 12px;border-radius:8px;border:0;cursor:pointer;background:rgba(255,255,255,0.03);color:inherit}
.btn.primary{background:linear-gradient(90deg,var(--accent),var(--accent-2));box-shadow:0 6px 18px rgba(124,58,237,0.18)}
.btn.accent{background:rgba(255,255,255,0.04);border:1px solid rgba(255,255,255,0.04)}

.main-grid{display:grid;grid-template-columns:220px 1fr;gap:16px;align-items:start}
.panel{background:var(--glass);padding:12px;border-radius:12px;box-shadow:0 8px 20px rgba(2,6,23,0.6);min-height:120px}
.panel h2{margin:0 0 10px 0;font-size:1rem;color:var(--muted)}

.last-five .last-five-box{display:flex;flex-direction:column;gap:8px;min-height:120px}
.last-item{padding:8px;border-radius:8px;background:linear-gradient(90deg,rgba(12,18,28,0.5),transparent);font-weight:600}

.grid-panel{overflow:auto}

/* grid container — fixed row height so transforms don't change layout */
.number-grid{
    display:grid;
    gap:6px;
    padding:12px;
    border-radius:10px;
    background:linear-gradient(180deg,rgba(255,255,255,0.02),transparent);
    min-height:240px;
    grid-auto-rows:56px; /* adjust cell height here */
    align-content:start;

    /* center grid tracks and center items inside each track */
    justify-content:center;
    justify-items:center;
    align-items:center;
}

/* layout for UK (90) and US (75) */
.number-grid.uk-grid{grid-template-columns:repeat(10, 1fr)}
.number-grid.us-grid{grid-template-columns:repeat(15, 1fr)}

/* cell */
.cell{
    position:relative; /* so decorative pseudo-element won't affect layout */
    background:var(--cell-bg);
    border-radius:8px;
    /* stable sizing: use flexbox so transforms don't affect grid layout */
    padding:0;
    text-align:center;
    font-weight:800;
    color:#cfe8ff;
    border:1px solid rgba(255,255,255,0.04);
    transition:transform .12s ease, box-shadow .12s ease, background .12s ease;
    user-select:none;

    display:flex;
    align-items:center;
    justify-content:center; /* ensure content is centered inside cell */
    height:100%;
    transform-origin:center;
    will-change:transform,box-shadow;

    /* center the cell inside its grid track so scaling stays centered */
    justify-self:center;
    align-self:center;

    /* visual size inside the track */
    width:82%;
    max-width:72px;
    min-width:44px;
}

/* subtle hover without changing layout */
.cell:hover{transform:translateY(-3px);box-shadow:0 10px 22px rgba(12,18,28,0.55)}

/* called state scales visually but stays centre-justified */
.cell.called{
    background:linear-gradient(90deg,var(--called),#087f5b);
    color:#01210f;
    box-shadow:0 8px 22px rgba(16,185,129,0.18);
    transform:scale(1.06);

    /* keep the same centering and visual size when called */
    justify-self:center;
    align-self:center;
    width:82%;
    max-width:72px;
}

/* small decorative bar when called — absolutely positioned so it doesn't shift content */
.cell.called::after{
    content:"";
    position:absolute;
    left:8%;
    right:8%;
    bottom:6px;
    height:4px;
    border-radius:4px;
    background:rgba(255,255,255,0.06);
    pointer-events:none;
}

/* footer and small screens */
.footer{margin-top:12px;text-align:center;color:var(--muted);font-size:0.85rem}

/* responsive */
@media (max-width: 1000px){
    .main-grid{grid-template-columns:1fr;gap:12px}
    .number-grid.uk-grid{grid-template-columns:repeat(9, 1fr)}
    .number-grid.us-grid{grid-template-columns:repeat(10, 1fr)}
    .cell{max-width:60px}
}

/* polish */
.header h1{display:flex;align-items:center;gap:10px}
.btn:disabled{opacity:0.5;cursor:not-allowed}