.kos-app,
.kos-admin {
  --kos-bg: #061D55;
  --kos-panel: #ffffff;
  --kos-text: #1d1d1f;
  --kos-muted: #6e6e73;
  --kos-border: #d2d2d7;
  --kos-live: #ff375f;
  --kos-accent: #0A5CFF;
  --kos-team-home: #0A5CFF;
  --kos-team-away: #20A4F3;
  color: var(--kos-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.kos-app {
  background:
    linear-gradient(180deg, rgba(2, 10, 31, 0.22), rgba(2, 8, 25, 0.68)),
    linear-gradient(135deg, var(--kos-team-home) 0%, #0A5CFF 48%, var(--kos-team-away) 100%),
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #0A5CFF 0%, #061D55 100%);
  border-radius: 26px;
  box-sizing: border-box;
  color: #fff;
  margin: 0 auto;
  max-width: 640px;
  min-height: 420px;
  overflow: hidden;
  padding: 18px;
}

.kos-admin .kos-grid,
.kos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.kos-panel,
.kos-card,
.kos-score-entry,
.kos-ad {
  background: rgba(4, 16, 46, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  box-sizing: border-box;
}

.kos-admin .kos-panel {
  background: #fff;
  border-color: var(--kos-border);
  border-radius: 8px;
}

.kos-panel {
  padding: 18px;
}

.kos-panel label,
.kos-score-entry label {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  font-weight: 700;
}

.kos-panel input,
.kos-panel select,
.kos-panel textarea,
.kos-score-entry input,
.kos-score-entry select,
.kos-score-entry textarea,
.kos-filter select {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  box-sizing: border-box;
  color: #111;
  min-height: 42px;
  max-width: 100%;
  padding: 0 12px;
  width: 100%;
}

.kos-panel textarea,
.kos-score-entry textarea {
  border-radius: 16px;
  padding: 10px 12px;
}

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

.kos-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.kos-edit-list {
  display: grid;
  gap: 10px;
}

.kos-edit-row,
.kos-ad-edit form:first-child {
  align-items: end;
  background: #fff;
  border: 1px solid var(--kos-border);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto repeat(auto-fit, minmax(120px, 1fr)) auto;
  padding: 12px;
}

.kos-compact-row {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) auto;
  padding: 8px;
}

.kos-player-row {
  grid-template-columns: auto repeat(auto-fit, minmax(110px, 1fr)) minmax(96px, auto);
  padding: 8px;
}

.kos-edit-row label,
.kos-ad-edit label {
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 3px;
  margin: 0;
}

.kos-edit-row input,
.kos-edit-row select,
.kos-edit-row textarea,
.kos-ad-edit input,
.kos-ad-edit select,
.kos-ad-edit textarea {
  min-height: 34px;
}

.kos-ad-edit {
  background: #fff;
  border: 1px solid var(--kos-border);
  border-radius: 8px;
  padding: 12px;
}

.kos-ad-edit form:first-child {
  border: 0;
  padding: 0;
}

.kos-logo-small,
.kos-avatar-small,
.kos-team-logo,
.kos-logo-placeholder {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  aspect-ratio: 1;
  height: 42px;
  object-fit: cover;
  object-position: center;
  overflow: hidden;
  width: 42px;
}

.kos-logo-small,
.kos-avatar-small {
  height: 30px;
  width: 30px;
}

.kos-logo-small,
.kos-avatar-small,
.kos-team-logo {
  clip-path: circle(50% at 50% 50%);
}

.kos-filter {
  align-items: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.kos-filter button,
.kos-primary,
.kos-secondary,
.kos-actions button,
.kos-timeline button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  min-height: 42px;
  padding: 0 16px;
}

.kos-filter button,
.kos-primary {
  background: #fff;
  color: #061D55;
  font-weight: 900;
}

.kos-secondary,
.kos-actions button,
.kos-timeline button {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 800;
  outline: 1px solid rgba(255, 255, 255, 0.16);
}

.kos-match-list {
  display: grid;
  gap: 10px;
}

.kos-card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 14px;
}

.kos-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 50%;
  display: inline-block;
  height: 24px;
  width: 24px;
}

.kos-card-meta,
.kos-card-foot {
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  gap: 12px;
}

.kos-card-meta strong {
  color: #fff;
}

.kos-score-row {
  align-items: center;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  min-height: 54px;
}

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

.kos-team span {
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kos-score {
  color: #fff;
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
}

.kos-detail-head {
  margin-bottom: 14px;
}

.kos-detail-head p {
  color: rgba(255, 255, 255, 0.66);
  margin: 8px 0 0;
}

.kos-pill {
  background: var(--kos-live);
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  margin-right: 6px;
  padding: 5px 10px;
  text-transform: uppercase;
}

.kos-pill.kos-muted {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.kos-hero-score {
  align-items: stretch;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  margin: 20px 0;
}

.kos-side {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 18px 10px;
  text-align: center;
}

.kos-side span {
  font-size: clamp(48px, 12vw, 78px);
  font-weight: 900;
  line-height: 1;
}

.kos-vs {
  align-self: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 30px;
  font-weight: 900;
}

.kos-scorer {
  background:
    linear-gradient(180deg, rgba(2, 10, 31, 0.42), rgba(2, 8, 25, 0.84)),
    linear-gradient(135deg, var(--kos-team-home), #0A5CFF 48%, var(--kos-team-away));
  border-radius: 26px;
  padding: 14px;
}

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

.kos-scorer-head span {
  color: rgba(255, 255, 255, 0.62);
  font-weight: 800;
}

.kos-scorer-head strong {
  color: #fff;
  display: block;
  font-size: 54px;
  font-weight: 900;
  line-height: 1;
}

.kos-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.kos-score-entry {
  background: rgba(0, 0, 0, 0.26);
  margin-bottom: 16px;
  padding: 14px;
}

.kos-score-entry h3,
.kos-app h3 {
  color: #fff;
  margin-top: 0;
}

.kos-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.kos-top-scorers {
  margin: 18px 0;
}

.kos-top-scorers ol {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.kos-top-scorers li {
  align-items: center;
  background: rgba(0, 28, 5, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  display: grid;
  gap: 4px 10px;
  grid-template-columns: auto auto 1fr auto;
  min-height: 58px;
  padding: 10px;
}

.kos-top-scorers strong {
  color: #fff;
}

.kos-top-scorers span:not(.kos-rank) {
  color: rgba(255, 255, 255, 0.66);
  grid-column: 3;
}

.kos-top-scorers b {
  color: #fff;
  font-size: 26px;
  grid-column: 4;
  grid-row: 1 / span 2;
}

.kos-rank {
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.kos-empty-row {
  color: rgba(255, 255, 255, 0.7);
  display: block !important;
}

.kos-timeline li {
  align-items: center;
  background: rgba(4, 16, 46, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  display: grid;
  gap: 4px 10px;
  grid-template-columns: 1fr auto;
  padding: 10px;
}

.kos-timeline strong {
  color: #fff;
}

.kos-timeline span,
.kos-timeline em,
.kos-timeline a {
  color: rgba(255, 255, 255, 0.66);
  font-style: normal;
  grid-column: 1;
}

.kos-timeline button {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.kos-timeline .kos-goal-row {
  grid-template-columns: minmax(90px, 1fr) minmax(120px, 1.4fr) auto auto;
}

.kos-timeline .kos-goal-row strong,
.kos-timeline .kos-goal-row span,
.kos-timeline .kos-goal-row b {
  grid-column: auto;
  grid-row: auto;
}

.kos-timeline .kos-goal-row b {
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.kos-timeline .kos-goal-row button {
  grid-column: auto;
  grid-row: auto;
}

.kos-note-row {
  grid-template-columns: auto 1fr auto;
}

.kos-note-icon {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  display: inline-block;
  height: 34px;
  position: relative;
  width: 34px;
}

.kos-note-icon::before {
  border: 2px solid #fff;
  border-radius: 3px;
  box-sizing: border-box;
  content: "";
  height: 20px;
  left: 9px;
  position: absolute;
  top: 7px;
  width: 16px;
}

.kos-note-icon::after {
  background:
    linear-gradient(#fff, #fff) 0 0 / 10px 2px no-repeat,
    linear-gradient(#fff, #fff) 0 6px / 10px 2px no-repeat,
    linear-gradient(#fff, #fff) 0 12px / 7px 2px no-repeat;
  content: "";
  height: 14px;
  left: 12px;
  opacity: 0.9;
  position: absolute;
  top: 11px;
  width: 10px;
}

.kos-score-chart {
  margin: 18px 0;
}

.kos-score-chart [data-kos-score-chart] {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  overflow: hidden;
  padding: 10px;
}

.kos-chart-svg {
  display: block;
  height: auto;
  width: 100%;
}

.kos-chart-grid {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.kos-chart-label {
  fill: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 700;
}

.kos-chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.kos-chart-home {
  stroke: #00d084;
}

.kos-chart-away {
  stroke: #ff6978;
}

.kos-chart-dot {
  stroke: #fff;
  stroke-width: 2;
}

.kos-chart-home-dot,
.kos-chart-home-key {
  fill: #00d084;
  background: #00d084;
}

.kos-chart-away-dot,
.kos-chart-away-key {
  fill: #ff6978;
  background: #ff6978;
}

.kos-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.kos-chart-legend span {
  align-items: center;
  color: rgba(255, 255, 255, 0.76);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
}

.kos-chart-legend i {
  border-radius: 50%;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.kos-ad {
  background: rgba(255, 255, 255, 0.12);
  margin: 16px 0;
  overflow: hidden;
  padding: 12px;
}

.kos-ad a {
  color: inherit;
  display: block;
  text-decoration: none;
}

.kos-ad-image {
  display: block;
  height: auto;
  max-width: 100%;
  width: 100%;
}

.kos-ad-has-image {
  padding: 0;
}

.kos-ad-has-image .kos-ad-image {
  aspect-ratio: 4 / 1;
  height: 100%;
  object-fit: cover;
}

.kos-ad-thumb {
  display: block;
  height: auto;
  margin-top: 6px;
  max-width: 120px;
}

.kos-media-field {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(160px, 1fr) auto;
}

.kos-inline-form {
  align-items: center;
  display: flex;
  gap: 6px;
}

.kos-empty {
  color: rgba(255, 255, 255, 0.7);
}

.kos-shake {
  animation: kos-shake 0.24s ease-in-out;
}

@keyframes kos-shake {
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

@media (max-width: 760px) {
  .kos-app {
    border-radius: 0;
  }

  .kos-filter {
    grid-template-columns: 1fr;
  }

  .kos-hero-score {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .kos-side {
    border-radius: 16px;
    padding: 12px 6px;
  }

  .kos-side .kos-team-logo,
  .kos-side .kos-logo-placeholder {
    height: 34px;
    width: 34px;
  }

  .kos-side strong {
    font-size: 13px;
    line-height: 1.15;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .kos-side span {
    font-size: clamp(38px, 16vw, 58px);
  }

  .kos-vs {
    display: block;
    font-size: 18px;
  }

  .kos-scorer-head {
    align-items: stretch;
    flex-direction: column;
  }

  .kos-primary {
    width: 100%;
  }

  .kos-quick-actions {
    justify-content: stretch;
  }

  .kos-quick-actions button {
    flex: 1 1 140px;
  }
}
