﻿:root {
  --bg-deep: #06140c;
  --bg-mid: #0d2818;
  --pitch: #1a6b3c;
  --pitch-line: rgba(236, 245, 228, 0.28);
  --ink: #f4f7ef;
  --muted: #a8bba8;
  --gold: #e8c468;
  --gold-deep: #b8892a;
  --accent: #7dffb2;
  --danger: #ff7b6e;
  --panel: rgba(8, 28, 16, 0.82);
  --panel-border: rgba(232, 196, 104, 0.18);
  --team-a: #2ecc71;
  --team-b: #4db7ff;
  --card-a-from: #1f6b3d;
  --card-a-to: #0f3d22;
  --card-b-from: #1a4f7a;
  --card-b-to: #0d2a44;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font-display: "Bebas Neue", sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-deep);
  overflow-x: clip;
}

.pitch-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(125, 255, 178, 0.16), transparent 55%),
    radial-gradient(circle at 15% 80%, rgba(232, 196, 104, 0.1), transparent 40%),
    linear-gradient(160deg, #082015 0%, #0a1f14 40%, #06140c 100%);
}

.pitch-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 48px,
      rgba(125, 255, 178, 0.03) 48px,
      rgba(125, 255, 178, 0.03) 49px
    );
  mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent);
  opacity: 0.5;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.topbar {
  padding: 1.75rem clamp(1.25rem, 4vw, 3rem) 0.5rem;
  animation: rise 0.7s ease both;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  line-height: 0.9;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 12vw, 6.5rem);
  letter-spacing: 0.04em;
  color: var(--ink);
  text-shadow: 0 0 40px rgba(125, 255, 178, 0.25);
}

.brand-sub {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--gold);
  letter-spacing: 0.12em;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: 1.25rem;
  padding: 1rem clamp(1.25rem, 4vw, 3rem) 2.5rem;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: rise 0.8s ease both;
}

.build-panel {
  animation-delay: 0.08s;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.panel-head .count {
  max-width: 100%;
}

.panel-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.btn-new-player {
  padding: 0.5rem 0.95rem;
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.04em;
  font-weight: 400;
}

.count,
.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.hint strong {
  color: var(--gold);
  font-weight: 600;
}

.player-form {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr;
  gap: 0.75rem;
  align-items: end;
}

.field.grow {
  grid-column: 1 / -1;
}

.pos-field {
  grid-column: 1 / 2;
}

.ovr-badge {
  grid-column: 2 / 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.45rem 0.7rem;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(232, 196, 104, 0.22), rgba(232, 196, 104, 0.06));
  border: 1px solid rgba(232, 196, 104, 0.35);
  min-height: 48px;
}

.ovr-badge span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.ovr-badge strong {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
  font-weight: 400;
}

.ovr-badge small {
  font-size: 0.68rem;
  color: var(--muted);
}

.skills-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.75rem;
  padding: 0.75rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.skill-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.skill-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.skill-field span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.skill-field em {
  font-style: normal;
  font-weight: 700;
}

.skill-help {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(232, 196, 104, 0.45);
  background: rgba(232, 196, 104, 0.12);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
}

.skill-help:hover,
.skill-help.is-open {
  background: rgba(232, 196, 104, 0.28);
  border-color: var(--gold);
}

.skill-tip {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: rgba(8, 28, 16, 0.95);
  border: 1px solid rgba(232, 196, 104, 0.35);
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.35;
  animation: slideIn 0.2s ease both;
}

.skill-tip strong {
  color: var(--gold);
  margin-right: 0.35rem;
  letter-spacing: 0.06em;
}

.skills-grid[data-mode="gk"] {
  border-color: rgba(232, 196, 104, 0.28);
  box-shadow: inset 0 0 0 1px rgba(232, 196, 104, 0.08);
}

.skill-controls {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 0.45rem;
  align-items: center;
}

.skill-field input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.skill-field input[type="number"] {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
  color: var(--gold);
  font: inherit;
  font-weight: 700;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.skill-field input[type="number"]::-webkit-outer-spin-button,
.skill-field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.skill-field input[type="number"]:focus {
  border-color: rgba(232, 196, 104, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 196, 104, 0.15);
}

.form-actions {
  grid-column: 1 / -1;
}

.photo-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.photo-picker {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px dashed rgba(232, 196, 104, 0.45);
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: border-color 0.2s, transform 0.15s;
}

.photo-picker:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.photo-picker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-picker span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.photo-clear {
  height: 40px;
}

.form-actions {
  display: flex;
  gap: 0.45rem;
  align-items: stretch;
}

.form-actions .btn-primary {
  flex: 1;
  height: 48px;
}

.form-actions .btn-ghost {
  height: 48px;
}

.player-form.editing {
  outline: 1px solid rgba(232, 196, 104, 0.28);
  outline-offset: 6px;
  border-radius: 14px;
}

@media (max-width: 520px) {
  .player-form {
    grid-template-columns: 1fr;
  }

  .pos-field,
  .ovr-badge,
  .form-actions {
    grid-column: 1 / -1;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.field strong {
  color: var(--gold);
  font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
  color: #f4f7ef;
  caret-color: #e8c468;
  padding: 0 0.9rem;
  font: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder {
  color: rgba(168, 187, 168, 0.75);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: rgba(232, 196, 104, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 196, 104, 0.15);
}

input[type="text"]:-webkit-autofill,
input[type="email"]:-webkit-autofill,
input[type="password"]:-webkit-autofill {
  -webkit-text-fill-color: #f4f7ef;
  caret-color: #e8c468;
  box-shadow: 0 0 0 1000px #0a1f14 inset;
  transition: background-color 99999s ease-out;
}

select option {
  background: #102418;
  color: var(--ink);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.btn {
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, #f0d28a, var(--gold-deep));
  color: #1a1204;
}

.btn-cta {
  background: linear-gradient(135deg, #7dffb2, #2ecc71 55%, #1a9b55);
  color: #042012;
  padding: 0.95rem 1.4rem;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 30px rgba(46, 204, 113, 0.28);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
}

.btn-ghost.danger:hover:not(:disabled) {
  color: var(--danger);
  border-color: rgba(255, 123, 110, 0.45);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 1rem;
}

.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: min(52vh, 520px);
  overflow: auto;
}

.player-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: slideIn 0.35s ease both;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.player-row:hover:not(.empty-row) {
  border-color: rgba(232, 196, 104, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.player-row.empty-row {
  grid-template-columns: 1fr;
  color: var(--muted);
}

.player-row.is-editing {
  border-color: rgba(232, 196, 104, 0.45);
  background: rgba(232, 196, 104, 0.08);
}

.list-face {
  position: relative;
  width: 48px;
  height: 48px;
}

.list-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: #102418;
  background: linear-gradient(160deg, #f2d78a, #c9962f);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
  object-fit: cover;
}

.list-avatar.has-photo {
  background: #102418;
}

.mini-ovr {
  position: absolute;
  right: -6px;
  bottom: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 0.25rem;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  background: linear-gradient(160deg, #f0d28a, #b8892a);
  border: 1px solid rgba(0, 0, 0, 0.25);
  color: #1a1204;
  line-height: 1;
}

.player-row .name {
  font-weight: 600;
  font-size: 0.98rem;
}

.player-row .pos {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  font-weight: 600;
  line-height: 1.25;
  margin-top: 0.15rem;
}

.pos-pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  background: rgba(125, 255, 178, 0.1);
  color: var(--accent);
}

.row-actions {
  display: flex;
  gap: 0.3rem;
}

.remove-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 0;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  background: rgba(255, 123, 110, 0.12);
  color: var(--danger);
}

.build-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.build-status {
  min-height: 1.4rem;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.build-status.error {
  color: var(--danger);
}

.build-status.ok {
  color: var(--accent);
}

.teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 720px) {
  .teams {
    grid-template-columns: 1fr;
  }
}

.team-board {
  border-radius: 16px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  animation: pop 0.55s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.team-board .team-header {
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

.team-board .pitch {
  border-radius: 0 0 16px 16px;
  overflow: hidden;
}

.team-board[data-team="B"] {
  animation-delay: 0.12s;
}

.team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.team-board[data-team="A"] .team-header {
  background: linear-gradient(90deg, rgba(46, 204, 113, 0.18), transparent);
}

.team-board[data-team="B"] .team-header {
  background: linear-gradient(90deg, rgba(77, 183, 255, 0.18), transparent);
}

.team-label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.team-header h3 {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.04em;
  font-weight: 400;
}

.team-board[data-team="A"] .team-header h3 {
  color: var(--team-a);
}

.team-board[data-team="B"] .team-header h3 {
  color: var(--team-b);
}

.team-meta {
  text-align: right;
}

.team-meta span {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.team-meta strong {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
}

.pitch {
  position: relative;
  min-height: 480px;
  padding: 1rem 0.75rem 8.5rem;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.15), transparent 30%),
    repeating-linear-gradient(
      0deg,
      #176338 0,
      #176338 28px,
      #1a7040 28px,
      #1a7040 56px
    );
}

.pitch::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid var(--pitch-line);
  border-radius: 8px;
  pointer-events: none;
}

.pitch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70px;
  height: 70px;
  border: 2px solid var(--pitch-line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.formation {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 440px;
  display: grid;
  grid-template-rows: 1fr 1fr 1fr 0.85fr;
  gap: 0.45rem;
}

.row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.4rem, 2vw, 1.1rem);
}

.fifa-card {
  width: 108px;
  aspect-ratio: 0.62;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  transform: translateY(8px) scale(0.96);
  opacity: 0;
  animation: cardIn 0.45s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
  isolation: isolate;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.fifa-card:active {
  cursor: grabbing;
}

.fifa-card.dragging {
  opacity: 0.35;
}

.fifa-card.drag-over {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  transform: scale(1.05);
  z-index: 4;
}

.drag-ghost {
  position: fixed;
  z-index: 9999;
  margin: 0;
  pointer-events: none;
  opacity: 0.92;
  transform: scale(1.06) rotate(-3deg);
  animation: none !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
}

.fifa-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 40%);
  pointer-events: none;
  z-index: 2;
}

.fifa-card.team-a {
  background:
    radial-gradient(circle at 70% 20%, rgba(232, 196, 104, 0.35), transparent 45%),
    linear-gradient(160deg, var(--card-a-from), var(--card-a-to));
  border: 1px solid rgba(125, 255, 178, 0.35);
}

.fifa-card.team-b {
  background:
    radial-gradient(circle at 70% 20%, rgba(232, 196, 104, 0.3), transparent 45%),
    linear-gradient(160deg, var(--card-b-from), var(--card-b-to));
  border: 1px solid rgba(77, 183, 255, 0.4);
}

.card-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 0.45rem 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
}

.card-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.card-ovr {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.card-pos {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.1rem;
}

.card-face {
  flex: 1;
  display: grid;
  place-items: center;
  margin: 0.1rem 0;
  min-height: 0;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: #102418;
  background: linear-gradient(160deg, #f2d78a, #c9962f);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
  object-fit: cover;
}

.avatar.has-photo {
  background: #0d2818;
  box-shadow: 0 0 0 2px rgba(232, 196, 104, 0.45);
}

.card-name {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin-bottom: 0.2rem;
}

.card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.12rem 0.15rem;
  padding-top: 0.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.stat-label {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.65);
}

.stat-val {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink);
}

.pitch-corner {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 0.4rem;
  pointer-events: none;
}

.fifa-card.corner-card {
  width: 96px;
  pointer-events: auto;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.fifa-card.corner-card .avatar {
  width: 36px;
  height: 36px;
  font-size: 1.05rem;
}

.fifa-card.corner-card .card-name {
  display: block;
  font-size: 0.62rem;
  line-height: 1.15;
  padding: 0 0.1rem;
}

.fifa-card.corner-card .stat-val {
  font-size: 0.85rem;
}

.footer {
  padding: 0 1.5rem 2rem;
  text-align: center;
  color: rgba(168, 187, 168, 0.7);
  font-size: 0.85rem;
}

body.hide-ovr .card-ovr,
body.hide-ovr .card-stats,
body.hide-ovr .mini-ovr,
body.hide-ovr .team-meta,
body.hide-ovr .player-row .pos {
  visibility: hidden;
}

body.hide-ovr .mini-ovr {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.hide-ovr .card-stats {
  border-top-color: transparent;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 520px) {
  .fifa-card {
    width: 88px;
  }

  .card-ovr {
    font-size: 1.35rem;
  }

  .avatar {
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
  }

  .stat-val {
    font-size: 0.8rem;
  }

  .pitch,
  .formation {
    min-height: 420px;
  }
}

/* Ã¯Â¿Â½Ã¯Â¿Â½ Liga Ã¯Â¿Â½Ã¯Â¿Â½ */
.app-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 1rem clamp(1.25rem, 4vw, 3rem) 0;
  padding-top: max(1rem, env(safe-area-inset-top));
}

.app-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-nav a.is-active,
.app-nav a:hover {
  color: var(--gold);
  border-color: rgba(232, 196, 104, 0.35);
  background: rgba(232, 196, 104, 0.08);
}

.league-wrap {
  display: grid;
  gap: 1.25rem;
  padding: 1rem clamp(1.25rem, 4vw, 3rem) 2.5rem;
}

.league-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 800px) {
  .league-stats-grid {
    grid-template-columns: 1fr;
  }
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  table-layout: auto;
}

.stats-table th,
.stats-table td {
  padding: 0.65rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-table th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-table .name-cell {
  font-weight: 600;
}

.stats-table .pts-cell {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.rounds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.round-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s, transform 0.15s;
}

.round-card:hover {
  border-color: rgba(232, 196, 104, 0.4);
  transform: translateY(-1px);
}

.round-card.played {
  background: linear-gradient(160deg, rgba(46, 204, 113, 0.12), rgba(0, 0, 0, 0.15));
}

.round-num {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.round-score {
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1;
}

.round-score.muted {
  color: var(--muted);
  font-size: 1.2rem;
}

.round-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.leader-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.leader-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.leader-list .leader-name {
  font-weight: 600;
}

.leader-list strong {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.leader-list .empty {
  color: var(--muted);
  border: 0;
}

.score-panel {
  text-align: center;
}

.scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.score-side {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 120px;
}

.score-team {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.score-num {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5rem);
  line-height: 0.9;
}

.score-num.team-a { color: var(--team-a); }
.score-num.team-b { color: var(--team-b); }

.score-x {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--muted);
}

.score-status {
  margin: 0.85rem 0 0;
  color: var(--muted);
}

.back-link {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  text-decoration: underline;
}

/* Login page */
body.is-login {
  min-height: 100vh;
}

body.is-login .pitch-bg {
  background:
    radial-gradient(ellipse 70% 55% at 18% 40%, rgba(46, 204, 113, 0.22), transparent 55%),
    radial-gradient(ellipse 55% 45% at 85% 20%, rgba(232, 196, 104, 0.16), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(77, 183, 255, 0.08), transparent 40%),
    linear-gradient(155deg, #04110a 0%, #0a2416 42%, #06140c 100%);
}

.login-stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(1.5rem, 5vw, 4rem);
  overflow: hidden;
}

.login-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  right: 8%;
  top: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 255, 178, 0.18), transparent 68%);
  filter: blur(8px);
  animation: loginPulse 5.5s ease-in-out infinite;
  pointer-events: none;
}

.login-pitch {
  position: absolute;
  inset: 12% auto 12% 6%;
  width: min(42vw, 520px);
  border: 2px solid rgba(236, 245, 228, 0.14);
  border-radius: 18px;
  opacity: 0.55;
  pointer-events: none;
  animation: loginRise 0.9s ease both;
}

.pitch-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 120px;
  border: 2px solid rgba(236, 245, 228, 0.18);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.pitch-line {
  position: absolute;
  background: rgba(236, 245, 228, 0.14);
}

.pitch-line-h {
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
}

.pitch-line-v {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
}

.login-hero {
  position: relative;
  z-index: 1;
  max-width: 560px;
  animation: loginRise 0.7s ease both;
}

.login-kicker {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.login-brand {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  line-height: 0.88;
}

.login-brand-main {
  font-family: var(--font-display);
  font-size: clamp(4.8rem, 14vw, 8.5rem);
  letter-spacing: 0.04em;
  color: var(--ink);
  text-shadow: 0 0 50px rgba(125, 255, 178, 0.22);
}

.login-brand-fc {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: 0.12em;
  color: var(--gold);
}

.login-lead {
  margin: 1.1rem 0 0;
  max-width: 34ch;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.45;
  color: var(--muted);
  font-weight: 500;
}

.login-bullets {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.login-bullets li {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 255, 178, 0.22);
  background: rgba(125, 255, 178, 0.07);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.login-card {
  position: relative;
  z-index: 2;
  width: min(100%, 420px);
  justify-self: end;
  padding: 1.6rem 1.45rem 1.35rem;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(14, 42, 26, 0.92), rgba(6, 20, 12, 0.94));
  border: 1px solid rgba(232, 196, 104, 0.28);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  animation: loginRise 0.85s ease 0.08s both;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(232, 196, 104, 0.12), transparent 35%);
}

.login-card-head {
  position: relative;
  margin-bottom: 1.15rem;
}

.login-card-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: 0.05em;
  font-weight: 400;
}

.login-card-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.login-form .field span {
  color: rgba(232, 196, 104, 0.85);
}

.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"] {
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: #f4f7ef;
  -webkit-text-fill-color: #f4f7ef;
  caret-color: #e8c468;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.login-form input[type="text"]:focus,
.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus {
  border-color: rgba(232, 196, 104, 0.65);
  box-shadow: 0 0 0 4px rgba(232, 196, 104, 0.14);
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
}

.remember-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
}

.login-submit {
  width: 100%;
  margin-top: 0.25rem;
  height: 54px;
  font-size: 1.05rem;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(46, 204, 113, 0.28);
}

.login-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.login-hint {
  position: relative;
  margin: 1.1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: center;
}

.login-hint strong {
  color: var(--gold);
}

.nav-logout {
  margin-left: auto;
}

.nav-logout .btn {
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
}

@keyframes loginRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loginPulse {
  0%, 100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.08);
  }
}

@media (max-width: 900px) {
  .login-stage {
    grid-template-columns: 1fr;
    align-content: center;
    padding-top: 2rem;
    padding-bottom: 2.5rem;
  }

  .login-pitch {
    display: none;
  }

  .login-hero {
    max-width: none;
    text-align: center;
  }

  .login-brand {
    justify-content: center;
  }

  .login-lead {
    margin-inline: auto;
  }

  .login-bullets {
    justify-content: center;
  }

  .login-card {
    justify-self: center;
    width: min(100%, 440px);
  }

  .login-glow {
    right: 50%;
    transform: translateX(50%);
    top: 8%;
  }
}

/* Pending / admin users / player dashboard */
.invite-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding-top: 2.5rem;
}

.invite-title {
  margin: 0.35rem 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  letter-spacing: 0.04em;
  line-height: 0.95;
}

.invite-cta {
  width: 100%;
  margin-top: 0.5rem;
  height: 52px;
  border-radius: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.invite-share-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.invite-link-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  padding: 0 0.85rem;
  font: inherit;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .invite-share-row {
    flex-direction: column;
    align-items: stretch;
  }

  .invite-share-row .btn {
    width: 100%;
  }
}

.pending-copy {
  margin: 0 0 0.85rem;
  color: var(--ink);
  line-height: 1.55;
  font-size: 1.02rem;
}

.pending-copy.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.pending-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(220px, 2fr) auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-user-row:last-child {
  border-bottom: 0;
}

.admin-approve-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.admin-approve-form select {
  min-width: 180px;
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.btn.danger {
  color: #ff8e8e;
  border-color: rgba(255, 100, 100, 0.35);
}

.player-hero-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  position: relative;
}

.player-photo-block {
  flex-shrink: 0;
}

.player-photo-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: block;
  line-height: 0;
}

.player-photo-trigger .player-hero-avatar {
  transition: transform 0.15s, border-color 0.15s;
}

.player-photo-trigger:hover .player-hero-avatar,
.player-photo-trigger:focus-visible .player-hero-avatar {
  transform: scale(1.03);
  border-color: var(--gold);
}

.player-photo-form {
  margin: 0;
}

.player-photo-sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  align-items: end;
}

.player-photo-sheet[hidden] {
  display: none !important;
}

.player-photo-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.player-photo-sheet-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.3rem;
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 0.7rem 0.75rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  border-radius: 14px 14px 0 0;
  background: color-mix(in srgb, var(--panel, #152018) 96%, #000);
  border-top: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
}

.player-photo-sheet-title {
  margin: 0 0 0.1rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--text, #eee) 70%, transparent);
}

.player-photo-sheet-btn {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  color: var(--gold);
  cursor: pointer;
}

.player-photo-sheet-btn-danger {
  color: #ff8f8f;
  border-color: color-mix(in srgb, #ff8f8f 45%, transparent);
  background: color-mix(in srgb, #ff8f8f 10%, transparent);
}

.player-photo-sheet-btn-cancel {
  margin-top: 0.05rem;
  color: color-mix(in srgb, var(--text, #eee) 80%, transparent);
  border-color: color-mix(in srgb, var(--text, #eee) 18%, transparent);
  background: transparent;
}

body.photo-sheet-open {
  overflow: hidden;
}

.player-hero-panel {
  text-align: left;
}

.player-hero-avatar {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1a3d2a, #0d1f16);
  border: 2px solid rgba(212, 175, 55, 0.45);
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.8rem;
  color: var(--gold);
  overflow: hidden;
  flex-shrink: 0;
}

.player-hero-avatar.has-photo {
  object-fit: cover;
}

.player-hero-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  letter-spacing: 0.04em;
  line-height: 0.95;
  color: var(--ink);
  text-align: left;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.player-hero-pos {
  font-size: 0.55em;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.player-greeting {
  margin: 0.25rem 0 0;
}

.player-topbar {
  padding-bottom: 0;
}

.player-brand .brand-mark {
  font-size: clamp(2.6rem, 10vw, 4.4rem);
}

.player-hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
  justify-content: center;
  flex: 1;
  text-align: left;
}

.player-hero-rankline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.player-stars {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  margin-top: 0.15rem;
}

.player-stars-row {
  display: inline-flex;
  gap: 0.12rem;
}

.star-slot {
  position: relative;
  width: 1.15rem;
  height: 1.15rem;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-block;
}

.star-empty,
.star-fill {
  position: absolute;
  left: 0;
  top: 0;
}

.star-empty {
  color: rgba(255, 255, 255, 0.18);
}

.star-fill {
  color: var(--gold);
  overflow: hidden;
  white-space: nowrap;
}

.player-stars-value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  line-height: 1;
}

.player-stars-delta {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.player-stars-delta.up,
.star-delta-cell.up {
  color: var(--accent);
}

.player-stars-delta.down,
.star-delta-cell.down {
  color: var(--danger);
}

.star-delta-cell {
  font-weight: 700;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
}

.achievements-shelf {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  padding-bottom: 0;
  margin-bottom: 0.85rem;
  max-width: 100%;
  overflow: visible;
}

.achievement-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
  width: 100%;
  min-width: 0;
  padding: 0.75rem 0.35rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
}

.achievement-tile.is-unlocked {
  border-color: rgba(232, 196, 104, 0.4);
  background: linear-gradient(160deg, rgba(232, 196, 104, 0.16), rgba(0, 0, 0, 0.28));
}

.achievement-tile.is-locked {
  opacity: 0.45;
  filter: grayscale(0.85);
}

.achievement-tile strong {
  font-size: 0.78rem;
  line-height: 1.25;
  font-weight: 700;
}

.achievements-open-btn {
  width: 100%;
}

.achievements-full {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.achievements-full[hidden] {
  display: none !important;
}

.achievements-full-head {
  margin-bottom: 0.85rem;
}

.achievements-full-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.achievement-card {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
  min-height: 84px;
}

.achievement-card.is-locked {
  opacity: 0.42;
  filter: grayscale(0.85);
}

.achievement-card.is-unlocked {
  border-color: rgba(232, 196, 104, 0.35);
  background: linear-gradient(145deg, rgba(232, 196, 104, 0.12), rgba(0, 0, 0, 0.28));
}

.achievement-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(232, 196, 104, 0.16);
  color: var(--gold);
}

.achievement-icon svg {
  width: 22px;
  height: 22px;
}

.achievement-card strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.achievement-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(232, 196, 104, 0.16);
  border: 1px solid rgba(232, 196, 104, 0.4);
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.muted-line {
  color: var(--muted);
  font-size: 0.92rem;
}

.player-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 0.85rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-chip-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stat-chip-icon svg {
  width: 24px;
  height: 24px;
}

.stat-chip > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.stat-chip span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.stat-chip strong {
  font-family: var(--font-display);
  font-size: 1.85rem;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--gold);
}

.stat-chip-games .stat-chip-icon {
  background: rgba(244, 247, 239, 0.1);
  color: var(--ink);
}

.stat-chip-win .stat-chip-icon {
  background: rgba(232, 196, 104, 0.18);
  color: var(--gold);
}

.stat-chip-goal .stat-chip-icon {
  background: rgba(125, 255, 178, 0.14);
  color: var(--accent);
}

.stat-chip-assist .stat-chip-icon {
  background: rgba(77, 183, 255, 0.16);
  color: var(--team-b);
}

.player-stat-grid,
.player-skills-mini {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
}

.player-stat-grid > div,
.player-skills-mini > div {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem 0.6rem;
  text-align: center;
}

.player-stat-grid span,
.player-skills-mini span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.player-stat-grid strong,
.player-skills-mini strong {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.55rem;
  letter-spacing: 0.03em;
  color: var(--gold);
}

@media (max-width: 720px) {
  .admin-user-row {
    grid-template-columns: 1fr;
  }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  body {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }

  body.is-login {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .app-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 0;
    margin: 0;
    padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom));
    background: rgba(4, 16, 10, 0.94);
    border-top: 1px solid rgba(232, 196, 104, 0.22);
    backdrop-filter: blur(14px);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
  }

  .app-nav a {
    flex-direction: column;
    gap: 0.1rem;
    min-height: 52px;
    padding: 0.4rem 0.2rem;
    border-radius: 12px;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    border: none;
  }

  .app-nav a.is-active,
  .app-nav a:hover {
    background: rgba(232, 196, 104, 0.14);
    border-color: transparent;
  }

  .nav-logout {
    margin-left: 0;
  }

  .nav-logout .btn {
    width: 100%;
    min-height: 52px;
    padding: 0.35rem 0.2rem;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
    border: none;
    border-radius: 12px;
  }

  .topbar {
    padding: 1rem 1rem 0.35rem;
  }

  .brand-mark {
    font-size: clamp(2.8rem, 14vw, 4.2rem);
  }

  .brand-sub {
    font-size: clamp(1.35rem, 6vw, 1.9rem);
  }

  .tagline {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .layout,
  .league-wrap {
    padding: 0.75rem 1rem 1.25rem;
    gap: 1rem;
  }

  .panel {
    padding: 1rem;
    border-radius: 16px;
  }

  .panel-head h2 {
    font-size: 1.55rem;
  }

  .panel-head-actions {
    width: 100%;
  }

  .panel-head-actions .btn,
  .btn-new-player {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  .btn,
  .btn-primary,
  .btn-cta,
  .btn-ghost {
    min-height: 44px;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px; /* evita zoom no iOS */
  }

  .login-stage {
    min-height: 100dvh;
    padding: 1.25rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
    gap: 1.25rem;
    align-content: start;
  }

  .login-hero {
    order: 0;
  }

  .login-card {
    order: 1;
    width: 100%;
    max-width: none;
    padding: 1.15rem 1rem 1.25rem;
  }

  .login-brand-main {
    font-size: clamp(3.4rem, 18vw, 5rem);
  }

  .login-brand-fc {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
  }

  .login-lead {
    font-size: 0.98rem;
    max-width: 28ch;
  }

  .login-bullets {
    display: none;
  }

  .login-form input[type="text"],
  .login-form input[type="email"],
  .login-form input[type="password"] {
    height: 48px;
    font-size: 16px;
  }

  .login-submit {
    height: 50px;
  }
}

.you-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(125, 255, 178, 0.14);
  border: 1px solid rgba(125, 255, 178, 0.35);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-back-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  margin-bottom: 0.35rem;
}

.players-directory {
  display: grid;
  gap: 0.7rem;
}

.player-dir-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.player-dir-card:hover {
  border-color: rgba(232, 196, 104, 0.4);
  background: rgba(232, 196, 104, 0.08);
  transform: translateY(-1px);
}

.player-dir-card.is-you {
  border-color: rgba(125, 255, 178, 0.35);
}

.player-dir-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1a3d2a, #0d1f16);
  border: 2px solid rgba(212, 175, 55, 0.4);
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold);
  overflow: hidden;
  flex-shrink: 0;
}

.player-dir-avatar.has-photo {
  object-fit: cover;
}

.player-dir-meta {
  min-width: 0;
  flex: 1;
}

.player-dir-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.55rem;
  margin-bottom: 0.3rem;
}

.player-dir-top strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  font-weight: 400;
}

.player-dir-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  margin-bottom: 0.35rem;
}

.star-slot-sm {
  width: 0.95rem;
  height: 0.95rem;
  font-size: 0.95rem;
}

.player-dir-stars-value {
  margin-left: 0.35rem;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.88rem;
}

.player-dir-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.pending-panel {
  max-width: 560px;
  margin: 3rem auto;
}

.profile-stats-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
}

.profile-stats-strip > div {
  text-align: center;
  padding: 0.55rem 0.2rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-stats-strip span {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.profile-stats-strip strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold);
  letter-spacing: 0.02em;
  line-height: 1;
}

.profile-stats-panel .panel-head {
  display: none;
}

@media (max-width: 768px) {
  .player-wrap.league-wrap,
  .league-wrap.player-wrap {
    padding: 0.7rem 0.75rem 1rem;
    gap: 0.7rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: clip;
  }

  .player-wrap .panel {
    padding: 0.8rem 0.75rem;
    border-radius: 16px;
    max-width: 100%;
    overflow: visible;
    box-sizing: border-box;
  }

  .league-wrap .panel:has(.table-scroll),
  .player-wrap .panel:has(.table-scroll) {
    overflow: visible;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .league-wrap .table-scroll,
  .player-wrap .table-scroll,
  .table-scroll {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: visible;
    padding-bottom: 0;
    margin-inline: 0;
  }

  /* Tabelas: cabem na tela sem zoom */
  .league-wrap .stats-table,
  .player-wrap .stats-table,
  .stats-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 0.72rem;
  }

  .league-wrap .stats-table th,
  .league-wrap .stats-table td,
  .player-wrap .stats-table th,
  .player-wrap .stats-table td,
  .stats-table th,
  .stats-table td {
    padding: 0.4rem 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .league-wrap .stats-table th:nth-child(1),
  .league-wrap .stats-table td:nth-child(1) {
    width: 1.4rem;
  }

  .league-wrap .stats-table th:nth-child(2),
  .league-wrap .stats-table td:nth-child(2) {
    width: auto;
  }

  .league-wrap .stats-table th:nth-child(n+3),
  .league-wrap .stats-table td:nth-child(n+3) {
    width: 2rem;
    text-align: center;
  }

  .league-wrap .stats-table th:nth-child(7),
  .league-wrap .stats-table td:nth-child(7),
  .league-wrap .stats-table th:nth-child(8),
  .league-wrap .stats-table td:nth-child(8) {
    width: 2.4rem;
  }

  .league-wrap .stats-table th:nth-child(9),
  .league-wrap .stats-table td:nth-child(9) {
    width: 2.6rem;
  }

  .league-wrap .stats-table .pts-cell,
  .player-wrap .stats-table .pts-cell {
    font-size: 1.05rem;
  }

  .league-wrap .stats-table .name-cell,
  .player-wrap .stats-table .name-cell {
    font-size: 0.78rem;
  }

  /* Histórico do jogador: 7 colunas */
  .player-wrap .stats-table th:nth-child(1),
  .player-wrap .stats-table td:nth-child(1) {
    width: 1.6rem;
  }

  .player-wrap .stats-table th:nth-child(2),
  .player-wrap .stats-table td:nth-child(2) {
    width: auto;
  }

  .player-wrap .stats-table th:nth-child(3),
  .player-wrap .stats-table td:nth-child(3) {
    width: 3.2rem;
    text-align: center;
  }

  .player-wrap .stats-table th:nth-child(n+4),
  .player-wrap .stats-table td:nth-child(n+4) {
    width: 2.1rem;
    text-align: center;
  }

  .league-wrap .panel-head .count {
    font-size: 0.72rem;
  }

  .player-wrap .panel-head {
    margin-bottom: 0.65rem;
  }

  .player-wrap .panel-head h2 {
    font-size: 1.4rem;
  }

  .player-hero-card {
    gap: 0.7rem;
  }

  .player-hero-avatar {
    width: 60px;
    height: 60px;
    font-size: 1.25rem;
    border-radius: 13px;
  }

  .player-hero-name {
    font-size: clamp(1.65rem, 6.5vw, 2.1rem);
  }

  .player-hero-meta {
    gap: 0.3rem;
    min-width: 0;
  }

  .player-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .stat-chip {
    flex-direction: row;
    align-items: center;
    padding: 0.65rem 0.55rem;
    gap: 0.5rem;
    min-width: 0;
  }

  .stat-chip-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  .stat-chip strong {
    font-size: 1.35rem;
  }

  .stat-chip span {
    font-size: 0.66rem;
  }

  .player-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .player-stat-grid > div {
    padding: 0.6rem 0.4rem;
  }

  .player-stat-grid strong {
    font-size: 1.3rem;
  }

  .achievements-shelf {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.65rem;
  }

  .achievement-tile {
    padding: 0.55rem 0.25rem;
    gap: 0.3rem;
  }

  .achievement-tile strong {
    font-size: 0.62rem;
    line-height: 1.2;
  }

  .achievement-icon {
    width: 30px;
    height: 30px;
  }

  .achievement-icon svg {
    width: 16px;
    height: 16px;
  }

  .achievements-open-btn {
    min-height: 42px;
    font-size: 0.9rem;
  }

  .player-stars-value {
    font-size: 1.25rem;
  }

  .star-slot {
    width: 1rem;
    height: 1rem;
    font-size: 1rem;
  }

  .player-wrap .table-scroll {
    max-width: 100%;
    overflow-x: visible;
  }

  .topbar {
    padding: 0.75rem 0.85rem 0.25rem;
  }

  .brand-mark {
    font-size: clamp(2.4rem, 11vw, 3.6rem);
  }

  .brand-sub {
    font-size: clamp(1.2rem, 5vw, 1.7rem);
  }

  .tagline {
    font-size: 0.88rem;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
  }

  .admin-approve-form {
    width: 100%;
  }

  .admin-approve-form select,
  .admin-approve-form .btn,
  .admin-user-row .btn {
    width: 100%;
    min-height: 44px;
  }

  .rounds-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fifa-card {
    width: 78px;
  }

  .pitch,
  .formation {
    min-height: 380px;
  }

  .photo-row {
    flex-wrap: wrap;
  }

  .players-directory,
  .player-dir-card,
  .league-wrap,
  .layout {
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 420px) {
  .rounds-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-kicker {
    font-size: 0.72rem;
  }

  .app-nav a,
  .nav-logout .btn {
    font-size: 0.62rem;
  }
}

.activity-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto auto;
  gap: 0.75rem;
  align-items: end;
}

.activity-filters input[type="date"] {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  padding: 0 0.9rem;
  font: inherit;
  color-scheme: dark;
}

.activity-table small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  white-space: nowrap;
}

.activity-table code {
  color: var(--accent);
  white-space: nowrap;
}

.activity-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  color: var(--muted);
}

.activity-pagination .is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

@media (max-width: 980px) {
  .activity-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .activity-filters {
    grid-template-columns: 1fr;
  }
}
