:root {
  --bg: #f4f6f3;
  --card: #ffffff;
  --text: #17201a;
  --muted: #5f6b63;
  --line: #dde3dc;
  --brand: #0f7a3d;
  --brand-ink: #ffffff;
  --brand-soft: #e3f3e8;
  --no: #b3261e;
  --no-soft: #fbe9e7;
  --warn-soft: #fff4d6;
  --team-a: #1d5fd1;
  --team-a-soft: #e6eefc;
  --team-b: #c2410c;
  --team-b-soft: #fdeee4;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1411;
    --card: #182019;
    --text: #e8eee9;
    --muted: #9aa79e;
    --line: #2a352d;
    --brand: #3fbf72;
    --brand-ink: #06210f;
    --brand-soft: #1b3324;
    --no: #f2857b;
    --no-soft: #3a1d1a;
    --warn-soft: #3a3115;
    --team-a: #7aa7ff;
    --team-a-soft: #1b2740;
    --team-b: #ff9a63;
    --team-b-soft: #3d2416;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--brand); color: var(--brand-ink);
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
}
.brand { color: inherit; text-decoration: none; font-weight: 700; font-size: 18px; display: inline-flex; align-items: center; gap: 8px; }
main { max-width: 560px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 2px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 12px 0;
}
label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
input, textarea {
  width: 100%; font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 12px;
  padding: 12px 14px; background: var(--brand); color: var(--brand-ink);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:disabled { opacity: .5; cursor: default; }
.btn-block { width: 100%; margin-top: 14px; }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn-no { background: var(--no-soft); color: var(--no); }
.btn-small { padding: 7px 10px; font-size: 14px; border-radius: 10px; }
.btn-wa { background: #25d366; color: #062b14; }
.rsvp { display: flex; gap: 10px; }
.rsvp button { flex: 1; padding: 16px 8px; font-size: 17px; white-space: nowrap; background: var(--bg); color: var(--text); border: 2px solid var(--line); }
.rsvp button.on-in { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.rsvp button.on-out { background: var(--no-soft); color: var(--no); border-color: var(--no); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 15px; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
ul.list li:first-child { border-top: 0; }
ul.list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.tag-ok { background: var(--brand-soft); color: var(--brand); }
.tag-wait { background: var(--warn-soft); color: var(--text); }
.tag-no { background: var(--no-soft); color: var(--no); }
.num { width: 24px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.iban {
  font-family: ui-monospace, Menlo, monospace; font-size: 14px;
  background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px;
  margin: 6px 0 10px;
}
.iban span { white-space: nowrap; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.team { border-radius: 12px; padding: 10px; min-height: 60px; }
.team h3 { margin: 0 0 6px; font-size: 14px; }
.team.a { background: var(--team-a-soft); } .team.a h3 { color: var(--team-a); }
.team.b { background: var(--team-b-soft); } .team.b h3 { color: var(--team-b); }
.team div { font-size: 15px; padding: 2px 0; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.pick button { background: var(--bg); color: var(--text); border: 2px solid var(--line); padding: 8px 12px; font-weight: 500; }
.pick button.a { background: var(--team-a-soft); border-color: var(--team-a); color: var(--team-a); }
.pick button.b { background: var(--team-b-soft); border-color: var(--team-b); color: var(--team-b); }
.vote { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vote button { flex: 1; }
.vote .on { outline: 3px solid var(--text); outline-offset: 1px; }
.approved { border: 2px solid var(--brand); }
.banner { background: var(--brand-soft); color: var(--brand); font-weight: 700; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.comment { font-size: 14px; padding: 6px 0; border-top: 1px solid var(--line); }
.comment b { font-weight: 600; }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-top: 10px; }
.match-link { display: block; color: inherit; text-decoration: none; }
.match-link .card { display: flex; align-items: center; gap: 12px; }
.match-link .day { flex: 1; }
#toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-size: 15px;
  opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%); }
.steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.steps li { margin: 4px 0; }
select {
  width: 100%; font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; appearance: none;
}
/* Saha */
.pitch {
  position: relative; aspect-ratio: 2 / 3; margin: 10px 0; border-radius: 12px; overflow: hidden;
  background: repeating-linear-gradient(0deg, #2f8f46 0 10%, #2a8340 10% 20%);
  border: 3px solid #2a8340;
}
.pitch .pl { position: absolute; border: 2px solid rgba(255,255,255,.75); pointer-events: none; }
.pitch .mid { left: 0; right: 0; top: 50%; border-width: 2px 0 0; }
.pitch .circle { left: 50%; top: 50%; width: 26%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); }
.pitch .box { left: 25%; width: 50%; height: 12%; }
.pitch .box-t { top: -2px; border-top: 0; }
.pitch .box-b { bottom: -2px; border-bottom: 0; }
.tlabel { position: absolute; left: 8px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0,0,0,.25); padding: 2px 8px; border-radius: 99px; }
.tlabel.b { top: 8px; } .tlabel.a { bottom: 8px; }
.pp {
  position: absolute; transform: translate(-50%, -50%); background: none; border: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 25%; color: #fff; cursor: default;
}
.pitch.editing .pp:not(.empty) { cursor: pointer; }
.pp .shirt {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.pp.a .shirt { background: #1d5fd1; } .pp.b .shirt { background: #e2601e; }
.pp.gk .shirt { background: #f2c230; color: #222; }
.pp.empty .shirt { background: rgba(255,255,255,.12); border-style: dashed; box-shadow: none; }
.pp .pn {
  font-size: 12px; font-weight: 600; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: rgba(0,0,0,.35); padding: 1px 6px; border-radius: 6px;
}
.pp.empty .pn { background: none; }
.bench { margin-top: -2px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag.ta { background: var(--team-a-soft); color: var(--team-a); }
.tag.tb { background: var(--team-b-soft); color: var(--team-b); }
.teamtabs { display: flex; gap: 8px; }
.teamtabs button { flex: 1; background: var(--bg); color: var(--text); border: 2px solid var(--line); padding: 9px; font-size: 15px; }
.teamtabs button.a.on { border-color: var(--team-a); color: var(--team-a); background: var(--team-a-soft); }
.teamtabs button.b.on { border-color: var(--team-b); color: var(--team-b); background: var(--team-b-soft); }
.fieldbar { display: flex; align-items: center; gap: 10px; margin-top: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; }
.fieldbar .fname { flex: 1; min-width: 0; font-weight: 600; }
.fieldpick { margin-top: 6px; }
.fieldpick label { margin-top: 0; }
/* Sürükle-bırak */
[data-drag] { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pitch.editing .pp[data-drag], .pick [data-drag], .bench [data-drag] { cursor: grab; }
.pitch.editing .pp.empty .pn { font-size: 10px; font-weight: 500; opacity: .75; }
.pitch.editing .pp.empty .shirt { width: 26px; height: 26px; }
.dragging { opacity: .35; }
.drop-over .shirt { outline: 3px solid #ffe066; outline-offset: 2px; transform: scale(1.15); }
.pick.drop-over, [data-pool].drop-over { outline: 2px dashed var(--brand); outline-offset: 4px; border-radius: 10px; }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none;
  background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 15px;
  padding: 8px 14px; border-radius: 99px; box-shadow: 0 6px 18px rgba(0,0,0,.3); white-space: nowrap;
}
body.is-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.pick[data-pool] { min-height: 44px; align-items: center; }
/* Sekmeler */
.tabs {
  position: sticky; top: calc(52px + env(safe-area-inset-top)); z-index: 4;
  display: flex; gap: 4px; margin: 14px -16px 0; padding: 8px 16px; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.tabs a {
  flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px;
  padding: 9px 4px; border-radius: 10px; white-space: nowrap;
}
.tabs a.on { background: var(--brand); color: var(--brand-ink); }
.tbadge { font-size: 12px; font-weight: 700; background: var(--line); color: var(--text); border-radius: 99px; padding: 1px 7px; margin-left: 2px; }
.tabs a.on .tbadge { background: rgba(255,255,255,.25); color: inherit; }
.breakdown { background: var(--bg); border-radius: 10px; padding: 8px 12px; margin: 4px 0 12px; }
.breakdown > div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.breakdown .sum { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
[hidden] { display: none !important; }
.pick.who button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
textarea { resize: vertical; }
.tag-guest { background: var(--warn-soft); color: var(--text); }
.guest-add { margin-top: 12px; }
.guest-add summary { margin-top: 0; font-weight: 600; color: var(--brand); }
.form-msg { margin: 8px 0 0; color: var(--muted); }
.form-msg:empty { display: none; }
.form-msg.error { color: var(--no); background: var(--no-soft); padding: 8px 10px; border-radius: 8px; }
label.inline { display: inline; margin: 0; color: inherit; font-size: inherit; }
label.inline input { width: auto; }
.field-item { border-top: 1px solid var(--line); padding: 6px 0; }
.field-item:first-child { border-top: 0; }
.field-item > summary { display: flex; align-items: center; gap: 10px; list-style: none; color: var(--text); font-size: 16px; margin: 0; padding: 4px 0; }
.field-item > summary::-webkit-details-marker { display: none; }
.field-item > summary .name { flex: 1; min-width: 0; }
.field-item[open] > summary .btn { visibility: hidden; }
.fieldpick { margin-top: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.fieldpick > summary { margin: 0; font-weight: 600; color: var(--brand); }
/* Giriş */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.who { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who button { background: rgba(255,255,255,.18); color: inherit; padding: 5px 10px; font-size: 13px; border-radius: 99px; }
input.pin { letter-spacing: 6px; font-size: 20px; max-width: 160px; }
.pincard > summary { margin: 0; font-weight: 600; }
