* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  min-height: 100vh;
  background:
    linear-gradient(rgba(7, 13, 26, 0.58), rgba(7, 13, 26, 0.78)),
    url("assets/worldcup-2026-bg.png") center top / cover fixed;
  color: #222;
}

body.modal-open {
  overflow: hidden;
}

.icon-sprite {
  display: none;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px;
}

h1 {
  text-align: center;
  margin: 10px 0 32px;
  color: white;
  font-size: 48px;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.page-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.title-icon {
  width: 58px;
  height: 58px;
  color: #7dd3fc;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

.card {
  background: rgba(255, 255, 255, 0.93);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
}

.card h2 {
  margin-top: 0;
}

.section-title,
.modal-header h2,
button,
.ranking-player,
.ranking-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-title .icon {
  color: #0f766e;
}

input,
select {
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
}

select:disabled {
  background: #eef2f7;
  color: #374151;
  cursor: not-allowed;
}

.match {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #e2e8f0;
}

.team {
  font-weight: bold;
}

.team-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.team-flag {
  width: 22px;
  flex: 0 0 22px;
  font-size: 17px;
  line-height: 1;
  text-align: center;
}

.score-input {
  width: 60px;
}

button {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: #0f766e;
  color: white;
  cursor: pointer;
}

button:hover {
  background: #115e59;
}

.ranking-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.ranking-player,
.ranking-action {
  min-width: 0;
}

.ranking-player .icon {
  color: #0f766e;
}

.ranking-player strong {
  overflow-wrap: anywhere;
}

.ranking-action {
  color: #475569;
  flex: 0 0 auto;
}

.ranking-button {
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.ranking-button:hover,
.ranking-button:focus-visible {
  background: rgba(15, 118, 110, 0.08);
  outline: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 13, 26, 0.72);
  z-index: 10;
}

.modal[hidden] {
  display: none;
}

.modal-dialog {
  width: min(720px, 100%);
  max-height: min(80vh, 720px);
  overflow: auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.modal-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-header h2 .icon {
  color: #0f766e;
}

.modal-close {
  flex: 0 0 auto;
}

#predictions-modal-body {
  padding: 16px 24px 24px;
}

.prediction-list {
  display: grid;
}

.prediction-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
}

.prediction-match {
  display: grid;
  gap: 4px;
}

.prediction-match span {
  color: #64748b;
  font-size: 13px;
}

.prediction-score {
  flex: 0 0 auto;
  font-weight: bold;
}

.prediction-teams {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

@media (max-width: 600px) {
  body {
    background-attachment: scroll;
  }

  h1 {
    font-size: 34px;
  }

  .title-icon {
    width: 46px;
    height: 46px;
  }

  .match {
    grid-template-columns: 1fr;
  }

  .ranking-row,
  .prediction-row {
    align-items: flex-start;
  }

  .ranking-action {
    white-space: nowrap;
  }

  .modal {
    padding: 12px;
  }

  .modal-header,
  #predictions-modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }
}
