* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: grid; place-items: center;
  font-family: system-ui, sans-serif; color: #fff;
  background-color: #3fa34d;
}
/* Sky, sun, clouds and striped grass */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background:
    /* sun */
    radial-gradient(circle at 82% 16%, #ffe066 0 5.5vmax, transparent calc(5.5vmax + 1px)),
    /* clouds: flat pill shapes */
    radial-gradient(ellipse 9vmax 2.2vmax at 18% 14%, #fff 98%, transparent),
    radial-gradient(ellipse 6vmax 2vmax at 24% 11%, #fff 98%, transparent),
    radial-gradient(ellipse 8vmax 2vmax at 58% 24%, #fff 98%, transparent),
    radial-gradient(ellipse 5vmax 1.8vmax at 63% 21%, #fff 98%, transparent),
    /* grass stripes (bottom 40%) */
    repeating-linear-gradient(90deg, #3fa34d 0 8vmax, #378f44 8vmax 16vmax) 0 100% / 100% 40% no-repeat,
    /* sky */
    linear-gradient(#2f8fe8, #9fd4ff);
}
/* Pitch markings */
body::after {
  content: ""; position: fixed; left: 50%; bottom: 4vh; z-index: -1;
  width: min(60vw, 520px); height: 22vh; transform: translateX(-50%);
  border: 4px solid rgba(255,255,255,.55); border-radius: 50%;
  box-shadow: 0 -2vh 0 -4px transparent;
}
main { width: min(92vw, 400px); transition: width .2s; background: rgba(12,32,64,.82); padding: 28px; border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
h1 { margin: 0 0 20px; text-align: center; }
.screen { display: flex; flex-direction: column; gap: 12px; }
[hidden] { display: none !important; }
label { font-size: 14px; opacity: .85; }
input {
  width: 100%; padding: 12px; font-size: 16px; border: 0; border-radius: 8px; background: #fff; color: #111;
}
button {
  padding: 12px; font-size: 16px; font-weight: 600; border: 0; border-radius: 8px;
  background: #ffc933; color: #222; cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button.secondary { background: rgba(255,255,255,.2); color: #fff; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
.error { color: #ff9a9a; min-height: 1.2em; margin: 0; font-size: 14px; }
#players { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 8px; }
#players li { padding: 14px; border-radius: 8px; background: rgba(255,255,255,.18); font-size: 18px; }
#players li.waiting { opacity: .6; font-style: italic; }
main.wide { width: min(96vw, 940px); padding: 16px; }
#pick-hint { margin: 0; text-align: center; font-size: 14px; opacity: .85; min-height: 1.2em; }
#players li { display: flex; align-items: center; gap: 10px; }
#players .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; background: transparent; flex: none; }
#players .ready { margin-left: auto; font-size: 14px; color: #8cffb0; }
#swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.swatch { aspect-ratio: 1; padding: 0; border-radius: 50%; border: 3px solid rgba(255,255,255,.5); }
.swatch.sel { border-color: #fff; box-shadow: 0 0 0 3px #ffc933; transform: scale(1.08); }
.swatch:disabled { opacity: .25; cursor: not-allowed; }
#game { width: 100%; height: auto; border-radius: 10px; display: block; background: #9fd4ff; }
#controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; font-size: 15px; }
.key { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; }
.key.active { background: rgba(255,201,51,.35); }
kbd { background: #fff; color: #111; border-radius: 5px; padding: 2px 8px; font-weight: 700; font-family: inherit; box-shadow: 0 2px 0 #aaa; }
