:root {
  --bg-1: #031026;
  --bg-2: #0a2d5b;
  --bg-3: #0e4f83;
  --card: rgba(7, 23, 47, 0.84);
  --card-soft: rgba(10, 31, 60, 0.7);
  --line: rgba(163, 200, 237, 0.25);
  --text: #e8f4ff;
  --muted: #a7c3df;
  --accent: #07d07a;
  --accent-2: #f4bf45;
  --danger: #ff8181;
  --ok: #98f3bf;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Cairo", "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(1300px 520px at 10% -15%, rgba(7, 208, 122, 0.2), transparent 55%),
    radial-gradient(1200px 480px at 90% -10%, rgba(244, 191, 69, 0.14), transparent 55%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2) 48%, var(--bg-3));
  overflow-x: hidden;
}

.bg-pitch {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0,
    rgba(255, 255, 255, 0.06) 1px,
    transparent 1px,
    transparent 70px
  );
}

.ball {
  position: fixed;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  filter: blur(0.3px);
  pointer-events: none;
  opacity: 0.24;
  animation: drift 12s ease-in-out infinite;
}

.ball-1 {
  top: -40px;
  left: -52px;
}

.ball-2 {
  bottom: -56px;
  right: -56px;
  animation-delay: -3.5s;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(0, -16px, 0) rotate(9deg);
  }
}

.app-shell {
  position: relative;
  z-index: 2;
  width: min(940px, 94vw);
  margin: 16px auto 32px;
}

.hero-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(140deg, rgba(4, 16, 34, 0.95), rgba(12, 47, 89, 0.72));
  padding: 16px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
}

.hero-head h1 {
  margin: 0 0 8px;
  font-size: clamp(23px, 4vw, 35px);
}

.hero-head p {
  margin: 0;
  line-height: 1.58;
  color: var(--muted);
}

.hero-badge {
  margin: 0 0 8px;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
}

.hero-status {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  background: rgba(6, 20, 40, 0.72);
}

.matches-wrap {
  margin-top: 14px;
}

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

.match-card {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
  box-shadow: 0 11px 30px rgba(0, 0, 0, 0.24);
  padding: 14px;
  animation: fade-up 0.34s ease both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.match-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

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

.match-prize {
  border: 1px solid rgba(244, 191, 69, 0.4);
  border-radius: 10px;
  padding: 6px 11px;
  font-weight: 800;
  background: linear-gradient(120deg, rgba(244, 191, 69, 0.18), rgba(7, 208, 122, 0.18));
  position: relative;
  overflow: hidden;
}

.match-prize::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.24), transparent);
  animation: shine 2.1s linear infinite;
}

@keyframes shine {
  to {
    transform: translateX(100%);
  }
}

.teams {
  margin-top: 10px;
  font-weight: 800;
  font-size: clamp(17px, 3vw, 24px);
}

.meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-main,
.btn-ghost {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
  font-size: 15px;
}

.btn-main {
  color: #032517;
  background: linear-gradient(130deg, #0ed27d, #07ad67);
}

.btn-main:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-ghost {
  color: #d6eaff;
  background: #2a4462;
}

.tag {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  border: 1px solid var(--line);
}

.tag-ok {
  color: var(--ok);
  border-color: rgba(13, 215, 128, 0.45);
}

.tag-locked {
  color: #ffc7c7;
  border-color: rgba(255, 129, 129, 0.45);
}

.hidden {
  display: none !important;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

.flash-msg {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 11px 12px;
  font-weight: 700;
}

.flash-ok {
  color: var(--ok);
  border-color: rgba(13, 215, 128, 0.45);
}

.flash-err {
  color: #ffc7c7;
  border-color: rgba(255, 129, 129, 0.45);
}

.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 8, 16, 0.76);
}

.modal-card {
  position: relative;
  width: min(500px, calc(100vw - 20px));
  margin: min(14vh, 95px) auto 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(4, 16, 34, 0.98), rgba(12, 47, 89, 0.95));
  padding: 15px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.34);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-head h2 {
  margin: 0;
  font-size: 22px;
}

.icon-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

.modal-meta {
  margin: 8px 0 0;
  color: var(--muted);
}

.score-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}

.score-side {
  display: grid;
  gap: 7px;
}

.team-chip {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 28, 56, 0.9);
  color: #bfd7ef;
  padding: 7px 10px;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-sep {
  font-size: 24px;
  font-weight: 800;
  color: #d8ebff;
}

select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 29, 57, 0.92);
  color: var(--text);
  padding: 10px;
  font-size: 17px;
}

.modal-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}

.section-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.history-wrap {
  margin-top: 14px;
}

.history-list {
  display: grid;
  gap: 9px;
}

.history-card {
  border: 1px solid rgba(163, 200, 237, 0.24);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(8, 27, 52, 0.9), rgba(11, 39, 70, 0.82));
  padding: 12px;
}

.history-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.history-teams {
  font-weight: 800;
}

.history-status {
  border: 1px solid rgba(244, 191, 69, 0.35);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  color: #ffe6ab;
  background: rgba(35, 44, 62, 0.55);
}

.history-meta {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.history-final {
  color: #ffe2ad;
  font-weight: 700;
}

.meta-result {
  color: #ffe2ad;
  font-weight: 700;
}

.pred-log {
  margin-top: 12px;
  border-top: 1px dashed rgba(163, 200, 237, 0.26);
  padding-top: 10px;
}

.pred-log-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.pred-log-title {
  font-size: 13px;
  font-weight: 700;
  color: #dff0ff;
}

.pred-log-count {
  font-size: 12px;
  color: #bfdbf3;
}

.pred-log-empty {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.pred-log-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.pred-log-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(163, 200, 237, 0.2);
  border-radius: 10px;
  padding: 7px 9px;
  background: rgba(7, 24, 45, 0.5);
}

.pred-log-player {
  font-size: 12px;
  color: #dff1ff;
}

.pred-log-score {
  font-weight: 800;
  font-size: 13px;
  color: #ffffff;
}

.pred-log-status {
  font-size: 12px;
  color: #ffe6ab;
}

.pred-log-you {
  justify-self: end;
  border: 1px solid rgba(7, 208, 122, 0.45);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--ok);
  background: rgba(6, 44, 29, 0.4);
}

@media (max-width: 560px) {
  .app-shell {
    width: 95vw;
  }

  .match-prize {
    font-size: 13px;
  }

  .teams {
    font-size: 19px;
  }

  .modal-card {
    margin-top: 12vh;
  }

  .pred-log-row {
    grid-template-columns: 1fr auto;
  }

  .pred-log-status {
    grid-column: span 2;
  }
}
