*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: white;
    color: #222;
}

body {
    min-height: 100vh;
}

a, .btn-link {
    color: #006bb7;
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.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;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* ERROR BOX */
.blazor-error-boundary {
    background: #b32121;
    color: white;
    padding: 1rem;
    border-radius: 12px;
    margin: 1rem;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* =========================
   HOME PAGE
========================= */

.home-container {
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    align-items: center;
    padding-top: 60px; 

    background: white;
    color: #222;
    text-align: center;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: #111;
}

.subtitle {
    font-size: 1.15rem;
    margin: 0 0 28px;
    color: #666;
}

.team-buttons {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.team-btn {
    width: 80%;
    max-width: 400px;
    padding: 18px;
    font-size: 1.15rem;
    font-weight: 600;
    border-radius: 18px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

    .team-btn:active {
        transform: scale(0.97);
    }

    .team-btn.red {
        background: linear-gradient(135deg, #ffb3b3, #ff7f7f);
        color: #8f0000;
    }

    .team-btn.blue {
        background: linear-gradient(135deg, #b8c6ff, #7d95ff);
        color: #1737c9;
    }

    .team-btn.green {
        background: linear-gradient(135deg, #b8f0c8, #6fd18f);
        color: #16663c;
    }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-box {
    width: 90%;
    max-width: 360px;
    background: white;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

    .modal-box h3 {
        margin-bottom: 10px;
    }

.age-input {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    border-radius: 12px;
    border: 1px solid #ddd;
    margin-top: 12px;
    margin-bottom: 14px;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.cancel-btn,
.confirm-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
}

.cancel-btn {
    background: #eee;
}

.confirm-btn {
    background: #6677f1;
    color: white;
}

.error-text {
    color: red;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

/* =========================
   BOARD PAGE
========================= */

.board-container {
    min-height: 100vh;
    background: white;
    padding: 20px 14px 40px;
}

.board-header {
    text-align: center;
    margin-bottom: 20px;
}

    .board-header h1 {
        margin: 0;
        font-size: 1.8rem;
        color: #111;
    }

    .board-header h2 {
        margin: 6px 0 0;
        font-size: 1rem;
        font-weight: 500;
        color: #777;
    }

/* GRID */

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

/* TILE STRUCTURE */

.tile-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    perspective: 1000px;
    cursor: pointer;
}

.tile-inner {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

    .tile-inner.flipped {
        transform: rotateY(180deg);
    }

/* TILE FACE */

.tile-face {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    backface-visibility: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    font-size: 0.82rem;
    line-height: 1.2;
}

/* FRONT */

.tile-front {
    background: linear-gradient(135deg, #6a7cff, #8b97ff);
    color: white;
    font-weight: 600;
}

/* BACK */

.tile-back {
    background: white;
    color: #111;
    border: 1px solid #ececec;
    transform: rotateY(180deg);
}

/* COMPLETED */

.tile-inner.completed.reward .tile-back {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    font-weight: 700;
}

.tile-inner.completed.punishment .tile-back {
    background: linear-gradient(135deg, #ff5f5f, #d63031);
    color: white;
    font-weight: 700;
}

/* IMAGE */

.tile-img {
    width: 42px;
    height: 42px;
    margin-bottom: 8px;
    object-fit: contain;
}

/* DONE BUTTON */

.done-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(46,204,113,.35);
    cursor: pointer;
    transition: transform 0.15s ease;
}

    .done-btn:active {
        transform: scale(0.9);
    }

/* =========================
   MOBILE TWEAKS
========================= */

@media (max-width: 500px) {
    .title {
        font-size: 2.1rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .team-btn {
        width: 90%;
        font-size: 1rem;
        padding: 16px;
    }

    .grid {
        gap: 10px;
    }

    .tile-face {
        font-size: 0.72rem;
        padding: 8px;
    }

    .board-header h1 {
        font-size: 1.5rem;
    }

    .board-header h2 {
        font-size: 0.95rem;
    }

    .tile-img {
        width: 36px;
        height: 36px;
    }
}


/* =========================
   ADMIN LOCK BUTTON
========================= */

.admin-lock-btn {
    position: fixed;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    cursor: pointer;
    font-size: 1.1rem;
    z-index: 10;
}

    .admin-lock-btn:active {
        transform: scale(0.95);
    }

/* =========================
   ADMIN PAGE
========================= */

.admin-container {
    min-height: 100vh;
    background: white;
    padding: 20px 16px 40px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
}

    .admin-header h1 {
        margin: 0;
        font-size: 1.8rem;
        color: #111;
    }

    .admin-header p {
        margin: 4px 0 0;
        color: #777;
    }

.back-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #f1f1f1;
    font-size: 1.2rem;
    cursor: pointer;
}

.admin-loading {
    text-align: center;
    color: #777;
}

.admin-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-card {
    border-radius: 20px;
    padding: 18px;
    background: white;
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .admin-card-header h2 {
        margin: 0;
        font-size: 1.2rem;
    }

    .admin-card-header span {
        font-weight: 700;
        color: #6677f1;
    }

.progress-bar {
    height: 10px;
    background: #eeeeee;
    border-radius: 999px;
    margin: 16px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #6677f1, #8b97ff);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

    .admin-stats div {
        background: #f8f8f8;
        border-radius: 14px;
        padding: 12px 8px;
    }

    .admin-stats strong {
        display: block;
        font-size: 1.2rem;
        color: #111;
    }

    .admin-stats span {
        font-size: 0.78rem;
        color: #777;
    }

.admin-refresh-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #6677f1, #8b97ff); /* same as before */
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(102,119,241,0.35);
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

    .admin-refresh-icon:active {
        transform: scale(0.92);
    }

    .admin-refresh-icon:hover {
        box-shadow: 0 8px 24px rgba(102,119,241,0.45);
    }

.reset-btn {
    width: 100%;
    margin-top: 12px;
    padding: 16px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #ff4d4d, #cc0000);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

    .reset-btn:active {
        transform: scale(0.96);
    }

.top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    /* target all links in top bar */
    .top-row a {
        font-size: 1.4rem;
        text-decoration: none;
        transition: transform 0.15s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

        /* hover / tap effect */
        .top-row a:hover {
            transform: scale(1.15);
        }

        /* mobile tap */
        .top-row a:active {
            transform: scale(0.95);
        }