/* Uygulama kabuğu, gezinme, sayfalar (maçlar, istatistik, ayarlar), giriş, diyaloglar, mobil. */

:root {
  --tabbar-height: 62px;
  --success: #3ddc97;
  --warn: #f2c14e;
}

.app-shell[hidden],
#view-login[hidden],
.view[hidden],
[hidden] {
  display: none !important;
}

.app-shell {
  padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
}

/* --- üst bar --------------------------------------------------------------- */

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.brand-text {
  display: grid;
  line-height: 1.05;
}

.brand-text small {
  color: var(--accent-2);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.brand-text strong {
  font-size: 1.05rem;
}

.main-nav {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.main-nav a {
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.main-nav a:hover {
  color: var(--text);
  background: rgba(237, 246, 238, 0.06);
}

.main-nav a.active {
  color: var(--text);
  background: rgba(61, 220, 151, 0.14);
  box-shadow: inset 0 -2px 0 var(--accent-2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(237, 246, 238, 0.16);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
}

.live-link {
  background: var(--danger);
  color: #fff;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.7); }
}

body.role-viewer [data-admin-only] {
  display: none !important;
}

/* --- alt sekme çubuğu (mobil) ---------------------------------------------- */

.tabbar {
  display: none;
}

/* --- sayfa görünümleri ------------------------------------------------------- */

.page {
  display: grid;
  gap: 16px;
  width: min(1100px, 100%);
  margin: 0 auto;
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.view-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1.1;
}

.view-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.back-link {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--accent-2);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.panel-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 35, 31, 0.92);
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel-block h2 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.team-heading {
  padding-left: 10px;
  border-left: 4px solid var(--team-color, var(--accent));
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.settings-page code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(237, 246, 238, 0.08);
  font-size: 0.85em;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 36px 16px;
  border: 1px dashed rgba(237, 246, 238, 0.2);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
}

.pill {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid rgba(237, 246, 238, 0.18);
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 900;
  color: var(--muted);
  vertical-align: middle;
}

.pill--gold {
  border-color: rgba(242, 193, 78, 0.6);
  background: rgba(242, 193, 78, 0.16);
  color: #ffe7a5;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(237, 246, 238, 0.08);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-chip--live {
  background: rgba(255, 107, 107, 0.2);
  color: #ffd4d4;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.toggle input {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--accent-2);
}

/* --- tablolar ----------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.stat-table th,
.stat-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(237, 246, 238, 0.1);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.stat-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-table tr:last-child td {
  border-bottom: 0;
}

.stat-table .num {
  text-align: right;
}

.stat-table a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.stat-table a:hover {
  color: var(--accent-2);
}

.stat-table .name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-table .name-cell small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.stat-table--edit input {
  width: 64px;
  min-height: 34px;
  padding: 0 6px;
  text-align: center;
}

.stat-table--edit input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--accent);
}

.rating-cell small {
  margin-left: 3px;
  color: var(--muted);
}

.sort-button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.sort-button.sort-desc::after {
  content: " ↓";
}

.sort-button.sort-asc::after {
  content: " ↑";
}

.th-short,
.table-legend {
  display: none;
}

.result {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 900;
  background: rgba(237, 246, 238, 0.1);
}

.result--win { background: rgba(61, 220, 151, 0.25); color: #d9ffee; }
.result--loss { background: rgba(255, 107, 107, 0.25); color: #ffd4d4; }
.result--draw { background: rgba(242, 193, 78, 0.22); color: #ffe7a5; }

/* --- avatar ------------------------------------------------------------------- */

.avatar {
  --avatar-size: 36px;
  width: var(--avatar-size);
  height: var(--avatar-size);
  flex: 0 0 auto;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #f88f46);
  color: #17201c;
  font-size: calc(var(--avatar-size) * 0.36);
  font-weight: 900;
}

.avatar--photo {
  background-size: cover;
  background-position: center top;
}

/* --- maç listesi ---------------------------------------------------------------- */

.match-list,
.live-banner {
  display: grid;
  gap: 8px;
}

.match-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 35, 31, 0.92);
  color: var(--text);
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease;
}

.match-row:hover {
  transform: translateY(-1px);
  border-color: rgba(61, 220, 151, 0.5);
}

.match-row__date {
  display: grid;
  font-weight: 800;
}

.match-row__date small,
.match-row__meta small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.match-row__teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.team-chip {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 10px;
  border-left: 4px solid var(--team-color, var(--accent));
  font-weight: 800;
}

.team-chip--right {
  padding-left: 0;
  padding-right: 10px;
  border-left: 0;
  border-right: 4px solid var(--team-color, var(--accent));
  text-align: right;
}

.match-score {
  font-size: 1.25rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.match-score i,
.scoreboard__score i,
.live-score i {
  font-style: normal;
  color: var(--muted);
  padding: 0 4px;
}

.match-score--live {
  color: #ffd4d4;
}

.match-row__meta {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(237, 246, 238, 0.06), transparent 60%),
    rgba(24, 35, 31, 0.92);
}

.scoreboard__team {
  min-width: 0;
  font-size: 1.15rem;
  font-weight: 900;
  padding-left: 12px;
  border-left: 5px solid var(--team-color, var(--accent));
}

.scoreboard__team--right {
  padding-left: 0;
  padding-right: 12px;
  border-left: 0;
  border-right: 5px solid var(--team-color, var(--accent));
  text-align: right;
}

.scoreboard__score {
  font-size: 2.4rem;
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
}

.scoreboard--detail {
  align-items: start;
}

.scoreboard--detail .scoreboard__team strong {
  display: block;
  font-size: 1.15rem;
}

.scoreboard__center {
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.scoreboard__center small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.scoreboard__mvp {
  color: var(--text) !important;
}

.scorers {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  font-size: 0.86rem;
  font-weight: 700;
}

.scorers li small {
  color: var(--muted);
  font-weight: 800;
}

.scoreboard__team--right .scorers {
  justify-items: end;
}

.match-layout {
  display: grid;
  grid-template-columns: minmax(300px, 460px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.match-layout__side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.info-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.info-nav a {
  padding: 6px 12px;
  border: 1px solid rgba(237, 246, 238, 0.16);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.info-nav a:hover {
  color: var(--text);
  border-color: var(--accent-2);
}

.info-section {
  scroll-margin-top: 12px;
}

.info-section h3 {
  margin: 14px 0 6px;
  font-size: 0.92rem;
}

.info-section p,
.info-section li {
  max-width: 78ch;
  line-height: 1.55;
}

.info-section ol,
.info-section ul {
  padding-left: 20px;
}

.info-formula {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(242, 193, 78, 0.12);
  border: 1px solid rgba(242, 193, 78, 0.35);
  font-weight: 800;
}

.info-table--narrow {
  width: auto;
  min-width: 320px;
}

.inline-link {
  color: var(--accent-2);
  font-weight: 800;
  text-decoration: none;
}

.toolbar-button--icon {
  flex: 0 0 auto;
  min-width: 40px;
  padding: 0;
  font-weight: 900;
}

/* --- mini saha -------------------------------------------------------------------- */

.mini-pitch {
  position: relative;
  width: min(100%, 440px);
  margin: 0 auto;
  aspect-ratio: 0.6;
  border: 2px solid rgba(237, 246, 238, 0.3);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(2, 8, 7, 0.15), rgba(2, 8, 7, 0.25)),
    url("assets/fut-saha-bg.webp") center / cover no-repeat,
    #07120e;
}

.mini-pitch__label {
  position: absolute;
  left: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(7, 18, 14, 0.75);
  border-left: 4px solid var(--team-color);
  font-size: 0.74rem;
  font-weight: 900;
}

.mini-pitch__label--top { top: 10px; }
.mini-pitch__label--bottom { bottom: 10px; left: auto; right: 10px; }

.mini-card {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  text-decoration: none;
  color: var(--text);
}

.mini-card .player-card {
  cursor: pointer;
}

.mini-pitch--tokens {
  width: 100%;
  margin: 0;
  aspect-ratio: 0.5;
}

.mini-pitch--tokens .mini-card {
  width: calc(var(--token-size, 46px) + 30px);
}

.mini-pitch--tokens .mini-card .mini-badges {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  margin-top: 3px;
}

.mini-card .mini-badges {
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  z-index: 2;
  white-space: nowrap;
}

.mini-card .mini-badge {
  font-size: 0.6rem;
  padding: 1px 6px;
}

.mini-token {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 0;
  width: 70px;
  color: var(--text);
  text-decoration: none;
}

.mini-face {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2.5px solid var(--team-color);
  background: linear-gradient(145deg, #2b3d34 0%, #16211c 100%);
  color: #f2c14e;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 1000;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(7, 18, 14, 0.7);
}

.mini-face--photo {
  background-image: var(--player-portrait-image);
  background-size: cover;
  background-position: center top;
}

.mini-token em {
  margin-top: -6px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--team-color);
  color: #0f1714;
  font-size: 0.5rem;
  font-style: normal;
  font-weight: 1000;
  line-height: 1.4;
  z-index: 1;
}

.mini-token > span:not(.mini-badges) {
  max-width: 76px;
  margin-top: 2px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(7, 18, 14, 0.8);
  font-size: 0.64rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-badges {
  display: flex;
  gap: 2px;
  margin-top: 2px;
}

.mini-badge {
  padding: 0 4px;
  border-radius: 999px;
  background: #f2c14e;
  color: #17201c;
  font-size: 0.54rem;
  font-weight: 1000;
  line-height: 1.5;
}

.mini-badge--assist {
  background: #3ddc97;
}

.mini-badge--mvp {
  background: #fff;
}

.mini-token:hover .mini-face {
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.9), 0 6px 16px rgba(0, 0, 0, 0.5);
}

/* --- olay zaman çizelgesi ------------------------------------------------------------ */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(237, 246, 238, 0.05);
  border-left: 4px solid var(--team-color, var(--accent));
}

.timeline-item--b {
  border-left: 0;
  border-right: 4px solid var(--team-color, var(--accent));
}

.timeline-minute {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.timeline-minute-input {
  width: 52px;
  min-height: 32px;
  padding: 0 4px;
  text-align: center;
}

.timeline-body small {
  color: var(--muted);
  margin-left: 6px;
}

/* --- maç formu ----------------------------------------------------------------------- */

.match-form {
  display: grid;
  gap: 16px;
}

.match-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.match-form__head {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: end;
}

.score-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.score-entry > label:first-child input {
  border-left: 4px solid var(--team-color);
}

.score-entry > label:last-child input {
  border-right: 4px solid var(--team-color);
}

.score-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.score-pair input {
  width: 64px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 900;
}

.score-pair i {
  font-style: normal;
  font-weight: 900;
}

.goal-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.goal-hint--warn {
  color: #ffe7a5;
}

.form-actions {
  display: grid;
  gap: 8px;
}

.form-actions--row {
  grid-template-columns: auto 1fr;
  justify-content: end;
}

.form-actions--row .primary-button {
  justify-self: end;
  min-width: 200px;
}

.photo-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

/* --- canlı maç ------------------------------------------------------------------------ */

.live-screen {
  display: grid;
  gap: 16px;
}

.live-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 107, 107, 0.1), transparent 70%),
    rgba(24, 35, 31, 0.95);
  position: sticky;
  top: 8px;
  z-index: 5;
}

.live-header__team {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.05rem;
  font-weight: 900;
  padding-left: 10px;
  border-left: 5px solid var(--team-color);
}

.live-header__team--right {
  padding-left: 0;
  padding-right: 10px;
  border-left: 0;
  border-right: 5px solid var(--team-color);
  text-align: right;
}

.live-score {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-items: center;
  align-items: center;
  column-gap: 2px;
  font-size: 2.2rem;
  font-weight: 1000;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.live-score b {
  display: inline;
}

.live-timer {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffd4d4;
  letter-spacing: 0.06em;
}

.live-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.live-team {
  display: grid;
  gap: 8px;
  align-content: start;
}

.live-player {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid rgba(237, 246, 238, 0.14);
  border-left: 5px solid var(--team-color);
  border-radius: 8px;
  background: rgba(24, 35, 31, 0.95);
  color: var(--text);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.live-player:disabled {
  cursor: default;
  opacity: 0.9;
}

.live-player em {
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  color: var(--team-color);
}

.live-player span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-badge {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(242, 193, 78, 0.2);
  color: #ffe7a5;
  font-size: 0.72rem;
}

.live-badge--card {
  background: transparent;
  padding: 0;
}

.action-sheet {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.action-button {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 74px;
  border: 1px solid rgba(237, 246, 238, 0.16);
  border-radius: 8px;
  background: rgba(237, 246, 238, 0.06);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.action-button b {
  font-size: 1.4rem;
}

.action-button--goal { border-color: rgba(61, 220, 151, 0.6); background: rgba(61, 220, 151, 0.14); }
.action-button--own_goal { border-color: rgba(255, 107, 107, 0.5); }

/* --- oyuncu seçici ------------------------------------------------------------------- */

.picker-list {
  display: grid;
  gap: 6px;
  max-height: min(60vh, 520px);
  overflow: auto;
}

.picker-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(237, 246, 238, 0.12);
  border-radius: 8px;
  background: rgba(237, 246, 238, 0.04);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.picker-row--fit {
  border-color: rgba(61, 220, 151, 0.5);
  background: linear-gradient(90deg, rgba(61, 220, 151, 0.12), transparent 50%), rgba(237, 246, 238, 0.04);
}

.picker-info {
  display: grid;
  min-width: 0;
}

.picker-info span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

/* --- otomatik kadro seçici ----------------------------------------------------------- */

.picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 10px;
}

.picker-count {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.picker-toolbar-actions {
  display: flex;
  gap: 6px;
}

.picker-toolbar-actions .ghost-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.check-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
  max-height: min(52vh, 480px);
  overflow: auto;
  padding: 2px;
}

.check-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(237, 246, 238, 0.12);
  border-radius: 8px;
  background: rgba(237, 246, 238, 0.04);
  cursor: pointer;
}

.check-row:has(input:checked) {
  border-color: rgba(61, 220, 151, 0.55);
  background: rgba(61, 220, 151, 0.1);
}

.check-row input {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--accent-2);
}

.check-info {
  display: grid;
  min-width: 0;
}

.check-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-info span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

/* --- takım dengesi ------------------------------------------------------------------- */

.team-balance {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(237, 246, 238, 0.14);
  border-radius: 8px;
  background: rgba(24, 35, 31, 0.8);
  font-size: 0.82rem;
}

.balance-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.balance-team b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.balance-team strong {
  font-size: 1.1rem;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--team-color);
  color: #0f1714;
}

.balance-team--right {
  justify-content: flex-end;
}

@media (max-width: 480px) {
  .balance-team b {
    display: none;
  }
}

.balance-note {
  font-weight: 900;
  color: var(--muted);
}

.balance--warn .balance-note { color: #ffe7a5; }
.balance--bad .balance-note { color: #ffd4d4; }

.pitch-toolbar-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pitch-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

/* --- istatistik ---------------------------------------------------------------------- */

.leaderboards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

/* Beş liste (Oyuncuların gözdesi dahil) geniş ekranda 3 + 2: sonuncusu satırda yalnız kalmasın, isimler kesilmesin */
@media (min-width: 900px) {
  .leaderboards--five {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .leaderboards--five > :nth-child(-n + 3) {
    grid-column: span 2;
  }

  .leaderboards--five > :nth-child(n + 4) {
    grid-column: span 3;
  }
}

.leader-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 35, 31, 0.92);
  padding: 14px;
}

.leader-card h2 {
  margin-bottom: 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.leader-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.leader-list li {
  display: grid;
  grid-template-columns: 20px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.leader-rank {
  color: var(--muted);
  font-weight: 900;
  font-size: 0.8rem;
}

.leader-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.player-page {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.player-page__stats .profile-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* "Oyuncu oyu" kutusuyla 9 kutu: 3 × 3 */
.player-page__stats .profile-stat-grid--nine {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* --- giriş ---------------------------------------------------------------------------- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-wrap--embedded {
  min-height: 0;
  padding: 8px 0;
  justify-items: start;
}

.login-card {
  width: min(400px, 100%);
  display: grid;
  gap: 12px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(24, 35, 31, 0.96);
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 1.7rem;
}

.login-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.login-error {
  margin: 0;
  color: #ffd4d4;
  font-size: 0.86rem;
  font-weight: 700;
}

/* --- diyalog ve bildirim ---------------------------------------------------------------- */

#dialogHost .modal-backdrop {
  z-index: 40;
}

.modal-body {
  min-width: 0;
}

.modal--dialog {
  width: min(440px, 100%);
}

.dialog-title {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.dialog-message {
  margin: 0 0 16px;
  color: var(--muted);
  white-space: pre-line;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  transform: translate(-50%, 20px);
  max-width: min(92vw, 480px);
  padding: 10px 16px;
  border-radius: 8px;
  background: #edf6ee;
  color: #0f1714;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast--success { background: var(--accent-2); }
.toast--error { background: var(--danger); color: #fff; }

/* --- jeton görünümü (telefon sahası) ---------------------------------------------------- */

.pitch--tokens .slot {
  width: 92px;
  min-height: 104px;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
}

.pitch--tokens .slot.occupied {
  width: 90px;
  min-height: 102px;
}

.pitch--tokens .position-label {
  font-size: 0.62rem;
}

.pitch--tokens .empty-slot {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--team-color, rgba(237, 246, 238, 0.6));
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 900;
  color: rgba(237, 246, 238, 0.85);
}

.player-card--token {
  --face-size: 60px;
  position: relative;
  display: grid;
  justify-items: center;
  width: 86px;
  height: auto;
  padding-top: 4px;
  background: none;
  box-shadow: none;
  text-shadow: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  filter: none;
}

.player-card--token.player-card--home,
.player-card--token.player-card--away {
  filter: none;
}

.token-face {
  width: var(--face-size);
  height: var(--face-size);
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2.5px solid var(--team-color);
  background: linear-gradient(145deg, #2b3d34 0%, #16211c 100%);
  color: #f2c14e;
  font-family: Arial, Helvetica, sans-serif;
  font-size: calc(var(--face-size) * 0.36);
  font-weight: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(7, 18, 14, 0.7);
}

.token-face--photo {
  background-image: var(--player-portrait-image);
  background-size: cover;
  background-position: center top;
}

.token-rating {
  position: absolute;
  top: 0;
  left: 2px;
  min-width: 22px;
  padding: 1px 4px;
  border-radius: 999px;
  background: #f2c14e;
  color: #17201c;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.7rem;
  font-weight: 1000;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}

.token-pos {
  position: absolute;
  top: calc(var(--face-size) - 4px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0 5px;
  border-radius: 6px;
  background: var(--team-color);
  color: #0f1714;
  font-size: 0.54rem;
  line-height: 1.4;
  font-weight: 1000;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}

.token-name {
  max-width: 86px;
  margin-top: 9px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(7, 18, 14, 0.78);
  color: #f6fff7;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-card--token .run-handle {
  right: 2px;
  bottom: auto;
  top: 2px;
  width: 24px;
  height: 24px;
}

.pitch--tokens .slot.selected {
  box-shadow: none;
  border-color: transparent;
  background: transparent;
}

.pitch--tokens .slot.selected .token-face {
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.9), 0 6px 16px rgba(0, 0, 0, 0.5);
}

.pitch--tokens .slot.selected .player-card {
  filter: none;
}

.pitch--two-teams.pitch--tokens .player-card--token {
  --face-size: 46px;
  width: 72px;
}

.pitch--two-teams.pitch--tokens .token-name {
  max-width: 72px;
  margin-top: 7px;
  font-size: 0.6rem;
}

.pitch--two-teams.pitch--tokens .token-rating {
  font-size: 0.62rem;
  min-width: 20px;
}

.pitch--two-teams.pitch--tokens .slot {
  width: 76px;
  min-height: 84px;
}

.pitch--two-teams.pitch--tokens .slot.occupied {
  width: 74px;
  min-height: 82px;
}

/* --- taşma korumaları -------------------------------------------------------------------- */

html,
body {
  overflow-x: hidden;
}

/* "hidden" gövdeyi kaydırma kabı yapar ve position: sticky çalışmaz (canlı maç başlığı, Ayarlar menüsü);
   "clip" taşmayı aynı şekilde keser ama kaydırma kabı oluşturmaz. Desteklemeyen tarayıcı "hidden"da kalır. */
@supports (overflow-x: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

.page > *,
.grid-2 > *,
.settings-main > *,
.panel-block,
.view-head > * {
  min-width: 0;
}

.table-wrap {
  max-width: 100%;
}

.player-list > .selected-meta {
  grid-column: 1 / -1;
  margin: 0;
}

.stat-table--sortable .name-cell,
.stat-table--sortable th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: rgba(24, 35, 31, 0.98);
}

/* --- kadro giriş formu (tablo yerine esnek satırlar) -------------------------------------- */

.lineup-editor {
  display: grid;
  gap: 6px;
}

.lineup-head,
.lineup-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 64px 64px 64px 64px 80px 48px;
  gap: 6px;
  align-items: center;
}

.lineup-head {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lineup-head span:not(:first-child),
.lineup-row .lineup-field {
  text-align: center;
}

.lineup-row {
  padding: 6px 4px;
  border-radius: 8px;
  background: rgba(237, 246, 238, 0.04);
}

.lineup-row:nth-child(even) {
  background: rgba(237, 246, 238, 0.07);
}

.lineup-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.lineup-field {
  display: grid;
  gap: 3px;
}

.lineup-field > span {
  display: none;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lineup-field input[type="number"] {
  width: 100%;
  min-height: 36px;
  padding: 0 4px;
  text-align: center;
}

.lineup-field--empty {
  color: var(--muted);
}

.lineup-mvp {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.lineup-mvp input {
  width: 20px;
  height: 20px;
  min-height: 0;
  accent-color: var(--accent);
}

.lineup-mvp span {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 900;
}

@media (max-width: 640px) {
  .lineup-head {
    display: none;
  }

  .lineup-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 8px;
  }

  .lineup-name {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .lineup-field > span {
    display: block;
  }

  .lineup-mvp {
    grid-column: 3;
  }
}

/* --- okuma modu ------------------------------------------------------------------------ */

.pitch--readonly .slot {
  cursor: default;
}

.pitch--readonly .run-handle {
  display: none;
}

/* --- mobil ------------------------------------------------------------------------------ */

@media (max-width: 900px) {
  .grid-2,
  .live-columns,
  .match-layout {
    grid-template-columns: 1fr;
  }

  .match-form__head {
    grid-template-columns: 1fr;
  }

  .player-page {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .player-page__stats {
    justify-self: stretch;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px 10px calc(var(--tabbar-height) + 14px + env(safe-area-inset-bottom, 0px));
  }

  .topbar {
    grid-template-columns: auto 1fr;
    gap: 10px;
    margin-bottom: 12px;
  }

  .main-nav {
    display: none;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .topbar-actions .ghost-button,
  .topbar-actions .primary-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .mode-badge {
    display: none;
  }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid rgba(237, 246, 238, 0.14);
    background: rgba(13, 20, 18, 0.96);
    backdrop-filter: blur(10px);
  }

  .tabbar a {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    text-decoration: none;
  }

  .tabbar a.active {
    color: var(--accent-2);
  }

  .tab-icon {
    font-size: 1.2rem;
    line-height: 1;
  }

  .workspace {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace .pitch-area { order: 1; }
  .workspace .tactics-panel { order: 2; }
  .workspace .roster-panel { order: 3; }

  .pitch-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .pitch-toolbar-buttons {
    grid-column: 1 / -1;
  }

  .pitch {
    aspect-ratio: 0.6;
  }

  .pitch.pitch--two-teams {
    aspect-ratio: 0.5;
  }

  .pitch-card {
    padding: 6px;
  }

  .stat-table th,
  .stat-table td {
    padding: 7px 4px;
    font-size: 0.8rem;
  }

  .stat-table--sortable .name-cell,
  .stat-table--sortable th:first-child {
    position: static;
    background: transparent;
  }

  .stat-table--sortable {
    table-layout: fixed;
    width: 100%;
  }

  .stat-table--sortable th:first-child {
    width: 34%;
  }

  .stat-table--sortable th {
    padding: 8px 2px;
    font-size: 0.66rem;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: visible;
  }

  .stat-table--sortable th.num {
    text-align: center;
  }

  .stat-table--sortable td.num {
    text-align: center;
    padding-left: 2px;
    padding-right: 2px;
  }

  .th-full {
    display: none;
  }

  .th-short {
    display: inline;
  }

  .sort-button.sort-desc::after,
  .sort-button.sort-asc::after {
    font-size: 0.6rem;
  }

  .sort-button.sort-desc::after {
    content: "↓";
  }

  .sort-button.sort-asc::after {
    content: "↑";
  }

  .table-legend {
    display: block;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
  }

  .stat-table--sortable th,
  .stat-table--sortable td {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stat-table--sortable .name-cell {
    gap: 6px;
  }

  .stat-table--sortable .name-cell a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stat-table--sortable .name-cell small {
    display: none;
  }

  .stat-table--sortable .name-cell .avatar {
    --avatar-size: 24px;
  }

  .col-mobile-hide {
    display: none;
  }

  .toolbar-button {
    flex: 1 1 auto;
    min-width: 0;
  }

  .player-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .view-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .scoreboard__score,
  .live-score {
    font-size: 1.8rem;
  }

  .scoreboard--detail {
    gap: 8px;
    padding: 12px;
  }

  .scoreboard--detail .scoreboard__team strong {
    font-size: 0.95rem;
  }

  .scorers {
    font-size: 0.76rem;
  }

  .match-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .match-row__meta {
    justify-items: start;
  }

  .score-entry {
    grid-template-columns: 1fr;
  }

  .form-actions--row {
    grid-template-columns: 1fr;
  }

  .form-actions--row .primary-button {
    justify-self: stretch;
  }

  .action-sheet {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-backdrop--sheet {
    align-items: end;
    padding: 0;
  }

  .modal--sheet {
    width: 100%;
    max-height: 82vh;
    border-radius: 14px 14px 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .live-header {
    top: 4px;
  }
}

@media (pointer: coarse) {
  .run-handle {
    width: 30px;
    height: 30px;
    bottom: -16px;
  }

  .slot.selected .run-handle {
    opacity: 1;
    pointer-events: auto;
  }
}

/* --- 2.1: havuz araçları, boş slotlar, ölçeklenen jetonlar -------------------------------- */

.pool-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.pool-search,
.pool-sort {
  min-height: 38px;
}

.pool-sort {
  width: auto;
  padding: 0 8px;
}

.fit-badge {
  justify-self: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(61, 220, 151, 0.16);
  color: var(--accent-2);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

/* Boş slot kutuları karttan küçük; komşu slotlarla üst üste binmez. */
.pitch:not(.pitch--tokens) .slot:not(.occupied) {
  width: calc(var(--card-width, 130px) * 0.8);
  min-height: calc(var(--card-height, 195px) * 0.56);
}

/* İki takımın aynı sahada olduğu görünümlerde jeton boyutu saha genişliğinden gelir (--token-size). */
.pitch--two-teams.pitch--tokens .player-card--token {
  --face-size: var(--token-size, 46px);
  width: calc(var(--token-size, 46px) + 26px);
}

.pitch--two-teams.pitch--tokens .token-name {
  max-width: calc(var(--token-size, 46px) + 26px);
  font-size: calc(var(--token-size, 46px) * 0.19);
}

.pitch--two-teams.pitch--tokens .token-rating {
  font-size: calc(var(--token-size, 46px) * 0.21);
}

.pitch--two-teams.pitch--tokens .slot {
  width: calc(var(--token-size, 46px) + 30px);
  min-height: calc(var(--token-size, 46px) + 38px);
}

.pitch--two-teams.pitch--tokens .slot.occupied {
  width: calc(var(--token-size, 46px) + 28px);
  min-height: calc(var(--token-size, 46px) + 36px);
}

.mini-pitch {
  --token-size: 52px;
}

@media (max-width: 760px) {
  .mini-pitch {
    --token-size: 44px;
  }
}

/* Karşılaşma görünümünde jetonlar küçük; oklar da ince çizilir. */
.pitch--two-teams .run-arrow,
.pitch--two-teams .draft-arrow {
  stroke-width: 5;
}

.pitch--two-teams .run-arrow.selected {
  stroke-width: 6.5;
}

@media (max-width: 760px) {
  /* Maç detayındaki oyuncu tabloları telefona sığsın: kısa başlıklar, sabit sütunlar. */
  .stat-table--match {
    table-layout: fixed;
  }

  .stat-table--match th:first-child {
    width: 46%;
  }

  .stat-table--match th,
  .stat-table--match td {
    padding-left: 3px;
    padding-right: 3px;
    letter-spacing: 0;
  }

  .stat-table--match .name-cell {
    gap: 6px;
    overflow: hidden;
  }

  .stat-table--match .name-cell a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stat-table--match .name-cell .avatar {
    --avatar-size: 24px;
    flex: none;
  }
}

/* --- 2.1: taktikler penceresi, geri alma, metin düğmeleri --------------------------------- */

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast--visible.toast--has-action {
  pointer-events: auto;
}

.toast-action {
  flex: none;
  min-height: 30px;
  padding: 0 12px;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-weight: 900;
  cursor: pointer;
}

.toast-action:hover {
  background: rgba(15, 23, 20, 0.12);
}

.text-button {
  min-height: 30px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.text-button:hover,
.text-button:focus-visible {
  background: rgba(237, 246, 238, 0.08);
  color: var(--text);
}

.text-button--danger:hover,
.text-button--danger:focus-visible {
  color: var(--danger);
}

.toolbar-button--icon {
  flex: 0 0 auto;
  min-width: 44px;
  font-size: 1.1rem;
}

.toolbar-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.dialog-field {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.dialog-field .dialog-message {
  margin: 0;
}

.tactic-save {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 14px 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 20, 0.6);
}

.tactic-save label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.tactic-lineup-toggle {
  margin: 4px 0 12px;
}

.tactic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
}

.tactic-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

.tactic-body {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.tactic-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tactic-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
}

.tactic-info span {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.tactic-info small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.tactic-apply {
  display: grid;
  grid-template-columns: auto repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
}

.tactic-apply-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tactic-apply-button {
  min-height: 34px;
  padding: 0 8px;
  border-left: 3px solid var(--team-color, var(--accent-2));
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tactic-tools {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 4px;
  margin: -2px -6px -6px;
  padding-top: 6px;
  border-top: 1px solid rgba(237, 246, 238, 0.08);
}

.tactic-preview {
  width: 84px;
  height: auto;
  aspect-ratio: 60 / 90;
}

.tactic-preview .tp-field {
  fill: #1c5a36;
  stroke: rgba(237, 246, 238, 0.55);
  stroke-width: 1;
}

.tactic-preview .tp-line {
  fill: none;
  stroke: rgba(237, 246, 238, 0.35);
  stroke-width: 0.8;
}

.tactic-preview .tp-run {
  stroke: #f2c14e;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.tactic-preview .tp-head {
  fill: #f2c14e;
}

.tactic-preview .tp-dot {
  fill: var(--tp-color, var(--accent-2));
  stroke: #0b1511;
  stroke-width: 1;
}

.empty-state--compact {
  padding: 22px 12px;
}

@media (max-width: 760px) {
  .tactic-save {
    grid-template-columns: 1fr;
  }

  .tactic-grid {
    grid-template-columns: 1fr;
  }

  .tactic-card {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .tactic-preview {
    width: 70px;
  }
}

/* --- 2.1: dönem filtresi, aylık maç grupları, reyting grafiği ------------------------------ */

.view-actions--filters {
  justify-content: flex-end;
}

.period-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.period-select select {
  width: auto;
  min-height: 38px;
  padding: 0 10px;
}

.match-group {
  display: grid;
  gap: 8px;
}

.match-group + .match-group {
  margin-top: 18px;
}

.match-group__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 900;
}

.match-group__title span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.rating-trend {
  --series-1: #1baf7a; /* doğrulandı: koyu zeminde (#18231f) açıklık bandında ve 3:1 üstü kontrast */
  --chart-surface: #18231f;
  margin-top: 16px;
}

.rating-trend__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 8px;
}

.rating-trend__head h2 {
  margin: 0;
}

.rating-trend__head .selected-meta {
  margin: 0;
}

.rating-chart {
  position: relative;
  width: 100%;
  border-radius: 6px;
  outline: none;
  touch-action: pan-y;
}

.rating-chart:focus-visible {
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.35);
}

.rating-chart__svg {
  display: block;
  max-width: 100%;
  overflow: visible;
}

.rc-grid {
  stroke: rgba(237, 246, 238, 0.09);
  stroke-width: 1;
}

.rc-axis {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rc-avg {
  stroke: rgba(237, 246, 238, 0.32);
  stroke-width: 1;
}

.rc-avg-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.rc-area {
  fill: var(--series-1);
  fill-opacity: 0.1;
  stroke: none;
}

.rc-line {
  fill: none;
  stroke: var(--series-1);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rc-crosshair {
  stroke: rgba(237, 246, 238, 0.45);
  stroke-width: 1;
}

.rc-dot {
  fill: var(--series-1);
  stroke: var(--chart-surface);
  stroke-width: 2;
}

.rc-dot--active {
  stroke: var(--text);
}

.rc-end-label {
  fill: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 2px;
  min-width: 150px;
  max-width: 240px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1714;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.chart-tooltip strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.chart-tooltip span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 760px) {
  .view-actions--filters {
    justify-content: flex-start;
    width: 100%;
  }

  .stat-table--history th,
  .stat-table--history td {
    padding-left: 4px;
    padding-right: 4px;
  }
}

@media (max-width: 760px) {
  /* Dar ekranda istatistik kutucuklarının etiketleri kesilmesin, iki satıra insin. */
  .profile-stat span {
    white-space: normal;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .stat-table--history .pill {
    padding: 0 4px;
  }
}

@media (max-width: 760px) {
  .view-actions--filters .period-select {
    flex: 1 1 100%;
  }

  .view-actions--filters .period-select select {
    flex: 1;
  }
}

/* --- 2.1: görsel cilalama ---------------------------------------------------------------- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Oyuncu formu: yerel dilde fotoğraf düğmesi (tarayıcının "Choose File" düğmesi yerine) */
.photo-field {
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
}

.photo-field__label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.photo-field__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.file-button:focus-within {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.stat-form-grid label span small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

/* Havuz kartı: genel puan ve mevkiler iki satır, ikisi de kesilmeden */
.player-chip .player-meta {
  display: grid;
  gap: 1px;
  white-space: normal;
  line-height: 1.2;
}

.player-chip .player-meta b {
  color: var(--text);
  font-weight: 900;
}

.player-chip .player-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-search {
  flex: 1 1 140px;
  max-width: 260px;
  min-height: 36px;
}

/* Maç formu: kaleci rozeti adın altına insin, ad kesilmesin */
.lineup-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  white-space: normal;
}

/* Maç detayındaki mini saha tek sütunlu düzende (tablet) gereğinden fazla uzamasın */
.mini-pitch--tokens {
  width: min(100%, 480px);
  margin: 0 auto;
}

/* Tablette üst çubuk: marka ve düğmeler üstte, menü altta */
@media (max-width: 1120px) and (min-width: 761px) {
  .topbar {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "brand actions"
      "nav nav";
    row-gap: 10px;
  }

  .brand {
    grid-area: brand;
  }

  .topbar-actions {
    grid-area: actions;
    flex-wrap: nowrap;
  }

  .main-nav {
    grid-area: nav;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .pitch-footer {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .pitch-footer .ghost-button {
    flex: 1 1 auto;
    white-space: nowrap;
  }
}

/* --- 2.2: takım logosu (arma) ------------------------------------------------------------- */

.team-logo {
  display: inline-block;
  flex: none;
  vertical-align: middle;
}

.team-logo--inline {
  margin-right: 6px;
}

/* Takım ayarları: ad, renk ve logo yan yana */
.team-settings {
  grid-template-columns: minmax(0, 1fr) 58px 58px;
}

.team-logo-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.team-logo-button {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(237, 246, 238, 0.16);
  border-radius: 6px;
  background: #0f1714;
  color: var(--muted);
  cursor: pointer;
}

.team-logo-button:hover,
.team-logo-button:focus-visible {
  border-color: var(--accent-2);
}

.team-logo-button--empty {
  border-style: dashed;
  font-size: 1.3rem;
  font-weight: 900;
}

/* Saha görünümü düğmeleri: logo + ad; uzun ad üç noktayla kısalır (havuzdaki dar takım sekmeleri logosuz kalır) */
.pitch-view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.team-label-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-team {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.balance-team .team-logo {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

/* Logo oluşturucu penceresi */
.modal--logo {
  width: min(920px, 100%);
}

.logo-editor {
  display: grid;
  grid-template-columns: minmax(210px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.logo-stage {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 16px 12px;
  border: 1px solid rgba(237, 246, 238, 0.13);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 32%, rgba(61, 220, 151, 0.14), transparent 68%),
    #0f1714;
}

.logo-stage__main {
  display: grid;
  place-items: center;
  width: 168px;
  height: 168px;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
}

.logo-stage__main .team-logo {
  width: 100%;
  height: 100%;
}

.logo-stage__sizes {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.logo-stage__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: rgba(237, 246, 238, 0.07);
  font-size: 0.85rem;
  font-weight: 900;
}

.logo-stage__chip b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-stage__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.logo-controls {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.logo-group h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.logo-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 6px;
}

.logo-option {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  padding: 7px 4px 6px;
  border: 1px solid rgba(237, 246, 238, 0.12);
  border-radius: 8px;
  background: rgba(237, 246, 238, 0.04);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}

.logo-option:hover,
.logo-option:focus-visible {
  border-color: rgba(61, 220, 151, 0.6);
}

.logo-option[aria-pressed="true"] {
  border-color: var(--accent-2);
  background: rgba(61, 220, 151, 0.12);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--accent-2);
}

.logo-option__art {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
}

.logo-option__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-palettes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.logo-palette {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid rgba(237, 246, 238, 0.2);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--p1) 0 50%, var(--p2) 50% 100%);
  cursor: pointer;
}

.logo-palette[aria-pressed="true"] {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--accent-2);
}

.logo-palette--team {
  border-style: dashed;
  border-color: rgba(237, 246, 238, 0.7);
}

.logo-colors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.logo-colors label,
.logo-text-field,
.logo-stars {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.logo-colors input[type="color"] {
  padding: 4px;
  cursor: pointer;
}

.logo-text-field small {
  font-weight: 700;
}

.logo-group--inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.logo-text-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-text-row input {
  max-width: 130px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo-stars__buttons {
  display: flex;
  gap: 4px;
}

.logo-star-button {
  width: 34px;
  min-height: 38px;
  border: 1px solid rgba(237, 246, 238, 0.14);
  border-radius: 6px;
  background: rgba(237, 246, 238, 0.05);
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.logo-star-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #17201c;
}

/* Kaydet/Vazgeç her zaman görünür: pencerenin altına yapışık */
.logo-editor__footer {
  position: sticky;
  bottom: -16px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px -16px -16px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.logo-editor__buttons {
  display: flex;
  gap: 8px;
}

@media (max-width: 760px) {
  .logo-editor {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Telefonda önizleme üstte yapışık kalır; seçenekler kaydırılırken logo görünür */
  .logo-stage {
    top: -16px;
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    gap: 8px 12px;
    padding: 10px;
  }

  .logo-stage__main {
    grid-row: span 2;
    width: 92px;
    height: 92px;
  }

  .logo-stage__sizes {
    display: none;
  }

  .logo-stage__actions {
    justify-content: flex-start;
  }

  .logo-stage__actions .ghost-button {
    min-height: 36px;
    padding: 0 10px;
  }

  .logo-options {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  }

  .logo-group--inline {
    grid-template-columns: 1fr;
  }

  .logo-star-button {
    flex: 1 1 0;
  }

  .logo-editor__footer {
    flex-wrap: wrap;
  }

  .logo-editor__buttons {
    flex: 1 1 auto;
    justify-content: flex-end;
  }
}

/* Maç ekranlarında logo: liste satırı, skor tablosu, canlı maç başlığı, mini saha etiketi, takım başlıkları */
.team-chip {
  display: flex;
  align-items: center;
  gap: 7px;
}

.team-chip--right {
  justify-content: flex-end;
}

.team-chip__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scoreboard__title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.scoreboard__title strong {
  min-width: 0;
  overflow-wrap: break-word;
}

.scoreboard__team--right .scoreboard__title {
  flex-direction: row-reverse;
}

.scoreboard__title .team-logo {
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

.live-header__team {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-header__team--right {
  justify-content: flex-end;
}

.mini-pitch__label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.team-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 760px) {
  .scoreboard__title .team-logo {
    width: 32px;
    height: 32px;
  }

  /* Telefonda logo adın üstünde: ad sütunun tamamını kullanır, kelime ortasından bölünmez */
  .scoreboard__title {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .scoreboard__team--right .scoreboard__title {
    flex-direction: column;
    align-items: flex-end;
  }

  /* Canlı maç başlığı telefonda: logo üstte, ad altta; ad tüm sütun genişliğini kullanır */
  .live-header__team {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .live-header__team--right {
    flex-direction: column-reverse;
    align-items: flex-end;
  }

  .live-header__team .team-label-text {
    max-width: 100%;
  }
}

/* --- 2.2: oyuncu oylaması (akran puanlama) ---------------------------------------------------- */

.status-chip--vote {
  background: rgba(61, 220, 151, 0.18);
  color: #b9f5dc;
}

.pill--warn {
  border-color: rgba(242, 193, 78, 0.7);
  background: rgba(242, 193, 78, 0.18);
  color: #ffe7a5;
}

.notice-line {
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid rgba(242, 193, 78, 0.4);
  border-radius: 8px;
  background: rgba(242, 193, 78, 0.08);
  color: #ffe7a5;
  font-size: 0.86rem;
  font-weight: 700;
}

.notice-line--error {
  border-color: rgba(255, 107, 107, 0.5);
  background: rgba(255, 107, 107, 0.1);
  color: #ffd4d4;
}

.voting-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.voting-panel p {
  margin: 0;
}

.voting-panel--open {
  border-color: rgba(61, 220, 151, 0.45);
  background:
    linear-gradient(135deg, rgba(61, 220, 151, 0.1), transparent 60%),
    rgba(24, 35, 31, 0.92);
}

.voting-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.voting-head h2 {
  margin: 0;
}

.voting-deadline {
  font-size: 0.95rem;
}

.voting-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(237, 246, 238, 0.1);
}

.voting-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-2);
  transition: width 240ms ease;
}

.voter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.voter-chip {
  padding: 3px 9px;
  border: 1px solid rgba(237, 246, 238, 0.14);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.voter-chip--done {
  border-color: rgba(61, 220, 151, 0.5);
  background: rgba(61, 220, 151, 0.12);
  color: #b9f5dc;
}

.voting-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.voting-mvp {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.voting-mvp small {
  color: var(--muted);
}

.voting-moderation summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.voting-moderation[open] summary {
  margin-bottom: 8px;
}

.moderation-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.moderation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px 12px;
  padding: 8px 10px;
  border: 1px solid rgba(237, 246, 238, 0.1);
  border-radius: 8px;
  background: rgba(237, 246, 238, 0.03);
  font-size: 0.85rem;
}

.moderation-row--outlier {
  border-color: rgba(242, 193, 78, 0.5);
}

.moderation-name {
  display: grid;
  min-width: 0;
  font-weight: 800;
}

.moderation-name small,
.moderation-meta {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

/* Maç tablosundaki oy sütunu ve oylarla harmanlanmış reyting işareti */
.peer-cell small {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.peer-cell--weak {
  color: var(--muted);
}

.peer-mark {
  margin-left: 2px;
  color: var(--accent-2);
  font-size: 0.7em;
  vertical-align: super;
}

/* Oy pusulası (kişisel link sayfası ve elden oylama) */
.ballot-form {
  display: grid;
  gap: 14px;
}

.ballot-team {
  display: grid;
  gap: 8px;
}

.ballot-team__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding-left: 10px;
  border-left: 4px solid var(--team-color);
  font-size: 0.95rem;
}

.ballot-team__title small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.ballot-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(237, 246, 238, 0.1);
  border-radius: 10px;
  background: rgba(237, 246, 238, 0.03);
}

.ballot-row--rated {
  border-color: rgba(61, 220, 151, 0.35);
}

.ballot-player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.ballot-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2b3d34 0%, #16211c 100%);
  background-size: cover;
  background-position: center top;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.ballot-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.ballot-player small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.ballot-value {
  min-width: 34px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(237, 246, 238, 0.08);
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 1000;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ballot-row--rated .ballot-value {
  background: var(--accent-2);
  color: #0f1714;
}

.ballot-row--mid .ballot-value {
  background: #f2c14e;
}

.ballot-row--low .ballot-value {
  background: #ff8a80;
}

.ballot-scale {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}

.ballot-score {
  min-width: 0;
  min-height: 38px;
  padding: 0;
  border: 1px solid rgba(237, 246, 238, 0.14);
  border-radius: 6px;
  background: rgba(237, 246, 238, 0.05);
  color: var(--text);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  touch-action: manipulation;
}

/* Düşükten yükseğe renk ipucu: 1-4 kırmızımsı, 5-6 sarımsı, 7-10 yeşilimsi (seçilince dolu) */
.ballot-score--1, .ballot-score--2, .ballot-score--3, .ballot-score--4 { --score-color: #ff8a80; }
.ballot-score--5, .ballot-score--6 { --score-color: #f2c14e; }
.ballot-score--7, .ballot-score--8, .ballot-score--9, .ballot-score--10 { --score-color: #3ddc97; }

.ballot-score {
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--score-color) 55%, transparent);
}

.ballot-score:hover,
.ballot-score:focus-visible {
  border-color: var(--score-color);
}

.ballot-score[aria-checked="true"] {
  border-color: var(--score-color);
  background: var(--score-color);
  color: #0f1714;
  box-shadow: none;
}

.ballot-mvp {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.ballot-mvp small {
  font-weight: 700;
}

.ballot-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.ballot-hint--warn {
  color: #ffe7a5;
}

/* Elden oylama penceresi */
.modal--ballot {
  width: min(720px, 100%);
}

.device-voters {
  margin-bottom: 14px;
}

.device-voters h3 {
  margin: 0 0 8px;
  padding-left: 10px;
  border-left: 4px solid var(--team-color);
  font-size: 0.92rem;
}

.device-voter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.device-voter {
  display: grid;
  gap: 2px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid rgba(237, 246, 238, 0.14);
  border-radius: 8px;
  background: rgba(237, 246, 238, 0.05);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.device-voter span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.device-voter small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.device-voter--done {
  border-color: rgba(61, 220, 151, 0.5);
  background: rgba(61, 220, 151, 0.1);
}

.device-voter--done small {
  color: #b9f5dc;
}

.device-ballot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.device-ballot-head p {
  margin: 0;
}

/* Kişisel oy linkleri penceresi */
.link-list {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 8px 10px;
  border: 1px solid rgba(237, 246, 238, 0.1);
  border-radius: 8px;
  background: rgba(237, 246, 238, 0.03);
}

.link-name {
  display: grid;
  min-width: 0;
  font-weight: 900;
}

.link-name small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.link-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.link-actions .ghost-button {
  min-height: 34px;
  padding: 0 10px;
}

/* Kişisel oy linki sayfası (uygulama kabuğu olmadan) */
#view-standalone[hidden] {
  display: none;
}

.vote-page {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 18px 16px 40px;
  display: grid;
  gap: 14px;
}

.vote-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vote-brand img {
  border-radius: 9px;
}

.vote-brand span {
  display: grid;
  line-height: 1.1;
}

.vote-brand small {
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vote-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(24, 35, 31, 0.94);
  box-shadow: var(--shadow);
}

.vote-card h1 {
  margin: 0;
  font-size: 1.35rem;
}

.vote-card p {
  margin: 0;
}

.vote-card--hello p,
.vote-card--message p {
  color: var(--muted);
  line-height: 1.45;
}

.vote-card--message {
  justify-items: start;
}

.vote-date {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.vote-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.vote-score strong {
  font-size: 1.6rem;
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
}

.vote-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.vote-team b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vote-team--b {
  flex-direction: row-reverse;
  text-align: right;
}

.vote-deadline {
  color: var(--muted);
  font-size: 0.85rem;
}

.vote-status {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.vote-status:empty {
  display: none;
}

.vote-status--ok {
  color: #b9f5dc;
}

@media (max-width: 760px) {
  .moderation-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .moderation-meta {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .ballot-score {
    min-height: 40px;
    font-size: 0.9rem;
  }

  .ballot-scale {
    gap: 3px;
  }

  .vote-page {
    padding: 14px 12px 32px;
  }
}

/* --- 2.2: bildirim kutusu --------------------------------------------------------------------
   left: 50% ile ortalanan kutu ekranın ancak yarısı kadar genişleyebiliyordu; telefonda eylem düğmesi
   ("Oylamayı başlat") kutudan taşıyordu. Kutu artık iki kenara sabitlenip ortalanır; telefonda alt menünün üstünde durur. */
.toast {
  left: 0;
  right: 0;
  width: max-content;
  max-width: min(92vw, 480px);
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: space-between;
  transform: translateY(20px);
}

.toast > span {
  flex: 1 1 auto;
  min-width: 0;
}

.toast--visible {
  transform: translateY(0);
}

@media (max-width: 760px) {
  .toast {
    bottom: calc(var(--tabbar-height) + 12px + env(safe-area-inset-bottom, 0px));
  }
}

/* --- 2.3: Telegram botu, sıradaki maç, katılım --------------------------------------------- */

.telegram-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}

.telegram-panel p {
  margin: 0;
}

.telegram-panel h2 {
  margin-bottom: 0;
}

.telegram-panel [data-telegram-body] {
  display: grid;
  gap: 12px;
}

.telegram-panel .settings-actions {
  margin-bottom: 0;
}

.telegram-steps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.telegram-setup {
  display: grid;
  gap: 10px;
}

.telegram-setup label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.telegram-setup .primary-button {
  justify-self: start;
}

.telegram-ok {
  color: var(--success);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.telegram-ok b {
  color: var(--text);
}

.telegram-connect {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px dashed rgba(61, 220, 151, 0.45);
  border-radius: 8px;
}

.telegram-connect .primary-button {
  justify-self: start;
}

.telegram-wait::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--warn);
  animation: telegram-pulse 1.2s ease-in-out infinite;
}

@keyframes telegram-pulse {
  50% {
    opacity: 0.25;
  }
}

.telegram-members {
  display: grid;
  gap: 8px;
}

.telegram-member-list summary,
.telegram-errors summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.telegram-member-list ul,
.telegram-errors ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.telegram-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(237, 246, 238, 0.05);
}

.telegram-member span {
  display: grid;
  min-width: 0;
}

.telegram-member small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-member--blocked strong {
  color: #ffd4d4;
}

.telegram-errors li {
  color: #ffe7a5;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.telegram-errors small {
  color: var(--muted);
}

.telegram-prefs {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.telegram-prefs legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* .editor-form label (dikey ızgara) kuralını ezmek için iki sınıflı seçici */
.telegram-prefs .telegram-pref,
.telegram-pref {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

.telegram-pref input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-2);
}

.telegram-pref span {
  flex: 1 1 180px;
}

.telegram-pref select {
  flex: 0 0 auto;
  width: auto;
  min-height: 34px;
  font-size: 0.82rem;
}

.telegram-pref.is-disabled {
  opacity: 0.45;
}

/* Sıradaki maç şeridi (Saha) */
.next-match-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(242, 193, 78, 0.35);
  border-radius: 8px;
  background: rgba(242, 193, 78, 0.07);
}

.next-match-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
}

.next-match-label {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.next-match-venue,
.next-match-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.next-match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.next-match-weekly {
  padding: 1px 8px;
  border: 1px solid rgba(242, 193, 78, 0.45);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

/* Sıradaki maç penceresi: haftalık tekrar */
.next-match-repeat__extra {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 4px;
}

.next-match-repeat__extra[hidden] {
  display: none;
}

.next-match-open {
  display: grid;
  gap: 5px;
  width: 100%;
  max-width: 360px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.next-match-repeat__extra .selected-meta {
  margin: 0;
}

/* Şeritte Telegram katılımı: tam satır, isimler açılır bölümde */
.next-match-attendance {
  flex: 1 1 100%;
  min-width: 0;
  padding-top: 6px;
  border-top: 1px solid rgba(242, 193, 78, 0.2);
  font-size: 0.86rem;
}

.next-match-attendance summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.next-match-attendance summary::-webkit-details-marker {
  display: none;
}

.next-match-attendance summary::after {
  content: "isimler ▾";
  color: var(--muted);
  font-size: 0.78rem;
}

.next-match-attendance[open] summary::after {
  content: "▴";
}

.next-match-attendance ul {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.next-match-attendance li strong {
  color: var(--text);
}

.next-match-attendance p {
  margin: 6px 0 0;
  color: var(--muted);
}

.next-match-bar:has(.next-match-add) {
  padding: 4px;
  border-style: dashed;
  background: transparent;
}

.next-match-add {
  width: 100%;
}

.next-match-form {
  display: grid;
  gap: 12px;
}

.form-grid__wide {
  grid-column: 1 / -1;
}

.form-error {
  margin: 0;
  color: #ffd4d4;
  font-size: 0.86rem;
  font-weight: 700;
}

.form-actions__end {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

/* Otomatik kadro: Telegram katılımı */
.attendance-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(61, 220, 151, 0.4);
  border-radius: 8px;
  background: rgba(61, 220, 151, 0.07);
  font-size: 0.86rem;
}

.attendance-hint small {
  color: var(--muted);
}

/* Oy sayfası: Telegram'ı bağla */
.vote-card--telegram {
  justify-items: start;
  border-color: rgba(42, 171, 238, 0.45);
}

.vote-card--telegram p {
  color: var(--muted);
  line-height: 1.45;
}

.vote-card--telegram strong {
  color: var(--text);
}

.vote-card--linked {
  border-color: rgba(61, 220, 151, 0.45);
}

@media (max-width: 760px) {
  .next-match-bar {
    padding: 8px 10px;
  }

  .next-match-actions {
    width: 100%;
  }

  .next-match-actions .toolbar-button {
    flex: 1 1 auto;
    white-space: nowrap;
  }

  .form-actions__end {
    width: 100%;
  }

  .form-actions__end button {
    flex: 1 1 0;
  }

  .telegram-member {
    align-items: flex-start;
  }
}

/* --- Maç ücreti (maç sayfası ve Ayarlar, yönetici) ------------------------------------------ */
.fee-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  border-color: rgba(242, 193, 78, 0.35);
}

.fee-panel p {
  margin: 0;
}

.fee-total {
  font-size: 0.95rem;
}

.fee-chip {
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.fee-chip:hover,
.fee-chip:focus-visible {
  border-color: rgba(237, 246, 238, 0.4);
}

.fee-chip small {
  color: var(--accent-2);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
}

.fee-form {
  display: grid;
  gap: 12px;
}

.fee-items {
  display: grid;
  gap: 8px;
  max-width: 620px;
}

.fee-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(84px, 140px) auto auto;
  align-items: center;
  gap: 8px;
}

.fee-item__unit {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.fee-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fee-presets .ghost-button {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.82rem;
}

.fee-payers {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fee-payers legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fee-payer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px 12px;
}

.fee-payer {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.fee-payer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fee-payer input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  accent-color: var(--accent-2);
}

.fee-round {
  display: grid;
  gap: 5px;
  max-width: 280px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.fee-preview {
  font-size: 0.95rem;
}

.fee-preview small {
  color: var(--muted);
}

.fee-iban {
  display: grid;
  gap: 8px;
}

@media (max-width: 520px) {
  .fee-item {
    grid-template-columns: minmax(0, 1fr) 96px auto;
  }

  .fee-item__unit {
    display: none;
  }
}

/* --- 2.7: Ayarlar sayfası (bölüm menüsü, hesap şeridi, ayar satırları) ------------------------ */
.settings-page {
  display: grid;
  grid-template-columns: 180px minmax(0, 780px);
  justify-content: start;
  align-items: start;
  gap: 28px;
}

.settings-page--plain {
  grid-template-columns: minmax(0, 780px);
}

.settings-nav {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 2px;
}

.settings-nav__item {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: left;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.settings-nav__item:hover,
.settings-nav__item:focus-visible {
  background: rgba(237, 246, 238, 0.05);
  color: var(--text);
}

.settings-nav__item.is-active {
  border-left-color: var(--accent-2);
  background: rgba(61, 220, 151, 0.08);
  color: var(--text);
}

.settings-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.settings-section {
  scroll-margin-top: 16px;
}

.settings-section__head {
  margin-bottom: 4px;
}

.settings-section__head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.settings-section__head p {
  max-width: 62ch;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
}

.settings-subhead {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.setting-list {
  display: grid;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 250px);
  align-items: center;
  gap: 8px 24px;
  padding: 14px 0;
  border-top: 1px solid rgba(237, 246, 238, 0.08);
}

.setting-list > .setting-row:first-child {
  border-top: 0;
}

.setting-row--wide {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
}

.setting-row__text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.setting-row__label {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.setting-row__hint {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.45;
}

.setting-row__control {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}

.setting-row__control > select,
.setting-row__control > input,
.setting-row__control > .input-unit {
  width: 100%;
}

.setting-value {
  color: var(--text);
  font-weight: 800;
}

/* Aç/kapa satırı: ad | (süre) | anahtar */
.setting-row--switch {
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "text extra switch";
}

.setting-row--switch .setting-row__text {
  grid-area: text;
  cursor: pointer;
}

.setting-row__extra {
  grid-area: extra;
}

.setting-row__extra select {
  width: auto;
  min-height: 36px;
  font-size: 0.85rem;
}

.setting-row__switch {
  grid-area: switch;
  display: flex;
}

input.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 46px;
  height: 28px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(237, 246, 238, 0.24);
  border-radius: 999px;
  background: radial-gradient(circle at 13px 50%, #cfdcd4 0 9px, transparent 9.5px) no-repeat, rgba(237, 246, 238, 0.1);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

input.switch:checked {
  border-color: var(--accent-2);
  background: radial-gradient(circle at calc(100% - 13px) 50%, #0f1714 0 9px, transparent 9.5px) no-repeat, var(--accent-2);
}

input.switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: none;
}

input.switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.5;
}

.settings-actions--end {
  justify-content: flex-end;
  margin: 8px 0 0;
}

.input-unit {
  position: relative;
  display: block;
}

.input-unit input {
  padding-right: 42px;
}

.input-unit > span {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  pointer-events: none;
}

/* Hesap şeridi */
.settings-account {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-account__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(61, 220, 151, 0.14);
  color: var(--accent-2);
  font-weight: 800;
}

.settings-account__text {
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
}

.settings-account__text span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.settings-account > .ghost-button,
.settings-account > .primary-button {
  flex: 0 0 auto;
}

/* Geri alınamaz işlemler */
.settings-danger {
  margin-top: 18px;
  padding: 2px 16px;
  border: 1px solid rgba(255, 107, 107, 0.32);
  border-radius: 8px;
  background: rgba(255, 107, 107, 0.04);
}

.settings-danger h3 {
  margin: 14px 0 0;
  color: #ffb4b4;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Telegram bölümü: durum, oyuncular, bildirimler, bağlantı */
.telegram-panel .telegram-ok {
  padding: 10px 12px;
  border: 1px solid rgba(61, 220, 151, 0.28);
  border-radius: 8px;
  background: rgba(61, 220, 151, 0.07);
}

.telegram-members .setting-row {
  border-top: 0;
  padding-bottom: 6px;
}

.telegram-member-list {
  margin-top: 2px;
}

.telegram-manage {
  margin-top: 10px;
  border-top: 1px solid rgba(237, 246, 238, 0.08);
}

.telegram-setup {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.telegram-setup > .settings-note {
  grid-column: 1 / -1;
}

.fee-payment {
  margin-top: 4px;
}

@media (max-width: 900px) {
  .settings-page {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  /* Dar ekranda bölüm menüsü üstte, kaydırınca yapışık kalan yatay şerit */
  .settings-nav {
    top: 0;
    z-index: 6;
    display: flex;
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(16, 24, 21, 0.94);
    backdrop-filter: blur(8px);
    scrollbar-width: none;
  }

  .settings-nav::-webkit-scrollbar {
    display: none;
  }

  .settings-nav__item {
    flex: 0 0 auto;
    width: auto;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .settings-nav__item.is-active {
    border-color: var(--accent-2);
    background: rgba(61, 220, 151, 0.14);
  }

  .settings-section {
    scroll-margin-top: 64px;
  }
}

@media (max-width: 760px) {
  /* telefonda şerit ekranın iki kenarına kadar uzanır (sayfa kenar boşluğu 10 px) */
  .settings-nav {
    margin: 0 -10px;
    padding: 8px 10px;
    border-width: 0 0 1px;
    border-radius: 0;
  }
}

@media (max-width: 640px) {
  .setting-row,
  .setting-row--wide {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .setting-row__control {
    justify-content: flex-start;
  }

  .setting-row--switch {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "text switch"
      "extra extra";
  }

  .setting-row__extra {
    justify-self: start;
  }

  .settings-account {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .settings-account > .ghost-button,
  .settings-account > .primary-button {
    grid-column: 1 / -1;
  }

  .settings-danger {
    padding: 2px 12px;
  }

  .telegram-setup {
    grid-template-columns: minmax(0, 1fr);
  }

  .telegram-setup .primary-button {
    justify-self: stretch;
  }
}

/* --- 2.7: görünüm düzeltmeleri -------------------------------------------------------------------- */
.nowrap {
  white-space: nowrap;
}

/* Maç sayfası: paneller arasındaki boşluğu sayfanın ızgarası verir (panelin kendi alt boşluğu iki katına çıkarıyordu) */
.voting-panel,
.fee-panel {
  margin-bottom: 0;
}

/* Tek kalemli ücrette "Sil" gösterilmez (yer tutulur, satır kaymaz) */
.fee-item [data-fee-remove]:disabled {
  visibility: hidden;
}

/* Telefonda pencere başlığı: başlık ve Kapat aynı satırda, pencere kayınca başlık üstte kalır */
@media (max-width: 760px) {
  .modal-head {
    position: sticky;
    top: -16px;
    z-index: 4;
    flex-direction: row;
    align-items: center;
    margin: -16px -16px 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(237, 246, 238, 0.08);
    background: var(--panel);
  }

  .modal-head h2 {
    min-width: 0;
    margin: 0;
    font-size: 1.05rem;
  }

  .modal-close {
    flex: 0 0 auto;
    min-width: 0;
    min-height: 36px;
    padding: 0 14px;
  }
}

/* Dokunmatik ekranda küçük bağlantı ve düğmelerin dokunma alanı büyür (görünüm değişmez) */
@media (pointer: coarse) {
  .fee-chip {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  .stat-table a,
  .back-link,
  .sort-button {
    position: relative;
  }

  .stat-table a::before,
  .back-link::before,
  .sort-button::before {
    content: "";
    position: absolute;
    inset: -10px -6px;
  }

  /* taşan adı kesen öğede sözde öğe kırpılır: dolgu + eksi boşlukla büyütülür */
  .leader-name {
    margin: -8px 0;
    padding: 8px 0;
  }

  .telegram-member-list summary,
  .telegram-errors summary,
  .voting-panel summary {
    padding: 8px 0;
  }

  .text-button {
    min-height: 36px;
    padding: 0 8px;
  }
}

/* Ayar satırındaki bağlantı düğmesi diğer düğmelerle aynı kalınlıkta */
.setting-row__control .ghost-button.link-button {
  font-weight: inherit;
}

/* Site erişimi: anahtarsız ziyaretçinin karşılama ekranı ve Ayarlar'daki grup linki. */
.welcome-card {
  justify-items: center;
}

.welcome-card,
.welcome-card h1,
.welcome-card p {
  text-align: center;
}

.welcome-mark {
  display: block;
  margin: 0 auto 12px;
  border-radius: 18px;
}

.welcome-admin {
  margin-top: 14px;
  font-size: 0.85rem;
}

.access-link {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  width: 100%;
}

.access-link input {
  flex: 1 1 220px;
  min-width: 0;
  font-size: 0.82rem;
}
