/* ============================================================
   ALLIANCE TOUR — PUBLIC
   style_public.css — complète style.css, ne le remplace pas
   ============================================================ */

:root {
    --bg:         #EBEBEB;
    --surface:    #FFFFFF;
    --border:     #E2E5EA;
    --border-mid: #D4D8DF;
    --text:       #1A1F2E;
    --muted:      #6B7280;
    --subtle:     #9CA3AF;
    --accent:     #1f2950;
    --radius:     10px;
    --radius-sm:  6px;
    --font:       system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font);
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    margin: 0;
}

/* --- Header ------------------------------------------------- */
.pub-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 105px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.pub-header-logo-at { display: block; line-height: 0; flex-shrink: 0; }
.pub-header-logo-at img { height: 100px; display: block; }
.pub-header-logo-pga { display: block; line-height: 0; flex-shrink: 0; }
.pub-header-logo-pga img { height: 100px; display: block; }

.pub-header-center { text-align: center; flex: 1; min-width: 0; }
.pub-header-region { font-size: 17px; color: #9CA3AF; letter-spacing: 0.05em; text-transform: uppercase; }
.pub-header-saison { font-size: 16px; font-weight: 600; color: #1f2950; margin-top: 3px; }

/* --- Contenu ----------------------------------------------- */
.pub-content { padding: 20px 24px; }

.pub-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }

.pub-select {
    padding: 7px 12px;
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.pub-select:focus { outline: none; border-color: var(--accent); }

.pub-expl { font-size: 11px; color: var(--subtle); margin-bottom: 14px; line-height: 1.5; }

/* --- Tableau ranking --------------------------------------- */
.pub-scroll {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}

.pub-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.pub-table thead th {
    padding: 8px 10px;
    text-align: left;
    background: #1f2950;
    color: #9BB5D4;
    font-size: 11px;
    font-weight: 500;
    border-bottom: 1px solid #2D3F5C;
    white-space: nowrap;
}

/* Sticky — thead */
.pub-th-cl {
    position: sticky; left: 0; z-index: 3;
    background: #1f2950;
    box-shadow: 2px 0 0 #4A6080;
    width: 38px; min-width: 38px; max-width: 38px;
    text-align: center;
}

.pub-th-name {
    position: sticky; left: 38px; z-index: 3;
    background: #1f2950;
    box-shadow: 2px 0 0 #4A6080;
    width: 160px; min-width: 160px; max-width: 160px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.pub-th-total {
    position: sticky; left: 200px; z-index: 3;
    background: #1f2950;
    box-shadow: 2px 0 0 #4A6080;
    width: 62px; min-width: 62px; max-width: 62px;
    text-align: center;
}

/* En-tête tournoi */
.pub-th-t {
    text-align: center;
    padding: 6px 10px;
    cursor: pointer;
    min-width: 80px;
    transition: background 100ms;
}

.pub-th-t:hover { background: #2D3F5C; }
.pub-th-t a { text-decoration: none; color: inherit; display: block; text-align: center; }
.pub-th-t .t-dimi  { font-weight: 600; color: #fff; display: block; font-size: 12px; text-align: center; }
.pub-th-t .t-date  { color: #7A93B4; font-size: 10px; display: block; margin-top: 1px; text-align: center; }
.pub-th-t .t-badge { display: inline-block; margin-top: 5px; padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 500; }
.pub-th-t .t-badge-wrap { display: block; text-align: center; }

/* Badges types */
.t-badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.tb-orange { background: #FEF3E2; color: #92580A; }
.tb-bleu   { background: #EBF3FB; color: #1A5C96; }
.tb-vert   { background: #EBF5EA; color: #2D6A2D; }
.tb-rouge  { background: #FDECEA; color: #922B2B; }
.tb-violet { background: #F3EFFE; color: #5B21B6; }

/* Lignes */
.pub-tr { border-top: 1px solid #F0F2F5; }

/* Sticky — tbody */
.pub-td-cl {
    position: sticky; left: 0; z-index: 1;
    box-shadow: 2px 0 0 #D4D8DF;
    text-align: center; font-size: 12px; color: var(--muted);
    width: 38px; min-width: 38px; max-width: 38px;
    padding: 9px 10px 9px 13px;
}

.pub-td-cl::before {
    content: ''; position: absolute;
    left: 0; top: 0; bottom: 0; width: 3px;
}

.pub-td-name {
    position: sticky; left: 38px; z-index: 1;
    box-shadow: 2px 0 0 #D4D8DF;
    font-weight: 500; padding: 9px 10px;
    width: 160px; min-width: 160px; max-width: 160px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.pub-td-total {
    position: sticky; left: 200px; z-index: 1;
    box-shadow: 2px 0 0 #D4D8DF;
    text-align: center; font-weight: 700; font-size: 14px;
    padding: 9px 10px;
    width: 62px; min-width: 62px; max-width: 62px;
}

.pub-td {
    padding: 9px 10px; text-align: center; font-size: 12px;
    cursor: pointer; transition: background 80ms;
}

.pub-td:hover { background: rgba(0,0,0,0.03); }
.pub-td.empty { color: #C9CDD4; cursor: default; }
.pub-td.empty:hover { background: none; }

/* Statuts de paiement */
.s-paye .pub-td-cl,
.s-paye .pub-td-name,
.s-paye .pub-td-total { background: var(--surface); }
.s-paye .pub-td-cl::before { background: #3D7A3A; }

.s-gris { background: #FAFAFA; }
.s-gris .pub-td-cl,
.s-gris .pub-td-name,
.s-gris .pub-td-total { background: #FAFAFA; }
.s-gris .pub-td-cl::before { background: #D1D5DB; }
.s-gris .pub-td-cl,
.s-gris .pub-td-name,
.s-gris .pub-td-total,
.s-gris .pub-td { color: #9CA3AF; }

.s-rouge { background: #FFF8F8; }
.s-rouge .pub-td-cl,
.s-rouge .pub-td-name,
.s-rouge .pub-td-total { background: #FFF8F8; }
.s-rouge .pub-td-cl::before { background: #DC2626; }
.s-rouge .pub-td-cl,
.s-rouge .pub-td-name,
.s-rouge .pub-td-total,
.s-rouge .pub-td { color: #7F1D1D; }
.s-rouge .pub-td.empty { color: #FECACA; }

/* Cartes de score */
.d_carte_score { background: #EBEBEB; border: 1px solid #D4D8DF; border-radius: 10px; }
.titre_block_a { background: #1f2950; border-radius: 10px 10px 0 0; }
.sp1 { color: #fff; font-weight: 600; }
.sp2 { color: #9BB5D4; }
.sp4 { background-color: #2D3F5C; color: #9BB5D4; }
.table_cs .tdcs_fond_gris_clair { background-color: #D4D8DF; border-radius: 5px; color: #1A1F2E; }

/* Légende */
.pub-legend { display: flex; align-items: center; gap: 20px; margin-top: 10px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.pub-li { display: flex; align-items: center; gap: 6px; }
.pub-lb { width: 3px; height: 14px; border-radius: 2px; flex-shrink: 0; }

/* Lien retour */
.pub-back {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--muted); text-decoration: none;
    padding: 6px 12px; border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm); background: var(--surface);
    margin-bottom: 16px; transition: border-color 150ms, color 150ms;
}
.pub-back::before { content: '←'; }
.pub-back:hover { color: var(--accent); border-color: var(--accent); }

/* Formulaire calculette */
.pub-form-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; max-width: 400px; }
.pub-field { margin-bottom: 16px; }
.pub-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.pub-label-hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.pub-input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-mid); border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font); background: var(--surface); color: var(--text); transition: border-color 150ms; }
.pub-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,41,80,0.08); }
.pub-input-short { width: 120px; }
.pub-btn { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 20px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font); font-weight: 500; cursor: pointer; transition: background 150ms; margin-top: 8px; }
.pub-btn:hover { background: #16203a; }
.pub-msg { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; border-left: 3px solid; }
.pub-msg-error   { background: #FDECEA; border-color: #DC2626; color: #7F1D1D; }
.pub-msg-success { background: #EBF5EA; border-color: #3D7A3A; color: #1A4A1A; }

/* Noms responsive */
.pub-nom-court   { display: none; }
.pub-nom-complet { display: inline; }

/* --- Responsive 768px -------------------------------------- */
@media (max-width: 768px) {
    .pub-header { padding: 0 16px; height: 80px; }
    .pub-header-logo-at img { height: 50px; }
    .pub-header-logo-pga img { height: 50px; }
    .pub-header-region { font-size: 10px; }
    .pub-header-saison { font-size: 12px; }
    .pub-content { padding: 12px 16px; }
    .pub-form-wrap { padding: 16px; }
    .pub-th-cl,  .pub-td-cl  { width: 28px; min-width: 28px; max-width: 28px; }
    .pub-th-name { width: 110px; min-width: 110px; max-width: 110px; font-size: 11px; left: 28px; }
    .pub-td-name { width: 110px; min-width: 110px; max-width: 110px; font-size: 11px; left: 28px; }
    .pub-th-total { left: 140px; width: 52px; min-width: 52px; max-width: 52px; font-size: 11px; }
    .pub-td-total { left: 140px; width: 52px; min-width: 52px; max-width: 52px; font-size: 12px; }
}

/* --- Responsive 480px -------------------------------------- */
@media (max-width: 480px) {
    .pub-header { padding: 0 12px; height: 70px; }
    .pub-header-logo-at img { height: 42px; }
    .pub-header-logo-pga img { height: 42px; }
    .pub-header-center { display: none; }
    .pub-legend { gap: 10px; font-size: 10px; }
    .pub-nom-complet { display: none; }
    .pub-nom-court   { display: inline; }
    .pub-th-name { width: 90px; min-width: 90px; max-width: 90px; left: 28px; }
    .pub-td-name { width: 90px; min-width: 90px; max-width: 90px; left: 28px; }
    .pub-th-total { left: 120px; }
    .pub-td-total { left: 120px; }
}
