:root{font-family:system-ui,-apple-system,'Segoe UI',sans-serif;color:#172622;background:#f5f8f6;font-size:17px}
*{box-sizing:border-box}
body{margin:0}
.wrap{width:min(1180px,calc(100% - 28px));margin:auto}
.sitehead{background:#14382d;color:white;box-shadow:0 2px 12px #0b241c22}
.headrow{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:18px 0;flex-wrap:wrap}
.brand{font-weight:900;letter-spacing:.3px;color:#d5fc80;text-decoration:none}
.sitehead nav{display:flex;gap:15px;align-items:center;flex-wrap:wrap}
.sitehead nav a{color:white}
.hello{color:#c6ded5}
.hero{padding:35px 0 18px}
.hero h1{font-size:clamp(30px,6vw,48px);line-height:1.05;margin:0 0 12px}
.hero p{font-size:1.07rem}
.hero-home{padding-bottom:8px}
.hero-grid{display:grid;grid-template-columns:1.6fr .9fr;gap:20px;align-items:stretch}
.hero-copy,.hero-aside{background:linear-gradient(180deg,#ffffff 0%,#f7fbf8 100%);border:1px solid #dbe6df;border-radius:24px;padding:26px;box-shadow:0 6px 24px #133b2410}
.hero-aside h2{margin-top:0}
.hero-mini-stats{display:flex;gap:12px;flex-wrap:wrap;margin-top:18px}
.home-match-card{padding-top:20px}
.section-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;flex-wrap:wrap;margin-bottom:14px}
.card{background:white;border:1px solid #dbe6df;border-radius:18px;padding:24px;margin:20px 0;box-shadow:0 4px 20px #133b2410}
.card h2{margin-top:0}
.field-card{padding:18px}
.badge{display:inline-block;border-radius:50px;padding:7px 12px;background:#e2f5d3;color:#285524;font-weight:700;font-size:.85rem}
.button,button{display:inline-flex;align-items:center;justify-content:center;min-height:50px;padding:12px 20px;border-radius:12px;border:0;background:#196647;color:white;font-weight:800;font-size:1rem;text-decoration:none;cursor:pointer}
.button.secondary,button.secondary{background:#e4efe9;color:#154331}
.button.danger,button.danger{background:#a83d43}
.button:focus,button:focus,input:focus,select:focus,textarea:focus{outline:3px solid #b3df55;outline-offset:2px}
.actions{display:flex;gap:10px;flex-wrap:wrap}
.big-actions .button{min-width:180px}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.stats{display:flex;gap:12px;flex-wrap:wrap}
.stat{background:#eff7f0;padding:15px 24px;border-radius:12px}
.stat strong{font-size:1.55rem;display:block}
label{display:block;font-weight:700;margin:14px 0 6px}
input,select,textarea{border:1px solid #a8bcb1;border-radius:10px;padding:13px;font:inherit;width:100%;background:#fff}
input[type=checkbox]{width:auto}
form.inline{display:inline}
table{border-collapse:collapse;width:100%}
th,td{border-bottom:1px solid #d8e7dd;padding:12px 8px;text-align:left}
.scroll{overflow-x:auto}
.notice{padding:14px;background:#e4f4cf;border-radius:12px;margin-top:18px}
.warning{background:#fff0d6;padding:16px;border-radius:12px}
.footer{text-align:center;color:#6a7c73;padding:45px 15px}
.subtle,.muted{color:#5b7166}
.match-list{display:flex;flex-direction:column;gap:14px}
.match-row{display:flex;justify-content:space-between;gap:20px;align-items:center;background:#f8fbf9;border:1px solid #e4eee7;border-radius:16px;padding:16px}
.match-row h3{margin:.45rem 0}
.match-row p{margin:.3rem 0}
.match-row-side{display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.mini-stat{background:#e9f4ed;border-radius:999px;padding:9px 12px;font-weight:700;color:#1c4a38}

/* Campo grafico */
.football-field{position:relative;width:100%;aspect-ratio:4/5;overflow:hidden;border:3px solid #ecfff0;border-radius:16px;background:repeating-linear-gradient(0deg,#276f47 0 12.5%,#308451 12.5% 25%);box-shadow:inset 0 0 0 5px #237043}
.field-line.half{position:absolute;left:0;right:0;top:50%;border-top:2px solid #ffffffaa}
.field-circle{position:absolute;top:50%;left:50%;width:26%;aspect-ratio:1;border:2px solid #ffffffbb;border-radius:50%;transform:translate(-50%,-50%)}
.area-top,.area-bottom{position:absolute;left:25%;width:50%;height:18%;border:2px solid #ffffffbb}
.area-top{top:0;border-top:0}
.area-bottom{bottom:0;border-bottom:0}
.goal-top,.goal-bottom{position:absolute;left:43%;width:14%;height:3%;border:2px solid #ffffffcc}
.goal-top{top:0;border-top:0}
.goal-bottom{bottom:0;border-bottom:0}
.field-player{position:absolute;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;z-index:2;width:31%;max-width:118px;gap:2px}
.shirt-symbol{display:inline-flex;align-items:center;justify-content:center;clip-path:polygon(25% 0%,40% 7%,60% 7%,75% 0%,100% 23%,88% 46%,76% 39%,76% 100%,24% 100%,24% 39%,12% 46%,0% 23%);width:49px;height:49px;background:var(--shirt,#FACC15);color:var(--shirt-text,#172622);font-size:1rem;font-weight:900;text-shadow:0 1px #7772;filter:drop-shadow(0 3px 5px #0007);box-shadow:inset 0 0 0 2px rgba(255,255,255,.18),inset 0 -8px 14px rgba(0,0,0,.16)}
.shirt-symbol.vacant{opacity:.72;filter:grayscale(.2)}
.player-name{color:white;text-shadow:0 1px 3px #103d2a,0 2px 4px #103d2a;font-size:clamp(.66rem,1.75vw,.87rem);font-weight:800;text-align:center;line-height:1.15;overflow-wrap:anywhere;max-width:100%}
.player-role{color:#dff8e8;text-shadow:0 1px 3px #103d2a;font-size:.66rem;font-weight:700;text-align:center}
button.choose-position{min-height:28px;padding:3px 7px;font-size:.72rem;border-radius:7px;background:#f3ffda;color:#125338}
input[type=color]{max-width:120px;min-height:52px;padding:4px}

@media(max-width:920px){
  .hero-grid,.grid2,.fields-home{grid-template-columns:1fr}
  .match-row{align-items:flex-start;flex-direction:column}
  .match-row-side{justify-content:flex-start}
}
@media(max-width:650px){
  .card{padding:18px}
  .sitehead nav{font-size:.9rem}
  .shirt-symbol{width:39px;height:39px}
  .field-player{width:31%}
  .player-role{font-size:.58rem}
}

.team-icon{margin-right:6px;vertical-align:middle}
.field-slot-form,.field-slot-link{display:block;width:100%;text-decoration:none}
.field-slot-button{all:unset;display:flex;flex-direction:column;align-items:center;gap:2px;width:100%;cursor:pointer}
.field-slot-link,.field-slot-button{padding:2px 4px;border-radius:12px;transition:transform .15s ease,filter .15s ease,background .15s ease}
.free-slot .field-slot-link:hover,.free-slot .field-slot-link:focus,.free-slot .field-slot-button:hover,.free-slot .field-slot-button:focus{transform:translateY(-2px);background:rgba(255,255,255,.08)}
.shirt-symbol.clickable{opacity:1;outline:2px solid rgba(215,250,132,.55);outline-offset:2px}
.slot-cta{display:inline-flex;align-items:center;justify-content:center;min-height:22px;padding:2px 8px;border-radius:999px;background:#e4f4cf;color:#163f2f;font-size:.67rem;font-weight:800;margin-top:2px;text-shadow:none}
.team-waitlist-box{margin-top:14px;padding:14px;border:1px dashed #cddfcf;border-radius:14px;background:#f8fbf8;display:flex;flex-direction:column;gap:8px}
.team-waitlist-box form{margin:0}

/* v05: campo pulito, maglie leggibili, nomi singoli */
.hero-grid{grid-template-columns:1.45fr .8fr}
.hero-copy,.hero-aside{padding:22px;border-radius:18px}
.hero-home h1{font-size:clamp(27px,3.8vw,42px)}
.football-field{background:repeating-linear-gradient(0deg,#278251 0 12.5%,#287347 12.5% 25%)}
.shirt-symbol{font-size:1.03rem;font-weight:950;filter:drop-shadow(0 2px 3px #061c14ac);text-shadow:none}
.field-card h2{display:flex;align-items:center;gap:7px}
.field-card .shirt-symbol.occupied,.field-card .shirt-symbol.vacant{outline:1px solid #ffffff9c;outline-offset:1px}
.field-player{gap:0}
.player-name{font-size:clamp(.76rem,1.7vw,.95rem);font-weight:850;text-shadow:0 2px 4px #09261b,0 1px 2px #09261b;margin-top:1px}
.fields-home .slot-cta,.fields-home .player-role{display:none}
.fields-home .field-card{border:0;box-shadow:none;margin:0;padding:12px}
.fields-home{gap:8px}
.field-slot-button .slot-cta{font-size:.65rem}
.share-actions{display:flex;gap:8px;flex-wrap:wrap;margin:15px 0}
.share-actions a,.share-actions button{min-height:44px;font-size:.87rem;padding:9px 13px;border:1px solid #cfe0d4;border-radius:10px;background:#eff7f1;color:#13563a;font-weight:750;text-decoration:none}
.share-actions a:hover,.share-actions button:hover{background:#dbefdf}
.chat-card{scroll-margin-top:15px}
.chat-messages{max-height:380px;overflow:auto;display:flex;flex-direction:column;gap:10px;padding:12px;background:#f1f7f3;border:1px solid #d7e7dd;border-radius:14px}
.chat-entry{padding:10px 13px;background:#fff;border-radius:12px;max-width:90%;border:1px solid #e3eae5;overflow-wrap:anywhere}
.chat-entry.self{align-self:flex-end;background:#e5f4db}
.chat-entry .chat-meta{font-size:.76rem;color:#64776b;margin-bottom:4px}
.chat-entry .chat-body{white-space:pre-wrap}
.chat-form textarea{min-height:82px}
.chat-error{color:#9c2631;font-weight:750}
@media(max-width:650px){.fields-home{grid-template-columns:1fr}.field-card{padding:12px}.share-actions a,.share-actions button{flex:1 1 125px}}

/* Accesso al gruppo WhatsApp fisso */
.whatsapp-panel{display:flex;align-items:center;justify-content:space-between;gap:24px;border:1px solid #b9dfc4;background:#f5fbf6}
.whatsapp-panel-text{max-width:670px}
.whatsapp-panel-text h2{margin:0 0 8px}
.whatsapp-panel-text p{margin:0;line-height:1.55}
.whatsapp-button{background:#177a49;color:#fff;white-space:normal;text-align:center;flex-shrink:0}
.whatsapp-button:hover{background:#10623b}
@media(max-width:720px){.whatsapp-panel{flex-direction:column;align-items:stretch}.whatsapp-panel .button{width:100%}}

/* v0.7: righe simmetriche e leggibilità su smartphone */
.football-field .field-player{max-width:112px;text-align:center}
.football-field .player-name{width:100%;text-align:center;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.football-field .field-slot-link,.football-field .field-slot-button{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%}
.invite-players{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:7px;max-height:230px;overflow:auto;padding:8px;border:1px solid #dbe6df;border-radius:12px}
.invite-player{font-weight:500;margin:0;display:flex;gap:8px;align-items:center;padding:8px}
@media(max-width:600px){.football-field .player-name{font-size:.68rem}.invite-players{grid-template-columns:1fr}}
