/* The palette: other colours appear once or twice, next to what they colour */
:root {
    --white: #FFFFFF;
    --gray-900: #111827;
    --gray-800: #1F2937;
    --gray-700: #374151;
    --gray-600: #4B5563;
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --blue-600: #2563EB;
    --blue-700: #1D4ED8;
    --blue-500: #3B82F6;
    --blue-100: #EAF1FE;
    --red-600: #DC2626;
    --red-700: #B91C1C;
    --red-100: #FEE2E2;
    --green-600: #16A34A;
    --green-700: #15803D;
    --green-800: #166534;
    --green-100: #DCFCE7;
    --amber-700: #B45309;
    --amber-800: #92400E;
    --amber-100: #FEF3C7;
    --page-background: #F9F9F9;
    /* What the status bar, the notch and the home indicator cover in an installed app, zero in a browser tab.
       The Android app sets the first names on old web views, see docs/mobile-apps.md */
    --safe-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
    --safe-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    padding: calc(12px + var(--safe-top)) 12px 12px;
    background: var(--page-background);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

.game-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.participant {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    flex-wrap: wrap;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

input, select, textarea {
    padding: 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    width: 100%;
    -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue-500);
}

input[type="number"] {
    width: 100%;
    min-width: 60px;
}

input[type="date"],
input[type="datetime-local"] {
    width: 100%;
}

button {
    padding: 12px 20px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    background: var(--blue-500);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 44px; /* Touch-friendly */
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button:active {
    background: var(--blue-600);
}

button:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.85em;
    overflow-x: auto;
    display: block;
}

table th, table td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: center;
    min-width: 60px;
}

.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-x: auto;
}

.select-input {
    min-width: 100%;
    padding: 12px 16px;
    border: 2px solid #ccc;
    border-radius: 10px;
    background: var(--page-background);
    font-weight: 600;
    font-size: 16px;
}

.select-popup-title { margin-top: 0; }
.select-popup-done { width: 100%; }

.select-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    -webkit-tap-highlight-color: transparent;
}

.select-popup {
    position: static;
    background: var(--white);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
    touch-action: manipulation;
}

.select-option {
    padding: 16px 12px;
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    background: var(--page-background);
    color: black;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.select-option.active {
    background: var(--blue-500);
    border-color: var(--blue-500);
    color: white;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-weight: 600;
    font-size: 0.9em;
    color: #555;
}

.error input,
.error select,
.error textarea {
    border-color: var(--red-600);
}

.error-text {
    font-size: 0.85em;
    color: var(--red-600);
    font-weight: 500;
}

.group-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    color: white;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.group-A { background: #2f80ed; }
.group-B { background: #27ae60; }
.group-C { background: #9b51e0; }
.group-D { background: #ffff1b; }
.group-none { background: #bdbdbd; }

/* Game page (.gp): header, summary, tabs, players, matches, standings, sheets */
.gp {
    color: var(--gray-900);
    margin: -12px;
    padding: 0 0 24px;
    min-height: 100vh;
    background: var(--gray-100);
}
.gp.gp-with-bar { padding-bottom: calc(120px + var(--safe-bottom)); }
.gp .gp-header { display: flex; align-items: center; gap: 4px; padding: 8px 8px 4px; }
.gp .gp-title { flex: 1; min-width: 0; margin: 0; font-size: 20px; font-weight: 700; color: var(--gray-900); overflow-wrap: anywhere; }
.gp .gp-icon-btn {
    width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 12px;
    background: transparent; color: var(--gray-800); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gp .gp-icon-btn:active, .gp .gp-icon-btn.active { background: var(--gray-200); }
.gp .gp-icon-btn.gp-icon-btn-sm { color: var(--gray-600); }
.gp .gp-card { background: var(--white); border-radius: 16px; box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05); }
.gp .gp-summary {
    margin: 4px 16px 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
}
.gp .gp-row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gp .gp-muted { color: var(--gray-500); font-size: 13px; }
.gp .gp-small { font-size: 13px; }
.gp .gp-inline-icon { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.gp .gp-state {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
    font-size: 13px; font-weight: 600; background: var(--gray-100); color: var(--gray-700);
}
.gp .gp-state-REGISTRATION { background: var(--blue-100); color: var(--blue-700); }
.gp .gp-state-STARTED { background: var(--green-100); color: var(--green-800); }
.gp .gp-state-CANCELLED { background: var(--red-100); color: var(--red-700); }
.gp .gp-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.gp .gp-dot-green { background: var(--green-600); }
.gp .gp-dot-amber { background: #F59E0B; }
.gp .gp-date { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; color: var(--gray-900); }
.gp .gp-club {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15px; font-weight: 600;
    color: var(--blue-600); text-decoration: none;
}
.gp .gp-club-courts { font-weight: 500; color: var(--gray-500); }
.gp .gp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gp .gp-chip { padding: 4px 10px; border-radius: 8px; background: var(--gray-100); font-size: 13px; color: var(--gray-700); }
/* games list: each row reuses the game page summary card */
.gp.gp-embedded { margin: 0; padding: 0; min-height: 0; background: transparent; }
.gp .gp-game-row { margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.gp .gp-game-row:active { background: var(--gray-50); }
.gp .gp-club.gp-club-plain { gap: 4px 8px; font-weight: 500; color: var(--gray-500); }
.gp .gp-club-plain .gp-club-name { font-weight: 600; color: var(--gray-900); }
.gp .gp-game-row-name { margin: 0; font-size: 18px; font-weight: 700; color: var(--gray-900); overflow-wrap: anywhere; }

.gp .gp-tabs {
    /* tabs that don't fit go to the next row, a label is never cut */
    margin: 0 16px 14px; display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--white);
    border-radius: 22px; box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
}
.gp .gp-tab {
    flex: 1 1 auto; height: 36px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 999px;
    background: transparent; color: var(--gray-500); font-size: 14px; font-weight: 600;
}
.gp .gp-tab.active { background: #E3EEFA; color: var(--blue-700); }

.gp .gp-stack { padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
.gp .gp-stack.gp-stack-tight { gap: 8px; }
.gp .gp-section-label {
    font-size: 13px; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.04em;
}
.gp .gp-round-label { padding: 8px 4px 0; }
.gp .gp-list-head { padding: 0 4px 2px; align-items: baseline; }
.gp .gp-empty { text-align: center; padding: 24px 12px; color: var(--gray-500); font-size: 14px; }

.gp .gp-info { display: flex; flex-direction: column; }
.gp .gp-info-row {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    min-height: 48px; padding: 8px 16px; border-bottom: 1px solid #F0F1F3; font-size: 15px;
}
.gp .gp-info-row:last-child { border-bottom: 0; }
.gp .gp-info-row > span { color: var(--gray-500); }
.gp .gp-info-row > strong { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.gp .gp-link-btn {
    display: flex; align-items: center; gap: 6px; min-height: 40px; margin-right: -8px; padding: 0 8px;
    border-radius: 10px; font-weight: 600; color: var(--blue-600); text-decoration: none; text-align: right;
}
.gp .gp-description { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.gp .gp-description p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--gray-800); white-space: pre-wrap; }

.gp .gp-add-player {
    display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; background: var(--white);
    border: 1.5px solid var(--gray-200); border-radius: 14px; color: var(--gray-500);
}
.gp .gp-add-player input {
    flex: 1; min-width: 0; padding: 0; border: 0; outline: none; background: transparent;
    font-size: 15px; color: var(--gray-900);
}
.gp .gp-team {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 64px;
    background: var(--white); border-radius: 14px; box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
    border: 2px solid transparent;
}
.gp .gp-team.tappable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gp .gp-team.tappable:active { background: var(--gray-100); }
.gp .gp-team.you { border-color: #BFD3FB; }
.gp .gp-team-no { width: 16px; font-size: 15px; font-weight: 700; color: var(--gray-500); flex-shrink: 0; }
.gp .gp-team-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gp .gp-team-names { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 15px; font-weight: 600; }
.gp .gp-plus { color: var(--gray-400); font-weight: 500; }
/* the mark stays next to the name when the names wrap */
.gp .gp-player-with-pay { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.gp .gp-pay {
    position: relative; flex-shrink: 0; width: 24px; height: 24px; min-width: 0; min-height: 0; padding: 0; margin: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px dashed var(--amber-700); border-radius: 50%; background: #FFFBEB; color: var(--amber-700);
    font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer;
    box-shadow: none; -webkit-tap-highlight-color: transparent;
}
/* a larger touch target than the mark itself */
.gp .gp-pay::after { content: ''; position: absolute; inset: -7px; }
.gp .gp-pay.paid { border: 1.5px solid var(--green-600); background: var(--green-600); color: var(--white); }
.gp .gp-pay-amount { font-size: 12px; font-weight: 700; color: var(--green-700); white-space: nowrap; }
.gp button.gp-pay-summary { width: auto; min-width: 0; min-height: 0; margin: 0; border: 0; box-shadow: none; cursor: pointer; line-height: inherit; }
.gp .gp-pay-form { display: flex; gap: 8px; }
.gp .gp-pay-form select { width: 96px; flex-shrink: 0; margin: 0; }
.gp .gp-pay-form input { flex: 1; min-width: 0; margin: 0; }
.gp .gp-secondary.gp-pay-remove { color: var(--red-700); }
.gp .gp-partner-wanted { font-weight: 500; color: var(--amber-700); }
.gp .gp-team-sub { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-500); overflow-wrap: anywhere; }
.gp .gp-team-sub.gp-warn { color: var(--amber-700); }
.gp .gp-team-sub.gp-ok { color: var(--green-700); }
.gp .gp-group {
    width: 30px; height: 30px; border-radius: 8px; color: var(--white); font-size: 14px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gp .gp-pill-btn {
    min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--blue-100); color: var(--blue-700);
    font-size: 14px; font-weight: 600; flex-shrink: 0;
}
.gp .gp-pill-btn.gp-pill-green { background: var(--green-100); color: var(--green-800); }
.gp .gp-placeholder {
    display: flex; align-items: center; justify-content: center; height: 56px; border: 1.5px dashed #CBD5E1;
    border-radius: 14px; color: var(--gray-500); font-size: 14px;
}

.gp .gp-filters { flex-wrap: wrap; }
.gp .gp-segmented {
    display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: var(--gray-200); border-radius: 10px; max-width: 100%;
}
/* equal widths while the labels fit in a row, otherwise they wrap */
.gp .gp-segmented.gp-segmented-full button { flex: 1 1 0; min-width: max-content; }
.gp .gp-segmented button {
    height: 32px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent;
    color: var(--gray-600); font-size: 13px; font-weight: 600;
}
.gp .gp-segmented button.active { background: var(--white); color: var(--gray-900); }
.gp .gp-switch {
    display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 600;
    color: var(--gray-700); cursor: pointer; user-select: none;
}
.gp .gp-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.gp .gp-switch-track {
    position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--gray-300); transition: background 0.2s;
}
.gp .gp-switch-thumb {
    position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--white);
    transition: left 0.2s;
}
.gp .gp-switch input:checked + .gp-switch-track { background: var(--blue-600); }
.gp .gp-switch input:checked + .gp-switch-track .gp-switch-thumb { left: 19px; }
.gp .gp-switch input:focus-visible + .gp-switch-track { outline: 2px solid var(--blue-600); outline-offset: 2px; }

.gp .gp-match { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; border: 2px solid transparent; }
.gp .gp-match.next { border-color: var(--blue-600); box-shadow: none; }
.gp .gp-court {
    padding: 3px 9px; border-radius: 999px; background: var(--gray-100); color: var(--gray-700); font-size: 12px; font-weight: 700;
}
.gp .gp-court.next { background: var(--blue-100); color: var(--blue-700); }
.gp .gp-match-status { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-500); text-align: right; }
.gp .gp-match-status-warn { font-weight: 600; color: var(--amber-700); }
.gp .gp-match-status-ok { font-weight: 600; color: var(--green-700); }
.gp .gp-match-status-tap {
    min-height: 32px; padding: 4px 6px 4px 10px; margin: -4px -6px -4px 0; border: 0; border-radius: 999px;
    background: var(--gray-100); color: var(--gray-700); font-weight: 600; gap: 2px;
}
.gp .gp-match-status-tap:active { background: var(--gray-200); }
.gp .gp-confirm-score {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: 14px;
}
.gp .gp-confirm-winners { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 16px; text-align: center; }
.gp .gp-flex { flex: 1; height: 50px; }
.gp .gp-match-row { display: flex; align-items: center; gap: 10px; }
.gp .gp-match-team { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.gp .gp-match-team.right { text-align: right; }
.gp .gp-score { display: flex; align-items: center; gap: 4px; }
.gp .gp-score-sep { font-weight: 700; color: var(--gray-500); }
.gp .gp-score-box {
    width: 48px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 10px;
    font-size: 19px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.gp .gp-score-box.win { background: var(--blue-600); color: var(--white); }
.gp .gp-score-box.lose { background: #EEF0F3; color: var(--gray-700); }
.gp .gp-score-box.empty { border: 1.5px dashed #94A3B8; background: #F8FAFC; color: var(--gray-500); }
.gp .gp-score-box:disabled { cursor: default; }

.gp .gp-standings-row {
    display: grid; grid-template-columns: 36px minmax(0, 1fr) 62px 72px; gap: 8px; align-items: center;
}
.gp .gp-standings-row .right { text-align: right; }
.gp .gp-standings-head {
    padding: 0 14px; font-size: 12px; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.04em;
}
.gp .gp-standings-item {
    padding: 10px 12px; background: var(--white); border-radius: 14px; box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
    border: 2px solid transparent;
}
.gp .gp-standings-item.you { border-color: var(--blue-600); box-shadow: none; }
.gp .gp-rank {
    width: 30px; height: 30px; border-radius: 50%; color: var(--gray-600); font-size: 15px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.gp .gp-rank-1 { background: var(--amber-100); color: var(--amber-800); }
.gp .gp-rank-2 { background: var(--gray-200); color: var(--gray-700); }
.gp .gp-rank-3 { background: #FCE7D6; color: #9A3412; }
.gp .gp-standings-team { min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.gp .gp-standings-player { display: flex; align-items: center; gap: 6px; }
.gp .gp-you-tag { padding: 1px 6px; border-radius: 6px; background: var(--blue-100); color: var(--blue-700); font-size: 11px; font-weight: 700; }
.gp .gp-wtl { font-size: 14px; color: var(--gray-700); }
.gp .gp-points { font-size: 15px; font-weight: 700; color: var(--blue-700); white-space: nowrap; }
.gp .gp-points-lost { font-weight: 500; color: var(--gray-500); }
.gp .gp-footnote { margin: 4px 4px 0; font-size: 13px; color: var(--gray-500); }

.gp .gp-bottom-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    padding: 12px 16px calc(16px + var(--safe-bottom));
    background: var(--white); border-top: 1px solid var(--gray-200); display: flex; flex-direction: column; gap: 6px;
}
.gp .gp-bottom-buttons { display: flex; gap: 8px; }
.gp .gp-primary {
    flex: 1; min-width: 0; height: 50px; border: 0; border-radius: 14px; background: var(--blue-600); color: var(--white);
    font-size: 17px; font-weight: 600; white-space: normal; line-height: 1.2; padding: 0 12px;
}
.gp .gp-secondary {
    height: 48px; border: 0; border-radius: 14px; background: var(--gray-100); color: var(--gray-900); font-size: 16px; font-weight: 600;
}
.gp .gp-bottom-hint { text-align: center; font-size: 12px; color: var(--gray-500); }

.gp .gp-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(17, 24, 39, 0.45); }
.gp .gp-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; max-height: 85vh; overflow-y: auto;
    background: var(--white); border-radius: 22px 22px 0 0;
    padding: 8px 16px calc(24px + var(--safe-bottom));
    display: flex; flex-direction: column; gap: 12px; box-shadow: 0 -8px 30px rgba(17, 24, 39, 0.18);
}
.gp .gp-grabber { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--gray-300); }
.gp .gp-sheet .gp-section-label { padding: 0 4px; }
.gp .gp-sheet-title { display: flex; flex-direction: column; gap: 2px; }
.gp .gp-sheet-title strong { font-size: 18px; }
.gp .gp-menu { display: flex; flex-direction: column; border: 1px solid var(--gray-200); border-radius: 14px; overflow: hidden; }
.gp .gp-menu button {
    display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border: 0;
    border-bottom: 1px solid var(--gray-200); border-radius: 0; background: var(--white); color: var(--gray-900);
    text-align: left; white-space: normal; font-size: 16px; font-weight: 500;
}
.gp .gp-menu button:last-child { border-bottom: 0; }
.gp .gp-menu button:active { background: var(--gray-100); }
.gp .gp-menu button:disabled { background: var(--gray-50); color: var(--gray-500); }
.gp .gp-menu-label { flex: 1; }
.gp .gp-menu-label-col { display: flex; flex-direction: column; gap: 2px; font-weight: 600; }
.gp .gp-menu-reason { font-size: 13px; font-weight: 500; color: var(--red-700); }
.gp .gp-group-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.gp .gp-division-row + .gp-division-row { margin-top: 6px; }
.gp .gp-group-picker button {
    height: 44px; border: 1.5px solid var(--gray-200); border-radius: 12px; background: var(--white); color: var(--gray-900);
    font-size: 16px; font-weight: 700;
}
.gp .gp-group-picker button.active { border-color: var(--blue-600); background: var(--blue-600); color: var(--white); }
/* the height leaves room for the city and country suggestions under their fields */
.gp .gp-filter-sheet { min-height: 70vh; }
.gp .gp-filter-sheet .gp-secondary:disabled { opacity: 0.5; }
.gp .gp-filter-sections { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.gp .gp-filter-section { display: flex; flex-direction: column; gap: 8px; }
.gp .gp-filter-section .location-filter { margin-bottom: 0; }
.gp .gp-filter-options { display: flex; flex-wrap: wrap; gap: 8px; }
.gp .gp-filter-options button {
    min-height: 40px; padding: 0 14px; border: 1.5px solid var(--gray-200); border-radius: 999px;
    background: var(--white); color: var(--gray-900); font-size: 14px; font-weight: 600;
}
.gp .gp-filter-options button.active { border-color: var(--blue-600); background: var(--blue-600); color: var(--white); }
.gp .gp-sheet-players { display: flex; flex-direction: column; border: 1px solid var(--gray-200); border-radius: 14px; overflow: hidden; }
.gp .gp-sheet-player { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--gray-200); }
.gp .gp-sheet-player:last-child { border-bottom: 0; }
.gp .gp-sheet-player-main { flex: 1; min-width: 0; }
.gp .gp-sheet-player-name { font-size: 15px; font-weight: 600; }
.gp .gp-round-btn {
    width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 999px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gp .gp-round-btn.gp-round-red { background: var(--red-100); color: var(--red-700); }

/* body padding is 8px on narrow screens, the page goes edge to edge */
@media (max-width: 360px) {
    .gp { margin: -8px; }
}

/* Top level pages under the top navigation (communities, clubs, profile) reuse the game page look */
.gp.gp-page { margin: 0; padding: 0 0 24px; min-height: 0; background: transparent; }
.gp.gp-page.with-fab { padding-bottom: 96px; }
.gp.gp-page .gp-header { padding: 0 0 8px; margin-left: -8px; }
.gp.gp-page > .gp-summary { margin: 0 0 12px; }
.gp.gp-page > .gp-tabs { margin: 0 0 14px; }
.gp.gp-page .gp-stack { padding: 0; }
.gp .gp-stack + .gp-stack { margin-top: 16px; }
.gp .gp-summary.gp-row-card { margin: 0; }
.gp .gp-summary.gp-row-card.tappable { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.gp .gp-summary.gp-row-card.tappable:active { background: var(--gray-50); }

/* search field with an icon */
.gp .gp-search {
    display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; background: var(--white);
    border: 1.5px solid var(--gray-200); border-radius: 14px; color: var(--gray-500);
}
.gp .gp-search:focus-within { border-color: var(--blue-600); }
.gp .gp-search input, .gp .gp-field .gp-search input, .gp .gp-field .gp-search input:focus {
    flex: 1; min-width: 0; padding: 0 2px; border: 0; outline: none; background: transparent;
    font-size: 16px; color: var(--gray-900);
}

/* list of rows inside one card */
.gp .gp-list { display: flex; flex-direction: column; overflow: hidden; }
.gp .gp-list-row {
    display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 12px 10px 16px;
    border-bottom: 1px solid #F0F1F3;
}
.gp .gp-list-row:last-child { border-bottom: 0; }
.gp .gp-list-row.tappable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gp .gp-list-row.tappable:active { background: var(--gray-50); }
.gp .gp-list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gp .gp-list-title { font-size: 15px; font-weight: 600; color: var(--gray-900); overflow-wrap: anywhere; }
.gp .gp-list-sub { font-size: 13px; color: var(--gray-500); overflow-wrap: anywhere; }
.gp .gp-row-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.gp .gp-chevron { color: var(--gray-400); flex-shrink: 0; transition: transform 0.2s; }
.gp .gp-chevron.open { transform: rotate(90deg); }
.gp .gp-link-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--gray-900); text-decoration: none; }
.gp .gp-link-row-main { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.gp .gp-list-toggle { justify-content: space-between; width: 100%; border: 0; background: none; color: inherit; text-align: left; }

.gp .gp-tag {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
    font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--gray-100); color: var(--gray-700);
}
.gp .gp-tag-blue { background: var(--blue-100); color: var(--blue-700); }
.gp .gp-tag-green { background: var(--green-100); color: var(--green-800); }
.gp .gp-level { font-size: 12px; font-weight: 600; color: var(--gray-600); background: var(--gray-100); border-radius: 6px; padding: 1px 5px; margin-left: 4px; }
.gp .gp-level-change { font-size: 12px; font-weight: 600; margin-left: 2px; }
.gp .gp-level-up { color: var(--green-700); }
.gp .gp-level-down { color: var(--red-700); }
.gp .gp-leader-pos { width: 28px; flex-shrink: 0; font-weight: 700; color: var(--gray-500); text-align: center; }
.gp .gp-leader-points { font-weight: 700; color: var(--gray-900); }
.gp .gp-ranking-you { background: var(--blue-100); }
.gp .gp-ranking-gap { min-height: 0; padding-top: 2px; padding-bottom: 2px; justify-content: center; color: var(--gray-400); }
.gp .gp-tag-amber { background: var(--amber-100); color: var(--amber-800); }
.gp .gp-tag-red { background: var(--red-100); color: var(--red-700); }
.gp .gp-ok-text { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--green-700); white-space: nowrap; }
.gp .gp-secondary.gp-block, .gp .gp-primary.gp-block { width: 100%; flex: none; }

/* community / club logo */
.gp .gp-logo {
    width: 48px; height: 48px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: var(--blue-100); color: var(--blue-700);
    display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
}
.gp .gp-logo.gp-logo-lg { width: 56px; height: 56px; border-radius: 14px; font-size: 22px; }
.gp .gp-logo img { width: 100%; height: 100%; object-fit: cover; }
.gp .gp-org-head { display: flex; align-items: center; gap: 12px; }
.gp .gp-org-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

/* forms */
.gp .gp-form { display: flex; flex-direction: column; }
.gp .gp-profile-tabs { margin-bottom: 12px; }
.gp .gp-login { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 16px; max-width: 400px; width: 100%; margin: 24px auto 0; }
.gp .gp-login-title { margin: 0; font-size: 22px; font-weight: 700; color: var(--gray-900); text-align: center; }
.gp .gp-login-subtitle { margin: 0 0 8px; }
.gp .gp-login-google { min-height: 40px; }
.gp .gp-login-telegram { width: 300px; max-width: 100%; height: 40px; border: 0; border-radius: 4px; background: #2AABEE; color: var(--white); font-size: 14px; font-weight: 600; }
.gp .gp-login-or { color: var(--gray-500); font-size: 13px; }
.gp .gp-login-form { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.gp .gp-login .error-text { margin: 0; text-align: center; }
.gp .gp-link-methods { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; }
.gp .gp-link-methods .gp-field-hint { width: 100%; }
.gp .gp-accounts-error { margin: 0; text-align: center; }
.gp .gp-account-unlink { flex: none; padding: 6px 12px; border: 0; border-radius: 8px; background: var(--gray-100); color: var(--red-600); font-size: 13px; font-weight: 600; }
.gp .gp-compare-scroll { overflow-x: auto; }
.gp .gp-compare { border-collapse: collapse; font-size: 13px; color: var(--gray-900); width: 100%; }
.gp .gp-compare th, .gp .gp-compare td { padding: 8px 10px; border-bottom: 1px solid var(--gray-100); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.gp .gp-compare tr:last-child th, .gp .gp-compare tr:last-child td { border-bottom: 0; }
.gp .gp-compare th { position: sticky; left: 0; background: var(--white); color: var(--gray-500); font-weight: 600; white-space: nowrap; }
.gp .gp-compare td { min-width: 130px; }
.gp .gp-compare-keep { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.gp .gp-compare-keep input { -webkit-appearance: radio; appearance: auto; flex: none; width: 18px; height: 18px; padding: 0; margin: 0; }
.gp .gp-compare-merge { height: 36px; width: 100%; padding: 0 8px; border-radius: 10px; font-size: 13px; }
.gp .gp-field {
    display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-bottom: 1px solid #F0F1F3;
}
.gp .gp-field:last-child { border-bottom: 0; }
.gp .gp-field > label, .gp .gp-field-label { font-size: 13px; font-weight: 600; color: var(--gray-600); }
.gp .gp-field input, .gp .gp-field select, .gp .gp-field textarea, .gp .gp-field .select-input,
.gp .gp-filter-grid input, .gp .gp-filter-grid select {
    padding: 11px 12px; border: 1.5px solid var(--gray-200); border-radius: 12px; background: var(--gray-50);
    font-size: 16px; font-weight: 400; color: var(--gray-900); min-width: 0;
}
.gp .gp-field input:focus, .gp .gp-field select:focus, .gp .gp-field textarea:focus,
.gp .gp-filter-grid input:focus, .gp .gp-filter-grid select:focus { border-color: var(--blue-600); background-color: var(--white); }
.gp .gp-field input:disabled { color: var(--gray-500); background: var(--gray-100); }
.gp .gp-field textarea { font-family: inherit; line-height: 1.5; resize: vertical; }
.gp .gp-field select, .gp .gp-filter-grid select {
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
.gp .gp-field.error input, .gp .gp-field.error select, .gp .gp-field.error .select-input { border-color: var(--red-600); }
.gp .gp-field .error-text { font-size: 13px; color: var(--red-700); }
.gp .gp-field-hint { font-size: 13px; color: var(--gray-500); }
.gp .gp-field .gp-segmented { max-width: none; }
.gp .gp-field .gp-segmented button { height: 36px; min-height: 36px; font-size: 14px; }

.gp .gp-filter-grid { padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gp .gp-filter-grid label { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--gray-500); }
.gp .gp-filter-grid .gp-filter-wide { grid-column: 1 / -1; }
.gp .gp-filter-grid input, .gp .gp-filter-grid select { width: 100%; padding: 9px 10px; font-size: 15px; }
.gp .gp-filter-grid select { padding-right: 32px; }

/* radio options, e.g. a community's visibility */
.gp .gp-options { display: flex; flex-direction: column; gap: 8px; }
.gp .gp-option {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--gray-200); border-radius: 14px;
    background: var(--white); color: var(--gray-900); text-align: left; white-space: normal; min-height: 0; font-weight: 400;
}
.gp .gp-option:active { background: var(--gray-50); }
.gp .gp-option.active { border-color: var(--blue-600); background: #F5F9FF; }
.gp .gp-option-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gp .gp-option-title { font-size: 15px; font-weight: 600; }
.gp .gp-option-desc { font-size: 13px; color: var(--gray-500); }
.gp .gp-radio {
    width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--gray-300); flex-shrink: 0; position: relative;
}
.gp .gp-option.active .gp-radio { border-color: var(--blue-600); }
.gp .gp-option.active .gp-radio::after {
    content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--blue-600);
}

/* permission toggles of an admin */
.gp .gp-switch.gp-switch-row { justify-content: space-between; gap: 12px; font-weight: 500; color: var(--gray-900); }
.gp .gp-switch.gp-switch-row > span:first-child { flex: 1; min-width: 0; }
.gp .gp-switch-track { flex-shrink: 0; }
.gp .gp-switch input:disabled + .gp-switch-track { opacity: 0.5; }
.gp .gp-switch.disabled { cursor: default; }
.gp .gp-expand { padding: 4px 16px 14px; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid #F0F1F3; }
.gp .gp-expand .gp-menu { margin-top: 8px; }

.gp .gp-profile-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 16px; text-align: center; }
.gp .gp-avatar {
    width: 88px; height: 88px; border-radius: 50%; overflow: hidden; background: var(--blue-100); color: var(--blue-700);
    display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 700; margin-bottom: 4px;
}
.gp .gp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.gp .gp-profile-name { font-size: 20px; font-weight: 700; color: var(--gray-900); overflow-wrap: anywhere; }

/* uploaded pictures, see shared/images.js */
.gp .gp-picture-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.gp .gp-picture-actions.gp-picture-actions-start { justify-content: flex-start; }
.gp .gp-file-btn { position: relative; display: inline-flex; align-items: center; cursor: pointer; overflow: hidden; }
.gp .gp-file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.gp .gp-file-btn:focus-within { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.gp .gp-file-btn.disabled { opacity: 0.6; cursor: default; }
.gp .gp-link-btn.gp-danger-link { color: var(--red-700); margin-right: 0; }
.gp .gp-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 8px; }
.gp .gp-photo { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gp .gp-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--gray-100); }
.gp .gp-photo-tag { position: absolute; top: 6px; left: 6px; }
.gp .gp-photo-actions { display: flex; flex-wrap: wrap; justify-content: space-between; }
.gp .gp-photo-actions .gp-link-btn { min-height: 32px; margin: 0; padding: 0 4px; font-size: 13px; }
/* small round pictures of players and communities, see components/avatar-circle.js */
.gp .gp-avatar-circle {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
    border-radius: 50%; background: var(--blue-100); color: var(--blue-700); font-weight: 700; line-height: 1;
}
.gp .gp-avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.gp .gp-avatar-large { margin-bottom: 4px; }
/* the community of a game at the top right of its card */
.gp .gp-summary-community { position: absolute; top: 12px; right: 12px; box-shadow: 0 0 0 2px var(--white); }
.gp .gp-summary-with-community > :nth-child(2) { padding-right: 40px; }
/* a player's name that opens the profile, the picture on the left */
.gp .gp-player-link {
    display: inline-flex; align-items: center; gap: 6px; min-width: 0; min-height: 0; margin: 0; padding: 0;
    border: 0; border-radius: 6px; background: none; font: inherit; color: inherit; text-align: inherit;
    white-space: normal; width: auto; cursor: pointer;
}
.gp .gp-player-link:active, .gp .gp-player-link:disabled { background: none; }
.gp button.gp-player-link:hover > span:last-child { text-decoration: underline; }
.gp span.gp-player-link { cursor: inherit; }
.gp .gp-player-link > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.gp .gp-match-team > div { margin: 2px 0; }
/* photos of a tournament */
.gp .gp-photo-open { display: block; width: 100%; min-height: 0; margin: 0; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gp .gp-photo-open:active { background: none; opacity: 0.85; }
.gp .gp-lightbox {
    position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(17, 24, 39, 0.92); cursor: zoom-out;
}
.gp .gp-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.gp .gp-lightbox-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; color: var(--white); }
.gp .gp-club-photo { width: calc(100% + 32px); margin: -14px -16px 0; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px 16px 0 0; background: var(--gray-100); }

/* Top navigation: pill tabs in a rounded floating bar */
.top-tabs {
    position: sticky;
    top: calc(8px + var(--safe-top));
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
    margin-bottom: 16px;
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.top-tabs .tab {
    flex: 1 1 auto;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 999px;
    background: transparent;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.top-tabs .tab:active {
    background: #eef2f7;
}

.top-tabs .tab.active {
    background: #e3eefa;
    color: #2f80d1;
}

/* Floating "new game" button */
.fab {
    position: fixed;
    right: 16px;
    bottom: calc(16px + var(--safe-bottom));
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.45);
}

/* keeps the last game card visible above the floating button */
.with-fab {
    padding-bottom: 80px;
}

/* Responsive text */
@media (max-width: 360px) {
    body {
        padding: 8px;
        font-size: 14px;
    }

    button {
        font-size: 14px;
        padding: 10px 16px;
    }
}

/* Loading spinner */
.loading {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.1em;
    color: #666;
}

/* Improved participant display */
.participant {
    background: var(--page-background);
    padding: 12px;
    border-radius: 8px;
    border-bottom: none;
}

/* Touch-friendly datalist alternative */
datalist {
    display: none;
}

/* Improved filter bar */
.filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    margin-bottom: 16px;
    align-items: end;
}

.filter-bar .form-field {
    margin-bottom: 0;
}

.location-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.location-filter .form-field {
    margin-bottom: 0;
    min-width: 0;
}

.location-filter .gp-field-label {
    font-weight: 600;
    font-size: 0.9em;
    color: #555;
}

.location-filter input,
.location-filter .select-input {
    box-sizing: border-box;
    width: 100%;
    height: 46px;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-fields {
    display: contents;
}

.community-scope {
    margin-bottom: 12px;
}

.gp-app-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 12px 16px;
    font-size: 13px;
    color: var(--gray-500);
    text-align: center;
}

.gp-app-footer a {
    color: inherit;
}

.gp-app-footer-name {
    font-weight: 600;
}

.with-fab + .gp-app-footer,
.gp-page.with-fab + .gp-app-footer {
    padding-bottom: 88px;
}

.filter-settings-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: relative;
}

.filter-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--red-600);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.you {
    border: 2px solid #2f80ed;
}

.tg-autocomplete {
    position: relative;
    width: 100%;
}

/* the city is typed in or found by the location of the device */
.tg-autocomplete.with-locate > input,
.gp .gp-field .tg-autocomplete.with-locate > input {
    padding-right: 44px;
}

.location-locate-btn {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--blue-600, #2f80ed);
    cursor: pointer;
}

.location-locate-btn:active,
.location-locate-btn:disabled {
    background: transparent;
    cursor: default;
}

.location-locate-btn.locating svg {
    animation: location-locate-pulse 1s ease-in-out infinite;
}

@keyframes location-locate-pulse {
    50% { opacity: 0.3; }
}

.tg-autocomplete-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;

    max-height: 260px;
    overflow-y: auto;

    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    z-index: 20;
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.autocomplete-item.active {
    background: #f2f6ff;
}

.autocomplete-item:hover {
    background: #f2f6ff;
}

.username {
    color: #888;
    font-size: 13px;
}

.gp .gp-admin-permissions { padding: 0 16px 16px; }
.gp .gp-switch-text { display: flex; flex: 1; flex-direction: column; font-weight: 500; }

.gp-text-faint { color: #888; }
.gp-text-danger { color: var(--red-700); }
.gp-text-warn { color: var(--amber-700); }
.gp .gp-weight-medium { font-weight: 500; }
.gp .gp-display-block { display: block; }
.gp .gp-padded-top { padding-top: 8px; }
.gp .gp-wrap-anywhere { min-width: 0; overflow-wrap: anywhere; }
.gp .gp-menu.gp-menu-white { background: var(--white); }
.gp .gp-price-row { display: flex; gap: 8px; }
.gp .gp-price-currency { width: 96px; flex-shrink: 0; }
.gp .gp-grow { flex: 1; }
.gp .gp-list-title.gp-title-large { font-size: 17px; font-weight: 700; }
.gp .gp-chips.gp-chips-centered { align-items: center; }
.gp .gp-row-end-btn { margin: -10px -10px -10px 0; }
.gp .gp-admin-permissions { display: flex; flex-direction: column; gap: 8px; }
.gp .gp-list-toggle { font-weight: 400; white-space: normal; }
.gp .gp-empty-state { text-align: center; padding: 40px 20px; color: #999; }

/* prizes */
.gp .gp-prize-row { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.gp .gp-prize-row:first-child { padding-top: 0; }
.gp .gp-field .gp-prize-row { padding: 10px 0; }
.gp .gp-field .gp-prize-row:first-child { padding-top: 0; }
.gp .gp-template-editor { gap: 8px; }
.gp .gp-template-editor .gp-field { padding-left: 0; padding-right: 0; }
/* a smaller switch, e.g. Default / Custom of a template */
.gp .gp-segmented.gp-segmented-sm { align-self: flex-start; padding: 2px; border-radius: 8px; }
.gp .gp-segmented.gp-segmented-sm button { height: 26px; min-height: 26px; padding: 0 12px; font-size: 12px; border-radius: 6px; }
.gp .gp-prize-reason { flex: 1; min-width: 0; }
.gp .gp-gift-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gp .gp-gift-chip {
    width: auto; min-height: 32px; padding: 4px 12px; font-size: 13px; font-weight: 600; border-radius: 999px;
    border: 1.5px solid var(--gray-200); background: var(--white); color: var(--gray-700); overflow-wrap: anywhere;
}
.gp .gp-gift-chip.active { background: var(--blue-100); border-color: var(--blue-500); color: var(--blue-700); }
.gp .gp-gift-chip.gp-gift-chip-add { border-style: dashed; color: var(--gray-500); }

/* a Telegram message as it will look like */
.gp .gp-tg-preview { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: #DCE6EF; border-radius: 14px; }
.gp .gp-tg-preview.gp-tg-stale { opacity: 0.6; }
.gp .gp-tg-title { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--gray-600); }
.gp .gp-tg-bubble { padding: 10px 12px; background: var(--white); border-radius: 12px; box-shadow: 0 1px 2px rgba(17, 24, 39, 0.12); }
.gp .gp-tg-text { font-size: 14px; line-height: 1.4; color: var(--gray-900); white-space: pre-wrap; overflow-wrap: anywhere; }
.gp .gp-tg-text a { color: var(--blue-600); }
.gp .gp-tg-text pre, .gp .gp-tg-text code { font-family: monospace; white-space: pre-wrap; }
.gp .gp-tg-text blockquote { margin: 4px 0; padding-left: 8px; border-left: 3px solid var(--blue-500); }
.gp .gp-tg-spoiler { background: var(--gray-200); border-radius: 3px; }
.gp .gp-tg-buttons { display: flex; gap: 6px; }
.gp .gp-tg-button {
    flex: 1; min-width: 0; padding: 7px 8px; font-size: 13px; font-weight: 600; text-align: center; color: var(--white);
    background: rgba(70, 90, 110, 0.55); border-radius: 8px; overflow-wrap: anywhere;
}

/* Plans of a community and billing */
.gp .gp-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gp .gp-plan-card { padding: 14px 16px; gap: 10px; }
.gp .gp-plan-current { font-size: 20px; font-weight: 700; color: var(--gray-900); }
.gp .gp-plan-usage { display: flex; flex-direction: column; }
.gp .gp-plan-pending { border: 1px solid var(--amber-100); background: #FFFBEB; }
.gp .gp-plan { border: 2px solid transparent; }
.gp .gp-plan-active { border-color: var(--green-600); }
.gp .gp-plan-name { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.gp .gp-plan-price { display: flex; align-items: baseline; gap: 6px; }
.gp .gp-plan-price strong { font-size: 24px; color: var(--gray-900); }
.gp .gp-plan-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--gray-800); }
.gp .gp-plan-features li { display: flex; gap: 8px; }
.gp .gp-plan-features li > span:first-child { width: 14px; flex: none; color: var(--green-700); font-weight: 700; }
.gp .gp-plan-features .gp-plan-off { color: var(--gray-400); }
.gp .gp-plan-features .gp-plan-off > span:first-child { color: var(--gray-400); }
.gp .gp-billing-history { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--gray-700); }
/* the plan on the card of a community, opens Pricing */
.gp .gp-org-plan {
    align-self: flex-start; height: auto; min-height: 0; padding: 0; border: 0; background: transparent;
    color: var(--gray-500); font-size: 13px; font-weight: 400; text-align: left; white-space: normal;
}
.gp .gp-org-plan strong { color: var(--blue-700); font-weight: 700; }
.gp .gp-org-plan:active { background: transparent; }
/* the gear of the community settings, at the top right of its card */
.gp .gp-summary { position: relative; }
.gp .gp-org-settings { position: absolute; top: 6px; right: 6px; color: var(--gray-600); }
.gp .gp-org-head.gp-org-head-gear { padding-right: 36px; }

/* Playoff bracket: a column per round from the left, the final on the right.
   Every pair of matches is joined by a line that goes on to the match of the next round between them. */
.gp .gp-bracket-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 4px 4px; background: none; border: 0; cursor: pointer; color: var(--gray-500);
}
.gp .gp-bracket-chevron { transition: transform 0.15s ease; }
.gp .gp-bracket-chevron.open { transform: rotate(90deg); }
.gp .gp-bracket-card { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.gp .gp-bracket { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.gp .gp-bracket-round { display: flex; flex-direction: column; flex: 0 0 auto; width: 172px; }
.gp .gp-bracket-round-name {
    height: 20px; padding-left: 14px; font-size: 12px; font-weight: 600; color: var(--gray-500);
}
.gp .gp-bracket-round:first-child .gp-bracket-round-name { padding-left: 0; }
.gp .gp-bracket-col { flex: 1; display: flex; flex-direction: column; }
.gp .gp-bracket-pair { flex: 1; display: flex; flex-direction: column; position: relative; }
.gp .gp-bracket-cell { flex: 1; display: flex; align-items: center; position: relative; padding: 4px 14px; min-width: 0; }
.gp .gp-bracket-round:first-child .gp-bracket-cell { padding-left: 0; }
/* to the next round */
.gp .gp-bracket-cell::after {
    content: ''; position: absolute; right: 0; top: 50%; width: 14px; border-top: 1.5px solid var(--gray-300);
}
.gp .gp-bracket-pair::after {
    content: ''; position: absolute; right: 0; top: 25%; bottom: 25%; border-right: 1.5px solid var(--gray-300);
}
/* from the previous round */
.gp .gp-bracket-round + .gp-bracket-round .gp-bracket-cell::before {
    content: ''; position: absolute; left: 0; top: 50%; width: 14px; border-top: 1.5px solid var(--gray-300);
}
.gp .gp-bracket-last::after,
.gp .gp-bracket-last .gp-bracket-cell::after { display: none; }
.gp .gp-bracket-last .gp-bracket-cell { padding-right: 0; }

.gp .gp-bm {
    width: 100%; min-width: 0; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--white);
    overflow: hidden; font-size: 13px;
}
.gp .gp-bm.bye { opacity: 0.6; }
.gp .gp-bm-code { padding: 3px 8px; font-size: 11px; color: var(--gray-500); background: var(--gray-50); border-bottom: 1px solid var(--gray-100); }
.gp .gp-bm-side { display: flex; align-items: center; gap: 6px; padding: 5px 8px; color: var(--gray-900); }
.gp .gp-bm-side + .gp-bm-side { border-top: 1px solid var(--gray-100); }
.gp .gp-bm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp .gp-bm-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.gp .gp-bm-side.win { font-weight: 700; }
.gp .gp-bm-side.lose { color: var(--gray-400); }
.gp .gp-bm-side.tbd .gp-bm-name { color: var(--gray-400); font-style: italic; }
.gp .gp-bm-side.you { background: var(--blue-100); }

/* Wide screens: a laptop, a desktop, a TV. The content keeps a readable width in the middle of the window,
   lists become grids of cards, and panels that slide from the bottom on a phone are dialogs in the middle. */
@media (min-width: 800px) {
    #app { max-width: 1120px; margin: 0 auto; }
    /* a page that paints its own background from edge to edge of a phone: the rest of the window follows it */
    body:has(#app > .gp:not(.gp-page):not(.gp-embedded)), body:has(#app > div > .gp:not(.gp-page):not(.gp-embedded)) { background: var(--gray-100); }

    .top-tabs { max-width: 640px; margin-left: auto; margin-right: auto; }
    .filter-bar, .community-scope { max-width: 640px; }
    .game-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: stretch; }

    /* cards in columns, everything else in the list takes a row of its own */
    .gp .gp-stack.gp-wide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
    .gp .gp-wide-grid > * { grid-column: 1 / -1; }
    .gp .gp-teams > .gp-team, .gp .gp-matches > .gp-match, .gp .gp-cards > .gp-row-card { grid-column: auto; }
    .gp .gp-cards > .gp-row-card { align-self: stretch; }

    /* one column of text or of a form */
    .gp .gp-stack.gp-column { max-width: 760px; width: 100%; }
    .gp.gp-narrow { padding-left: max(0px, calc((100% - 720px) / 2)); padding-right: max(0px, calc((100% - 720px) / 2)); }
    .gp.gp-page.gp-narrow { max-width: 760px; margin-left: auto; margin-right: auto; padding-left: 0; padding-right: 0; }

    .gp .gp-bottom-bar { padding-left: max(16px, calc((100vw - 720px) / 2)); padding-right: max(16px, calc((100vw - 720px) / 2)); }
    .fab { right: max(16px, calc((100vw - 1120px) / 2)); }

    .gp .gp-sheet {
        left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%, -50%);
        width: min(560px, calc(100vw - 32px)); border-radius: 22px; padding: 20px 20px 24px;
        box-shadow: 0 20px 50px rgba(17, 24, 39, 0.25);
    }
    .gp .gp-filter-sheet { min-height: 0; }
    .gp .gp-grabber { display: none; }
}

/* A game on a wide screen: what it is on the left, the open tab on the right */
@media (min-width: 1000px) {
    .gp.gp-game { display: grid; grid-template-columns: 340px minmax(0, 1fr); column-gap: 4px; align-items: start; align-content: start; }
    .gp.gp-game > .gp-header { grid-column: 1 / -1; }
    .gp.gp-game > .gp-summary { grid-column: 1; grid-row: 2 / span 2; position: sticky; top: 12px; }
    .gp.gp-game > .gp-tabs, .gp.gp-game > .gp-stack { grid-column: 2; }
}

/* Presentation of a game on a big screen (.pres). Every size is a number of units: --u is set by the page
   from the size of the window, so the same picture fills a laptop and a TV. The heights of the rows come
   from the page too: it counts with them what fits a slide. */
.pres {
    position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; overflow: hidden;
    background: var(--gray-100); color: var(--gray-900); font-size: var(--u); line-height: 1.3;
}
.pres-header {
    display: flex; align-items: center; gap: calc(var(--u) * 1.2); flex-shrink: 0;
    padding: calc(var(--u) * 0.8) calc(var(--u) * 1.2);
}
.pres-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: calc(var(--u) * 0.2); }
.pres-title {
    margin: 0; font-size: calc(var(--u) * 1.7); font-weight: 700; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pres-subtitle {
    display: flex; align-items: center; gap: calc(var(--u) * 0.9); font-size: calc(var(--u) * 0.9); color: var(--gray-600);
    white-space: nowrap; overflow: hidden;
}
.pres-state {
    display: inline-flex; align-items: center; gap: calc(var(--u) * 0.35); padding: calc(var(--u) * 0.15) calc(var(--u) * 0.6);
    border-radius: 999px; background: var(--gray-200); color: var(--gray-700); font-weight: 700;
}
.pres-state-STARTED { background: var(--green-100); color: var(--green-800); }
.pres-state-CANCELLED { background: var(--red-100); color: var(--red-700); }
.pres-live { width: calc(var(--u) * 0.5); height: calc(var(--u) * 0.5); border-radius: 50%; background: var(--green-600); }
.pres-dots { display: flex; gap: calc(var(--u) * 0.4); }
.pres-dot { width: calc(var(--u) * 0.55); height: calc(var(--u) * 0.55); border-radius: 50%; background: var(--gray-300); }
.pres-dot.active { background: var(--blue-600); }
.pres-clock { font-size: calc(var(--u) * 1.8); font-weight: 700; font-variant-numeric: tabular-nums; }
.pres-actions { display: flex; gap: calc(var(--u) * 0.3); }
.pres-btn {
    width: calc(var(--u) * 2.2); height: calc(var(--u) * 2.2); min-width: 28px; min-height: 28px; padding: calc(var(--u) * 0.45);
    border-radius: 50%; background: transparent; color: var(--gray-500); display: flex; align-items: center; justify-content: center;
}
.pres-btn:hover, .pres-btn:active { background: var(--gray-200); color: var(--gray-800); }

.pres-main {
    flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: calc(var(--u) * 0.8); padding: 0 calc(var(--u) * 1.2) calc(var(--u) * 1.2);
}
.pres-side {
    min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--white);
    border-radius: calc(var(--u) * 0.9); padding: calc(var(--u) * 0.5) calc(var(--u) * 1) calc(var(--u) * 0.6);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}
.pres-side-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.pres-group-head {
    height: calc(var(--u) * var(--pres-group-head-h)); flex-shrink: 0; display: flex; align-items: center;
    justify-content: space-between; gap: calc(var(--u) * 1);
}
.pres-group-title {
    font-size: calc(var(--u) * 1.15); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pres-group-sub { font-size: calc(var(--u) * 0.95); font-weight: 600; color: var(--gray-500); white-space: nowrap; }

.pres-match {
    height: calc(var(--u) * (var(--pres-pair-match-h) - 0.4)); margin-bottom: calc(var(--u) * 0.4); flex-shrink: 0;
    display: grid; grid-template-columns: calc(var(--u) * 4.2) minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
    gap: calc(var(--u) * 0.8); padding: 0 calc(var(--u) * 0.8); background: var(--gray-50);
    border: 1px solid var(--gray-200); border-radius: calc(var(--u) * 0.7);
}
.pres-match.single { height: calc(var(--u) * (var(--pres-single-match-h) - 0.4)); }
.pres-court {
    display: flex; flex-direction: column; align-items: center; justify-content: center; align-self: center;
    padding: calc(var(--u) * 0.2) 0; border-radius: calc(var(--u) * 0.5); background: var(--blue-100); color: var(--blue-700);
    font-size: calc(var(--u) * 0.7); font-weight: 600; line-height: 1.15; overflow: hidden;
}
.pres-match.single .pres-court { flex-direction: row; gap: calc(var(--u) * 0.3); }
.pres-court strong { font-size: calc(var(--u) * 1.25); white-space: nowrap; }
.pres-team { min-width: 0; font-size: calc(var(--u) * 1.15); font-weight: 600; line-height: 1.35; }
.pres-team > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pres-team.right { text-align: right; }
.pres-score { display: flex; align-items: center; gap: calc(var(--u) * 0.3); }
.pres-score-sep { font-weight: 700; color: var(--gray-500); }
.pres-score-box {
    width: calc(var(--u) * 2.7); height: calc(var(--u) * 2.3); border-radius: calc(var(--u) * 0.5);
    display: flex; align-items: center; justify-content: center; font-size: calc(var(--u) * 1.5); font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.pres-match.single .pres-score-box { height: calc(var(--u) * 2); }
.pres-score-box.win { background: var(--blue-600); color: var(--white); }
.pres-score-box.lose { background: #EEF0F3; color: var(--gray-700); }
.pres-score-box.empty { border: 1.5px dashed #94A3B8; background: #F8FAFC; color: var(--gray-500); }

.pres-row {
    height: calc(var(--u) * (var(--pres-row-h) - 0.3)); margin-bottom: calc(var(--u) * 0.3); flex-shrink: 0;
    display: grid; grid-template-columns: calc(var(--u) * 2.2) minmax(0, 1fr) calc(var(--u) * 5) calc(var(--u) * 6.5);
    align-items: center; gap: calc(var(--u) * 0.7); padding: 0 calc(var(--u) * 0.8);
    background: var(--gray-50); border-radius: calc(var(--u) * 0.6); font-size: calc(var(--u) * 1.1);
}
.pres-row .right { text-align: right; }
.pres-row.pres-row-head {
    height: calc(var(--u) * var(--pres-table-head-h)); margin-bottom: 0; background: transparent;
    font-size: calc(var(--u) * 0.8); font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em;
}
.pres-rank {
    width: calc(var(--u) * 1.7); height: calc(var(--u) * 1.7); border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: calc(var(--u) * 0.95); font-weight: 700; color: var(--gray-600);
}
.pres-rank-1 { background: var(--amber-100); color: var(--amber-800); }
.pres-rank-2 { background: var(--gray-200); color: var(--gray-700); }
.pres-rank-3 { background: #FCE7D6; color: #9A3412; }
.pres-row-team { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pres-wtl { color: var(--gray-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pres-points { font-weight: 700; color: var(--blue-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pres-empty { padding: calc(var(--u) * 1) 0; color: var(--gray-500); font-size: calc(var(--u) * 1); }

.pres-fit { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.pres-fit-content { position: absolute; top: 0; left: 0; width: max-content; transform-origin: top left; }
.pres-fit .gp-bracket { overflow: visible; }

.pres-message {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 0.6);
    padding: calc(var(--u) * 2); text-align: center; font-size: calc(var(--u) * 1.2); color: var(--gray-600);
}
.pres-message strong { font-size: calc(var(--u) * 2.4); color: var(--gray-900); }

/* a screen that is taller than wide: the matches above the standings */
@media (orientation: portrait) {
    .pres-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
    .pres-subtitle { flex-wrap: wrap; white-space: normal; }
}

/* An installed app draws under the status bar: this covers what scrolls there. Nothing in a browser tab */
body::before {
    content: ''; position: fixed; top: 0; left: 0; right: 0; z-index: 60;
    height: var(--safe-top); background: var(--page-background);
}

/* Notifications in the profile, signing in to the apps */
.gp .gp-login-browser { width: 300px; max-width: 100%; }
.gp .gp-app-login-name { font-size: 17px; font-weight: 600; color: var(--gray-900); text-align: center; overflow-wrap: anywhere; }
.gp a.gp-primary { display: block; text-align: center; text-decoration: none; }
.gp .gp-not-found-code { font-size: 56px; font-weight: 800; line-height: 1; color: var(--gray-300); letter-spacing: 2px; }

/* Sign in instead of the profile, for a person who looks at a public tournament without signing in */
.top-tabs .tab.tab-sign-in { background: var(--blue-600); color: var(--white); }
.top-tabs .tab.tab-sign-in:active { opacity: 0.85; }

/* The text that is shared, as it will be sent */
.gp .gp-share-preview {
    max-height: 30vh; overflow-y: auto; padding: 10px 12px; border-radius: 12px; background: var(--gray-100);
    color: var(--gray-800); font-size: 14px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere;
    user-select: text; -webkit-user-select: text;
}

/* help on the Telegram tab of a community, see pages/telegram-help.js */
.gp .gp-help { gap: 8px; padding-top: 12px; font-size: 14px; line-height: 1.45; color: var(--gray-800); }
.gp .gp-help p { margin: 0; }
.gp .gp-help-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.gp .gp-help code { padding: 1px 5px; border-radius: 6px; background: var(--gray-100); font-size: 13px; }

/* the pencil on a picture and its menu, see components/picture-menu.js */
.gp .gp-picture-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
/* the menu opens inside centered cards */
.gp .gp-picture-wrap .gp-sheet, .gp .gp-photo .gp-sheet { text-align: left; }
.gp .gp-picture-edit {
    position: absolute; right: -4px; bottom: -4px; width: 32px; height: 32px; min-height: 32px; padding: 0;
    display: flex; align-items: center; justify-content: center; border: 2px solid var(--white); border-radius: 50%;
    background: var(--blue-600); color: var(--white); box-shadow: 0 1px 4px rgba(17, 24, 39, 0.25); cursor: pointer;
}
.gp .gp-picture-edit:active { background: var(--blue-700); }
.gp .gp-picture-edit:disabled { cursor: default; background: var(--blue-600); }
.gp .gp-picture-wrap.gp-picture-wrap-avatar .gp-picture-edit { right: 0; bottom: 4px; }
.gp .gp-spinner {
    width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: var(--white);
    border-radius: 50%; animation: gp-spin 0.8s linear infinite;
}
@keyframes gp-spin { to { transform: rotate(360deg); } }
.gp .gp-menu .gp-menu-item {
    position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px;
    border-bottom: 1px solid var(--gray-200); background: var(--white); color: var(--gray-900);
    font-size: 16px; font-weight: 500; cursor: pointer;
}
.gp .gp-menu .gp-menu-item:last-child { border-bottom: 0; }
.gp .gp-menu .gp-menu-item:active { background: var(--gray-100); }
.gp .gp-menu .gp-menu-item:focus-within { outline: 2px solid var(--blue-600); outline-offset: -2px; }
.gp .gp-menu button.gp-text-danger { color: var(--red-700); }

/* choosing the part of a photo, see components/picture-cropper.js; teleported to the body, so not under .gp */
.gp-cropper {
    position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; background: #0B0D12; color: #FFFFFF;
    padding: var(--safe-top) 0 calc(12px + var(--safe-bottom)); outline: none;
}
.gp-cropper-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; }
.gp-cropper-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
.gp-cropper .gp-cropper-text-btn {
    min-width: 72px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent;
    color: #FFFFFF; font-size: 16px; font-weight: 500; box-shadow: none;
}
.gp-cropper .gp-cropper-text-btn.gp-cropper-done { color: #7FB0FF; font-weight: 700; }
.gp-cropper .gp-cropper-text-btn:disabled { opacity: 0.4; background: transparent; }
.gp-cropper .gp-cropper-text-btn:active { background: rgba(255, 255, 255, 0.1); }
.gp-cropper-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.gp-cropper-stage:active { cursor: grabbing; }
.gp-cropper-image { position: absolute; max-width: none; pointer-events: none; -webkit-user-drag: none; }
.gp-cropper-frame {
    position: absolute; pointer-events: none; border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 200vmax rgba(11, 13, 18, 0.62);
}
.gp-cropper-frame.round { border-radius: 50%; }
.gp-cropper-bar { display: flex; align-items: center; gap: 12px; width: min(100%, 420px); margin: 12px auto 4px; padding: 0 20px; color: #C9CED8; }
.gp-cropper-bar input[type=range] { -webkit-appearance: auto; appearance: auto; width: auto; flex: 1; margin: 0; padding: 0; accent-color: #7FB0FF; min-height: 32px; border: 0; background: transparent; }
.gp-cropper-hint { padding: 0 20px; text-align: center; font-size: 13px; color: #9AA1AD; }
/* smaller on the logo of a community and on the photos of a club */
.gp .gp-org-head .gp-picture-edit, .gp .gp-photo .gp-picture-edit { width: 28px; height: 28px; min-height: 28px; right: -6px; bottom: -6px; }
.gp .gp-photo .gp-picture-edit { right: 6px; bottom: auto; top: 6px; }
.gp .gp-photo-grid.gp-photo-grid-wide .gp-photo img { aspect-ratio: 16 / 9; }

/* the bell of the alerts about new tournaments, see app/pages/alerts-bell.js */
.gp .gp-bell { width: 40px; height: 40px; min-height: 40px; margin: -8px -8px -8px 0; color: var(--gray-500); }
.gp .gp-bell.on { color: var(--blue-600); }
.gp .gp-community-row { min-height: 24px; }
/* the bell and the gear at the top right of the card of a community */
.gp .gp-org-card-actions { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; }
.gp .gp-org-card-actions .gp-bell { margin: 0; width: 44px; height: 44px; min-height: 44px; }
.gp .gp-org-head.gp-org-head-gear2 { padding-right: 80px; }
.gp .gp-alerts-sheet { gap: 10px; }
.gp .gp-alerts-group { display: flex; flex-direction: column; gap: 2px; padding: 4px 14px; border: 1px solid var(--gray-200); border-radius: 14px; }
.gp .gp-alerts-group .gp-switch-text { gap: 2px; font-size: 15px; font-weight: 600; color: var(--gray-900); }
.gp .gp-alerts-group .gp-switch.disabled { opacity: 0.55; }
.gp .gp-alerts-filters { gap: 12px; padding: 12px 14px 14px; }
.gp .gp-alerts-inline-btn { align-self: flex-start; min-height: 34px; margin: -2px 0 6px; font-size: 13px; }
.gp .gp-filter-options button.gp-filter-square { min-width: 44px; padding: 0 10px; }
.gp .gp-alerts-sheet .gp-bottom-buttons .gp-secondary { flex: 1; }
