:root {
  color-scheme: light;
  --bg: #f3efe3;
  --card: #fffdf7;
  --ink: #183126;
  --muted: #5a6c62;
  --accent: #1f4d36;
  --accent-soft: #d8eadf;
  --line: #d9d2bf;
  --shadow: 0 12px 30px rgba(24, 49, 38, 0.12);
  --radius: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(119, 168, 113, 0.22), transparent 28%),
    linear-gradient(180deg, #f8f5ea 0%, var(--bg) 100%);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 0.95;
}

.app-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 100px;
}

.hero {
  padding: 18px 4px 10px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
}

.hero-copy,
.section-copy,
.overview-theme,
.modal-time,
.tile-meta,
.tile-purpose {
  color: var(--muted);
}

.screen-panel[hidden] {
  display: none;
}

.practice-switcher {
  margin-bottom: 8px;
}

.selector-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.practice-select,
.roster-input {
  width: 100%;
  border: 1px solid rgba(24, 49, 38, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font-size: 1rem;
  box-shadow: inset 0 0 0 1px rgba(24, 49, 38, 0.05);
}

.roster-input {
  resize: vertical;
  min-height: 176px;
}

.start-time-label {
  margin-top: 12px;
}

.overview-card,
.tile-button,
.detail-modal,
.position-slot {
  background: var(--card);
  box-shadow: var(--shadow);
}

.overview-card {
  border-radius: var(--radius);
  padding: 18px;
  margin: 10px 0 20px;
  border: 1px solid rgba(24, 49, 38, 0.07);
}

.overview-label {
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.9rem;
}

.live-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.action-button {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
}

.small-button {
  padding: 9px 12px;
  font-size: 0.9rem;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.secondary-button {
  background: rgba(31, 77, 54, 0.1);
  color: var(--accent);
}

.action-button:disabled {
  opacity: 0.45;
}

.live-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(31, 77, 54, 0.08);
  color: var(--ink);
  font-size: 0.95rem;
}

.transition-banner {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff3cc;
  color: #5c4810;
  font-weight: 700;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 10px;
}

.compact-header {
  align-items: center;
}

.tile-list {
  display: grid;
  gap: 12px;
}

.tile-button {
  width: 100%;
  border: 1px solid rgba(24, 49, 38, 0.07);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.tile-button.tile-done {
  opacity: 0.7;
  background: #f6f2e6;
}

.tile-button.tile-current {
  border-color: rgba(31, 77, 54, 0.36);
  box-shadow: 0 0 0 3px rgba(31, 77, 54, 0.12), var(--shadow);
  background: #f4fbf6;
}

.tile-button.tile-break {
  background: #fffaf0;
}

.tile-time {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 77, 54, 0.08);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}

.tile-title {
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.tile-meta {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.tile-purpose {
  margin-bottom: 0;
  line-height: 1.35;
}

.game-layout {
  display: grid;
  gap: 16px;
}

.game-column {
  display: grid;
  gap: 10px;
}

.roster-editor {
  margin-bottom: 16px;
}

.profile-grid {
  display: grid;
  gap: 12px;
}

.profile-player-name {
  margin-bottom: 14px;
  font-weight: 700;
  color: var(--ink);
}

.field-column,
.bench-column {
  background: var(--card);
  border: 1px solid rgba(24, 49, 38, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.position-slot {
  min-height: 112px;
  width: min(156px, 38vw);
  position: absolute;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 8px;
  backdrop-filter: blur(3px);
  background: rgba(255, 253, 247, 0.94);
}

.position-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field-board {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(24, 49, 38, 0.12);
  background:
    linear-gradient(180deg, rgba(8, 45, 23, 0.1), rgba(8, 45, 23, 0.22)),
    var(--field-image) center/cover no-repeat,
    linear-gradient(180deg, #5ea56a 0%, #3e8a4f 100%);
}

.empty-slot,
.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.bench-row {
  min-height: 136px;
  border: 1px dashed rgba(31, 77, 54, 0.24);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-content: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(244, 239, 224, 0.96));
}

.player-card {
  width: 100%;
  border: 1px solid rgba(24, 49, 38, 0.1);
  border-radius: 16px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f3e8 100%);
  display: block;
  text-align: left;
  color: var(--ink);
  cursor: grab;
}

.player-card-body {
  display: grid;
  gap: 4px;
}

.player-summary {
  display: block;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.2;
}

.player-role-meta {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
}

.player-card-selected {
  border-color: rgba(31, 77, 54, 0.44);
  box-shadow: 0 0 0 3px rgba(31, 77, 54, 0.12);
  background: linear-gradient(180deg, #f4fbf6 0%, #e6f4ea 100%);
}

.player-card-pending {
  border-color: rgba(196, 116, 11, 0.45);
  background: linear-gradient(180deg, #fffaf0 0%, #ffe5bf 100%);
  cursor: pointer;
}

.player-name {
  display: none;
}

.player-status {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #8c5a07;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.player-warning {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: #a33922;
}

.player-card-outside-role {
  border-color: rgba(163, 57, 34, 0.34);
  background: linear-gradient(180deg, #fff8f4 0%, #ffefe7 100%);
}

.position-slot {
  touch-action: none;
}

.position-slot-moving {
  z-index: 5;
  box-shadow: 0 0 0 4px rgba(31, 77, 54, 0.18), var(--shadow);
}

.drop-zone-active {
  border-color: rgba(31, 77, 54, 0.52);
  box-shadow: 0 0 0 3px rgba(31, 77, 54, 0.12);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  background: rgba(255, 253, 247, 0.95);
  border: 1px solid rgba(24, 49, 38, 0.08);
  border-radius: 999px;
  box-shadow: 0 18px 36px rgba(24, 49, 38, 0.18);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 8px;
  backdrop-filter: blur(10px);
}

.nav-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

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

.detail-modal {
  width: min(92vw, 640px);
  border: 0;
  border-radius: 24px;
  padding: 0;
}

.detail-modal::backdrop {
  background: rgba(12, 21, 16, 0.56);
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  padding: 10px 14px;
  color: var(--accent);
}

.modal-body {
  padding: 18px;
}

.modal-body section {
  margin-bottom: 18px;
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
}

@media (min-width: 640px) {
  .tile-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (min-width: 820px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
}

@media (max-width: 520px) {
  .field-board {
    min-height: 460px;
  }

  .position-slot {
    width: min(96px, 27vw);
    min-height: 70px;
    padding: 7px 8px;
    border-radius: 14px;
    gap: 5px;
  }

  .position-label {
    font-size: 0.7rem;
  }

  .player-card {
    padding: 7px 8px;
    border-radius: 12px;
  }

  .player-summary {
    font-size: 0.76rem;
    line-height: 1.1;
  }

  .player-status {
    font-size: 0.62rem;
  }

  .bench-row {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }

  .empty-slot {
    font-size: 0.78rem;
  }
}
