/* Local Coach — standalone amateur football coach tool */

.lc-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg, #0d1117);
  color: var(--text, #e6edf3);
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

#lc-root {
  width: 100%;
}

.lc-main {
  overflow: auto;
  padding: 0.65rem 0.75rem 5rem;
}

.lc-main--pitch-fill {
  padding-bottom: calc(3.25rem + env(safe-area-inset-bottom, 0px));
}

.lc-main--pitch-fill .lc-top,
.lc-main--pitch-fill .lc-save-hint,
.lc-main--pitch-fill .lc-set-pick {
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.lc-main--pitch-fill .lc-set-pick {
  margin-bottom: 0.35rem;
}

.lc-main--pitch-fill .lc-stat-summary {
  padding: 0.45rem 0.4rem 0.35rem;
}

.lc-login {
  max-width: 22rem;
  margin: 2rem auto;
  padding: 0 0.5rem;
}

.lc-login h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
}

.lc-login p {
  margin: 0 0 1rem;
  color: var(--muted, #8b949e);
  font-size: 0.9rem;
  line-height: 1.45;
}

.lc-field {
  margin-bottom: 0.75rem;
}

.lc-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #8b949e);
  margin-bottom: 0.25rem;
}

.lc-field input,
.lc-field select,
.lc-field textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border, #30363d);
  background: var(--surface, #161b22);
  color: var(--text, #e6edf3);
}

.lc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.lc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-height: 2.75rem;
  padding: 0.34rem 0.64rem;
  border-radius: 6px;
  border: 1px solid var(--border, #30363d);
  background: var(--surface, #161b22);
  color: var(--text, #e6edf3);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  appearance: none;
  -webkit-appearance: none;
}

.lc-btn:hover:not(:disabled) {
  background: var(--surface-hover, #21262d);
}

.lc-btn--danger {
  background: var(--surface, #161b22);
  border-color: var(--border, #30363d);
  color: var(--text, #e6edf3);
}

.lc-btn--danger:hover:not(:disabled) {
  background: var(--surface-hover, #21262d);
}

.lc-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lc-msg {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
  color: #f85149;
}

.lc-msg--ok {
  color: #3fb950;
}

.lc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.lc-top h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.lc-top__meta {
  font-size: 0.78rem;
  color: var(--muted, #8b949e);
}

.lc-pitch-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.lc-pitch-wrap--fill {
  width: 100%;
  max-width: none;
  margin: 0;
}

.lc-stats--fill {
  max-width: none;
  margin: 0;
  width: 100%;
}

.lc-pitch {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(180deg, #1a5c2e 0%, #1e6b35 48%, #1a5c2e 100%);
  overflow: hidden;
  touch-action: none;
}

.lc-pitch::before {
  content: "";
  position: absolute;
  inset: 2% 2%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  pointer-events: none;
}

.lc-pitch__line {
  position: absolute;
  left: 2%;
  right: 2%;
  top: 50%;
  height: 2px;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.lc-zone-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  padding: 4px;
}

.lc-zone {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 0;
  gap: 0;
  border: none;
  background: transparent;
}

.lc-zone__label {
  flex-shrink: 0;
  text-align: center;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.1;
  padding: 0.12rem 0.1rem;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(0, 0, 0, 0.18);
}

.lc-zone__actions {
  flex: 1;
  display: flex;
  gap: 2px;
  min-height: 0;
}

.lc-zone-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.15rem 0.1rem;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  user-select: none;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}

.lc-zone-half__kind {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.78);
}

.lc-zone-half__count {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.lc-zone-half:active {
  background: rgba(0, 0, 0, 0.38);
}

.lc-zone-half--lost {
  border-color: rgba(248, 81, 73, 0.45);
}

.lc-zone-half--shot {
  border-color: rgba(63, 185, 80, 0.45);
}

.lc-player {
  position: absolute;
  width: 3.5rem;
  height: 3.5rem;
  margin: -1.75rem 0 0 -1.75rem;
  border-radius: 50%;
  background: var(--surface, #161b22);
  border: 2px solid var(--border, #30363d);
  color: var(--text, #e6edf3);
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  z-index: 2;
}

.lc-player.is-dragging {
  opacity: 0.85;
  z-index: 5;
  cursor: grabbing;
}

.lc-player.is-set-corner {
  box-shadow: 0 0 0 2px #f0883e;
}

.lc-player.is-set-fk {
  box-shadow: 0 0 0 2px #a371f7;
}

.lc-player.is-set-pen {
  box-shadow: 0 0 0 2px #f85149;
}

.lc-bench-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 420px;
  margin: 0 auto;
}

.lc-bench-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border, #30363d);
  background: var(--surface, #161b22);
  cursor: pointer;
}

.lc-bench-row:active {
  background: #21262d;
}

.lc-bench-row__num {
  font-weight: 800;
  min-width: 2rem;
  color: var(--text, #e6edf3);
}

.lc-bench-row__name {
  flex: 1;
  font-weight: 600;
}

.lc-bench-row__placeholder {
  color: var(--muted, #8b949e);
  font-weight: 500;
}

.lc-bench-row__tag {
  font-size: 0.72rem;
  color: var(--muted, #8b949e);
}

.lc-roster {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 420px;
  margin: 0 auto;
}

.lc-roster-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  gap: 0.35rem;
  align-items: center;
}

.lc-roster-row input[type="text"],
.lc-roster-row input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border, #30363d);
  background: var(--surface, #161b22);
  color: var(--text, #e6edf3);
}

.lc-icon-btn {
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border, #30363d);
  background: var(--surface, #161b22);
  color: var(--muted, #8b949e);
  font-size: 1rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.lc-icon-btn.lc-del-player,
.lc-icon-btn.lc-note-del {
  color: #f85149;
  border-color: #8b3030;
}

.lc-icon-btn.lc-del-player:hover,
.lc-icon-btn.lc-note-del:hover {
  background: #3d1218;
}

.lc-notes {
  max-width: 420px;
  margin: 0 auto;
}

.lc-note {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border, #30363d);
}

.lc-note p {
  flex: 1;
  margin: 0;
  line-height: 1.4;
}

.lc-stats {
  max-width: 420px;
  margin: 0 auto;
}

.lc-stat-pick {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.lc-stat-pick button {
  flex: 1;
  min-width: 5rem;
}

.lc-stat-pick button.is-active,
.lc-set-pick button.is-active {
  border-color: var(--text, #e6edf3);
  color: var(--text, #e6edf3);
  background: var(--surface-hover, #21262d);
}

.lc-stat-summary {
  margin-top: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted, #8b949e);
}

.lc-stat-summary strong {
  color: var(--text, #e6edf3);
}

.lc-set-pick {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0.65rem 0;
}

.lc-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border-top: 1px solid var(--border, #30363d);
  background: var(--surface, #161b22);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 20;
}

.lc-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.35rem 0.25rem;
  border: none;
  background: transparent;
  color: var(--muted, #8b949e);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.lc-tab.is-active {
  color: var(--text, #e6edf3);
  background: var(--surface-hover, #21262d);
}

.lc-tab__icon {
  display: none;
}

.lc-roster-row input[type="text"]::placeholder,
.lc-roster-row input[type="number"]::placeholder {
  color: var(--muted, #8b949e);
  opacity: 1;
}

.lc-save-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted, #8b949e);
  margin-top: 0.35rem;
}
