* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f2f2f2;
    color: #111;
    min-height: 100vh;
}

.login,
.app {
    max-width: 620px;
    margin: 0 auto;
    padding: 14px;
}

.top {
    text-align: center;
    margin: 8px 0 10px;
}

.top h2 {
    margin: 0 0 2px;
    color: #c00000;
    font-size: clamp(18px, 5vw, 26px);
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 700;
}

.top h1 {
    margin: 0;
    color: #c00000;
    font-size: clamp(34px, 9vw, 56px);
    font-weight: 900;
    letter-spacing: 6px;
    line-height: 1;
}

.foot {
    text-align: center;
    margin-top: 10px;
    font-size: clamp(9px, 2.6vw, 12px);
    color: #c00000;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ---------- Login ---------- */

.login-box {
    background: #fff;
    border: 2px solid #111;
    padding: 22px 18px;
    margin-top: 18px;
}

.login-box h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.login-box .hint {
    margin: 0 0 14px;
    font-size: 14px;
    color: #555;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-box input[type="email"] {
    padding: 13px 12px;
    font-size: 16px;
    border: 2px solid #999;
    border-radius: 4px;
    outline: none;
}

.login-box input[type="email"]:focus {
    border-color: #c00000;
}

.login-box button {
    padding: 13px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    background: #c00000;
    color: #fff;
    cursor: pointer;
}

.login-box button:active {
    background: #900000;
}

.login-box .error {
    margin: 0 0 12px;
    padding: 10px;
    background: #ffe3e3;
    border: 1px solid #c00000;
    color: #c00000;
    border-radius: 4px;
    font-size: 14px;
}

/* ---------- Card ---------- */

.userbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 13px;
}

.userbar .who {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #444;
}

.userbar .logout {
    flex-shrink: 0;
    color: #c00000;
    text-decoration: none;
    font-weight: 700;
    padding: 6px 10px;
    border: 1px solid #c00000;
    border-radius: 4px;
}

.userbar .logout:active {
    background: #c00000;
    color: #fff;
}

.bingo-banner {
    background: #c00000;
    color: #fff;
    font-weight: 800;
    text-align: center;
    padding: 10px;
    margin: 0 0 10px;
    border-radius: 4px;
    letter-spacing: 1px;
    font-size: clamp(13px, 3.4vw, 17px);
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

.card {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    background: #fff;
    border: 3px solid #111;
}

.cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
    padding: 4px 3px 3px;
    border: 1px solid #888;
    background: #fff;
    color: #111;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
}

button.cell {
    width: 100%;
    height: 100%;
}

.cell:active {
    background: #f0f0f0;
}

.cell.done {
    background: #ffdcdc;
}

.cell .label {
    font-size: clamp(7px, 2.55vw, 12px);
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: auto;
    width: 100%;
}

.cell.done .label {
    color: #a00000;
}

.cell.done::after {
    content: "\2713";
    position: absolute;
    top: 1px;
    right: 4px;
    color: #c00000;
    font-size: clamp(10px, 3vw, 15px);
    font-weight: 900;
}

.cell .subs {
    display: flex;
    gap: 2px;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    padding-top: 3px;
    flex-wrap: nowrap;
}

.cell .sub {
    width: clamp(12px, 3.4vw, 17px);
    height: clamp(12px, 3.4vw, 17px);
    min-width: 0;
    padding: 0;
    border: 1px solid #555;
    background: #fff;
    color: #c00000;
    font-size: clamp(8px, 2vw, 11px);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px;
}

.cell .sub.done {
    background: #c00000;
    border-color: #c00000;
    color: #fff;
}

.cell .progress {
    font-size: clamp(6px, 2vw, 9px);
    color: #666;
    font-weight: 700;
    line-height: 1.3;
}

.cell.done .progress {
    color: #a00000;
}

.cell.in-line {
    outline: 3px solid #ffb300;
    outline-offset: -3px;
}

@media (min-width: 560px) {
    .cell .label {
        font-size: 11px;
    }
    .cell .sub {
        width: 15px;
        height: 15px;
    }
}
