:root{
  --b:#3B82F6; --i:#EF4444; --n:#FACC15; --g:#22C55E; --o:#F59E0B;
  --bg:#f6f7fb; --card:#ffffff; --ink:#0f172a; --muted:#64748b;
  --ring:rgba(15,23,42,.10); --radius:18px; --shadow:0 8px 30px rgba(15,23,42,.08);
}
*{ box-sizing:border-box; }
body{ margin:0; font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif; background:var(--bg); color:var(--ink); }
a{ color:inherit; text-decoration:none; } a:hover{ text-decoration:underline; }
.container{ width:min(1100px, 92vw); margin:0 auto; padding:18px 0 56px; }
.topbar{ position:sticky; top:0; z-index:10; background:rgba(246,247,251,.86); backdrop-filter: blur(10px); border-bottom:1px solid var(--ring); }
.topbar-inner{ width:min(1100px, 92vw); margin:0 auto; display:flex; align-items:center; justify-content:space-between; padding:12px 0; }
.brand{ display:flex; align-items:center; gap:10px; }
.brand-icon{ width:36px; height:36px; border-radius:12px; box-shadow: var(--shadow); background:#fff; }
.brand-name{ font-weight:800; letter-spacing:.2px; }
.nav{ display:flex; align-items:center; gap:14px; color:var(--muted); }
.nav .btn{ background: var(--ink); color:#fff; padding:10px 14px; border-radius: 14px; text-decoration:none; }
.card{ background:var(--card); border:1px solid var(--ring); border-radius: var(--radius); box-shadow: var(--shadow); padding:16px; }
.grid{ display:grid; grid-template-columns: 1.1fr .9fr; gap:16px; }
@media (max-width: 860px){ .grid{ grid-template-columns: 1fr; } }
.h1{ font-size: clamp(26px, 4vw, 42px); line-height:1.05; margin:8px 0 10px; }
.lead{ color:var(--muted); font-size: 16px; line-height:1.5; margin:0; }
.row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.input{ width:100%; padding:12px 12px; border-radius:14px; border:1px solid var(--ring); background:#fff; font-size:16px; }
label{ display:block; font-weight:700; margin:10px 0 6px; }
.btn-primary{ display:inline-flex; align-items:center; justify-content:center; border:0; border-radius:14px; padding:12px 14px; font-weight:800;
  background: linear-gradient(135deg, var(--i), var(--o)); color:#fff; cursor:pointer; }
.btn-secondary{ border:1px solid var(--ring); border-radius:14px; padding:12px 14px; background:#fff; cursor:pointer; }
.muted{ color:var(--muted); }
.bingo-header{ display:grid; grid-template-columns: repeat(5, 1fr); gap:10px; margin:10px 0 12px; }
.pill{ border-radius: 999px; border:2px solid var(--ring); padding:10px 12px; text-align:center; font-weight:900; }
.pill.B{ background: color-mix(in srgb, var(--b) 18%, white); border-color: color-mix(in srgb, var(--b) 60%, white); }
.pill.I{ background: color-mix(in srgb, var(--i) 18%, white); border-color: color-mix(in srgb, var(--i) 60%, white); }
.pill.N{ background: color-mix(in srgb, var(--n) 18%, white); border-color: color-mix(in srgb, var(--n) 60%, white); }
.pill.G{ background: color-mix(in srgb, var(--g) 18%, white); border-color: color-mix(in srgb, var(--g) 60%, white); }
.pill.O{ background: color-mix(in srgb, var(--o) 18%, white); border-color: color-mix(in srgb, var(--o) 60%, white); }
.notice{ border-left: 6px solid var(--b); background: color-mix(in srgb, var(--b) 8%, white); padding:12px 12px; border-radius: 14px; }
.footer{ border-top:1px solid var(--ring); padding:18px 0; }
.footer-inner{ display:flex; justify-content:space-between; align-items:center; }
.table{ width:100%; border-collapse: collapse; }
.table th, .table td{ padding:10px; border-bottom:1px solid var(--ring); text-align:left; }
.table th{ color:var(--muted); font-weight:800; font-size: 13px; text-transform: uppercase; letter-spacing:.06em; }
.codebox{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight:900; letter-spacing:.2em;
  background:#0b1220; color:#fff; padding:10px 12px; border-radius:14px; display:inline-block; }
.calls{ display:flex; flex-wrap:wrap; gap:8px; }
.callchip{ border:1px solid var(--ring); border-radius:999px; padding:8px 10px; background:#fff; font-weight:800; }

/* ===== Dashboard Credit Badges ===== */
.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    line-height: 1;
    border: 1px solid var(--ring);
    white-space: nowrap;
}

.badge-owned {
    background: color-mix(in srgb, var(--g) 18%, white);
    border-color: color-mix(in srgb, var(--g) 60%, white);
    color: #064e3b;
}

.badge-free {
    background: color-mix(in srgb, var(--n) 18%, white);
    border-color: color-mix(in srgb, var(--n) 60%, white);
    color: #713f12;
}

.badge-none {
    background: #fff;
    border-color: var(--ring);
    color: var(--muted);
}
/* ===== Simple Tooltip ===== */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: 120%;
    transform: translateX(-50%);
    background: #111;
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    z-index: 50;
}

.tooltip::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 112%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #111;
    opacity: 0;
    transition: opacity .15s ease;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
}
.badge-warning {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #7f1d1d;
}
/* ===== Caller Board (B I N G O) ===== */
.callerboard{
    display:grid;
    grid-template-columns: repeat(5, minmax(56px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 760px;
}

.cb-head{
    font-weight: 900;
    text-align: center;
    padding: 12px 0;
    border-radius: 999px;
    border: 3px solid rgba(0,0,0,0.08);
    letter-spacing: .12em;
}

.cb-cell{
    text-align:center;
    padding: 14px 0;
    border-radius: 999px;
    font-weight: 800;
    background: #fff;
    border: 3px solid rgba(0,0,0,0.08);
}

/* Header colors (match the image) */
.cb-b.cb-head{ background:#4aa3ff; color:#0b1b2a; }
.cb-i.cb-head{ background:#ff5b5b; color:#2a0b0b; }
.cb-n.cb-head{ background:#ffe34a; color:#2a240b; }
.cb-g.cb-head{ background:#7ce15a; color:#0f2a0b; }
.cb-o.cb-head{ background:#ffbd4a; color:#2a1b0b; }

/* Cell borders by column (colored outline only) */
.cb-b.cb-cell{ border-color: rgba(74,163,255,.65); }
.cb-i.cb-cell{ border-color: rgba(255,91,91,.65); }
.cb-n.cb-cell{ border-color: rgba(255,227,74,.75); }
.cb-g.cb-cell{ border-color: rgba(124,225,90,.65); }
.cb-o.cb-cell{ border-color: rgba(255,189,74,.70); }

/* Called state (tinted gray like your screenshot) */
.cb-called{
    background: rgba(0,0,0,0.10);
}
/* 5x5 sizing */
.callerboard-5x5 {
    grid-template-rows: auto repeat(5, 1fr);
}

/* Marked (daubed) look */
.cb-cell.cb-marked {
    position: relative;
    outline: none;
}

.cb-cell.cb-marked::after {
    content: "";
    position: absolute;
    inset: 10%;
    border-radius: 999px;
    background: rgba(255, 0, 0, 0.35);
    box-shadow: 0 0 0 2px rgba(255,0,0,0.35) inset;
    pointer-events: none;
}

/* Free space */
.cb-free {
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Tiny "nope" feedback if they tap an uncalled number */
.cb-shake { animation: cbShake 0.22s linear; }
@keyframes cbShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

/* Responsive tweaks */
@media (max-width: 520px){
    .callerboard{ gap: 10px; }
    .cb-cell{ padding: 12px 0; font-size: 14px; }
    .cb-head{ padding: 10px 0; font-size: 14px; }
}
/* ===== Caller Roller Modal ===== */
.overlay{
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9999;
}

.modal{
    width: min(640px, 100%);
    background: var(--card, #fff);
    border-radius: 18px;
    border: 1px solid var(--ring);
    box-shadow: 0 18px 60px rgba(0,0,0,.25);
    padding: 16px;
}

.modalTop{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.modalTitle{
    font-weight: 900;
    font-size: 18px;
}

.modalX{
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--ring);
    background: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.rollerStage{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    padding: 10px 6px 6px;
    min-height: 280px;
}

.rollerGif{
    width: min(360px, 86vw);
    height: auto;
    border-radius: 14px;
}

.callResult{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap: 10px;
}

.callCircle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle at top, #1b2336, #0b1020);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    box-sizing: border-box;
}

/* text container inside the circle */
.callText{
    width:100%;
    height:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding:18px;
    box-sizing:border-box;
    color:#fff;
    text-shadow:0 2px 10px rgba(0,0,0,.6);
    visibility:hidden; /* JS shows it */
}

.callCol{
    font-weight:900;
    line-height:1;
    white-space:nowrap;
}

.callVal{
    font-weight:900;
    line-height:1.05;
    white-space:nowrap;   /* no wrap */
}


/* top label (B/I/N/G/O or your custom label) */
.callTop{
    font-weight:800;
    letter-spacing: .02em;
    margin-bottom: .18em;
    line-height:1;
    white-space:nowrap;
    color:#fff;
    text-shadow:0 2px 10px rgba(0,0,0,.6);
}

/* main value (number or your custom word/phrase) */
.callMain{
    font-weight:900;
    line-height:1.05;

    /* allow long custom text to wrap if needed */
    white-space:normal;
    word-break:break-word;
    overflow-wrap:anywhere;

    /* keep it from overflowing visually */
    max-width:100%;
    color:#fff;
    text-shadow:0 2px 10px rgba(0,0,0,.6);
}
.modalActions{
    display:flex;
    justify-content:flex-end;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--ring);
}

@media (max-width: 520px){
    .callCircle{ width: 140px; height: 140px; }
    .callText{ font-size: 46px; }
    .rollerStage{ min-height: 240px; }
}
#adSlot { min-height: 250px; }
.callText{
    width: 100%;
    height: 100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding: 18px;
    box-sizing:border-box;
}
.nav-user {
    margin-right: 10px;
    font-weight: 600;
    opacity: 0.85;
}
.alert{
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,0,0,0.35);
    background: rgba(255,0,0,0.08);
}
/* Action button container */
/* ===== Dashboard Action Buttons ===== */
.action-buttons{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
}
.action-buttons form{ margin:0; }

/* HOST = play / start (green) */
.btn-host{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:0;
    border-radius:14px;
    padding:10px 16px;
    font-weight:900;
    letter-spacing:.02em;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color:#ffffff;
    cursor:pointer;
    box-shadow: 0 6px 16px rgba(22,163,74,.35);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-host:hover:not(:disabled){
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(22,163,74,.45);
    filter: brightness(1.05);
}
.btn-host:disabled{
    opacity:.45;
    cursor:not-allowed;
    box-shadow:none;
    transform:none;
}

/* EDIT = utility action (blue outline) */
.btn-edit{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:2px solid #3b82f6;
    border-radius:14px;
    padding:9px 14px;
    background:#ffffff;
    color:#1e40af;
    font-weight:800;
    cursor:pointer;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn-edit:hover{
    background: color-mix(in srgb, #3b82f6 10%, white);
    box-shadow: 0 4px 10px rgba(59,130,246,.25);
}

/* Optional: Buy More Games = neutral emphasis */
.btn-edit.buy-more{
    border-color: #64748b;
    color:#334155;
}
.btn-edit.buy-more:hover{
    background: #f1f5f9;
}
#playerBoard { position: relative; z-index: 5; }
#playerBoard .cb-cell { pointer-events: auto; }
