﻿:root {
  color-scheme: light;
  --panel: rgba(248, 244, 235, 0.92);
  --panel-strong: #f8f2e7;
  --line: rgba(255, 255, 255, 0.9);
  --ink: #173229;
  --muted: #547064;
  --accent: #ce6a32;
  --accent-soft: #f6d5bf;
  --field-a: #2f7d4a;
  --field-b: #2a7043;
  --bench: #21493a;
  --shadow: 0 18px 40px rgba(28, 46, 38, 0.18);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Trebuchet MS", Verdana, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.65), transparent 30%),
    linear-gradient(135deg, #eef3df 0%, #d6e5d0 55%, #c6d9cd 100%);
}

button,
select {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Arial Narrow", "Franklin Gothic Medium", Impact, sans-serif;
  letter-spacing: 0.03em;
}

h1 { font-size: 2rem; }
h2 { font-size: 2.1rem; }
h3 { font-size: 1.35rem; }

.app-shell {
  min-height: 100vh;
}

.top-bar,
.section-heading,
.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.secondary-button,
.player-chip,
.field-player,
.icon-button,
.slot-marker {
  border: 0;
  cursor: pointer;
}

.secondary-button {
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(23, 50, 41, 0.08);
}

.secondary-button--full { width: 100%; }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(23, 50, 41, 0.08);
}

.icon-button--small {
  width: 38px;
  height: 38px;
}

.bench-panel,
.stats-view {
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(23, 50, 41, 0.08);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.player-list,
.bench-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.player-chip {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-md);
  text-align: left;
  background: #fff8f1;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.player-chip:hover,
.player-chip:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(23, 50, 41, 0.12);
}

.field-player:hover,
.field-player:focus-visible {
  box-shadow: 0 10px 20px rgba(23, 50, 41, 0.12);
}

.player-chip.is-active,
.field-player.is-active {
  outline: 3px solid rgba(206, 106, 50, 0.28);
  background: #fff;
}

.player-number,
.field-player__number,
.detail-hero__number {
  display: inline-grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.detail-hero__number {
  width: 3rem;
  height: 3rem;
  font-size: 1.1rem;
}

.player-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.player-role,
.detail-subtext,
.field-player__slot,
.section-heading span,
.field-hint,
.timer-card__label,
.mini-stat span,
.modal__content p {
  color: var(--muted);
}

.board-area {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
}

.view-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.nav-chip {
  border: 0;
  cursor: pointer;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(23, 50, 41, 0.08);
}

.nav-chip.is-active {
  background: var(--accent);
  color: #fff;
}

.top-bar { align-items: stretch; }

.top-bar__left {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.game-controls,
.toolbar,
.timer-card__actions,
.formation-select,
.detail-actions,
.positions-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.positions-row,
.detail-actions {
  flex-wrap: wrap;
}

.formation-select {
  padding: 0.25rem 0.35rem 0.25rem 0.85rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(23, 50, 41, 0.08);
}

.formation-select select {
  padding: 0.45rem 1rem 0.45rem 0.75rem;
  border: 0;
  background: transparent;
}

.timer-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.timer-card strong {
  font-family: "Arial Narrow", "Franklin Gothic Medium", Impact, sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.coach-surface {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1.2rem;
  align-items: start;
}

.bench-panel {
  background: linear-gradient(180deg, rgba(33, 73, 58, 0.95), rgba(27, 58, 47, 0.96));
  color: #f7f3eb;
}

.bench-subtitle {
  margin-top: 0.2rem;
  color: rgba(247, 243, 235, 0.7);
  font-size: 0.85rem;
}

.bench-panel .section-heading span,
.bench-panel .player-role {
  color: rgba(247, 243, 235, 0.7);
}

.bench-panel .player-chip {
  background: rgba(255, 255, 255, 0.1);
  color: #f7f3eb;
}

.bench-panel .player-number {
  background: #f7f3eb;
  color: var(--bench);
}

.bench-stats-button {
  margin-top: 1rem;
}

.field-wrapper { position: relative; }

.field-hint {
  margin-top: 0.75rem;
  padding: 0 0.35rem;
  font-size: 0.88rem;
}

.field-surface {
  position: relative;
  min-height: 82vh;
  overflow: hidden;
  border-radius: 42px;
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.05) 100%),
    repeating-linear-gradient(180deg, var(--field-a) 0, var(--field-a) 70px, var(--field-b) 70px, var(--field-b) 140px);
  box-shadow: var(--shadow);
}

.field-surface.is-drop-target {
  box-shadow: 0 0 0 4px rgba(246, 213, 191, 0.8), var(--shadow);
}

.field-markings {
  position: absolute;
  inset: 1.1rem;
  border: 3px solid var(--line);
  border-radius: 32px;
}

.mid-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  background: var(--line);
  transform: translateY(-50%);
}

.center-circle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  border: 3px solid var(--line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.penalty-box,
.goal-box {
  position: absolute;
  left: 50%;
  border: 3px solid var(--line);
  transform: translateX(-50%);
}

.penalty-box { width: 42%; height: 16%; }
.goal-box { width: 22%; height: 7%; }
.penalty-box.top,
.goal-box.top { top: -3px; border-top: 0; }
.penalty-box.bottom,
.goal-box.bottom { bottom: -3px; border-bottom: 0; }

.slot-marker {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  transform: translate(-50%, -50%);
}

.slot-marker.is-filled {
  opacity: 0;
  pointer-events: none;
}

.slot-marker.is-targeted {
  border-style: solid;
  border-color: rgba(246, 213, 191, 0.95);
  background: rgba(246, 213, 191, 0.22);
  box-shadow: 0 0 0 8px rgba(246, 213, 191, 0.16);
}

.field-player {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 84px;
  padding: 0.5rem 0.45rem 0.6rem;
  border-radius: 18px;
  background: rgba(255, 248, 241, 0.94);
  color: var(--ink);
  transform: translate(-50%, -50%);
  transition: box-shadow 160ms ease, background 160ms ease;
}

.field-player__name {
  font-size: 0.82rem;
  font-weight: 700;
}

.field-player__slot {
  font-size: 0.72rem;
}

.detail-card {
  display: grid;
  gap: 1rem;
}

.detail-card--empty { color: var(--muted); }

.detail-hero {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem;
  border-radius: var(--radius-md);
  background: var(--panel-strong);
}

.stat-grid,
.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.stat-card,
.mini-stat {
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: #fff;
}

.stat-card strong,
.mini-stat strong {
  display: block;
  font-size: 1.3rem;
  font-family: "Arial Narrow", "Franklin Gothic Medium", Impact, sans-serif;
}

.position-pill {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #7d3d18;
  font-size: 0.82rem;
  font-weight: 700;
}

.stats-view.is-hidden,
.roster-view.is-hidden,
.config-view.is-hidden,
.board-view.is-hidden,
.modal.is-hidden {
  display: none;
}

.inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 20px rgba(23, 50, 41, 0.08);
}

.inline-toggle input {
  accent-color: var(--accent);
}

.is-hidden {
  display: none;
}

.roster-manager {
  display: grid;
  gap: 1.25rem;
}

.config-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 1.25rem;
}

.config-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
}

.config-help {
  color: var(--muted);
  font-size: 0.92rem;
}

.config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.config-field-wrap {
  position: relative;
}

.field-surface--config {
  min-height: 72vh;
}

.config-player {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 82px;
  padding: 0.45rem 0.4rem 0.55rem;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 248, 241, 0.95);
  color: var(--ink);
  transform: translate(-50%, -50%);
  cursor: grab;
  box-shadow: 0 10px 20px rgba(23, 50, 41, 0.12);
}

.config-player:active {
  cursor: grabbing;
}

.config-player__label {
  font-size: 0.72rem;
  color: var(--muted);
}

.roster-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
}

.roster-field {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}

.roster-field input,
.roster-field select {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(23, 50, 41, 0.12);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
}

.roster-field--wide {
  grid-column: span 3;
}

.roster-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  grid-column: span 3;
}

.player-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100vh;
  padding: 1.25rem;
  background: rgba(251, 247, 238, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: -18px 0 40px rgba(28, 46, 38, 0.18);
  z-index: 20;
  overflow-y: auto;
}

.player-drawer.is-hidden {
  display: none;
}

.player-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stats-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.stats-table th,
.stats-table td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(23, 50, 41, 0.08);
}

.stats-table th {
  background: #eef4e7;
  font-family: "Arial Narrow", "Franklin Gothic Medium", Impact, sans-serif;
  font-size: 1rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(14, 26, 21, 0.46);
}

.modal__card {
  width: min(520px, 100%);
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: #fbf7ee;
  box-shadow: var(--shadow);
}

.modal__content {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

@media (max-width: 1180px) {
  .coach-surface { grid-template-columns: minmax(220px, 280px) 1fr; }
  .field-surface { min-height: 60vh; }
}

@media (max-width: 920px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .game-controls,
  .toolbar {
    flex-wrap: wrap;
  }
  .coach-surface {
    grid-template-columns: 1fr;
  }
  .field-surface {
    min-height: 56vh;
  }
  .player-drawer {
    width: 100%;
  }
  .config-layout {
    grid-template-columns: 1fr;
  }
  .roster-form {
    grid-template-columns: 1fr;
  }
  .roster-field--wide,
  .roster-form__actions {
    grid-column: span 1;
  }
}
