/* Best Tippers page-only styles. Load after the shared stylesheet. */
.tipmenu-panel {
    width: 90%;
    max-width: 90%;
    margin: 0 auto 25px;
    padding: var(--gird-module-padding, 24px);
    box-sizing: border-box;
    color: var(--base-font-color, #fff);
    background: var(--boxes-color, rgba(255,255,255,.1));
    border: 1px solid var(--grid-module-border-color);
    border-radius: var(--grid-module-border-radius, 12px);
}
.tipmenu-panel h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px;
}
.tipmenu-panel .tipmenu-note {
    color: var(--alt-font-color-three, #d1d5db);
    font-size: 13px;
    line-height: 1.55;
    margin: 10px 0 0;
    overflow-wrap: anywhere;
}
.tipmenu-panel[hidden], .tipmenu-panel [hidden], .tipmenu-panel #tipmenu-status:empty, .tipmenu-panel #tipmenu-result-status:empty { display: none !important; }
.tipmenu-panel .tipmenu-editor {
    border: 1px solid var(--grid-module-border-color);
    border-radius: var(--grid-module-border-radius, 12px);
    background: rgba(255,255,255,.035);
    overflow: visible;
}
.tipmenu-panel .tipmenu-editor > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    list-style: none;
    user-select: none;
}
.tipmenu-panel .tipmenu-editor > summary::-webkit-details-marker { display: none; }
.tipmenu-panel .tipmenu-editor > summary::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-right: 4px;
}
.tipmenu-panel .tipmenu-editor[open] > summary::after { transform: rotate(225deg); }
.tipmenu-panel .tipmenu-editor[open] > summary { border-bottom: 1px solid var(--grid-module-border-color); }
.tipmenu-panel .tipmenu-editor-body { padding: 0 16px 14px; }
.tipmenu-panel .tipmenu-editor-body > .tipmenu-note { margin: 12px 0; }
.tipmenu-panel .tipmenu-editor-list {
    max-height: none;
    overflow: visible;
    padding: 0 0 2px;
}
.tipmenu-panel .tipmenu-labels, .tipmenu-panel #tipmenu-rows {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 7px;
}
.tipmenu-panel .tipmenu-labels { margin: 0 0 6px; }
.tipmenu-panel .tipmenu-row {
    display: grid;
    grid-template-columns: 108px minmax(0,1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 0;
}
.tipmenu-panel .tipmenu-labels strong { font-size: 13px; color: var(--alt-font-color-three, #d1d5db); font-weight: 500; }
.tipmenu-panel .tipmenu-row input, .tipmenu-panel .tipmenu-btn {
    min-width: 0;
    min-height: 36px;
    border: 1px solid var(--grid-module-border-color);
    border-radius: var(--alt-border-radius, 8px);
    background: var(--boxes-color);
    color: inherit;
    padding: 7px 10px;
    font: inherit;
    font-size: 14px;
    line-height: 1.35;
}
.tipmenu-panel .tipmenu-row input { width: 100%; }
.tipmenu-panel .tipmenu-amount { font-variant-numeric: tabular-nums; }
.tipmenu-panel .tipmenu-btn { cursor: pointer; white-space: nowrap; }
.tipmenu-panel .tipmenu-remove { color: var(--alt-font-color-three, #d1d5db); background: transparent; font-size: 13px; }
.tipmenu-panel .tipmenu-remove:hover { background: rgba(232,78,62,.16); border-color: var(--offline-status-color, #e84e3e); }
.tipmenu-panel #tipmenu-add { background: var(--gradient-background-three); font-weight: 600; border-color: transparent; padding-inline: 16px; }
.tipmenu-panel #tipmenu-add:hover { filter: brightness(1.12); }
.tipmenu-panel :is(button, input, summary):focus-visible { outline: 2px solid var(--button-color-one, #59a6f8); outline-offset: 2px; }
.tipmenu-panel .tipmenu-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 12px 0 0; }
.tipmenu-panel .tipmenu-actions label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.tipmenu-panel #tipmenu-remember { width: 16px; height: 16px; accent-color: var(--button-color-one, #59a6f8); }
.tipmenu-panel #tipmenu-results { margin-top: 20px; }
.tipmenu-panel .tipmenu-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: var(--alt-grid-gap, 16px);
    margin: 0 0 20px;
}
.tipmenu-panel .tipmenu-metric {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--grid-module-border-color);
    border-radius: var(--grid-module-border-radius, 12px);
    padding: 16px 18px;
    background: var(--alt-background-color);
    min-width: 0;
}
.tipmenu-panel .tipmenu-metric span { font-size: 14px; color: var(--alt-font-color-three, #d1d5db); line-height: 1.35; }
.tipmenu-panel .tipmenu-metric strong { font-size: clamp(22px, 1.75vw, 30px); font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tipmenu-panel .tipmenu-metric:last-child { background: linear-gradient(115deg, rgba(89,166,248,.16), rgba(45,100,159,.1)); }
.tipmenu-panel .tipmenu-table-wrap { overflow: visible; border: 1px solid var(--grid-module-border-color); border-radius: var(--grid-module-border-radius, 12px); }
.tipmenu-panel .tipmenu-table { width: 100%; min-width: 0; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.tipmenu-panel .tipmenu-table :is(th,td) { padding: 9px 14px; text-align: right; border-bottom: 1px solid rgba(255,255,255,.12); font-size: 14px; vertical-align: middle; }
.tipmenu-panel .tipmenu-table th { font-weight: 600; background: rgba(255,255,255,.075); line-height: 1.35; }
.tipmenu-panel .tipmenu-table :is(th,td):first-child { width: 40%; text-align: left; overflow-wrap: anywhere; }
.tipmenu-panel .tipmenu-table :is(th,td):nth-child(2) { width: 13%; }
.tipmenu-panel .tipmenu-table :is(th,td):nth-child(3) { width: 13%; }
.tipmenu-panel .tipmenu-table :is(th,td):nth-child(4) { width: 16%; }
.tipmenu-panel .tipmenu-table :is(th,td):nth-child(5) { width: 18%; }
.tipmenu-panel .tipmenu-table td:not(:first-child) { white-space: nowrap; }
.tipmenu-panel .tipmenu-table tbody tr:nth-child(even) { background: rgba(255,255,255,.025); }
.tipmenu-panel .tipmenu-table tbody tr:hover { background: rgba(255,255,255,.07); }
.tipmenu-panel .tipmenu-table tbody tr:nth-last-child(2) td { border-top: 1px solid var(--grid-module-border-color); }
.tipmenu-panel .tipmenu-table tbody tr:nth-last-child(-n+2) { background: rgba(255,255,255,.06); }
.tipmenu-panel .tipmenu-table tbody tr:nth-last-child(-n+2) td:first-child { font-weight: 600; }
.tipmenu-panel .tipmenu-table tbody tr:last-child td { border-bottom: none; }
.tipmenu-panel .tipmenu-table progress {
    display: block;
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    margin-top: 4px;
    border: none;
    border-radius: 99px;
    background: rgba(255,255,255,.14);
    overflow: hidden;
    color: var(--button-color-one, #59a6f8);
}
.tipmenu-panel .tipmenu-table progress::-webkit-progress-bar { background: rgba(255,255,255,.14); border-radius: 99px; }
.tipmenu-panel .tipmenu-table progress::-webkit-progress-value { background: var(--gradient-background-three); border-radius: 99px; }
.tipmenu-panel .tipmenu-table progress::-moz-progress-bar { background: var(--gradient-background-three); border-radius: 99px; }
@media (max-width: 750px) {
    .tipmenu-panel { padding: 14px; }
    .tipmenu-panel .tipmenu-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
    .tipmenu-panel .tipmenu-metric { padding: 12px; }
    .tipmenu-panel .tipmenu-editor-body { padding: 0 10px 12px; }
    .tipmenu-panel .tipmenu-editor > summary { padding: 12px; }
    .tipmenu-panel .tipmenu-row { grid-template-columns: 76px minmax(0,1fr) auto; gap: 5px; }
    .tipmenu-panel .tipmenu-row input, .tipmenu-panel .tipmenu-btn { padding-inline: 6px; font-size: 13px; }
    .tipmenu-panel .tipmenu-table :is(th,td) { padding: 9px 10px; }
}


/* Existing earnings and tippers tables: scoped to this page's results. */
#besttippers-results[hidden] { display: none !important; }
#besttippers-results {
    width: 90%;
    margin: 0 auto 32px;
    display: grid;
    gap: var(--grid-gap, 20px);
    font-variant-numeric: tabular-nums;
}
#besttippers-results .bt-earnings-panel,
#besttippers-results .bt-ranking-panel {
    min-width: 0;
    padding: var(--gird-module-padding, 24px);
    background: var(--boxes-color, rgba(255,255,255,.1));
    border: 1px solid var(--grid-module-border-color);
    border-radius: var(--grid-module-border-radius, 12px);
}
#besttippers-results h2 { font-size: 20px; font-weight: 600; margin: 0 0 16px; }
#besttippers-results .totals { margin: 0; overflow-x: auto; text-align: left; }
#besttippers-results .gt-tbl {
    width: 100%; min-width: 660px; margin: 0;
    border: 0; border-collapse: separate; border-spacing: 8px 0;
    background: transparent; backdrop-filter: none;
}
#besttippers-results .gt-tbl th,
#besttippers-results .gt-tbl td {
    text-align: left; white-space: nowrap;
    background: var(--alt-background-color);
    border: 1px solid var(--grid-module-border-color);
    padding: 12px 16px;
}
#besttippers-results .gt-tbl th {
    font-size: 13px; font-weight: 500; color: var(--alt-font-color-three);
    border-radius: 10px 10px 0 0; border-bottom: 0; padding-bottom: 4px;
}
#besttippers-results .gt-tbl td {
    font-size: clamp(19px, 1.5vw, 27px); font-weight: 600; color: inherit;
    border-radius: 0 0 10px 10px; border-top: 0; padding-top: 4px;
}
#besttippers-results .gt-tbl :is(th,td):last-child { background: rgba(89,166,248,.15); }
#besttippers-results .gt-tbl td:last-child { color: #fff; }
#besttippers-results .bt-ranking-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
#besttippers-results .bt-ranking-header h2 { margin: 0; }
#besttippers-results .bt-ranking-header p { color: var(--alt-font-color-three); font-size: 13px; }
#besttippers-results .container {
    width: 100%; max-width: 100%; margin: 0;
    overflow: auto; max-height: min(68vh, 820px);
    border: 1px solid var(--grid-module-border-color);
    border-radius: var(--alt-border-radius, 8px);
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent;
}
#besttippers-results .container:focus-visible { outline: 2px solid var(--button-color-one); }
#besttippers-results #table {
    width: 100%; min-width: 700px; margin: 0;
    border: 0; border-collapse: separate; border-spacing: 0;
    background: transparent;
}
#besttippers-results #table :is(th,td) {
    font-family: var(--base-font-family); font-size: 14px;
    text-align: right; padding: 9px 16px;
    color: var(--base-font-color); border: 0;
    border-bottom: 1px solid rgba(255,255,255,.09);
    background: transparent !important;
    white-space: nowrap;
}
#besttippers-results #table th {
    position: sticky; top: 0; z-index: 2;
    font-weight: 600; cursor: pointer;
    background: var(--body-background-color, #1d1b56) !important;
    border-bottom: 1px solid var(--grid-module-border-color);
    padding-block: 13px;
}
#besttippers-results #table th:hover { filter: brightness(1.25); }
#besttippers-results #table :is(th,td):first-child { text-align: left; min-width: 180px; }
#besttippers-results #table td:first-child { font-weight: 500; }
#besttippers-results #table tbody tr:nth-child(even) { background: rgba(255,255,255,.035); }
#besttippers-results #table tbody tr:hover { background: rgba(89,166,248,.12); }
#besttippers-results #table td:last-child { font-weight: 700; background: rgba(89,166,248,.065) !important; }
#besttippers-results #table th:last-child { color: #b6ddff; }
#besttippers-results #table th:is(.tablesorter-headerAsc,.headerSortUp,.tablesorter-headerSortUp)::after { content: " ▲"; font-size: 11px; color: #b6ddff; }
#besttippers-results #table th:is(.tablesorter-headerDesc,.headerSortDown,.tablesorter-headerSortDown)::after { content: " ▼"; font-size: 11px; color: #b6ddff; }
#besttippers-results #table tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 750px) {
    #besttippers-results .bt-earnings-panel, #besttippers-results .bt-ranking-panel { padding: 14px; }
    #besttippers-results .gt-tbl :is(th,td), #besttippers-results #table :is(th,td) { padding-inline: 10px; }
    #besttippers-results .gt-tbl td { font-size: 20px; }
    #besttippers-results .container { max-height: 65vh; }
}

/* Keep the entire tip menu in the page scroll. On narrow displays,
   show results as labeled rows rather than a horizontally scrolling table. */
@media (max-width: 980px) {
    .tipmenu-panel .tipmenu-table-wrap { border: 0; }
    .tipmenu-panel .tipmenu-table,
    .tipmenu-panel .tipmenu-table tbody { display: block; width: 100%; }
    .tipmenu-panel .tipmenu-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
    .tipmenu-panel .tipmenu-table tbody tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 12px; border: 1px solid var(--grid-module-border-color); border-radius: var(--alt-border-radius, 8px); margin-bottom: 8px; padding: 8px 12px; }
    .tipmenu-panel .tipmenu-table tbody tr:last-child { margin-bottom: 0; }
    .tipmenu-panel .tipmenu-table tbody tr td:nth-child(n) { display: block; width: auto; min-width: 0; border: 0; padding: 6px 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
    .tipmenu-panel .tipmenu-table tbody tr td:first-child { grid-column: 1 / -1; font-weight: 600; border-bottom: 1px solid var(--grid-module-border-color); margin-bottom: 3px; }
    .tipmenu-panel .tipmenu-table tbody tr td:not(:first-child)::before { content: attr(data-label); display: block; font-size: 12px; color: var(--alt-font-color-three, #d1d5db); margin-bottom: 3px; }
}
@media (min-width: 981px) {
    .tipmenu-panel .tipmenu-table td:not(:first-child) { white-space: normal; overflow-wrap: anywhere; }
}

/* v5: the expanded tip menu must grow with its content, never scroll internally. */
.tipmenu-panel,
.tipmenu-panel .tipmenu-editor,
.tipmenu-panel .tipmenu-editor-body,
.tipmenu-panel .tipmenu-editor-list,
.tipmenu-panel #tipmenu-rows,
.tipmenu-panel #tipmenu-results,
.tipmenu-panel .tipmenu-table-wrap {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* v6: configuration follows the instructions within the same grid wrapper.
   Output remains a separate full-width results panel below Start. */
.besttiper_wrapper > #tip-menu-panel {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: transparent;
}
#tip-menu-output #tipmenu-results { margin-top: 0; }
#tip-menu-output #tipmenu-result-status:not(:empty) { margin: 0 0 14px; }
