:root {
  /* Outlet brand: amber-orange (#f2b106) with deep amber #9a6200 */
  --brand: #f2b106;
  --brand-strong: #ef9d00;
  --plum: #9a6200; /* deep amber — headings & pill text */
  --plum-2: #c47d00; /* mid amber — focus, borders, secondary */
  --plum-deep: #7a4e00; /* deepest amber — button gradient bottom */
  --lav-bg: #f2b106; /* orange background base */
  --lav-soft: #ffe7ad; /* soft tint — score buttons */
  --lav-pill: #fff2cf; /* light pill background */
  --ink: #3a2600; /* warm dark-brown text */
  --muted: #9c8552;
  --line: #efe1c0; /* warm border */
  --white: #ffffff;
  --danger: #c0392b;
  --success: #1f9d62;
  --shadow: 0 18px 50px rgba(150, 95, 0, 0.2);
  --radius-lg: 26px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Tajawal", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #ffffff;
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.prediction-page {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 22px 14px 32px;
  overflow-x: hidden;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  margin-bottom: 18px;
}

.hero-title {
  margin: 0 auto 14px;
  max-width: 380px;
  font-size: 1.06rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.6;
}

.prize-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  background: var(--lav-pill);
  color: var(--plum);
  border-radius: 999px;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 8px 20px rgba(150, 95, 0, 0.12);
}

/* ---------- Card ---------- */
.card {
  background: var(--white);
  border: 1px solid #f2e8d2;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px 18px 22px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.match-pill {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--plum);
}

.predict-pill {
  padding: 7px 16px;
  background: var(--lav-pill);
  color: var(--plum-2);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---------- Match ---------- */
.match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  background: linear-gradient(180deg, #fffaf0 0%, #fff3da 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 6px 14px;
}

.team {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.flag {
  width: 72px;
  max-width: 100%;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(90, 58, 0, 0.2);
}

.team-name {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--ink);
}

.vs {
  align-self: center;
  margin-top: 22px;
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--plum);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 18px rgba(150, 95, 0, 0.35);
}

/* ---------- Score stepper ---------- */
.score-control {
  margin-top: 4px;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(90, 58, 0, 0.08);
}

.score-btn {
  flex: none;
  width: 32px;
  height: 36px;
  border: 0;
  background: var(--lav-soft);
  color: var(--plum);
  border-radius: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.score-btn:active {
  transform: scale(0.92);
}

.score-btn:hover {
  background: #ffdb8a;
}

.score-value {
  min-width: 34px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Roomier on wider viewports where there is space to spare */
@media (min-width: 440px) {
  .flag {
    width: 84px;
    height: 56px;
  }
  .vs {
    width: 46px;
    height: 46px;
  }
  .score-btn {
    width: 34px;
    height: 38px;
  }
  .score-value {
    min-width: 40px;
    font-size: 1.7rem;
  }
}

/* ---------- Form ---------- */
.prediction-form {
  margin-top: 20px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--plum);
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder {
  color: #c9b48a;
}

.field input:focus {
  outline: none;
  border-color: var(--plum-2);
  box-shadow: 0 0 0 4px rgba(196, 125, 0, 0.16);
  background: #fff;
}

.field input[dir="ltr"] {
  text-align: right;
}

.error {
  margin: 6px 2px 0;
  min-height: 1em;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--danger);
}

.submit-button {
  position: relative;
  width: 100%;
  margin-top: 6px;
  padding: 16px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--brand-strong) 0%, var(--plum-deep) 100%);
  color: #fff;
  font-size: 1.06rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 12px 26px rgba(150, 95, 0, 0.34);
  transition: transform 0.1s ease, filter 0.15s ease;
}

.submit-button:hover {
  filter: brightness(1.06);
}

.submit-button:active {
  transform: translateY(1px);
}

.submit-button:disabled {
  cursor: progress;
  filter: saturate(0.7) brightness(0.95);
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  display: none;
  animation: spin 0.7s linear infinite;
}

.is-submitting .spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status-message {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
}

.status-message.is-error {
  background: #fdecea;
  color: var(--danger);
}

.status-message.is-info {
  background: var(--lav-pill);
  color: var(--plum);
}

.card-foot {
  margin: 16px 0 2px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
}

/* ---------- Success ---------- */
.success-panel {
  display: none;
  text-align: center;
  background: var(--white);
  border: 1px solid #f2e8d2;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 34px 22px 30px;
  margin-top: 18px;
}

.success-panel.is-visible {
  display: block;
  animation: pop 0.35s ease;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.success-check {
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
  display: block;
}

.success-circle {
  fill: none;
  stroke: var(--success);
  stroke-width: 6;
  stroke-dasharray: 289;
  stroke-dashoffset: 289;
  animation: draw 0.5s ease forwards;
}

.success-tick {
  fill: none;
  stroke: var(--success);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
  animation: draw 0.4s 0.35s ease forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.success-title {
  margin: 0 0 8px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--plum);
}

.success-scoreline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 12px;
  padding: 8px 18px;
  background: var(--lav-pill);
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
}

.success-message {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.success-again {
  padding: 13px 26px;
  border: 1.5px solid var(--plum-2);
  border-radius: 14px;
  background: #fff;
  color: var(--plum-2);
  font-size: 0.98rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.success-again:hover {
  background: var(--lav-pill);
}

.success-again[hidden] {
  display: none;
}
