html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

#BingoItems {
    width: 100%;
    max-width: 600px;
    height: 150px;
    overflow-y: auto;
    resize: vertical;
    box-sizing: border-box;
}

.bingo-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-size), minmax(0, 1fr));
    gap: 5px;
    max-width: 450px;
    margin: 0 auto;
}

.bingo-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #adb5bd;
    border-radius: 6px;
    background: #f8f9fa;
    font-size: clamp(1.1rem, 6vw, 1.8rem);
    font-weight: 600;
}

.bingo-cell {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: box-shadow 0.15s, transform 0.15s;
}

.bingo-cell.selected {
    box-shadow: 0 0 0 3px #0d6efd, 0 0 10px rgba(13, 110, 253, 0.6);
    transform: scale(1.06);
    position: relative;
    z-index: 1;
}

.bingo-tooltip {
    position: fixed;
    z-index: 2000;
    max-width: min(280px, calc(100vw - 16px));
    padding: 0.5rem 0.75rem;
    background: #212529;
    color: #fff;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    overflow-wrap: anywhere;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s;
}

.bingo-tooltip.show {
    opacity: 1;
    visibility: visible;
}

.bingo-tooltip::after {
    content: "";
    position: absolute;
    left: var(--arrow-x, 50%);
    top: 100%;
    margin-left: -6px;
    border: 6px solid transparent;
    border-top-color: #212529;
}

.bingo-tooltip.below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #212529;
}

.bingo-cell.called {
    background: #198754;
    border-color: #146c43;
    color: #fff;
}

/* ---- smartphone-friendly game page ---- */
.game-tabs {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: #fff;
    padding: 0.5rem 0;
}

.game-tabs .nav-link {
    padding: 0.75rem 0;
    font-weight: 600;
}

.call-list {
    max-height: 60vh;
    max-height: 60dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.call-row label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 56px;
    margin: 0;
    padding: 0.5rem 1rem;
    cursor: pointer;
    touch-action: manipulation;
}

.call-row .form-check-input {
    flex-shrink: 0;
    width: 1.6rem;
    height: 1.6rem;
    margin-top: 0;
}

/* Dashboard game list */
.dashboard-game-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dashboard-game-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 16px;
    margin-bottom: 12px;

    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.dashboard-game-name {
    font-size: 1rem;
    font-weight: 600;
    overflow-wrap: anywhere;
    min-width: 0;
}

.dashboard-game-item form {
    margin: 0;
    flex-shrink: 0;
}

.dashboard-join-button {
    min-height: 44px;
    padding: 10px 16px;
    white-space: nowrap;
}

/* Smartphone layout */
@media (max-width: 576px) {
    .dashboard-game-item {
        gap: 12px;
        padding: 12px;
    }

    .dashboard-game-name {
        font-size: 0.95rem;
    }

    .dashboard-join-button {
        min-height: 44px;
        padding: 10px 12px;
    }
}
