/* Gem League admin: brand colour on top of Metronic, plus the team-logo cropper. */
:root, [data-bs-theme=light] {
    --bs-primary: #d9a900;
    --bs-primary-rgb: 217, 169, 0;
    --bs-primary-active: #b88f00;
    --bs-primary-light: #fff7d6;
    --bs-primary-inverse: #111111;
    --bs-text-primary: #b88f00;
}
[data-bs-theme=dark] {
    --bs-primary: #f5c518;
    --bs-primary-rgb: 245, 197, 24;
    --bs-primary-active: #ffd43b;
    --bs-primary-light: #2b2510;
    --bs-primary-inverse: #111111;
    --bs-text-primary: #f5c518;
}
.btn.btn-primary { color: var(--bs-primary-inverse); }
.btn.btn-primary:hover:not(.btn-active), .btn.btn-primary:focus:not(.btn-active) { color: var(--bs-primary-inverse) !important; }

.gl-team-logo { width: 44px; height: 44px; object-fit: contain; border-radius: .5rem; background: var(--bs-gray-100); }
.gl-team-logo--lg { width: 160px; height: 160px; }
.gl-team-logo-placeholder { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--bs-gray-600); }

.gl-cropper[hidden] { display: none; }
.gl-cropper__frame {
    position: relative; width: 320px; max-width: 100%; aspect-ratio: 1; overflow: hidden;
    border: 2px solid var(--bs-primary); border-radius: .5rem;
    background-color: #fff;
    background-image: linear-gradient(45deg, #e9e9e9 25%, transparent 25%), linear-gradient(-45deg, #e9e9e9 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e9e9e9 75%), linear-gradient(-45deg, transparent 75%, #e9e9e9 75%);
    background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px;
    cursor: grab; touch-action: none; user-select: none;
}
.gl-cropper__frame:active { cursor: grabbing; }
.gl-cropper__frame img { position: absolute; top: 0; left: 0; max-width: none; pointer-events: none; }
.gl-cropper__zoom { width: 320px; max-width: 100%; accent-color: var(--bs-primary); }

.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
[data-bs-theme=light] .btn.btn-light-primary, [data-bs-theme=light] .badge-light-primary { color: #7a5d00; }

/* Toolbar pickers (round / stage / season) shrink on phones instead of overflowing. */
#kt_app_toolbar_container form { max-width: 100%; min-width: 0; }
#kt_app_toolbar_container form select { min-width: 0; max-width: min(100%, 380px); flex: 1 1 auto; text-overflow: ellipsis; }
#kt_app_toolbar_container > div { min-width: 0; max-width: 100%; }
#kt_app_toolbar_container form select.w-auto { width: 100% !important; }
@media (min-width: 768px) { #kt_app_toolbar_container form select.w-auto { width: auto !important; } }

/* X (Twitter) logo inside small icon buttons. */
.gl-x-icon { display: inline-flex; width: 14px; height: 14px; }
.gl-x-icon svg { width: 100%; height: 100%; fill: currentColor; }

/* Metronic has no min-w-0. Without it a flex child won't shrink below its content, so
   text-truncate never truncates (e.g. the account menu's "Discord @… · X @…" line ran
   out of the dropdown). */
.min-w-0 { min-width: 0 !important; }

/* Metronic's small text (fs-7, fs-8, badges, table headers) drops below 12px on phones and
   tablets; .gl-readable keeps a page at 12px minimum there. */
@media (max-width: 991.98px) {
    .gl-dashboard .fs-7,
    .gl-dashboard .badge,
    .gl-readable .fs-7,
    .gl-readable .fs-8,
    .gl-readable .form-text,
    .gl-readable .badge,
    .gl-readable thead th { font-size: 12px !important; }
    /* Small controls are hard to tap on a phone. */
    .gl-readable .btn-sm,
    .gl-readable .form-select-sm { font-size: 13px !important; min-height: 40px; }
}

/* A table that becomes one block per row on phones, so nothing has to scroll sideways. */
@media (max-width: 767.98px) {
    .gl-stack-table thead { display: none; }
    .gl-stack-table,
    .gl-stack-table tbody,
    .gl-stack-table tr,
    .gl-stack-table td { display: block; width: 100%; }
    .gl-stack-table td { padding-left: 0 !important; padding-right: 0 !important; border: 0 !important; }
    .gl-stack-table td + td { padding-top: 0 !important; }
    /* Short facts (tag, role, trophies) share one line under the name. */
    .gl-stack-table td.gl-stack-inline { display: inline-block; width: auto; padding-top: 0 !important; margin-right: 0.85rem; }
    .gl-stack-table td.text-end { text-align: left !important; }
    /* Keep dropdowns readable; the row wraps instead of squeezing them. */
    .gl-stack-table .form-select { min-width: 9.5rem; }
}
