:root {
  --bg: #edf1f8;
  --paper: #fffefa;
  --paper-2: #f4f6fb;
  --ink: #151a26;
  --muted: #687187;
  --line: #d7deea;
  --deep: #11182a;
  --deep-2: #1a2d63;
  --grass: #2556b8;
  --grass-2: #3b73e6;
  --clay: #d33b45;
  --sky: #8bb8ff;
  --shadow: 0 14px 34px rgba(28, 45, 99, .13);
  --soft-shadow: 0 8px 18px rgba(28, 45, 99, .09);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(90deg, rgba(37, 86, 184, .07) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 48%, #e2e8f4 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 12px 76px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(37, 86, 184, .14);
  border-radius: 10px;
  padding: 12px;
  background:
    linear-gradient(135deg, #ffffff 0%, #f6f8ff 42%, #e7edf9 100%);
  box-shadow: var(--soft-shadow);
}

.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.preset-button,
.dlc-toggle {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid rgba(37, 86, 184, .16);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, .78);
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset;
}

.preset-button {
  padding: 0 10px;
  color: var(--deep-2);
}

.dlc-toggle.is-active {
  color: #fff;
  border-color: rgba(37, 86, 184, .76);
  background: linear-gradient(180deg, #4d82ee, #2556b8);
  box-shadow: 0 8px 16px rgba(37, 86, 184, .18);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--grass);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  color: var(--deep);
  font-size: 25px;
  line-height: 1;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 14px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lineup-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 11px;
  scrollbar-width: none;
}

.lineup-strip::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  min-width: 62px;
  min-height: 34px;
  max-width: 132px;
  border: 1px solid rgba(21, 32, 24, .16);
  border-radius: 999px;
  padding: 0 14px;
  overflow: hidden;
  color: #304236;
  background: rgba(251, 250, 243, .88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip.is-active {
  color: #fffefa;
  border-color: rgba(37, 86, 184, .88);
  background: linear-gradient(180deg, #4d82ee, #2556b8);
  box-shadow: 0 8px 16px rgba(37, 86, 184, .22);
}

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

.player-filter {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: 0 -12px 10px;
  padding: 8px 12px 10px;
  background: rgba(237, 241, 248, .94);
  border-bottom: 1px solid rgba(37, 86, 184, .10);
  backdrop-filter: blur(10px);
}

.lineup-name-field {
  margin: -2px 0 10px;
}

.lineup-name-button,
.lineup-name-input {
  width: auto;
  max-width: 210px;
}

.lineup-name-button {
  min-height: 32px;
  border: 1px solid rgba(37, 86, 184, .14);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--deep);
  background: rgba(255, 255, 255, .76);
  font-size: 13px;
  font-weight: 900;
}

.lineup-name-button .edit-mark {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.lineup-name-input {
  min-height: 34px;
  font-size: 14px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #435142;
  font-size: 12px;
  font-weight: 900;
}

select,
input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid #bfccb8;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: linear-gradient(180deg, #fffdf7, var(--paper));
  outline: none;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.2;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .95) inset,
    0 1px 0 rgba(21, 32, 24, .04);
}

select:focus,
input:focus {
  border-color: rgba(59, 115, 230, .72);
  box-shadow:
    0 0 0 3px rgba(59, 115, 230, .16),
    0 1px 0 rgba(255, 255, 255, .95) inset;
}

.pitch-wrap {
  padding: 7px;
  border: 1px solid rgba(21, 32, 24, .18);
  border-radius: 12px;
  background: linear-gradient(180deg, #fdfbf3, #dfe7f4);
  box-shadow: var(--shadow);
}

.pitch {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.15;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .12), rgba(0, 0, 0, .08)),
    #3a414c url("../assets/others/field-bg.svg") center / 100% 100% no-repeat;
}

.slot {
  position: absolute;
  width: 92px;
  min-width: 0;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 3px;
  background: transparent;
  color: inherit;
  padding: 0;
}

.slot-avatar {
  width: clamp(44px, 13vw, 60px);
  height: clamp(44px, 13vw, 60px);
  border-radius: 999px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(222, 235, 255, .96);
  background: #172018;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, .72),
    0 0 18px rgba(59, 115, 230, .54),
    0 4px 10px rgba(0, 0, 0, .28);
}

.slot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slot-empty .slot-avatar {
  border-style: dashed;
  color: #dce9ff;
  font-size: 11px;
  font-weight: 950;
}

.slot-name {
  width: 88px;
  min-height: 16px;
  color: #eef5ff;
  font-size: clamp(10px, 2.7vw, 13px);
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
  text-shadow:
    0 1px 2px #000,
    0 0 8px rgba(59, 115, 230, .95);
}

.slot-pos {
  color: rgba(255, 255, 255, .74);
  font-size: 9px;
  font-weight: 850;
  text-shadow: 0 1px 2px #000;
}

.slot-empty .slot-name {
  display: none;
}

.settings-panel {
  margin-top: 12px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(37, 86, 184, .12);
  border-radius: 9px;
  background: rgba(251, 250, 243, .92);
  box-shadow: var(--soft-shadow);
}

.settings-panel h3 {
  margin-bottom: 12px;
  color: var(--deep);
}

.field-grid {
  display: grid;
  gap: 10px;
  min-width: 0;
}

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

.field-grid.three {
  grid-template-columns: 1fr;
}

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

.list-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.player-list,
.match-feed,
.sheet-list {
  display: grid;
  gap: 8px;
}

.player-row,
.feed-item {
  border: 1px solid rgba(21, 32, 24, .13);
  border-radius: 8px;
  background: rgba(251, 250, 243, .94);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .92) inset;
}

.player-row {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  overflow: hidden;
}

.player-row::before {
  display: none;
}

.player-row img {
  width: 46px;
  height: 46px;
  border: 2px solid #dce9ff;
  border-radius: 999px;
  object-fit: cover;
  background: #e8edf2;
}

.player-main strong {
  display: block;
  font-size: 14px;
}

.player-main span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.rating-badge {
  min-width: 34px;
  border-radius: 6px;
  padding: 4px 0;
  color: var(--grass);
  text-align: center;
  font-weight: 950;
  background: #eef4ff;
  border: 1px solid #cfe0ff;
  box-shadow: none;
}

.attr-line {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.attr-line span,
.attr-pill {
  border-radius: 4px;
  padding: 4px 0;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.attr-low {
  color: #6f2b21;
  background: #f2d2c9;
}

.attr-mid {
  color: #6a4b08;
  background: #f0dda2;
}

.attr-good {
  color: #245339;
  background: #c5e4cf;
}

.attr-elite {
  color: #102f20;
  background: #9fd0ff;
}

.match-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  margin: 14px 0;
}

.match-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 14px;
}

.team-card,
.score-card {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  padding: 12px 10px;
  background:
    linear-gradient(180deg, var(--deep-2), var(--deep));
  color: #fffdf4;
  box-shadow: var(--soft-shadow);
}

.team-card span {
  display: block;
  color: #adc2b3;
  font-size: 10px;
  font-weight: 950;
}

.team-card strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border-color: rgba(139, 184, 255, .38);
}

.score-card b {
  color: #eef5ff;
  font-size: 30px;
}

.primary-action {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  color: #fffdf4;
  background: linear-gradient(180deg, var(--grass-2), var(--grass));
  box-shadow: 0 10px 20px rgba(37, 86, 184, .22);
  font-weight: 950;
}

.secondary-action {
  min-width: 92px;
  min-height: 44px;
  border: 1px solid rgba(37, 86, 184, .18);
  border-radius: 8px;
  color: var(--grass);
  background: rgba(255, 255, 255, .84);
  font-weight: 950;
}

.primary-action:disabled {
  color: rgba(255, 255, 255, .82);
  background: #7f8d82;
  box-shadow: none;
}

.feed-item {
  padding: 12px;
  color: #1b2744;
  font-size: 13px;
}

.feed-summary {
  border-color: rgba(37, 86, 184, .20);
  background: #ffffff;
  color: var(--deep);
}

.feed-summary strong {
  font-size: 14px;
  line-height: 1.35;
}

.feed-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mvp-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 70px;
}

.mvp-card img {
  width: 52px;
  height: 52px;
  border: 2px solid #dce9ff;
  border-radius: 999px;
  object-fit: cover;
}

.mvp-main {
  display: grid;
  gap: 2px;
}

.mvp-main small {
  color: var(--deep-2);
  font-size: 12px;
  font-weight: 900;
}

.match-event {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  position: relative;
  border-left: 1px solid rgba(37, 86, 184, .12);
  background: rgba(255, 254, 250, .96);
  transition: transform .28s ease, opacity .28s ease, box-shadow .28s ease;
}

.match-event b {
  color: #2556b8;
  font-size: 13px;
  font-weight: 950;
}

.event-name {
  color: #102a69;
  font-weight: 950;
}

.event-goal,
.event-penaltyGoal {
  border-color: rgba(37, 86, 184, .34);
  border-left-width: 4px;
  border-left-color: #2556b8;
  background: linear-gradient(180deg, #edf4ff, #f9fbff);
  box-shadow: 0 8px 18px rgba(37, 86, 184, .13);
}

.event-goal b,
.event-penaltyGoal b {
  color: #0f3f98;
}

.event-yellowCard {
  border-color: rgba(196, 151, 32, .55);
  border-left-width: 4px;
  border-left-color: #c49720;
  background: #fff7dc;
}

.event-redCard {
  border-color: rgba(185, 88, 68, .50);
  border-left-width: 4px;
  border-left-color: var(--clay);
  background: #fff0ec;
}

.live-status {
  color: var(--muted);
  font-weight: 900;
}

.is-new {
  animation: liveIn .38s ease both;
}

@keyframes liveIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(37, 86, 184, .16);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    box-shadow: none;
  }
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 20;
  width: min(calc(100% - 24px), 456px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(37, 86, 184, .14);
  border-radius: 12px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 12px 30px rgba(37, 86, 184, .16);
  backdrop-filter: blur(12px);
}

.bottom-nav button {
  min-height: 38px;
  border-radius: 8px;
  color: #7b8498;
  background: transparent;
  font-size: 13px;
  font-weight: 950;
}

.bottom-nav button.is-active {
  color: #fffefa;
  background: linear-gradient(180deg, #4d82ee, #2556b8);
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: end;
  background: rgba(17, 24, 42, .52);
}

.sheet.is-open {
  display: flex;
}

.sheet-panel {
  width: min(100%, 480px);
  max-height: 82vh;
  margin: 0 auto;
  border: 1px solid rgba(21, 32, 24, .16);
  border-radius: 14px 14px 0 0;
  padding: 14px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 -18px 44px rgba(0, 0, 0, .22);
}

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

.sheet-head h2 {
  color: var(--deep);
}

.ghost-button {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 12px;
  color: #fffdf4;
  background: var(--deep-2);
  font-weight: 900;
}

.sheet-search {
  margin-bottom: 10px;
}

.sheet-list {
  max-height: calc(82vh - 130px);
  overflow: auto;
  padding-bottom: 8px;
}

.sheet-player {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border: 1px solid rgba(21, 32, 24, .13);
  border-radius: 8px;
  padding: 7px;
  background: #fffdf7;
  color: var(--ink);
  text-align: left;
}

.sheet-player img {
  width: 42px;
  height: 42px;
  border: 2px solid #dce9ff;
  border-radius: 999px;
  object-fit: cover;
}

.sheet-player strong,
.sheet-player span {
  display: block;
}

.sheet-player strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-player span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.sheet-player b {
  min-width: 34px;
  border-radius: 6px;
  padding: 5px 0;
  color: #fffdf4;
  text-align: center;
  background: var(--grass);
}

@media (min-width: 430px) {
  .field-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 700px) {
  body {
    background:
      linear-gradient(90deg, #dbe3f1 0, #f7f9fe 20%, #f7f9fe 80%, #dbe3f1 100%);
  }
}
