:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --card: rgba(255, 255, 255, 0.05);
  --card-strong: rgba(255, 255, 255, 0.12);
  --text: #f7f7f7;
  --muted: #d4d4d4;
  --accent: #e10600;
  --accent-2: #ffffff;
  --success: #53e38d;
  --danger: #ff8c8c;
  --slot-size: clamp(68px, 16vw, 88px);
  font-family: "Trebuchet MS", "Gill Sans", "Futura", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 30% 20%, rgba(225, 6, 0, 0.18) 0, transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.12) 0, transparent 24%),
    linear-gradient(145deg, var(--bg), var(--bg-2));
  padding: 24px;
}

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

p {
  margin: 0 0 8px;
  color: var(--muted);
}

a {
  color: var(--accent);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
}

.pill strong {
  color: var(--text);
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 60px rgba(0, 0, 0, 0.25);
  margin-bottom: 12px;
}

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

.field {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    repeating-radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.06) 0 1px, transparent 3px),
    repeating-radial-gradient(circle at 80% 60%, rgba(0, 0, 0, 0.08) 0 1.2px, transparent 3px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.12)),
    #b2903b;
  border: 2px solid #d7c07a;
  border-radius: 16px;
  padding: 12px;
  min-height: 420px;
  aspect-ratio: 3 / 2.2;
  overflow: hidden;
  max-width: 760px;
  margin: 0 auto;
}

.field-title {
  text-align: center;
  margin: 18px 0 28px;
  color: #fff4d0;
  letter-spacing: 0.6px;
}

.field::before,
.field::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  pointer-events: none;
  z-index: 0;
}

.field::after {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  inset: auto;
  top: calc(50% - 55px);
  left: calc(50% - 55px);
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 1px, transparent 4px);
  z-index: 0;
}

.field-watermark {
  position: absolute;
  width: 120px;
  height: 120px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  opacity: 0.60;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  transform: translate(-50%, -50%);
}

.field-watermark.left {
  /* same sizing, position via left/top inline */
}
.positions {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
  padding: 12px 10px 10px;
  z-index: 2;
  height: 100%;
  width: 100%;
  align-items: center;
}

.position {
  cursor: pointer;
  border-radius: 16px;
  padding: 6px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  background: transparent;
}

.position.active {
  transform: translateY(-2px);
}

.position.active .slot {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 8px 22px rgba(0, 0, 0, 0.4);
}

.slot {
  width: var(--slot-size);
  height: var(--slot-size);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f0cc72, #c79a34);
  border: 3px dashed rgba(255, 255, 255, 0.85);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}

.slot.filled {
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.75),
    0 0 16px rgba(0, 0, 0, 0.7),
    0 0 32px rgba(246, 207, 94, 0.72),
    0 0 60px rgba(246, 207, 94, 0.55);
}

.slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0%;
  display: block;
}

.slot.empty {
  color: #fff;
  font-size: 30px;
  font-weight: 800;
}

.slot-badge {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translate(-50%, 50%);
  background: #59441c;
  color: #f8f0dc;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.slot-name {
  margin-top: 10px;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.slot-placeholder {
  margin-top: 6px;
  color: #f0e5c1;
  font-weight: 600;
}

.pos-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.avatar.stacked {
  display: grid;
  place-items: center;
  gap: 4px;
}

.avatar-note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 14px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 15px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
}

.row {
  display: flex;
  gap: 10px;
}

.row > * {
  flex: 1;
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  cursor: pointer;
  color: #0a0a0a;
  background: linear-gradient(120deg, var(--accent), #ff3b30);
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

button.disabled,
button:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.submit-ready {
  background: linear-gradient(120deg, #22c55e, #16a34a) !important;
  color: #0a0a0a !important;
}

.fullwidth {
  width: 100%;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.list-item.mvp {
  background: linear-gradient(135deg, rgba(240, 204, 114, 0.25), rgba(199, 154, 52, 0.5));
  border-color: rgba(240, 204, 114, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 24px rgba(240, 204, 114, 0.35);
}

.list-item.mvp .avatar {
  border: 2px solid rgba(240, 204, 114, 0.8);
  box-shadow: 0 0 12px rgba(240, 204, 114, 0.4);
}

.mvp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  margin-left: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f0cc72, #c79a34);
  color: #0a0a0a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  vertical-align: middle;
}

.mvp-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
}

.status.open {
  color: var(--success);
}

.status.closed {
  color: var(--danger);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.table th,
.table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  font-size: 14px;
}

.hint {
  font-size: 13px;
  color: var(--muted);
}

.share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: var(--muted);
}

.hidden {
  display: none;
}

.hint-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  z-index: 200;
  max-width: 280px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.hint-box.show {
  opacity: 1;
  pointer-events: auto;
}

.modal.hidden {
  display: none !important;
}

.share-block {
  margin-top: 12px;
}

.submit-card {
  margin-top: 16px;
}

.player-list,
#playerEditModal {
  z-index: 600;
}

.squad {
  margin-top: 8px;
  padding: 8px 0;
}

.squad .hint {
  padding: 8px 0;
}

.squad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.squad-card {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.squad-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill-number {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 12px;
}

button.danger {
  background: rgba(255, 0, 0, 0.18);
  color: #fff;
}
button.danger:hover {
  background: rgba(255, 0, 0, 0.25);
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
}

.modal-card {
  max-width: 440px;
  width: min(440px, 92vw);
  max-height: 90vh;
  overflow: auto;
  position: relative;
  z-index: 510;
}

.modal.show {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #e10600;
  color: transparent;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
}

.modal-close:hover {
  transform: scale(1.03);
}

.modal-close::before,
.modal-close::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}

.modal-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.submission-card {
  max-width: 540px;
}

.submission-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.summary-card .avatar {
  width: 44px;
  height: 44px;
}

.summary-teamlogo {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.summary-teamlogo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.summary-teamlogo.placeholder {
  opacity: 0.4;
}
.sponsor-block {
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}

.sponsor-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sponsor-tile {
  height: 80px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sponsor-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sponsor-tile span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 0 8px;
}

.warning {
  color: var(--danger);
  font-weight: 700;
}

.edit-hint {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

.pill.team-label {
  display: inline-block;
  margin-bottom: 8px;
}

select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 16px;
}

select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 6px;
  margin: 8px 0 12px;
  padding: 6px;
}

.team-tile {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.team-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-tile .team-name {
  display: none;
}

.team-tile.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(225, 6, 0, 0.3);
}

.select-like {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.select-caret {
  font-size: 14px;
  opacity: 0.8;
}

.player-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.player-card {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s, background 0.2s;
}

.player-card:hover {
  border-color: var(--accent);
  background: rgba(225, 6, 0, 0.1);
}

.player-card .avatar {
  width: 46px;
  height: 46px;
}

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

.sponsor-slot {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sponsor-preview {
  height: 120px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.sponsor-preview.small {
  height: 72px;
  width: 140px;
}

.sponsor-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.sponsor-crop label {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  body {
    padding: 12px;
  }
  .card {
    padding: 14px;
    margin-bottom: 14px;
  }
  .field {
    max-width: 100%;
    width: 100%;
    aspect-ratio: auto;
    min-height: 700px;
    padding: 22px;
  }
  .submit-card {
    margin-top: 18px;
  }
  .positions {
    gap: 14px;
    padding: 18px 10px 14px;
  }
  :root {
    --slot-size: clamp(96px, 26vw, 124px);
  }
  .slot-name,
  .slot-placeholder {
    font-size: 14px;
  }
  .modal-card {
    max-width: 100%;
    margin: 0 8px;
  }
  .row {
    flex-direction: column;
  }
  .share {
    flex-direction: column;
    align-items: flex-start;
  }
  .team-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
    padding: 4px;
  }
}

@media (max-width: 720px) {
  body {
    padding: 16px;
  }
  .row {
    flex-direction: column;
  }
  .positions {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .admin .header {
    align-items: flex-start;
  }
  .admin .list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .admin .list-item > div:last-child {
    width: 100%;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
  .admin .list-item button {
    width: 100%;
  }
  .admin .squad-grid {
    grid-template-columns: 1fr;
  }
  .admin .table-wrapper {
    margin: 0 -6px;
    padding: 0 6px 4px;
  }
  .admin .table {
    min-width: 520px;
  }
  .submission-summary {
    grid-template-columns: 1fr;
  }
  .sponsor-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .sponsor-tile {
    height: 60px;
  }
  .sponsor-admin-grid {
    grid-template-columns: 1fr;
  }
}
