:root {
  --bg: #030b12;
  --surface: #071824;
  --surface-strong: #0a202d;
  --text: #edf7ff;
  --muted: #91a8ba;
  --line: rgba(166, 210, 234, 0.17);
  --brand: #62e9c2;
  --brand-strong: #32d7ab;
  --green: #62e9ae;
  --red: #ff6977;
  --yellow: #ffd260;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
  font-family: "Inter", Arial, sans-serif;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  position: relative;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(49, 136, 255, 0.16), transparent 34rem),
    radial-gradient(circle at 88% 12%, rgba(98, 233, 194, 0.1), transparent 30rem),
    linear-gradient(rgba(3, 11, 18, 0.82), rgba(3, 11, 18, 0.96)),
    url("/assets/futbol/images/background/app-futbol-field-scroll.png") center top / cover fixed,
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(98, 233, 194, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98, 233, 194, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

body.is-embedded-demo {
  min-height: 100%;
  background:
    radial-gradient(circle at 16% 0%, rgba(49, 136, 255, 0.12), transparent 28rem),
    linear-gradient(180deg, #030b12, #06141e);
}

body.is-embedded-demo::before {
  opacity: 0.55;
}

body.is-embedded-demo .app-shell {
  min-height: 100vh;
}

body.is-embedded-demo [data-menu-action="logout"] {
  display: none;
}

::selection {
  color: #03120e;
  background: var(--brand);
}

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

button {
  border-radius: 11px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

:is(button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(98, 233, 194, 0.24);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  color: var(--text);
}

h1,
h2,
.period-status,
.score-line,
.clock-display {
  font-family: "Barlow Condensed", "Inter", sans-serif;
}

h1 {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.7rem, 5vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.15rem;
}

.eyebrow {
  color: var(--brand-strong);
  letter-spacing: 0.13em;
}

.auth-shell {
  padding: 28px 16px;
}

.login-panel,
.settings-panel,
.settings-account-card {
  border: 1px solid var(--line);
  border-bottom: 1px solid rgba(98, 233, 194, 0.42);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(49, 136, 255, 0.12), transparent 36%),
    linear-gradient(145deg, rgba(9, 31, 44, 0.98), rgba(4, 17, 27, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), var(--shadow);
}

.login-panel {
  gap: 30px;
  width: min(100%, 490px);
  padding: clamp(26px, 5vw, 42px);
}

.login-panel > div:not(.login-brand) {
  display: none;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.login-brand .referee-pansolvs-logo {
  width: 136px;
  height: 38px;
  object-fit: contain;
}

.login-brand h1 {
  margin-top: 4px;
  font-size: 1.7rem;
}

.login-panel .eyebrow {
  font-size: 0.67rem;
}

.settings-panel,
.settings-account-card {
  border-radius: 18px;
}

.settings-account-card span,
#login-status,
.flow-summary {
  color: var(--muted);
}

.settings-account-card strong {
  color: var(--text);
}

.form-stack {
  gap: 16px;
}

.form-stack label,
.bo-panel label,
.penalty-panel label,
.match-notes-panel label {
  color: #cce2ef;
  font-size: 0.78rem;
  letter-spacing: 0.035em;
}

.form-stack input,
.bo-panel select,
.penalty-panel input,
.match-notes-panel textarea,
.head-assign-select {
  border: 1px solid rgba(166, 210, 234, 0.28);
  color: var(--text);
  background: #04121c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

:is(.form-stack input, .bo-panel select, .penalty-panel input, .match-notes-panel textarea, .head-assign-select):hover {
  border-color: rgba(98, 233, 194, 0.36);
}

:is(.form-stack input, .bo-panel select, .penalty-panel input, .match-notes-panel textarea, .head-assign-select):focus {
  border-color: var(--brand);
}

input::placeholder,
textarea::placeholder {
  color: #657f91 !important;
  opacity: 1;
}

select option,
.bo-panel select option {
  color: var(--text);
  background: #071824;
}

.password-toggle {
  color: var(--muted);
  border-radius: 8px;
}

.password-toggle:hover:not(:disabled) {
  color: #03120e;
  border-color: var(--brand);
  background: var(--brand);
}

.auth-warning,
.match-date-warning {
  border-color: rgba(255, 210, 96, 0.36);
  color: #ffe5a1;
  background: rgba(255, 210, 96, 0.09);
}

#login-status.is-error,
.flow-summary.is-error {
  color: #ff9ba5;
}

#login-status.is-ok,
.flow-summary.is-ok {
  color: #80edbd;
}

.app-shell {
  width: min(100%, 980px);
  padding: 0 18px 52px;
}

.app-header {
  top: 10px;
  margin: 10px 0 28px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(4, 17, 27, 0.9);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(20px);
}

.referee-header-brand {
  gap: 16px;
}

.referee-header-brand .referee-pansolvs-logo {
  width: 112px;
  max-width: 112px;
  height: 30px;
  object-fit: contain;
}

.referee-pansolvs-logo {
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(49, 136, 255, 0.18));
}

.connection-pill {
  border-color: rgba(98, 233, 174, 0.32);
  color: #8cf0c2;
  background: rgba(98, 233, 174, 0.09);
}

.connection-pill::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.connection-pill.is-offline {
  border-color: rgba(255, 105, 119, 0.34);
  color: #ff9ba5;
  background: rgba(255, 105, 119, 0.09);
}

.menu-button {
  border: 1px solid rgba(166, 210, 234, 0.28);
  border-radius: 12px;
  color: var(--text);
  background: rgba(166, 210, 234, 0.06);
}

.menu-button:hover:not(:disabled) {
  border-color: rgba(98, 233, 194, 0.48);
  background: rgba(98, 233, 194, 0.1);
}

.menu-button span {
  background: currentColor;
}

.mobile-menu {
  top: calc(100% + 10px);
  padding: 9px;
  border: 1px solid rgba(166, 210, 234, 0.28);
  border-radius: 15px;
  background: rgba(5, 20, 30, 0.99);
  box-shadow: var(--shadow);
}

.mobile-menu button {
  color: var(--text);
  border-radius: 9px;
}

.mobile-menu button:hover,
.mobile-menu button:active {
  color: var(--brand);
  background: rgba(98, 233, 194, 0.08);
}

.section-heading {
  margin-bottom: 18px;
}

.league-list,
.match-list,
.upcoming-day-list,
.event-list,
.player-list {
  gap: 11px;
  margin-top: 16px;
}

.league-card,
.match-card,
.event-row,
.player-option {
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--text);
  background:
    linear-gradient(105deg, rgba(49, 136, 255, 0.035), transparent 45%),
    rgba(7, 24, 36, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

:is(.league-card, .match-card, .player-option):hover {
  border-color: rgba(98, 233, 194, 0.34);
  background:
    linear-gradient(105deg, rgba(98, 233, 194, 0.07), transparent 48%),
    rgba(8, 29, 42, 0.98);
}

.league-card {
  position: relative;
  min-height: 92px;
  padding: 18px 54px 18px 20px;
  overflow: hidden;
}

.league-card::after {
  width: 9px;
  height: 9px;
  position: absolute;
  right: 18px;
  top: 50%;
  color: var(--brand);
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.league-card strong,
.match-card strong {
  color: var(--text);
}

.league-card span,
.match-card span,
.match-meta,
.clock-state,
.event-row span,
.flow-summary {
  color: var(--muted);
}

.league-card.is-assigned,
.match-card.is-assigned {
  border-color: rgba(98, 233, 194, 0.52);
  background:
    linear-gradient(90deg, rgba(98, 233, 194, 0.13), transparent 58%),
    rgba(7, 26, 37, 0.98);
  box-shadow: 0 0 0 2px rgba(98, 233, 194, 0.06), 0 16px 40px rgba(0, 0, 0, 0.26);
}

.assigned-label {
  border-color: rgba(98, 233, 194, 0.35);
  color: #8cf0ce !important;
  background: rgba(98, 233, 194, 0.09);
}

.match-card {
  min-height: 92px;
  padding: 15px 16px;
}

.match-card-open {
  color: var(--text);
}

.match-card-open:not(:disabled):hover strong {
  color: var(--brand);
}

.match-card .status-tag {
  border: 1px solid rgba(49, 136, 255, 0.25);
  color: #93beff;
  background: rgba(49, 136, 255, 0.1);
}

.upcoming-group {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(5, 20, 30, 0.92);
}

.upcoming-group > summary {
  color: var(--text);
}

.upcoming-group > summary::after {
  content: "+";
  color: var(--brand);
}

.upcoming-group[open] > summary::after {
  content: "−";
  transform: none;
}

.back-button,
.secondary-button,
.icon-button,
.head-referee-reset {
  border: 1px solid rgba(166, 210, 234, 0.28);
  color: #dcebf3;
  background: rgba(166, 210, 234, 0.065);
}

:is(.back-button, .secondary-button, .icon-button, .head-referee-reset):hover:not(:disabled) {
  border-color: rgba(98, 233, 194, 0.44);
  color: var(--brand);
  background: rgba(98, 233, 194, 0.08);
}

.back-button::before {
  width: 7px;
  height: 7px;
  border-bottom: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  content: "";
  margin-right: 7px;
  transform: rotate(45deg);
}

.primary-button {
  border: 1px solid var(--brand);
  color: #03120e;
  background: var(--brand);
  box-shadow: 0 10px 25px rgba(98, 233, 194, 0.14);
}

.primary-button:hover:not(:disabled) {
  background: #83f2d2;
  box-shadow: 0 13px 30px rgba(98, 233, 194, 0.22);
  transform: translateY(-1px);
}

.danger-button,
.assign-match-button.is-release {
  border: 1px solid rgba(255, 105, 119, 0.5);
  color: #ffe3e6;
  background: rgba(255, 105, 119, 0.15);
}

.danger-button:hover:not(:disabled),
.assign-match-button.is-release:hover:not(:disabled) {
  background: rgba(255, 105, 119, 0.24);
}

.match-referee-label {
  color: #86ebbd;
}

.match-hero,
.clock-panel,
.event-panel,
.summary-panel {
  margin-top: 14px;
  padding: clamp(18px, 3.5vw, 28px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 88% 0%, rgba(49, 136, 255, 0.07), transparent 35%),
    rgba(6, 22, 33, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.match-hero {
  gap: 14px;
  border-color: rgba(98, 233, 194, 0.19);
}

.roster-panel {
  border-color: rgba(98, 233, 194, 0.2);
  border-radius: 20px;
  color: var(--text);
  background:
    radial-gradient(circle at 88% 0%, rgba(49, 136, 255, 0.09), transparent 38%),
    linear-gradient(145deg, rgba(7, 27, 39, 0.98), rgba(4, 18, 28, 0.98));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.roster-heading h3 {
  color: var(--text);
}

.roster-panel > .flow-summary {
  border-color: rgba(166, 210, 234, 0.2);
  color: #a9bfcc;
  background: rgba(166, 210, 234, 0.035);
}

.roster-actions {
  padding-top: 4px;
  border-top: 1px solid rgba(166, 210, 234, 0.1);
}

.match-hero h2 {
  font-size: clamp(1.6rem, 5.6vw, 2.45rem);
}

.score-line {
  color: var(--brand);
  font-size: clamp(3.8rem, 18vw, 6.3rem);
  text-shadow: 0 0 30px rgba(98, 233, 194, 0.15);
}

.clock-panel {
  border-color: rgba(49, 136, 255, 0.2);
  background:
    radial-gradient(circle at 50% 20%, rgba(49, 136, 255, 0.1), transparent 45%),
    rgba(5, 19, 29, 0.97);
}

.period-status {
  color: #8ebeff;
  letter-spacing: 0.05em;
}

.clock-display {
  color: var(--text);
  letter-spacing: 0.015em;
  text-shadow: 0 0 36px rgba(49, 136, 255, 0.16);
}

.event-type-grid button,
.choice-grid button,
.foul-card-actions button {
  border: 1px solid rgba(166, 210, 234, 0.28);
  color: var(--text);
  background: rgba(10, 32, 45, 0.96);
}

.event-type-grid button {
  border: 2px solid rgba(49, 136, 255, 0.42);
  background:
    radial-gradient(circle at 50% 34%, rgba(49, 136, 255, 0.12), transparent 48%),
    rgba(7, 25, 37, 0.98);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.27);
}

.event-type-grid button:hover:not(:disabled) {
  border-color: rgba(98, 233, 194, 0.62);
  transform: translateY(-2px);
}

.event-type-grid button.is-active,
.choice-grid button.is-active,
.player-option.is-active,
.foul-card-actions button.is-active {
  border-color: var(--brand);
  color: var(--brand);
  background:
    radial-gradient(circle at 50% 30%, rgba(98, 233, 194, 0.15), transparent 50%),
    rgba(98, 233, 194, 0.08);
  box-shadow: 0 0 0 3px rgba(98, 233, 194, 0.08), 0 14px 30px rgba(0, 0, 0, 0.3);
}

.goal-type-actions button {
  border-radius: 11px;
}

.flow-label {
  color: #bad0dd;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flow-summary {
  border: 1px dashed rgba(166, 210, 234, 0.28);
  border-radius: 12px;
  background: rgba(166, 210, 234, 0.025);
}

.flow-summary.is-ok {
  border-color: rgba(98, 233, 174, 0.38);
  color: #87edbd;
  background: rgba(98, 233, 174, 0.055);
}

.flow-summary.is-error {
  border-color: rgba(255, 105, 119, 0.42);
  color: #ff9da6;
  background: rgba(255, 105, 119, 0.07);
}

.summary-heading {
  border: 1px solid rgba(98, 233, 194, 0.25);
  border-radius: 14px;
  color: var(--text);
  background: rgba(98, 233, 194, 0.06);
}

.summary-toggle {
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: rgba(166, 210, 234, 0.04);
}

.summary-toggle:hover:not(:disabled) {
  border-color: rgba(98, 233, 194, 0.34);
  background: rgba(98, 233, 194, 0.06);
}

.summary-toggle::after,
.summary-result,
.summary-event-count {
  color: var(--brand);
}

.summary-team strong,
.summary-player-name,
.event-row strong {
  color: var(--text);
}

.summary-team span,
.summary-player-list.is-empty {
  color: var(--muted);
}

.summary-player-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(166, 210, 234, 0.035);
}

.bo-panel,
.penalty-panel,
.match-notes-panel {
  border: 1px solid rgba(166, 210, 234, 0.28);
  border-radius: 15px;
  color: var(--text);
  background: rgba(4, 18, 28, 0.86);
}

.bo-panel h3,
.penalty-panel h3 {
  color: var(--text);
}

.event-row {
  box-shadow: none;
}

.head-referee-row {
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 20, 30, 0.72);
}

.head-referee-row.is-assigned {
  border-color: rgba(49, 136, 255, 0.3);
  background: rgba(49, 136, 255, 0.07);
}

.head-referee-row.is-free {
  border-color: rgba(98, 233, 174, 0.22);
}

.head-referee-name {
  color: var(--text);
}

.head-referee-match {
  color: var(--muted);
}

.head-referee-match.is-free {
  color: #80e9b7;
}

.head-referee-role {
  border-color: rgba(49, 136, 255, 0.3);
  color: #94c1ff;
  background: rgba(49, 136, 255, 0.08);
}

.toast {
  border: 1px solid rgba(98, 233, 194, 0.3);
  border-radius: 13px;
  color: var(--text);
  background: rgba(5, 23, 33, 0.98);
  box-shadow: var(--shadow);
}

@media (max-width: 720px) {
  .app-shell {
    padding-inline: 12px;
  }

  .app-header {
    top: 6px;
    margin-top: 6px;
    padding: 10px 11px;
    border-radius: 15px;
  }

  .referee-header-brand {
    gap: 9px;
  }

  .referee-header-brand .referee-pansolvs-logo {
    width: 84px;
    height: 24px;
  }

  .referee-header-brand h1 {
    font-size: 1.12rem;
  }

  .connection-pill {
    max-width: 120px;
    min-width: 0;
    padding-inline: 8px;
    font-size: 0.68rem;
  }

  .match-hero,
  .clock-panel,
  .event-panel,
  .summary-panel {
    padding: 17px 14px;
    border-radius: 17px;
  }
}

@media (max-width: 520px) {
  .login-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-brand .referee-pansolvs-logo {
    width: 126px;
  }

  .header-actions {
    gap: 6px;
  }

  .connection-pill::before {
    width: 6px;
    height: 6px;
    margin-right: 4px;
  }

  .league-card,
  .match-card {
    border-radius: 13px;
  }

  .match-card strong {
    font-size: 0.94rem;
  }

  .match-card .status-tag {
    padding: 5px 7px;
    font-size: 0.67rem;
  }

  .event-type-grid button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.guide-screen {
  width: min(100%, 880px);
  margin: 0 auto;
}

.guide-hero {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: clamp(22px, 5vw, 38px);
  border: 1px solid rgba(98, 233, 194, 0.24);
  border-radius: 20px;
  background: radial-gradient(circle at 88% 0%, rgba(49, 136, 255, 0.15), transparent 40%), linear-gradient(145deg, rgba(8, 31, 44, 0.98), rgba(4, 18, 28, 0.98));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
}

.guide-hero h2,
.guide-hero p {
  margin: 0;
}

.guide-hero h2 {
  font-size: clamp(2rem, 6vw, 3.15rem);
}

.guide-hero p {
  max-width: 620px;
  color: #a9bfcc;
  line-height: 1.5;
}

.guide-quick-nav {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  padding: 10px;
  overflow-x: auto;
  border: 1px solid rgba(166, 210, 234, 0.14);
  border-radius: 14px;
  background: rgba(5, 20, 30, 0.92);
  scrollbar-width: thin;
}

.guide-quick-nav button {
  flex: 0 0 auto;
  min-height: 0;
  padding: 8px 12px;
  border: 1px solid rgba(166, 210, 234, 0.18);
  border-radius: 999px;
  color: #c5d8e2;
  background: rgba(166, 210, 234, 0.04);
  font-size: 0.82rem;
  font-weight: 800;
}

.guide-quick-nav button:hover {
  border-color: rgba(98, 233, 194, 0.42);
  color: var(--brand);
}

.guide-content {
  display: grid;
  gap: 12px;
}

.guide-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  padding: clamp(18px, 4vw, 26px);
  scroll-margin-top: 18px;
  border: 1px solid rgba(49, 136, 255, 0.2);
  border-radius: 18px;
  background: rgba(7, 25, 37, 0.96);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
}

.guide-card.is-danger {
  border-color: rgba(255, 105, 119, 0.28);
}

.guide-step {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(98, 233, 194, 0.42);
  border-radius: 12px;
  color: var(--brand);
  background: rgba(98, 233, 194, 0.08);
  font-family: "Barlow Condensed", "Inter", sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
}

.guide-card.is-danger .guide-step {
  border-color: rgba(255, 105, 119, 0.45);
  color: #ff9da6;
  background: rgba(255, 105, 119, 0.08);
}

.guide-card h3 {
  margin: 1px 0 12px;
  font-size: 1.18rem;
}

.guide-card ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: #c5d8e2;
  line-height: 1.48;
}

.guide-card li::marker {
  color: var(--brand);
  font-weight: 900;
}

.guide-note {
  margin: 15px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--brand);
  border-radius: 0 9px 9px 0;
  color: #a9bfcc;
  background: rgba(98, 233, 194, 0.045);
  font-size: 0.88rem;
  line-height: 1.45;
}

.guide-help-card {
  border: 1px solid rgba(255, 210, 96, 0.26);
  border-radius: 18px;
  background: rgba(29, 27, 16, 0.86);
  overflow: hidden;
}

.guide-help-card summary {
  padding: 18px 20px;
  color: #ffe29a;
  font-weight: 900;
  cursor: pointer;
}

.guide-help-card > div {
  display: grid;
  gap: 10px;
  padding: 0 20px 20px;
  color: #c9c4ae;
  line-height: 1.45;
}

.guide-help-card p {
  margin: 0;
}

@media (max-width: 520px) {
  .guide-card {
    grid-template-columns: 1fr;
  }

  .guide-step {
    width: 38px;
    height: 38px;
  }
}
