* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f1e7;
  color: #10271c;
}

.site-header {
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: 32px 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #66736d;
}

h1 {
  margin: 0;
  font-size: 68px;
  line-height: 1;
}

h1 span { color: #287a4c; }

.help-button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid #d5d1c5;
  background: #fffdf7;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

main {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.puzzle-heading {
  text-align: center;
  margin: 20px 0 30px;
}

.puzzle-heading h2 {
  margin: 6px 0 4px;
  font-size: 50px;
}

#season-description {
  margin: 0;
  font-size: 18px;
  color: #66736d;
}

.scoreboard {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 20px;
}

.scoreboard div {
  display: flex;
  flex-direction: column;
}

.scoreboard strong { font-size: 24px; }
.scoreboard span { font-size: 14px; color: #66736d; }

.football-field {
  width: 850px;
  margin: 40px auto;
  padding: 70px 60px;
  background: linear-gradient(90deg, #1f6f3d, #2b8049, #1f6f3d);
  border: 8px solid white;
  border-radius: 50% / 14%;
  display: flex;
  flex-direction: column;
  gap: 35px;
  position: relative;
  overflow: hidden;
}

.field-row {
  display: flex;
  justify-content: space-between;
}

.player-card {
  width: 180px;
  height: 105px;
  background: white;
  border: none;
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.45s ease, box-shadow 0.45s ease;
  transform-style: preserve-3d;
}

.player-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 22px rgba(0,0,0,.25);
}

.field-position {
  font-size: 18px;
  font-weight: 700;
  color: #6c736f;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.player-answer {
  font-size: 34px;
  font-weight: bold;
  color: #10271c;
}

.guesses-left {
  margin-top: 8px;
  font-size: 14px;
  color: #777;
}

.lineup-line {
  position: relative;
  display: flex;
  align-items: center;
}

.lineup-line .field-row { width: 100%; }

.line-label {
  position: absolute;
  left: -70px;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #777;
  color: white;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 800;
  z-index: 4;
  flex-shrink: 0;
}

.football-field::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 260px;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  border: 3px solid rgba(255,255,255,.8);
  z-index: 1;
  pointer-events: none;
}

.lineup-line,
.field-row,
.player-card { position: relative; z-index: 2; }

.football-field::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  border: 3px solid rgba(255,255,255,.8);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.arc-top,
.arc-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 420px;
  border: 3px solid rgba(255,255,255,.85);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.arc-top { top: -105px; }
.arc-bottom { bottom: -105px; }

.goal-posts {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 3;
}

.goal-posts-top { top: 2px; align-items: flex-start; }
.goal-posts-bottom { bottom: 2px; align-items: flex-end; }
.goal-posts span {
  display: block;
  width: 6px;
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.goal-posts .goal-post { height: 68px; }
.goal-posts .behind-post { height: 48px; }
.goal-posts-top .goal-post,
.goal-posts-top .behind-post { transform: translateY(-40%); }
.goal-posts-bottom .goal-post,
.goal-posts-bottom .behind-post { transform: translateY(40%); }

.player-card.selected {
  border: 3px solid #ffd54f;
  box-shadow: 0 0 18px rgba(255,213,79,.7);
  transform: scale(1.03);
}

.guess-panel {
  width: 700px;
  max-width: 90%;
  margin: 30px auto;
  text-align: center;
}

.selected-position {
  color: #d9d9d9;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
}

#player-guess {
  width: 100%;
  padding: 16px 20px;
  font-size: 18px;
  border: 2px solid #555;
  border-radius: 12px;
  background: #2d2d2d;
  color: white;
  outline: none;
  transition: all .2s ease;
}

#player-guess:focus {
  border-color: #ffd54f;
  box-shadow: 0 0 10px rgba(255,213,79,.4);
}

#player-suggestions { margin-top: 10px; }

#submit-guess {
  margin-top: 15px;
  padding: 14px 28px;
  background: #ffd54f;
  color: #222;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
}

#submit-guess:hover { background: #ffca28; transform: translateY(-2px); }
#submit-guess:active { transform: translateY(0); }

.player-card.solved {
  background: linear-gradient(180deg,#f4fff7 0%,#dff3e5 100%);
  border: 3px solid #2f8f57;
  box-shadow: 0 8px 18px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,255,255,.8);
}

.player-card.solved .field-position {
  color: #2f8f57;
  font-size: 15px;
  letter-spacing: .8px;
}

.player-card.solved .player-answer {
  display: block;
  max-width: 150px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.4px;
  color: #123c26;
  text-align: center;
  margin: 6px auto 4px;
}

.player-card.solved .guesses-left { display: none; }

.player-card.selected:not(.solved) {
  background: white;
  border: 3px solid #ffd54f;
  box-shadow: 0 0 18px rgba(255,213,79,.75);
  transform: scale(1.03);
}

.player-card.solved { animation: cardFlip .6s ease; }

@keyframes cardFlip {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

.player-card.out {
  background: #ddd;
  border: 3px solid #888;
  color: #666;
  cursor: not-allowed;
  opacity: .8;
}
.player-card.out .player-answer { color: #666; }

.profile-page {
  width: min(900px,92%);
  margin: 0 auto;
  padding: 30px 0 70px;
}
.profile-heading { text-align: center; margin-bottom: 32px; }
.profile-heading h2 { margin: 8px 0 0; font-size: 42px; color: #123c26; }
.profile-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  color: #123c26;
  background: white;
  border: 1px solid #d7d3c5;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}
.profile-back-link:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,.1); }

.stats-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.stat-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: white;
  border: 1px solid #ddd8ca;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(0,0,0,.08);
}
.stat-card span { color:#68736d; font-size:15px; font-weight:700; letter-spacing:.4px; text-transform:uppercase; }
.stat-card strong { margin-top:10px; color:#123c26; font-size:38px; line-height:1; }

.player-card { perspective: 900px; overflow: visible; }
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 108px;
  transform-style: preserve-3d;
  transition: transform .35s ease;
}
.player-card.show-hints .card-inner { transform: rotateY(180deg); }
.card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: 18px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.card-front { background: inherit; }
.hint-toggle {
  position: absolute;
  top: 7px;
  right: 8px;
  z-index: 10;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #123c26;
  color: white;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  transition: transform .15s ease, box-shadow .15s ease;
}
.hint-toggle:hover { transform: scale(1.12); box-shadow: 0 3px 9px rgba(0,0,0,.25); }
.card-back {
  transform: rotateY(180deg);
  background: #fff;
  color: #123c26;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.card-back .field-position { position:absolute; top:8px; left:12px; font-size:15px; font-weight:700; color:#6f7772; }
.card-back .player-hint { display:flex; flex-direction:column; gap:4px; font-size:12px; line-height:1.25; font-weight:700; text-align:left; margin-top:8px; }
.card-front .player-hint { display:none; }
.hint-line { display:flex; align-items:center; gap:6px; width:100%; }
.card-back .player-hint { width:100%; max-width:120px; display:flex; flex-direction:column; gap:5px; margin-top:8px; font-size:12px; line-height:1.2; font-weight:700; text-align:left; }

.game-result-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10,30,20,.55);
  backdrop-filter: blur(4px);
}
.game-result-modal.hidden { display:none; }
.hidden { display:none; }
.game-result-card {
  width:min(420px,100%);
  padding:30px;
  background:#fff;
  border-radius:22px;
  text-align:center;
  box-shadow:0 18px 50px rgba(0,0,0,.25);
}
.game-result-card h2 { margin:0 0 8px; color:#123c26; font-size:32px; }
#result-puzzle { margin:0 0 24px; color:#68736d; font-size:17px; font-weight:600; }
.result-stats { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:24px; }
.result-stats div { padding:18px 10px; background:#f5f3eb; border-radius:14px; }
.result-stats strong { display:block; color:#123c26; font-size:26px; }
.result-stats span { display:block; margin-top:4px; color:#68736d; font-size:12px; }
#close-result { border:0; border-radius:999px; padding:12px 24px; background:#123c26; color:#fff; font-size:15px; font-weight:700; cursor:pointer; }

.player-card.revealed { background:#eee; border:3px solid #8a8a8a; color:#555; }
.player-card.revealed .player-answer { display:block; color:#444; font-size:18px; font-weight:700; text-align:center; }
.player-card.revealed .guesses-left { display:none; }
.player-card.revealed .hint-toggle { display:none; }
.player-card.locked { cursor:default; }
#player-guess:disabled,#submit-guess:disabled { opacity:.55; cursor:not-allowed; }

#reopen-results {
  display:block;
  margin:18px auto 0;
  padding:10px 20px;
  border:none;
  border-radius:999px;
  background:#123c26;
  color:#fff;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(0,0,0,.18);
  transition:transform .2s ease,box-shadow .2s ease;
}
#reopen-results:hover { transform:translateY(-2px); box-shadow:0 8px 20px rgba(0,0,0,.22); }
#reopen-results.hidden { display:none; }

#share-result {
  padding:12px 22px;
  border:2px solid #123c26;
  border-radius:999px;
  background:#fff;
  color:#123c26;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  transition:transform .2s ease,background .2s ease;
}
#share-result:hover { background:#f2f5ef; transform:translateY(-2px); }

.header-actions { display:flex; align-items:center; gap:10px; }
.profile-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:46px;
  padding:0 18px;
  background:#fffdf7;
  color:#123c26;
  border:1px solid #d5d1c5;
  border-radius:999px;
  font-size:15px;
  font-weight:700;
  text-decoration:none;
  cursor:pointer;
}
.profile-button:hover { transform:translateY(-1px); box-shadow:0 6px 14px rgba(0,0,0,.1); }
#give-up {
  margin-top:10px;
  padding:10px 18px;
  background:transparent;
  color:#8a3b3b;
  border:1px solid #c9a5a5;
  border-radius:999px;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
}
#give-up:hover { background:#f7eaea; }

.archive-page { width:min(900px,92%); margin:0 auto; padding:40px 0 70px; }
.archive-page h1 { margin-bottom:8px; font-size:48px; color:#123c26; }
.archive-page > p { margin-top:0; margin-bottom:28px; color:#66736d; font-size:16px; }
#archive-list { display:grid; gap:12px; margin-bottom:28px; }
.archive-puzzle { display:flex; align-items:center; justify-content:space-between; padding:16px 18px; background:#fff; color:#123c26; border:1px solid #ddd8ca; border-radius:14px; text-decoration:none; transition:transform .2s ease,box-shadow .2s ease; }
.archive-puzzle:hover { transform:translateY(-2px); box-shadow:0 8px 18px rgba(0,0,0,.12); }
.archive-puzzle strong { font-size:16px; }
.archive-puzzle span { color:#66736d; font-size:14px; }
.jumper-number { font-size:48px; font-weight:900; line-height:1; color:#10271c; text-align:center; }

.help-modal { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,.6); z-index:9999; padding:20px; }
.help-modal.hidden { display:none; }
.help-card { position:relative; width:min(520px,100%); max-height:85vh; overflow-y:auto; background:#fffdf7; color:#10271c; border-radius:20px; padding:32px; box-shadow:0 18px 50px rgba(0,0,0,.3); }
.close-help { position:absolute; top:12px; right:16px; border:none; background:transparent; font-size:28px; cursor:pointer; }

/* ================================
   MOBILE / iPHONE LAYOUT
   ================================ */
@media (max-width: 650px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body { -webkit-text-size-adjust: 100%; }

  .site-header {
    width: 100%;
    padding: 18px 14px 4px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .eyebrow { font-size: 10px; letter-spacing: 1.4px; }
  h1 { font-size: 46px; }

  .header-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .profile-button {
    height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }

  .help-button { width: 40px; height: 40px; font-size: 18px; }

  main {
    width: 100%;
    max-width: 100%;
  }

  .puzzle-heading {
    width: 100%;
    margin: 14px auto 20px;
    padding: 0 14px;
  }

  .puzzle-heading h2 {
    font-size: 34px;
    line-height: 1.1;
  }

  #season-description { font-size: 14px; }

  .scoreboard {
    gap: 34px;
    margin-top: 14px;
  }

  .scoreboard strong { font-size: 20px; }
  .scoreboard span { font-size: 12px; }

  /* The important fix: the field is now contained inside the phone. */
  .football-field {
    width: calc(100% - 20px);
    max-width: 390px;
    margin: 20px auto;
    padding: 34px 10px;
    border-width: 5px;
    border-radius: 50% / 8%;
    gap: 18px;
  }

  .lineup-line {
    width: 100%;
  }

  .line-label { display: none; }

  /* Three cards always fit inside the field. */
  .field-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .player-card {
    width: 100%;
    min-width: 0;
    height: 78px;
    min-height: 78px;
    border-radius: 12px;
  }

  .card-inner {
    width: 100%;
    min-width: 0;
    min-height: 78px;
  }

  .card-face { padding: 6px 4px; border-radius: 12px; }

  .field-position {
    font-size: 12px;
    margin-bottom: 3px;
    letter-spacing: .6px;
  }

  .player-answer { font-size: 25px; }

  .guesses-left {
    margin-top: 3px;
    font-size: 9px;
    white-space: nowrap;
  }

  .hint-toggle {
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    font-size: 12px;
  }

  .player-card.solved .field-position {
    font-size: 11px;
  }

  .player-card.solved .player-answer {
    max-width: 100%;
    font-size: 15px;
    line-height: 1.05;
    margin: 4px auto 2px;
  }

  .card-back .field-position {
    top: 5px;
    left: 7px;
    font-size: 11px;
  }

  .card-back .player-hint {
    max-width: 100px;
    font-size: 9px;
    gap: 3px;
    margin-top: 5px;
  }

  .football-field::before {
    width: 150px;
    height: 120px;
    border-width: 2px;
  }

  .football-field::after {
    width: 58px;
    height: 58px;
    border-width: 2px;
  }

  .arc-top,
  .arc-bottom {
    width: 420px;
    height: 220px;
  }

  .arc-top { top: -70px; }
  .arc-bottom { bottom: -70px; }

  .goal-posts { width: 90px; }
  .goal-posts span { width: 4px; }
  .goal-posts .goal-post { height: 48px; }
  .goal-posts .behind-post { height: 34px; }

  .guess-panel {
    width: calc(100% - 28px);
    max-width: 390px;
    margin: 22px auto 30px;
  }

  .selected-position { font-size: 16px; margin-bottom: 10px; }

  #player-guess {
    width: 100%;
    padding: 14px 15px;
    font-size: 16px;
  }

  #submit-guess,
  #give-up {
    font-size: 15px;
    padding: 12px 20px;
  }

  .game-result-modal { padding: 12px; }
  .game-result-card { width: 100%; max-width: 360px; padding: 30px 20px; border-radius: 22px; }
  .game-result-card h2 { font-size: 32px; }
  #result-puzzle { font-size: 16px; margin-bottom: 22px; }
  .result-stats { gap: 10px; }
  .result-stats div { padding: 17px 6px; }
  .result-stats strong { font-size: 27px; }
  .result-stats span { font-size: 11px; }
  #share-result, #close-result { font-size: 15px; padding: 13px 20px; }
}
