.birthday-banner { display:flex; align-items:center; gap:14px; position:relative; z-index:20; padding:18px; margin:0 0 20px; border:1px solid #d8ab584d; border-radius:22px; background:linear-gradient(115deg,var(--surface),var(--surface-2)); box-shadow:0 6px 20px #00000008; }
.birthday-cake { font-size:32px; flex-shrink:0; }
.birthday-banner>div { flex:1; min-width:0; }
.birthday-banner small { display:block; font-size:9px; font-weight:800; letter-spacing:.12em; color:var(--muted); }
.birthday-banner strong { display:block; font-size:17px; line-height:1.4; margin:4px 0; overflow-wrap:anywhere; }
.birthday-banner div>span { font-size:12px; color:var(--muted); }
.birthday-banner button { flex-shrink:0; width:44px; height:44px; border:0; border-radius:50%; background:var(--surface-2); color:var(--text); font-size:24px; cursor:pointer; }
.birthday-banner button:focus-visible { outline:2px solid var(--primary); }
.birthday-person { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid var(--border); }
.birthday-person>div { min-width:0; }
.birthday-person strong { display:block; font-size:13px; overflow-wrap:anywhere; }
.birthday-person span { display:block; font-size:12px; color:var(--muted); margin-top:4px; }
.birthday-person button { flex-shrink:0; min-height:44px; font-size:12px; padding:8px 12px; }
.birthday-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.birthday-settings { margin-top:20px; }

.birthday-settings { margin-top:0; }
.birthday-settings .section-title { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; }
.player-row-actions { display:flex; flex-shrink:0; gap:6px; }
.player-row-actions .player-remove { min-width:44px; font-size:20px; }
.team-settings-details { margin-top:20px; }
.team-settings-details summary { cursor:pointer; font-weight:700; padding:8px 0; }

.settings-collapse summary { cursor:pointer; font-weight:700; font-size:18px; padding:8px 0; }
.settings-collapse[open] summary { margin-bottom:12px; }
.settings-collapse summary:focus-visible { outline:2px solid var(--primary); outline-offset:4px; border-radius:4px; }

/* Consistent settings layout, scoped to avoid changing other pages. */
.settings-page { display:grid; gap:16px; min-width:0; }
.settings-page > .card, .settings-page .data-management > .card { margin:0; border-radius:20px; }
.settings-page .birthday-settings { padding:18px; }
.settings-page .section-title { margin:0 0 12px; gap:12px; }
.settings-page .section-title h2 { margin:0; font-size:19px; line-height:1.3; }
.settings-page .birthday-settings > p { margin:0 0 8px; line-height:1.5; }
.settings-page .birthday-person { padding:14px 0; }
.settings-page .birthday-person:last-child { border-bottom:0; padding-bottom:0; }
.settings-page .section-head { margin:8px 0 -4px; padding:0 18px; }
.settings-page .section-head h2 { margin:0; font-size:13px; letter-spacing:.06em; color:var(--muted); }
.settings-page .data-management { gap:12px; }
.settings-page details.card { padding:0; overflow:hidden; }
.settings-page details > summary { display:flex; align-items:center; gap:12px; list-style:none; cursor:pointer; padding:18px; margin:0; min-height:78px; box-sizing:border-box; }
.settings-page details > summary::-webkit-details-marker { display:none; }
.settings-menu-icon { display:grid; place-items:center; flex:0 0 38px; height:38px; border-radius:12px; background:var(--surface-2); color:var(--primary); font-size:22px; }
.settings-menu-label { flex:1; min-width:0; }
.settings-menu-label strong { display:block; font-size:15px; line-height:1.35; }
.settings-menu-label small { display:block; color:var(--muted); font-size:11px; font-weight:400; line-height:1.4; margin-top:3px; }
.settings-chevron { color:var(--muted); font-size:22px; transition:transform .15s; }
.settings-page details[open] > summary .settings-chevron { transform:rotate(180deg); }
.settings-page details[open] > summary { border-bottom:1px solid var(--border); }
.settings-page .data-section-heading { padding:14px 18px; background:transparent; border:0; }
.settings-page .data-section-heading p { margin:0; }
.settings-page .data-action-row { padding:16px 18px; }
.settings-page .team-settings-details > p { margin:16px 18px; line-height:1.5; }
.settings-page .team-settings-details > .form { padding:0 18px 18px; }
.settings-page .data-section-danger .settings-menu-icon { color:var(--red); background:color-mix(in srgb,var(--red) 9%,var(--surface)); }
@media(max-width:360px) { .settings-page .birthday-person { gap:8px; } .settings-page .player-row-actions { gap:4px; } .settings-page .player-row-actions button { padding:8px; } }

.player-portrait { width:88px; height:88px; object-fit:cover; border-radius:24px; flex-shrink:0; border:3px solid var(--surface); box-shadow:0 5px 18px #00000012; }
.portrait-fallback { display:grid; place-items:center; background:linear-gradient(135deg,#2563eb,#153b84); color:white; font-size:26px; font-weight:800; }
.photo-editor { display:flex; align-items:center; gap:16px; padding:16px; background:var(--surface-2); border-radius:20px; }
.photo-editor .btn { display:inline-flex; min-height:44px; align-items:center; font-size:12px; margin:3px 0; cursor:pointer; }
.photo-editor p { margin:8px 0 0; }
.player-profile-hero { display:flex; align-items:center; gap:16px; padding:20px 16px; border-radius:22px; background:linear-gradient(120deg,var(--surface-2),var(--surface)); border:1px solid var(--border); }
.player-profile-hero > div { min-width:0; }
.player-profile-hero small { color:var(--muted); font-size:9px; font-weight:800; letter-spacing:.1em; }
.player-profile-hero h3 { font-size:21px; line-height:1.2; margin:6px 0; overflow-wrap:anywhere; }
.player-profile-hero p { color:var(--muted); font-size:12px; margin:5px 0; }
.player-profile-status { padding:12px 4px; font-size:13px; font-weight:700; }
@media(max-width:360px){.player-profile-hero{gap:12px;padding:16px 12px}.player-portrait{width:72px;height:72px}.photo-editor{padding:12px;gap:12px}}

/* Creazione giocatore: tutti i controlli restano dentro il popup mobile. */
.player-create-modal,
.player-create-modal .form,
.player-create-modal .photo-editor,
.player-create-modal .photo-editor-actions,
.player-create-modal .photo-crop-controls {
 min-width:0;
 max-width:100%;
 box-sizing:border-box;
}
.player-create-modal { overflow-x:hidden; }
.player-create-modal .photo-editor-actions { display:flex; flex-wrap:wrap; gap:6px; flex:1 1 auto; }
.player-create-modal .photo-editor-actions .btn { max-width:100%; white-space:normal; text-align:center; justify-content:center; }
.player-create-modal #photoCropCanvas { display:block; width:min(260px,100%); max-width:100%; }
.player-create-modal #photoCropControls input[type="range"] { display:block; width:100%; max-width:100%; min-width:0; box-sizing:border-box; }
@media(max-width:420px) {
 .player-create-modal { width:100%; }
 .player-create-modal .photo-editor {
  display:grid;
  grid-template-columns:72px minmax(0,1fr);
  align-items:center;
  padding:12px;
  gap:10px;
 }
 .player-create-modal .photo-editor-preview { grid-row:1 / span 2; min-width:0; }
 .player-create-modal .photo-editor .player-portrait { width:68px; height:68px; border-radius:19px; }
 .player-create-modal .photo-editor-actions { display:grid; grid-template-columns:minmax(0,1fr); width:100%; }
 .player-create-modal .photo-editor-actions .btn { width:100%; min-width:0; margin:0; padding:9px 7px; min-height:38px; }
 .player-create-modal #newPlayerPhotoStatus { grid-column:1/-1; overflow-wrap:anywhere; }
}

/* Schede giocatore: stessa misura e un solo scroll interno, senza barra visibile. */
.modal-backdrop {
 overflow:hidden;
 padding-bottom:max(104px,calc(88px + env(safe-area-inset-bottom)));
}
.modal {
 box-sizing:border-box;
 scrollbar-width:none;
 -ms-overflow-style:none;
 overscroll-behavior:contain;
}
.modal::-webkit-scrollbar { display:none; width:0; height:0; }
.player-profile-modal {
 width:min(600px,100%);
 height:min(760px,calc(100dvh - 142px - env(safe-area-inset-bottom)));
 max-height:calc(100dvh - 142px - env(safe-area-inset-bottom));
 overflow-y:auto;
}
.player-profile-modal > .row {
 position:sticky;
 top:-20px;
 z-index:5;
 margin:-20px -20px 16px;
 padding:20px;
 background:var(--surface);
 border-bottom:1px solid var(--border);
}
.player-profile-modal .player-history-section {
 margin-top:16px;
 padding:0 16px 8px;
 border:1px solid var(--border);
 border-radius:18px;
 background:var(--surface);
 overflow:hidden;
}
.player-profile-modal .player-history-section .compact-section-head {
 display:flex;
 align-items:center;
 justify-content:flex-start;
 gap:11px;
 margin:0 -16px 4px;
 padding:14px 16px;
 background:var(--surface-2);
 border-bottom:1px solid var(--border);
}
.player-profile-modal .player-history-section .compact-section-head > div { min-width:0; text-align:left; }
.player-profile-modal .player-history-section .compact-section-head h3 { margin:0; }
.player-profile-modal .player-history-section .compact-section-head small {
 display:block;
 margin-top:3px;
 color:var(--muted);
 font-size:10px;
 line-height:1.35;
}
.history-section-icon {
 display:grid;
 place-items:center;
 flex:0 0 34px;
 height:34px;
 border-radius:11px;
 background:color-mix(in srgb,var(--primary) 12%,var(--surface));
 color:var(--primary);
 font-size:16px;
 font-weight:800;
}
.player-fines-section .history-section-icon {
 background:color-mix(in srgb,var(--red) 10%,var(--surface));
 color:var(--red);
}
.player-profile-modal .player-history-section .player-history-row:first-child { border-top:0; }
.player-profile-modal .player-history-section > .player-history-list > p { padding:12px 0 6px; }
@media(max-width:420px) {
 .player-profile-modal {
  height:calc(100dvh - 126px - env(safe-area-inset-bottom));
  max-height:calc(100dvh - 126px - env(safe-area-inset-bottom));
  border-radius:22px;
 }
 .player-profile-modal .player-history-summary { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .player-profile-modal .player-history-summary > div { padding:10px 8px; }
 .player-profile-modal .player-history-summary span { font-size:9px; }
 .player-profile-modal .player-history-summary strong { font-size:14px; }
}

.birthday-person[hidden]{display:none}
.player-search-field{display:grid;gap:8px;margin:16px 0;font-size:12px;color:var(--muted)}
#photoCropControls[hidden]{display:none} #photoCropControls{display:grid;gap:12px} #photoCropCanvas{width:100%;max-width:260px;height:auto;border-radius:20px;justify-self:center} #photoCropControls label{display:grid;gap:6px;font-size:12px} #photoCropControls input{width:100%;min-height:36px} .player-share-controls{display:grid;gap:8px;margin:12px 0 18px;font-size:12px;color:var(--muted)}

.player-avatar-button{padding:0;border:0;cursor:pointer;flex-shrink:0;min-width:44px;min-height:44px;overflow:hidden}.player-avatar-button:focus-visible{outline:2px solid var(--primary);outline-offset:3px}.player-list-photo{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}.payment-player .player-avatar{overflow:hidden;flex-shrink:0}.player-avatar-button .player-list-photo{width:44px;height:44px}

.payment-player .player-avatar { width:44px; height:44px; flex:0 0 44px; border-radius:13px; background:var(--surface-2); color:var(--text); }
