@import url('https://fonts.googleapis.com/css2?family=Lustria&display=swap');

:root {
    --accent: #7b3140; /* deep burgundy accent for buttons/links */
    --accent-soft: #f3e5eb; /* pale burgundy/rose tone */
    --border-soft: #dddddd;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Lustria", Georgia, "Times New Roman", serif;
}

.page-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
}

/* =========================================================
   Hero band (home page)
   ========================================================= */
header.site-hero {
    border-radius: 14px;
    padding: 1.1rem 1.1rem 1rem;
    margin: 0.8rem 0 1rem;
    background: linear-gradient(180deg, var(--accent-soft), #ffffff);
    border: 1px solid #ead6dd;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.site-hero-inner {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1.1rem;
    align-items: center;
}

.site-hero-brand {
    display: flex;
    justify-content: center;
    align-items: center;
}

.site-hero-logo {
    max-width: 220px;
    height: auto;
    display: block;
}

.site-hero-content {
    text-align: left;
}

.site-hero-title {
    margin: 0 0 0.35rem;
    font-size: 1.55rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #2f2f2f;
}

.site-hero-lede {
    margin: 0 0 0.8rem;
    font-size: 1.0rem;
    line-height: 1.35;
    color: #444;
    max-width: 62ch;
}

.site-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 0.65rem;
}

.hero-link {
    display: inline-block;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
    border: 1px solid var(--border-soft);
    background: #ffffff;
    color: #444;
}

.hero-link:hover,
.hero-link:focus {
    filter: brightness(0.98);
    text-decoration: none;
}

/* Make thresholds links feel primary without being too shouty */
#view-thresholds-woods-link.hero-link,
#view-thresholds-indoor-link.hero-link {
    border-color: rgba(123, 49, 64, 0.35);
    background: rgba(123, 49, 64, 0.06);
    color: #3f1b23;
}

#view-thresholds-woods-link.hero-link:hover,
#view-thresholds-indoor-link.hero-link:hover {
    filter: brightness(1.02);
}

.site-hero-note {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    max-width: 80ch;
}

header.site-header {
    padding: 1.2rem 1rem 0.4rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

header.site-header.dashboard-header {
    /* Make dashboard header more compact and “app-like” */
    background: var(--accent-soft);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 0.8rem 1rem 1rem;
    margin-bottom: 1rem;
}

/* Ensure meta block is left-aligned in dashboard */
header.site-header.dashboard-header .site-header-meta {
    align-items: flex-start;
    text-align: left;
}

/* Slightly stronger title on dashboard */
header.site-header.dashboard-header .site-title {
    font-size: 1.1rem;
}

.site-logo-image {
    max-width: 220px;
    height: auto;
    display: block;
    margin: 0 auto 0.5rem;
}

.site-header p {
    margin: 0;
    font-size: 1.15rem;
    color: #444;
}

/* Intro + legend */
.challenge-intro {
    text-align: center;
    margin: 0.75rem 0;
    color: #444;
}

.challenge-summary {
    max-width: 720px;
    margin: 0 auto 1.2rem;
    font-size: 0.95rem;
    line-height: 1.35;
}

.challenge-summary a {
    color: var(--accent);
    text-decoration: underline;
}

.challenge-rank-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 0.5rem;
}

.legend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.legend-star {
    width: 128px;
    height: 128px;
    object-fit: contain;
    margin-bottom: 0.35rem;
}

/* Layout for hall of fame + login column */
.front-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.25rem 1.25rem 1.5rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);

}

.front-main {
    flex: 2 1 320px;
    background: #ffffff;
    border-radius: 10px;
    padding: 1rem 1rem 1.25rem;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.front-aside {
    flex: 1 1 260px;
    background: #ffffff;
    border-radius: 10px;
    padding: 1rem 1rem 1.25rem;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

h2.section-title {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #444;
}

/* Hall of Fame */
.hof-intro {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.75rem;
}

/* HOF section header: master icon left of title + intro */
.hof-section-header {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    margin-bottom: 0.75rem;
}

.hof-section-icon {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.hof-section-icon-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
}

.hof-section-text .section-title {
    margin-top: 0.1rem;
}

.hof-section-text .hof-intro {
    margin-top: 0.15rem;
}

/* Table wrapper (base) */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: #fff;
}

/* HOF table */
table.hof-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
    font-size: 0.9rem;
    table-layout: fixed; /* prevents column resizing during sorts */
}

.hof-table th,
.hof-table td {
    padding: 0.45rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hof-table th {
    background: var(--accent-soft);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
}

.hof-table tr:last-child td {
    border-bottom: none;
}

/* Column widths via <colgroup> */
.hof-col-archer {
    width: 30%;
}

.hof-col-rank {
    width: 18%;
}

.hof-col-bowstyle {
    width: 36%;
}

.hof-col-score {
    width: 16%;
}

/* Rank column: allow icon to overflow above the table */
.hof-rank-icon {
    position: relative;
    text-align: center;
    width: 1%;
    white-space: nowrap;
    overflow: visible;
}

.hof-table th.hof-rank-col,
.hof-table td.hof-rank-icon {
    overflow: visible;
    text-overflow: unset;
}

/* Rank icon: small in cell, large on hover/focus/tap */
.hof-rank-icon .rank-star {
    position: relative;
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: inline-block;
    transition: transform 140ms ease, filter 140ms ease;
    transform-origin: center;
    cursor: pointer;
}

.hof-rank-icon:hover .rank-star,
.hof-rank-icon .rank-star:focus,
.hof-rank-icon.is-zoom .rank-star {
    transform: scale(2.5);
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25));
    z-index: 10;
}

/* Raise the whole cell above neighbours during zoom */
.hof-table td.hof-rank-icon {
    z-index: 1;
}

.hof-rank-icon:hover,
.hof-rank-icon.is-zoom {
    z-index: 9999;
}

/* Prevent clipping of the zoomed icon on the home page */
.front-layout .table-wrapper {
    overflow: visible;
}

/* Home hero: install / open-in-new-tab CTA */
.site-hero-install {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.btn-small {
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
}

.install-hint {
    font-size: 0.9rem;
    color: #555;
}


/* Login box */
.login-intro {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.75rem;
    font-weight: bold;
}

/* Logged-in actions (Your Dashboard / Admin / Logout) */
.logged-in-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

/* Let each button share the row nicely on wider screens */
.logged-in-actions .btn-primary,
.logged-in-actions .btn-secondary {
    flex: 1 1 140px;
    text-align: center;
}

form.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.form-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
}

.form-field input[type="email"],
.form-field input[type="password"] {
    padding: 0.45rem 0.55rem;
    border-radius: 6px;
    border: 1px solid var(--border-soft);
    font-size: 0.9rem;
}

/* Removed duplicated .btn-primary and .btn-secondary blocks here as per instructions */

/* Modal / popup */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.modal.is-open {
    display: block;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.modal-dialog {
    position: relative;
    max-width: 900px;
    margin: 4vh auto;
    background: #fff;
    border-radius: 10px;
    padding: 1rem 1.2rem 1.2rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

/* Threshold modal: rank legend strip */
.threshold-rank-legend {
    margin: 0 0 0.75rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    border: 1px solid #ead6dd;
    background: linear-gradient(180deg, rgba(123, 49, 64, 0.06), rgba(255, 255, 255, 0));
    text-align: center;
}

.threshold-rank-legend-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.9rem;
    align-items: center;
    justify-content: center;
}

.threshold-rank-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.threshold-rank-icon {
    width: 128px;
    height: 128px;
    object-fit: contain;
    flex: 0 0 auto;
}



.modal-title {
    margin: 0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
}

.threshold-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.threshold-table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.threshold-table th,
.threshold-table td {
    border: 1px solid #ccc;
    padding: 0.3rem 0.4rem;
    text-align: center;
}

.threshold-table th {
    background: #f5f5f5;
}

.threshold-footnote {
    font-size: 0.8rem;
    color: #666;
}


/* Row colouring for ranks in popup */
.rank-row-master {
    background: #e3d5db;
}

.rank-row-gold {
    background: #fff3c2;
}

.rank-row-silver {
    background: #eef1fa;
}

.rank-row-bronze {
    background: #fde6d6;
}

.short_input {
    width: 6ch;
    max-width: 6ch;
}


.site-logo-small {
    width: 128px;
    height: 128px;
    object-fit: contain;
    flex-shrink: 0;
}

.site-header-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.site-title {
    margin: 0;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #444;
}

.user-chip {
    font-size: 0.85rem;
    color: #555;
}

.user-chip strong {
    font-weight: 600;
}

.nav-actions {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-primary {
    border: none;
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-secondary {
    border: 1px solid var(--border-soft);
    background: #fff;
    color: #444;
}

.btn-secondary:hover {
    filter: brightness(0.97);
}

/* Summary bar */
.summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.summary-item {
    flex: 1 1 170px;
    background: #ffffff;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.summary-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #777;
    margin-bottom: 0.2rem;
}

.summary-value {
    font-size: 0.98rem;
    font-weight: 600;
    color: #333;
}

.summary-sub {
    font-size: 0.8rem;
    color: #777;
}

.summary-text a {
    color: var(--accent);
    text-decoration: underline;
}

/* Dashboard tabs – integrated style */
.dashboard-tabs {
    display: flex;
    gap: 0.25rem;
    margin: 0.25rem 0 0;
    padding-left: 0.25rem;
}

.tab-btn {
    position: relative;
    padding: 0.45rem 0.9rem;
    border-radius: 10px 10px 0 0;
    border: 1px solid var(--border-soft);
    border-bottom: none;
    background: #f8f8f8;
    color: #555;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tab-btn:hover {
    background: #f3f3f3;
}

.tab-btn.is-active {
    background: #ffffff;
    color: #333;
    border-color: var(--border-soft);
    z-index: 2;
}

/* Panels feel connected to tabs */
.tab-panel {
    display: none;
    border: 1px solid var(--border-soft);
    border-radius: 0 10px 10px 10px;
    padding: 1.1rem 1rem 1rem; /* extra space from the tab border line */
    margin-top: -1px; /* visually connect to active tab */
}

.tab-panel.is-active {
    display: block;
}

/* Admin tabs – match Dashboard tab styling */
.tabs[data-tabs="admin"] .tab-buttons {
    display: flex;
    gap: 0.25rem;
    margin: 0.25rem 0 0;
    padding-left: 0.25rem;
    flex-wrap: wrap;
}

.tabs[data-tabs="admin"] .tab-button {
    position: relative;
    padding: 0.45rem 0.9rem;
    border-radius: 10px 10px 0 0;
    border: 1px solid var(--border-soft);
    border-bottom: none;
    background: #f8f8f8;
    color: #555;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tabs[data-tabs="admin"] .tab-button:hover {
    background: #f3f3f3;
}

.tabs[data-tabs="admin"] .tab-button.is-active {
    background: #ffffff;
    color: #333;
    border-color: var(--border-soft);
    z-index: 2;
}

.tabs[data-tabs="admin"] .tab-panels {
    display: block;
}

.tabs[data-tabs="admin"] .tab-panel {
    display: none; /* JS toggles display; keep default consistent */
    border: 1px solid var(--border-soft);
    border-radius: 0 10px 10px 10px;
    padding: 1.1rem 1rem 1rem; /* extra space from the tab border line */
    margin-top: -1px; /* visually connect to active tab */
}

/* Make sure inline-style display toggling still wins */
.tabs[data-tabs="admin"] .tab-panel[style*="display"] {
    border: 1px solid var(--border-soft);
}

/* Admin – Quick Actions layout (two columns on desktop) */
.admin-quick-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}


/* Allow cards inside the quick grid to stretch nicely */
.admin-quick-grid .admin-add-user {
    max-width: none;
}

main {
    display: grid;
    grid-template-columns: minmax(0, 2fr);
    gap: 1.25rem;
}

.card {
    background: #ffffff;
    border-radius: 10px;
    padding: 1rem 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}

.card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.0rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #444;
}

.summary-text {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.6rem;
}

/* Chart card */
.chart-card {
    margin-bottom: 1.25rem;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
}

#scoreChart {
    width: 100%;
    max-width: 100%;
    height: 360px;
}

.chart-empty {
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.5rem;
}

.chart-key {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: #555;
}

.chart-key-group {
    margin-bottom: 0.35rem;
}

.chart-key-row {
    margin: 0.12rem 0;
}

.chart-key-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.chart-key-dash {
    display: inline-block;
    width: 32px;
    height: 0;
    border-top: 2px solid #555;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
}

table.history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
    font-size: 0.9rem;
}

.history-table th,
.history-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid #eee;
    text-align: left;
    white-space: nowrap;
}

.history-table th {
    background: var(--accent-soft);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
}

.history-table tr:last-child td {
    border-bottom: none;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem 1rem;
    margin-bottom: 0.5em;
}

/* Removed duplicated .form-field and .form-field label block here as per instructions */

.form-field input[type="number"],
.form-field input[type="date"],
.form-field select,
.form-field input[type="file"] {
    padding: 0.45rem 0.55rem;
    border-radius: 6px;
    border: 1px solid var(--border-soft);
    font-size: 0.9rem;
}

.form-footer {
    margin-top: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.form-help {
    font-size: 0.8rem;
    color: #777;
}

.history-table td.history-actions {
    white-space: nowrap;
}

.action-buttons {
    display: inline-flex;
    gap: 0.35rem;
    flex-wrap: nowrap;
    align-items: center;
}

.action-chip {
    display: inline-block;
    padding: 0.18rem 0.45rem;    /* slightly tighter */
    border-radius: 999px;
    font-size: 0.75rem;          /* a bit smaller */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    user-select: none;
    border: none;
    transition: filter 0.12s ease, transform 0.12s ease, opacity 0.12s ease;
}

/* Variants */
.action-card {
    background: #d5ecff;
    color: #124a73;
}

.action-edit {
    background: #ffe7b7;
    color: #8e5800;
}

.action-delete {
    background: #ffdad5;
    color: #801c1c;
}

/* Hover/active states */
.action-chip:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.action-chip:active {
    filter: brightness(0.92);
    transform: translateY(0);
}

/* Action chip links should look like buttons, not links */
a.action-chip {
    text-decoration: none;
    color: inherit;
}

/* Prevent underline on hover/focus as well */
a.action-chip:hover,
a.action-chip:focus {
    text-decoration: none;
}

.alert-error {
    margin-bottom: 0.6rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 6px;
    background: #ffe5e5;
    color: #8a1a1a;
}

.alert-success {
    margin-bottom: 0.6rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 6px;
    background: #e5f8e8;
    color: #1b6b29;
}

/* Login meta text + links (home sidebar) */
/* Login meta text + links (home sidebar) */
.login-intro {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.75rem;
}

.login-meta {
    margin-top: 0.45rem; /* small gap under the button */
    padding: 0; /* no box padding */
    font-size: 0.9rem; /* match body text size */
    color: #555; /* subtle text colour */
    border: none; /* remove box */
    background: transparent; /* remove box */
}

.login-meta + .login-meta {
    margin-top: 0.25rem; /* tight gap between the two lines */
}

.login-meta a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.login-meta a:hover,
.login-meta a:focus {
    text-decoration: underline;
}

/* Unified auth feedback box */
.auth-feedback {
    margin-top: 0.9rem;
    padding: 0.7rem 0.85rem;
    border-radius: 8px;
    border: 1px solid #d0d8e8;
    background: #ffeedd;
    color: #444;
    font-size: 0.9rem;
    line-height: 1.4;
}

.auth-feedback p {
    margin: 0 0 0.25rem;
}

.auth-feedback p:last-child {
    margin-bottom: 0;
}

/* Variants */
.auth-feedback--error {
    color: #8a1a1a;
    background: #ffaaaa;
    border-color: #8a1a1a;
}

.auth-feedback--success {
    color: #1b6b29;
    background: #aaffaa;
    border-color: #1b6b29;
}


/* Admin threshold tables: subtle zebra + focus row to reduce mistakes */
.admin-thresholds .history-table tbody tr:nth-child(even),
.admin-indoor .history-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.03);
}

.admin-thresholds .history-table tbody tr:hover,
.admin-indoor .history-table tbody tr:hover {
    background: rgba(123, 49, 64, 0.06);
}

/* Keep inputs readable on striped rows */

.admin-thresholds .history-table input,
.admin-indoor .history-table input,
.admin-thresholds .history-table select,
.admin-indoor .history-table select {
    background: rgba(255, 255, 255, 0.85);
}

/* Admin inputs: match Add New User styling */
.admin-thresholds .history-table input,
.admin-indoor .history-table input,
.admin-thresholds .history-table select,
.admin-indoor .history-table select,
#indoor-shoot-modal input,
#indoor-shoot-modal select {
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    box-sizing: border-box;
    outline: none;
}

.admin-thresholds .history-table input:focus,
.admin-indoor .history-table input:focus,
.admin-thresholds .history-table select:focus,
.admin-indoor .history-table select:focus,
#indoor-shoot-modal input:focus,
#indoor-shoot-modal select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(123, 49, 64, 0.12);
}

/* Admin: Add New User card */
.admin-add-user {
    margin-top: 1.25rem;
    padding: 0.9rem 1.1rem 1.1rem;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: #fdf7fb; /* soft version of your page tint */
}

.admin-add-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 0.6rem;
}

.admin-add-grid {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.admin-add-grid.admin-add-grid-wide {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.admin-add-span-all {
    grid-column: 1 / -1;
}


.admin-add-field label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.admin-add-field input[type="text"],
.admin-add-field input[type="email"],
.admin-add-field input[type="password"] {
    width: 100%;
    max-width: 260px;
    padding: 0.35rem 0.5rem;
    border-radius: 6px; /* match other inputs */
    border: 1px solid var(--border-soft);
    font-size: 0.9rem;
    box-sizing: border-box;
    background: #ffffff; /* ensure same background as other fields */
}

/* Admin: inline user edit inputs in users table */
.history-table input[name^="edit_"] {
    border-radius: 6px;
    border: 1px solid var(--border-soft);
    font-size: 0.9rem;
    box-sizing: border-box;
    background: #ffffff;
}

.admin-add-field-inline label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.admin-add-field-inline input[type="checkbox"] {
    margin: 0;
}

.admin-add-footer {
    margin-top: 0.7rem;
}

/* =========================================================
   Responsive
   ========================================================= */

/* Mobile tweaks */
@media (max-width: 640px) {

    .dashboard-tabs {
        gap: 0.2rem;
        padding-left: 0;
    }

    .tab-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
    }

    .tab-panel {
        padding-top: 0.75rem;
    }

    .site-logo-image {
        max-width: 170px;
    }

    .front-main,
    .front-aside {
        padding: 0.8rem;
    }

    /* Stack ranking columns and let tables shrink on very small screens */
    .front-layout {
        flex-direction: column;
    }

    .table-wrapper {
        overflow-x: visible;
    }

    table.hof-table {
        min-width: 100%;
        table-layout: auto;
    }

    .hof-table th,
    .hof-table td {
        white-space: normal;
        text-overflow: clip;
    }

    .legend-star {
        width: 96px;
        height: 96px;
    }

    .hof-rank-icon .rank-star {
        width: 48px;
        height: 48px;
    }

    .challenge-summary {
        font-size: 0.9rem;
    }

    .modal-dialog {
        margin: 6vh 0.5rem;
        padding: 0.8rem 0.8rem 1rem;
    }

    .threshold-rank-legend {
        padding: 0.5rem 0.55rem;
        margin-bottom: 0.65rem;
    }

    .threshold-rank-legend-inner {
        justify-content: center;
        gap: 0.55rem 0.75rem;
    }

    .threshold-rank-icon {
        width: 72px;
        height: 72px;
    }

    /* Responsive section header icon sizing */
    .hof-section-header {
        grid-template-columns: 56px minmax(0, 1fr);
        gap: 0.6rem;
        margin-bottom: 0.65rem;
    }

    .hof-section-icon-img {
        width: 56px;
        height: 56px;
    }

    header.site-header {
        flex-direction: column;
        align-items: center;
        padding: 0.9rem 0.75rem 1.1rem;
    }

    /* Responsive hero styles */
    header.site-hero {
        padding: 0.9rem 0.75rem 0.9rem;
        margin: 0.6rem 0 0.9rem;
        border-radius: 12px;
    }

    .site-hero-inner {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .site-hero-logo {
        max-width: 170px;
    }

    .site-hero-content {
        text-align: center;
    }

    .site-hero-title {
        font-size: 1.25rem;
    }

    .site-hero-lede {
        font-size: 0.95rem;
        margin-bottom: 0.7rem;
        max-width: none;
    }

    .site-hero-actions {
        justify-content: center;
    }

    .hero-link {
        font-size: 0.85rem;
        padding: 0.42rem 0.75rem;
    }

    .nav-actions {
        margin-left: 0;
        margin-top: 0.5rem;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .site-logo-small {
        width: 64px;
        height: 64px;
    }

    .summary-bar {
        flex-direction: column;
    }

    #scoreChart {
        height: 220px;
    }

    /* Let the history table shrink properly on small screens */
    table.history-table {
        min-width: 100%;
        table-layout: auto;
    }

    .history-table th,
    .history-table td {
        white-space: normal;        /* allow wrapping */
        text-overflow: clip;
    }

    /* Action column: left-align and allow wrapping */
    .history-table td.history-actions {
        white-space: normal;
        text-align: left;
    }

    .action-buttons {
        flex-wrap: wrap;
        row-gap: 0.2rem;
        font-size: 0.68rem;
    }

    /* Smaller chips on narrow screens */
    .action-chip {
        font-size: 0.68rem;
        padding: 0.14rem 0.3rem;   /* noticeably slimmer */
    }

    /* Slightly smaller table text on very small screens */
    table.hof-table,
    table.history-table {
        font-size: 0.7rem;
    }

    .hof-table th,
    .history-table th {
        font-size: 0.6rem;
    }

    .summary-item {
        padding: 0.45rem 0.6rem;
        border-radius: 8px;
    }

    .summary-label {
        font-size: 0.65rem;
        margin-bottom: 0.05rem;
        letter-spacing: 0.05em;
    }

    .summary-value {
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 0.1rem;
    }

    .summary-sub {
        font-size: 0.7rem;
        line-height: 1.15;
    }


}

@media (max-width: 900px) {
    .admin-quick-grid {
        grid-template-columns: 1fr;
    }
}

/* For touch devices, hover shouldn't depend on pointer */
@media (hover: none) {
    .action-chip:hover {
        transform: none;
        filter: none;
    }
    .page-wrapper {
        padding: 0.5rem 0.4rem 0.6rem;
    }

    /* Reduce “gap” after the last card */
    .page-wrapper > .card:last-child,
    .page-wrapper > main > .card:last-child {
        margin-bottom: 0.3rem;
    }
}

@media (max-width: 600px) {

    .page-wrapper {
        padding: 0.5rem 0.4rem 0.6rem;
    }

    /* Reduce “gap” after the last card */
    .page-wrapper > .card:last-child,
    .page-wrapper > main > .card:last-child {
        margin-bottom: 0.3rem;
    }

}

@media (max-width: 900px) {
    .admin-add-grid.admin-add-grid-wide {
        grid-template-columns: 1fr;
    }
    .page-wrapper {
        padding: 0.5rem 0.4rem 0.6rem;
    }

    /* Reduce “gap” after the last card */
    .page-wrapper > .card:last-child,
    .page-wrapper > main > .card:last-child {
        margin-bottom: 0.3rem;
    }


}

