:root {
  --bg: #07160f;
  --panel: #10261b;
  --panel-2: #163323;
  --line: rgba(255,255,255,.12);
  --text: #f6fff9;
  --muted: #a7c4b3;
  --accent: #f6c945;
  --accent-2: #ef7b45;
  --green: #0d7b43;
  --green-dark: #07502c;
  --danger: #ff665f;
  --success: #45d68b;
  --shadow: 0 22px 60px rgba(0,0,0,.34);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(31, 133, 77, .28), transparent 34rem),
    linear-gradient(180deg, #0b2016, #06110c 70%);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(16px, 4vw, 52px);
  background: rgba(4, 17, 11, .84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-ball {
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 16px; font-size: 27px;
  background: linear-gradient(145deg, #ffffff, #d8e4dc);
  box-shadow: inset 0 -5px 10px rgba(0,0,0,.14), 0 10px 26px rgba(0,0,0,.25);
}
.brand h1 { margin: 0; font-size: clamp(1.18rem, 3vw, 1.55rem); letter-spacing: -.03em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }
.top-actions { display: flex; gap: 10px; }

main { width: 100%; flex: 1; }
.screen { display: none; width: min(1260px, calc(100% - 28px)); margin: 0 auto; padding: 38px 0 48px; }
.screen.active { display: block; animation: screenIn .38s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } }

.hero-copy { max-width: 820px; margin: 0 auto 30px; text-align: center; }
.eyebrow {
  display: inline-block; color: var(--accent); font-size: .72rem; font-weight: 900;
  letter-spacing: .18em; text-transform: uppercase;
}
.hero-copy h2, .result-card h2, .stats-card h2 {
  margin: 10px 0 12px; font-size: clamp(2rem, 5vw, 4rem); line-height: .98; letter-spacing: -.055em;
}
.hero-copy p, .result-card > p, .stats-card > p { color: var(--muted); font-size: 1rem; line-height: 1.65; }

.setup-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 82px minmax(0, 1fr);
  align-items: center; gap: 18px;
}
.player-card {
  background: linear-gradient(180deg, rgba(28, 65, 45, .94), rgba(11, 34, 23, .96));
  border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); padding: clamp(18px, 3vw, 30px);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.player-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 90% 0%, rgba(246,201,69,.14), transparent 18rem);
}
.card-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.card-heading span { color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.card-heading strong { color: var(--accent); }
.avatar-editor { display: flex; align-items: end; justify-content: center; min-height: 170px; margin-bottom: 18px; }
.photo-picker {
  width: 102px; text-align: center; position: relative; z-index: 2; transform: translateX(12px);
}
.photo-picker img {
  width: 98px; height: 98px; object-fit: cover; border-radius: 50%; border: 5px solid #f3ca93;
  box-shadow: 0 12px 28px rgba(0,0,0,.34); background: #95613c;
}
.photo-picker span {
  display: inline-block; margin-top: 8px; padding: 5px 9px; border-radius: 999px;
  background: rgba(0,0,0,.35); color: #fff; font-size: .72rem; font-weight: 800;
}
.mini-caricature { width: 120px; height: 160px; position: relative; transform: translateX(-14px); }
.mini-head {
  position: absolute; top: 4px; left: 25px; width: 72px; height: 78px; overflow: hidden;
  border-radius: 48% 48% 44% 44%; border: 4px solid #f0c28b; z-index: 2; background: #7a4b2d;
}
.mini-head img { width: 100%; height: 100%; object-fit: cover; }
.mini-body {
  position: absolute; left: 17px; top: 69px; width: 88px; height: 82px; border-radius: 46% 46% 20% 20%;
  box-shadow: inset 0 -10px 0 rgba(0,0,0,.13);
}
.home-shirt { background: linear-gradient(90deg, #0d4f9f 0 38%, #fff 38% 49%, #e33b3b 49% 60%, #0d4f9f 60%); }
.away-shirt { background: linear-gradient(90deg, #f4f4f4 0 38%, #1452a1 38% 49%, #e43f3f 49% 60%, #f4f4f4 60%); }
.player-card label:not(.photo-picker) { display: block; margin-top: 14px; position: relative; z-index: 1; }
.player-card label > span { display: block; margin: 0 0 7px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.player-card input, .player-card select {
  width: 100%; height: 50px; border: 1px solid rgba(255,255,255,.14); border-radius: 14px;
  padding: 0 14px; color: #fff; background: rgba(4,15,10,.54); outline: none;
}
.player-card input:focus, .player-card select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(246,201,69,.12); }
.player-card select option { color: #111; }
.versus-badge {
  width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; margin: auto;
  color: #102016; background: var(--accent); font-weight: 1000; font-size: 1.25rem;
  box-shadow: 0 12px 28px rgba(0,0,0,.28), inset 0 -5px 0 rgba(0,0,0,.12);
}
.setup-actions { text-align: center; margin-top: 24px; }
.form-error { color: #ff9d98; min-height: 1.4em; }
.rules-strip {
  margin-top: 26px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.rules-strip div { padding: 16px; text-align: center; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.035); }
.rules-strip strong { display: block; color: var(--accent); font-size: 1.55rem; }
.rules-strip span { color: var(--muted); font-size: .78rem; }

.primary-btn, .secondary-btn, .icon-btn {
  border: 0; border-radius: 14px; min-height: 44px; padding: 0 18px; font-weight: 900;
  transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}
.primary-btn { background: linear-gradient(180deg, #f8d45a, #e7ae27); color: #172017; box-shadow: 0 10px 24px rgba(226,172,39,.22); }
.secondary-btn, .icon-btn { color: #fff; background: rgba(255,255,255,.08); border: 1px solid var(--line); }
.icon-btn { width: 46px; padding: 0; }
.primary-btn:hover, .secondary-btn:hover, .icon-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.primary-btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.large { min-width: min(360px, 100%); min-height: 56px; font-size: 1.05rem; }

.scoreboard {
  display: grid; grid-template-columns: 1fr minmax(190px, .55fr) 1fr; align-items: center; gap: 12px;
  margin-bottom: 14px; background: rgba(9,27,18,.94); border: 1px solid var(--line); border-radius: 20px; padding: 12px 16px;
}
.score-player { display: flex; align-items: center; gap: 12px; min-width: 0; }
.score-player img { width: 46px; height: 46px; object-fit: cover; border: 3px solid #efc58d; border-radius: 50%; background: #77462d; }
.score-player div { min-width: 0; }
.score-player strong, .score-player span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-player span { color: var(--muted); font-size: .75rem; }
.score-player b { margin-left: auto; font-size: 2rem; color: var(--accent); }
.away-side { justify-content: flex-end; text-align: right; }
.away-side b { margin: 0 auto 0 0; }
.round-display { text-align: center; }
.round-display span, .round-display small { display: block; color: var(--muted); font-size: .72rem; }
.round-display strong { display: block; margin: 2px 0; font-size: .94rem; }

.stadium-wrap {
  position: relative; overflow: hidden; border-radius: 26px; border: 1px solid rgba(255,255,255,.14); box-shadow: var(--shadow);
  background: linear-gradient(#17222c 0 23%, #0e4728 23%);
}
.stadium-lights {
  position: absolute; inset: 0 0 auto; height: 72px; z-index: 0; opacity: .8;
  background: radial-gradient(ellipse at 25% 0, rgba(255,255,255,.8), transparent 24%), radial-gradient(ellipse at 75% 0, rgba(255,255,255,.8), transparent 24%);
}
.crowd {
  height: 125px; background:
    radial-gradient(circle, #f4d35e 0 2px, transparent 3px) 0 0/18px 15px,
    radial-gradient(circle, #fff 0 1.7px, transparent 2.8px) 8px 5px/21px 17px,
    linear-gradient(#15202a, #07100b);
  opacity: .75;
}
.pitch {
  position: relative; width: 100%; height: clamp(430px, 63vw, 690px); overflow: hidden; perspective: 900px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.03) 50%, transparent 50%) 0 0/12.5% 100%,
    linear-gradient(180deg, #21844c, #0b5f32 56%, #0b4e2b);
}
.grass-lines {
  position: absolute; inset: 0; opacity: .25;
  background: repeating-linear-gradient(92deg, transparent 0 4px, rgba(255,255,255,.07) 4px 5px);
}
.penalty-area {
  position: absolute; left: 20%; right: 20%; top: 7%; height: 44%; border: 3px solid rgba(255,255,255,.62); border-top: 0;
  transform: perspective(500px) rotateX(9deg); transform-origin: top;
}
.penalty-arc {
  position: absolute; left: 39%; top: 43%; width: 22%; height: 19%; border: 3px solid rgba(255,255,255,.58); border-radius: 50%;
  border-top-color: transparent; border-left-color: transparent; border-right-color: transparent;
}
.penalty-spot { position: absolute; left: 50%; top: 67%; width: 10px; height: 6px; transform: translate(-50%,-50%); border-radius: 50%; background: rgba(255,255,255,.8); }

.goal {
  position: absolute; z-index: 4; left: 50%; top: 8%; width: min(72%, 760px); aspect-ratio: 2.15/1;
  transform: translateX(-50%); filter: drop-shadow(0 14px 12px rgba(0,0,0,.38));
}
.crossbar, .post { position: absolute; z-index: 9; background: linear-gradient(90deg,#dedede,#fff 45%,#b7b7b7); box-shadow: 0 3px 6px rgba(0,0,0,.32); }
.crossbar { left: 2%; right: 2%; top: 4%; height: 10px; border-radius: 8px; }
.post { top: 4%; bottom: 2%; width: 10px; border-radius: 8px; }
.left-post { left: 2%; } .right-post { right: 2%; }
.net {
  position: absolute; inset: 5% 2% 2%; opacity: .78;
  background-image: linear-gradient(rgba(255,255,255,.48) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.48) 1px, transparent 1px);
  background-size: 24px 20px;
  box-shadow: inset 0 10px 20px rgba(0,0,0,.17);
}
.goal-depth { position:absolute; top:8%; bottom:0; width:14%; border-top:2px solid rgba(255,255,255,.4); opacity:.5; }
.left-depth { left:-9%; transform: skewY(-38deg); border-left:2px solid rgba(255,255,255,.4); }
.right-depth { right:-9%; transform: skewY(38deg); border-right:2px solid rgba(255,255,255,.4); }
.goal-zones { position: absolute; inset: 8% 4% 5%; z-index: 7; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.goal-zone {
  border: 1px dashed rgba(255,255,255,.22); background: transparent; color: rgba(255,255,255,.52); position: relative;
}
.goal-zone span { position: absolute; right: 8px; bottom: 6px; font-size: .62rem; font-weight: 900; opacity: .5; }
.goal-zone:hover, .goal-zone.selected { background: rgba(246,201,69,.09); }
.target-marker {
  position: absolute; z-index: 12; left: 25%; top: 30%; width: 74px; height: 74px; transform: translate(-50%,-50%);
  border: 4px solid var(--accent); border-radius: 50%; box-shadow: 0 0 0 7px rgba(246,201,69,.16), 0 0 28px rgba(246,201,69,.65);
  opacity: 0; pointer-events: none; transition: width .2s ease, height .2s ease, opacity .2s ease;
}
.target-marker::before, .target-marker::after { content:""; position:absolute; background:var(--accent); }
.target-marker::before { width: 2px; top:-8px; bottom:-8px; left:50%; }
.target-marker::after { height: 2px; left:-8px; right:-8px; top:50%; }
.target-marker.visible { opacity: 1; }

.caricature { position: absolute; z-index: 15; width: 100px; height: 170px; transform-origin: 50% 100%; }
.caricature .head {
  position: absolute; z-index: 6; left: 25px; top: 0; width: 52px; height: 58px; overflow: hidden;
  border-radius: 48% 48% 44% 44%; border: 3px solid #e8b877; background: #7e4b2e; box-shadow: 0 4px 8px rgba(0,0,0,.25);
}
.caricature .head img { width:100%; height:100%; object-fit:cover; }
.caricature .hair { position:absolute; z-index:7; top:-3px; left:28px; width:46px; height:17px; border-radius:50% 50% 30% 30%; background:#15100d; opacity:.86; }
.caricature .body { position:absolute; z-index:4; left:25px; top:49px; width:54px; height:68px; border-radius:18px 18px 12px 12px; box-shadow:inset 0 -8px rgba(0,0,0,.13); }
.caricature .arm, .caricature .leg { position:absolute; z-index:3; border-radius:999px; transform-origin: top center; }
.caricature .arm { width:15px; height:70px; top:54px; background:linear-gradient(#e3aa70 42%,#d58e54 43%); }
.caricature .arm-left { left:20px; transform:rotate(18deg); }
.caricature .arm-right { right:16px; transform:rotate(-18deg); }
.caricature .leg { width:18px; height:67px; top:108px; background:linear-gradient(#10293f 0 60%,#d79356 61% 88%,#151515 89%); }
.caricature .leg-left { left:31px; transform:rotate(5deg); }
.caricature .leg-right { right:25px; transform:rotate(-5deg); }
.character-shadow { position:absolute; left:15px; right:5px; bottom:-4px; height:18px; border-radius:50%; background:rgba(0,0,0,.28); filter:blur(3px); }
.keeper-character { left: calc(50% - 50px); bottom: 1%; transform: scale(.83); cursor: grab; touch-action:none; transition: left .2s ease, bottom .2s ease, transform .22s ease; }
.keeper-character.dragging { cursor:grabbing; transition:none; }
.keeper-shirt { background: linear-gradient(90deg,#f29f24,#ffc24c 45%,#d56b17); }
.keeper-character .arm-left { transform: rotate(58deg); left:14px; }
.keeper-character .arm-right { transform: rotate(-58deg); right:10px; }
.glove { position:absolute; z-index:5; width:24px; height:20px; top:103px; border-radius:45%; background:#d9edff; border:2px solid #6b879b; }
.glove-left { left:0; transform:rotate(-20deg); } .glove-right { right:-1px; transform:rotate(20deg); }
.keeper-character.diving-left { transform: translate(-75px, 12px) rotate(-62deg) scale(.9); }
.keeper-character.diving-right { transform: translate(75px, 12px) rotate(62deg) scale(.9); }
.keeper-character.diving-up-left { transform: translate(-62px,-42px) rotate(-48deg) scale(.88); }
.keeper-character.diving-up-right { transform: translate(62px,-42px) rotate(48deg) scale(.88); }
.shooter-character { left: calc(50% - 118px); top: 60%; transform: scale(1.08); transition: transform .28s ease, left .28s ease, top .28s ease; }
.shooter-character.shooting { transform: translate(55px,-25px) rotate(-8deg) scale(1.08); }
.shooter-character .kicking { transform: rotate(-42deg); }

.football {
  position: absolute; z-index: 30; left: 50%; top: 68%; width: 38px; height: 38px; transform: translate(-50%,-50%);
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #dedede 58%, #8f8f8f 100%);
  box-shadow: inset -5px -7px 8px rgba(0,0,0,.18), 0 7px 9px rgba(0,0,0,.32); transition: none;
}
.football::before { content:""; position:absolute; inset:10px; background:#161616; clip-path:polygon(50% 0,100% 38%,82% 100%,18% 100%,0 38%); }
.football::after { content:""; position:absolute; inset:4px; border:2px solid rgba(0,0,0,.45); border-radius:50%; opacity:.5; }
.football.spinning { animation: spinBall .22s linear infinite; }
@keyframes spinBall { to { rotate: 360deg; } }
#trajectoryCanvas { position:absolute; inset:0; width:100%; height:100%; z-index:22; pointer-events:none; }

.result-flash {
  position:absolute; z-index:40; left:50%; top:52%; transform:translate(-50%,-50%) scale(.8); opacity:0;
  padding:14px 24px; border-radius:18px; font-weight:1000; font-size:clamp(1.4rem,5vw,3rem); text-transform:uppercase;
  background:rgba(3,14,9,.82); border:2px solid rgba(255,255,255,.35); text-shadow:0 3px 8px rgba(0,0,0,.4);
}
.result-flash.show { animation: resultPop 1.25s ease both; }
.result-flash.goal { color:var(--success); }
.result-flash.save, .result-flash.miss { color:var(--danger); }
@keyframes resultPop { 0%{opacity:0;transform:translate(-50%,-50%) scale(.7)} 18%,75%{opacity:1;transform:translate(-50%,-50%) scale(1)} 100%{opacity:0;transform:translate(-50%,-50%) scale(1.08)} }

.control-panel {
  margin-top:14px; padding:18px; border:1px solid var(--line); border-radius:22px;
  background:linear-gradient(180deg,rgba(19,50,34,.97),rgba(9,29,19,.97)); box-shadow:var(--shadow);
}
.hidden { display:none !important; }
.panel-title { display:flex; justify-content:space-between; align-items:center; gap:14px; margin-bottom:14px; }
.panel-title span { color:var(--accent); font-size:.68rem; font-weight:900; letter-spacing:.14em; }
.panel-title h3 { margin:4px 0 0; font-size:clamp(1rem,3vw,1.35rem); }
.active-player-pill { display:flex; align-items:center; gap:8px; padding:6px 10px 6px 6px; background:rgba(0,0,0,.25); border-radius:999px; }
.active-player-pill img { width:32px; height:32px; object-fit:cover; border:2px solid #efc58d; border-radius:50%; }
.coverage-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:9px; }
.coverage-grid div, .probability-row div { padding:12px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.04); }
.coverage-grid span, .probability-row span { display:block; color:var(--muted); font-size:.68rem; }
.coverage-grid strong, .probability-row strong { display:block; margin-top:3px; color:var(--accent); font-size:1.2rem; }
.hint { color:var(--muted); font-size:.82rem; line-height:1.5; }
.control-panel > .primary-btn { width:100%; min-height:52px; }
.shot-controls { display:grid; grid-template-columns:1.4fr .8fr; gap:14px; }
.shot-types { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; }
.shot-type { min-height:96px; padding:8px; color:#fff; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.04); }
.shot-type span, .shot-type strong, .shot-type small { display:block; }
.shot-type span { font-size:1.35rem; }
.shot-type strong { margin:5px 0 2px; font-size:.8rem; }
.shot-type small { color:var(--muted); font-size:.64rem; }
.shot-type.active { border-color:var(--accent); background:rgba(246,201,69,.1); box-shadow:0 0 0 2px rgba(246,201,69,.08); }
.risk-box { padding:13px; border:1px solid var(--line); border-radius:16px; background:rgba(0,0,0,.14); }
.risk-head, .risk-scale { display:flex; justify-content:space-between; gap:12px; }
.risk-head label { font-weight:900; }
.risk-head strong { color:var(--accent); }
.risk-box input { width:100%; accent-color:var(--accent); }
.risk-scale { color:var(--muted); font-size:.65rem; }
.probability-row { display:grid; grid-template-columns:repeat(3,1fr); gap:7px; margin-top:10px; }

.modal {
  position:fixed; z-index:100; inset:0; display:grid; place-items:center; padding:18px;
  background:rgba(1,8,5,.78); backdrop-filter:blur(12px);
}
.modal[hidden] { display:none; }
.modal-card { width:min(620px,100%); max-height:90vh; overflow:auto; padding:28px; border:1px solid var(--line); border-radius:24px; background:linear-gradient(180deg,#173825,#0c2116); box-shadow:var(--shadow); position:relative; }
.handoff-card { text-align:center; width:min(440px,100%); }
.handoff-icon { font-size:3rem; }
.handoff-card h2 { margin:8px 0; }
.handoff-card p { color:var(--muted); line-height:1.55; }
.handoff-card .primary-btn { width:100%; min-height:52px; }
.modal-close { position:absolute; right:14px; top:12px; width:40px; height:40px; border:0; border-radius:50%; color:#fff; background:rgba(255,255,255,.08); font-size:1.6rem; }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:16px; margin:18px 0; }
table { width:100%; border-collapse:collapse; min-width:650px; }
th,td { padding:12px 10px; text-align:center; border-bottom:1px solid var(--line); font-size:.82rem; }
th { position:sticky; top:0; background:#102d1e; color:var(--muted); }
td:nth-child(2), th:nth-child(2) { text-align:left; font-weight:800; }

.result-card { width:min(900px,100%); margin:0 auto; padding:clamp(22px,4vw,42px); text-align:center; border:1px solid var(--line); border-radius:28px; background:linear-gradient(180deg,#163524,#0a2015); box-shadow:var(--shadow); }
.final-score { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:18px; margin:28px 0; }
.final-score > div:not(.final-vs) { padding:20px; border:1px solid var(--line); border-radius:20px; background:rgba(255,255,255,.035); }
.final-score img { width:86px; height:86px; object-fit:cover; margin:0 auto 10px; border:4px solid #efc58d; border-radius:50%; }
.final-score strong, .final-score span, .final-score b, .final-score small { display:block; }
.final-score span, .final-score small { color:var(--muted); }
.final-score b { margin:8px 0 2px; color:var(--accent); font-size:3rem; }
.final-vs { font-size:2rem; color:var(--muted); }
.match-breakdown { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; margin:18px 0 24px; }
.attempt-chip { padding:10px 6px; border-radius:12px; background:rgba(255,255,255,.04); border:1px solid var(--line); }
.attempt-chip strong,.attempt-chip span { display:block; }
.attempt-chip span { color:var(--muted); font-size:.65rem; }
.attempt-chip.goal strong { color:var(--success); }.attempt-chip.save strong,.attempt-chip.miss strong { color:var(--danger); }
.result-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; }

footer {
  display:flex; justify-content:center; flex-wrap:wrap; gap:10px 22px; padding:18px;
  color:#72917e; border-top:1px solid var(--line); font-size:.72rem;
}
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }

@media (max-width: 840px) {
  .setup-grid { grid-template-columns:1fr; }
  .versus-badge { width:52px; height:52px; }
  .rules-strip { grid-template-columns:repeat(2,1fr); }
  .scoreboard { grid-template-columns:1fr 1fr; }
  .round-display { grid-column:1/-1; grid-row:2; border-top:1px solid var(--line); padding-top:8px; }
  .shot-controls { grid-template-columns:1fr; }
  .shot-types { grid-template-columns:repeat(5,minmax(72px,1fr)); overflow-x:auto; padding-bottom:4px; }
  .coverage-grid { grid-template-columns:repeat(2,1fr); }
  .pitch { height:520px; }
  .goal { width:88%; }
}

@media (max-width: 560px) {
  .topbar { padding:10px 12px; }
  .brand p { display:none; }
  .secondary-btn { padding:0 12px; }
  .screen { width:min(100% - 18px,1260px); padding-top:24px; }
  .player-card { padding:18px; }
  .rules-strip { gap:8px; }
  .scoreboard { padding:9px; }
  .score-player { gap:7px; }
  .score-player img { width:38px; height:38px; }
  .score-player b { font-size:1.6rem; }
  .score-player strong { font-size:.8rem; max-width:86px; }
  .crowd { height:78px; }
  .pitch { height:480px; }
  .goal { top:8%; width:94%; }
  .shooter-character { top:59%; left:calc(50% - 105px); transform:scale(.94); }
  .football { top:69%; }
  .panel-title { align-items:flex-start; }
  .active-player-pill strong { display:none; }
  .probability-row div { padding:9px 7px; }
  .probability-row strong { font-size:.92rem; }
  .match-breakdown { grid-template-columns:repeat(2,1fr); }
  .final-score { grid-template-columns:1fr 44px 1fr; gap:6px; }
  .final-score > div:not(.final-vs) { padding:13px 7px; }
  .final-score img { width:64px; height:64px; }
  .final-score b { font-size:2.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:.01ms!important; animation-iteration-count:1!important; scroll-behavior:auto!important; }
}

/* =========================================================
   Nôs Penálti Online 1.0 — átrio, presença e partidas
   ========================================================= */

.brand-button {
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.connection-pill,
.role-pill,
.spectator-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2.25rem;
  padding: .45rem .75rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .02em;
  white-space: nowrap;
}

.connection-pill.online { background: rgba(61, 219, 139, .16); color: #9ff6c8; border: 1px solid rgba(61,219,139,.35); }
.connection-pill.offline { background: rgba(255, 107, 107, .14); color: #ffc2c2; border: 1px solid rgba(255,107,107,.35); }
.connection-pill.connecting { background: rgba(255, 204, 77, .14); color: #ffe18a; border: 1px solid rgba(255,204,77,.35); }

.single-card {
  width: min(640px, calc(100% - 2rem));
  margin: 1.5rem auto 3rem;
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(241,248,244,.96));
  border: 1px solid rgba(10, 64, 39, .12);
  box-shadow: 0 24px 70px rgba(0, 29, 18, .2);
  border-radius: 26px;
  padding: clamp(1.25rem, 3vw, 2rem);
  color: #10251b;
}

.warning-card code,
.code-note code {
  padding: .1rem .35rem;
  border-radius: .35rem;
  background: rgba(9, 74, 44, .08);
}

.code-note {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 16px;
  background: #102a1e;
  color: #eafff2;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .84rem;
  line-height: 1.55;
}

.compact-hero { padding-bottom: 0; }
.profile-form { display: grid; gap: 1rem; }
.profile-form > label { display: grid; gap: .45rem; }
.profile-form > label > span { font-weight: 900; color: #18412c; }
.profile-form input,
.profile-form select {
  width: 100%;
  min-height: 3.1rem;
  border: 1px solid rgba(12, 88, 51, .2);
  border-radius: 14px;
  background: #fff;
  padding: .75rem .9rem;
  font: inherit;
  color: #11251b;
}
.large-avatar-editor { justify-content: center; margin-bottom: .5rem; }

.lobby-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.2rem 0 1rem;
}

.lobby-heading h2 { margin: .2rem 0 .35rem; }
.lobby-heading p { margin: 0; max-width: 760px; color: rgba(255,255,255,.75); }

.my-profile-card {
  min-width: 230px;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .75rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
}

.my-profile-card img,
.online-avatar,
.invite-avatar,
.match-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8f3ec;
  border: 3px solid rgba(255,255,255,.78);
}
.my-profile-card strong { display: block; }
.my-profile-card span { color: rgba(255,255,255,.68); font-size: .82rem; }
.my-profile-card button { margin-left: auto; }

.lobby-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.lobby-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .45rem;
  padding: .8rem 1rem;
  border-radius: 16px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}
.lobby-summary strong { font-size: 1.45rem; }
.lobby-summary span { font-size: .78rem; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .06em; }

.lobby-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 1rem;
  padding-bottom: 2rem;
}

.lobby-panel {
  min-width: 0;
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(239,248,243,.96));
  color: #10251b;
  border-radius: 22px;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.42);
  box-shadow: 0 20px 55px rgba(0, 29, 18, .18);
}

.matches-panel { grid-column: 1 / 2; }
.ranking-panel { grid-column: 2 / 3; }

.panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .8rem;
}
.panel-heading-row h3 { margin: .15rem 0 0; }

.stack-list,
.match-list {
  display: grid;
  gap: .65rem;
  max-height: 430px;
  overflow: auto;
  padding-right: .2rem;
}
.secondary-stack { margin-top: .8rem; padding-top: .8rem; border-top: 1px dashed rgba(11,82,48,.18); }

.empty-state {
  border: 1px dashed rgba(12, 88, 51, .22);
  border-radius: 15px;
  padding: 1rem;
  color: #567064;
  text-align: center;
  background: rgba(255,255,255,.45);
}

.online-row,
.invite-row,
.live-match-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(12, 88, 51, .1);
  box-shadow: 0 8px 22px rgba(11, 68, 41, .06);
}
.online-main,
.invite-main { min-width: 0; flex: 1; }
.online-main strong,
.invite-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-main span,
.invite-main span { font-size: .79rem; color: #667a70; }

.status-dot {
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  display: inline-block;
  margin-right: .25rem;
  background: #8a9a91;
}
.status-dot.free { background: #20b96d; box-shadow: 0 0 0 4px rgba(32,185,109,.12); }
.status-dot.playing { background: #f1a72d; box-shadow: 0 0 0 4px rgba(241,167,45,.12); }
.status-dot.watching { background: #5b8cff; box-shadow: 0 0 0 4px rgba(91,140,255,.12); }

.row-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; justify-content: flex-end; }
.mini-btn {
  border: 0;
  border-radius: 999px;
  padding: .55rem .8rem;
  font-weight: 900;
  cursor: pointer;
  background: #0b6a3b;
  color: #fff;
  white-space: nowrap;
}
.mini-btn.secondary { background: #eaf3ee; color: #174b31; }
.mini-btn.danger { background: #ffe9e9; color: #a62424; }
.mini-btn:disabled { opacity: .45; cursor: not-allowed; }

.live-match-row { display: grid; grid-template-columns: minmax(0,1fr) auto; }
.live-match-teams { display: grid; gap: .4rem; }
.live-team { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: .55rem; }
.live-team img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.live-team div { min-width: 0; }
.live-team strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-team span { font-size: .74rem; color: #667a70; }
.live-team b { font-size: 1.15rem; }
.live-match-meta { font-size: .74rem; color: #6b7b72; margin-top: .35rem; }

.mini-ranking { display: grid; gap: .4rem; }
.ranking-row { display: grid; grid-template-columns: 1.5rem minmax(0,1fr) auto auto; gap: .5rem; align-items: center; padding: .55rem .65rem; border-radius: 12px; background: rgba(11,106,59,.06); }
.ranking-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-row span { font-size: .78rem; color: #63766c; }

.match-toolbar {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .8rem 0;
}
.match-toolbar .role-pill { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); }
.match-toolbar .spectator-pill { background: rgba(61,123,255,.16); color: #cfe0ff; border: 1px solid rgba(91,140,255,.3); }
.match-toolbar .danger-btn { margin-left: auto; }

.danger-btn {
  border: 0;
  min-height: 2.7rem;
  border-radius: 999px;
  padding: .65rem 1rem;
  background: linear-gradient(135deg, #c72c2c, #8f1717);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(154, 27, 27, .2);
}
.danger-btn:disabled { opacity: .45; cursor: not-allowed; }

.waiting-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 150px;
  text-align: left;
}
.waiting-panel h3 { margin: .15rem 0 .35rem; }
.waiting-panel p { margin: 0; color: #60746a; }
.waiting-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(11,106,59,.15);
  border-top-color: #0b6a3b;
  animation: onlineSpin .9s linear infinite;
}
@keyframes onlineSpin { to { transform: rotate(360deg); } }

.match-lower-grid {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.match-log-card,
.match-info-card {
  background: rgba(255,255,255,.94);
  color: #10251b;
  border-radius: 18px;
  padding: 1rem;
}
.match-log { display: grid; gap: .45rem; margin-top: .6rem; max-height: 210px; overflow: auto; }
.log-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .55rem; align-items: center; padding: .55rem .65rem; border-radius: 12px; background: #f1f7f3; }
.log-row.goal { background: #e3f8eb; }
.log-row.save { background: #fff2d8; }
.log-row.miss,
.log-row.post { background: #ffecec; }
.log-row time { font-size: .7rem; color: #7a8c82; }
.log-row strong { font-size: .84rem; }
.log-row span { font-size: .78rem; color: #586c61; }

.goal.readonly .goal-zone,
.goal.keeper-mode .goal-zone { pointer-events: none; }
.goal.attacker-mode .goal-zone { pointer-events: auto; }
.keeper-character.locked { filter: drop-shadow(0 0 10px rgba(255, 220, 77, .8)); }

.toast-area {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  display: grid;
  gap: .6rem;
  width: min(360px, calc(100% - 2rem));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: .9rem 1rem;
  border-radius: 16px;
  color: #fff;
  background: rgba(12, 42, 28, .96);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
  animation: toastIn .25s ease-out;
}
.toast.error { background: rgba(122, 25, 25, .97); }
.toast.success { background: rgba(8, 103, 55, .97); }
.toast strong { display: block; margin-bottom: .2rem; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

.modal-actions { display: flex; justify-content: center; gap: .65rem; flex-wrap: wrap; margin-top: 1rem; }

@media (max-width: 900px) {
  .lobby-heading { align-items: stretch; flex-direction: column; }
  .my-profile-card { width: 100%; }
  .lobby-grid { grid-template-columns: 1fr; }
  .matches-panel,
  .ranking-panel { grid-column: auto; }
  .match-lower-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar { align-items: flex-start; }
  .top-actions { justify-content: flex-end; }
  .connection-pill { width: 100%; justify-content: center; order: 3; }
  .lobby-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .lobby-summary > div { flex-direction: column; align-items: center; gap: .1rem; }
  .match-toolbar { flex-wrap: wrap; }
  .match-toolbar .danger-btn { margin-left: 0; }
  .scoreboard { grid-template-columns: 1fr; }
  .round-display { order: -1; }
  .score-player.away-side { flex-direction: row; }
  .live-match-row { grid-template-columns: 1fr; }
  .live-match-row > .mini-btn { width: 100%; margin-top: .6rem; }
}

/* =========================================================
   NÔS PENÁLTI 1.0.1 — REDESENHO VISUAL E CONTROLO DA BALIZA
   ========================================================= */

.stadium-wrap {
  background:
    radial-gradient(circle at 50% 8%, rgba(255,255,255,.16), transparent 22%),
    linear-gradient(#101820 0 20%, #092a19 20%);
}

.crowd {
  height: 138px;
  opacity: .92;
  background:
    radial-gradient(circle, rgba(255,214,89,.95) 0 1.6px, transparent 2.2px) 0 0/15px 13px,
    radial-gradient(circle, rgba(231,241,255,.92) 0 1.35px, transparent 2px) 7px 4px/19px 16px,
    radial-gradient(circle, rgba(80,159,255,.7) 0 1.5px, transparent 2.1px) 2px 8px/23px 18px,
    linear-gradient(180deg,#1a2632 0,#0b1116 72%,#071009 100%);
  box-shadow: inset 0 -30px 40px rgba(0,0,0,.7);
}

.pitch {
  height: clamp(520px, 67vw, 760px);
  perspective: 1250px;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(96,191,106,.38), transparent 42%),
    repeating-linear-gradient(0deg,
      rgba(255,255,255,.025) 0 54px,
      rgba(0,0,0,.035) 54px 108px),
    linear-gradient(180deg,#27854b 0%,#146c3a 39%,#0d5b31 69%,#0a4a29 100%);
}

.pitch::before {
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:
    repeating-linear-gradient(91deg, transparent 0 5px, rgba(255,255,255,.025) 5px 6px),
    radial-gradient(ellipse at 50% 88%, transparent 0 43%, rgba(0,0,0,.24) 100%);
  mix-blend-mode: overlay;
}

.pitch::after {
  content:"";
  position:absolute;
  inset:0;
  z-index:40;
  pointer-events:none;
  box-shadow: inset 0 0 70px rgba(0,0,0,.26), inset 0 -50px 70px rgba(0,0,0,.2);
}

.grass-lines {
  z-index:1;
  opacity:.34;
  background:
    repeating-linear-gradient(96deg, transparent 0 3px, rgba(255,255,255,.035) 3px 4px),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(0,0,0,.018) 22px 23px);
}

.penalty-area,
.penalty-arc { display:none; }

.pitch-markings {
  position:absolute;
  inset:0;
  z-index:2;
  width:100%;
  height:100%;
  overflow:visible;
  pointer-events:none;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.28));
}

.pitch-markings path {
  fill:none;
  stroke:rgba(255,255,255,.8);
  stroke-width:2.15;
  vector-effect:non-scaling-stroke;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.pitch-markings .goal-line { stroke:rgba(255,255,255,.66); }
.pitch-markings .goal-box-line { stroke:rgba(255,255,255,.72); }
.pitch-markings .penalty-arc-line { stroke:rgba(255,255,255,.76); }

.penalty-spot {
  z-index:4;
  left:50%;
  top:70.4%;
  width:12px;
  height:7px;
  background:rgba(255,255,255,.92);
  box-shadow:0 2px 4px rgba(0,0,0,.35);
}

.goal {
  --goal-front: 2.2%;
  z-index:6;
  top:5.5%;
  width:min(61%, 700px);
  aspect-ratio:2.52 / 1;
  transform:translateX(-50%);
  filter:drop-shadow(0 22px 16px rgba(0,0,0,.46));
  touch-action:none;
}

.goal::after {
  content:"";
  position:absolute;
  left:9%;
  right:9%;
  bottom:-6.5%;
  height:10%;
  z-index:0;
  border-radius:50%;
  background:rgba(0,0,0,.35);
  filter:blur(10px);
}

.goal-back-frame {
  position:absolute;
  z-index:1;
  left:8.2%;
  right:8.2%;
  top:11.2%;
  bottom:10%;
  border:3px solid rgba(228,236,238,.7);
  border-radius:2px;
  box-shadow:inset 0 0 18px rgba(0,0,0,.18);
}

.crossbar,
.post {
  z-index:12;
  background:linear-gradient(90deg,#aeb7ba 0%,#f8faf9 31%,#ffffff 54%,#b8c0c3 100%);
  box-shadow:0 4px 7px rgba(0,0,0,.38), inset 1px 0 rgba(255,255,255,.95);
}

.crossbar {
  left:1.4%;
  right:1.4%;
  top:2.2%;
  height:12px;
  border-radius:8px;
}

.post {
  top:2.2%;
  bottom:2.5%;
  width:12px;
  border-radius:8px;
}

.left-post { left:1.4%; }
.right-post { right:1.4%; }

.net {
  z-index:2;
  inset:11.6% 8.5% 10.3%;
  opacity:.76;
  clip-path:polygon(0 0,100% 0,96.5% 100%,3.5% 100%);
  background-image:
    linear-gradient(rgba(241,247,249,.55) 1px, transparent 1px),
    linear-gradient(90deg,rgba(241,247,249,.55) 1px, transparent 1px);
  background-size:22px 18px;
  box-shadow:inset 0 14px 24px rgba(0,0,0,.18);
}

.goal-depth {
  z-index:3;
  top:4.6%;
  bottom:5.5%;
  width:8.3%;
  opacity:.68;
  border:0;
  background-image:
    linear-gradient(rgba(241,247,249,.46) 1px,transparent 1px),
    linear-gradient(90deg,rgba(241,247,249,.46) 1px,transparent 1px);
  background-size:15px 17px;
}

.left-depth {
  left:1.7%;
  transform:none;
  clip-path:polygon(0 0,100% 8%,100% 92%,0 100%);
}

.right-depth {
  right:1.7%;
  transform:none;
  clip-path:polygon(100% 0,0 8%,0 92%,100% 100%);
}

.goal-floor-net {
  position:absolute;
  z-index:3;
  left:2.5%;
  right:2.5%;
  bottom:2.5%;
  height:10%;
  opacity:.62;
  clip-path:polygon(0 0,100% 0,92% 100%,8% 100%);
  background-image:
    linear-gradient(rgba(241,247,249,.45) 1px,transparent 1px),
    linear-gradient(90deg,rgba(241,247,249,.45) 1px,transparent 1px);
  background-size:20px 14px;
}

.keeper-range-glow {
  position:absolute;
  z-index:5;
  left:50%;
  top:58%;
  width:34%;
  height:48%;
  transform:translate(-50%,-50%);
  border-radius:50%;
  opacity:0;
  pointer-events:none;
  background:radial-gradient(ellipse,rgba(70,219,137,.2),rgba(70,219,137,.06) 48%,transparent 72%);
  transition:opacity .2s ease;
}

.goal.keeper-mode {
  cursor:crosshair;
}

.goal.keeper-mode .keeper-range-glow { opacity:1; }

.goal-zones {
  z-index:8;
  inset:9% 4.2% 7%;
  gap:0;
}

.goal-zone {
  border:0;
  outline:0;
  background:transparent;
  color:rgba(255,255,255,.8);
  cursor:crosshair;
}

.goal-zone::before {
  content:"";
  position:absolute;
  width:64px;
  height:44px;
  border:1px solid transparent;
  border-radius:13px;
  opacity:0;
  transition:opacity .18s ease,border-color .18s ease,background .18s ease,transform .18s ease;
}

.goal-zone:nth-child(1)::before { left:7%; top:8%; }
.goal-zone:nth-child(2)::before { right:7%; top:8%; }
.goal-zone:nth-child(3)::before { left:7%; bottom:8%; }
.goal-zone:nth-child(4)::before { right:7%; bottom:8%; }

.goal.attacker-mode .goal-zone::before {
  opacity:.72;
  border-color:rgba(255,255,255,.36);
  background:rgba(10,20,15,.1);
  box-shadow:0 0 0 1px rgba(0,0,0,.12);
}

.goal.attacker-mode .goal-zone:hover::before,
.goal-zone.selected::before {
  border-color:rgba(246,201,69,.96);
  background:rgba(246,201,69,.13);
  transform:scale(1.05);
  box-shadow:0 0 16px rgba(246,201,69,.34);
}

.goal-zone span {
  right:auto;
  bottom:auto;
  opacity:0;
  font-size:.58rem;
  letter-spacing:.06em;
}

.goal.attacker-mode .goal-zone span { opacity:.42; }
.goal-zone:nth-child(1) span { left:11%; top:12%; }
.goal-zone:nth-child(2) span { right:11%; top:12%; left:auto; }
.goal-zone:nth-child(3) span { left:11%; bottom:12%; }
.goal-zone:nth-child(4) span { right:11%; bottom:12%; left:auto; }

.target-marker {
  width:66px;
  height:66px;
  border-width:3px;
  box-shadow:0 0 0 5px rgba(246,201,69,.12),0 0 22px rgba(246,201,69,.55);
}

/* Personagens com anatomia sólida e volumes, mantendo fotografia personalizada. */
.caricature {
  --skin:#b86f43;
  --kit:#1760b9;
  --kit-dark:#0c315d;
  --shorts:#102d4b;
  --socks:#164f8a;
  width:126px;
  height:224px;
  transform-origin:50% 82%;
  filter:drop-shadow(0 8px 8px rgba(0,0,0,.22));
}

.caricature .character-shadow {
  left:18px;
  right:8px;
  bottom:0;
  height:19px;
  background:rgba(0,0,0,.34);
  filter:blur(5px);
}

.caricature .head {
  left:34px;
  top:0;
  width:59px;
  height:67px;
  border:3px solid rgba(233,177,123,.95);
  border-radius:46% 46% 43% 43% / 42% 42% 50% 50%;
  background:#855039;
  box-shadow:0 5px 10px rgba(0,0,0,.3),inset 0 -4px 7px rgba(0,0,0,.1);
}

.caricature .head img {
  object-position:center 28%;
  filter:saturate(.98) contrast(1.03);
}

.caricature .hair {
  top:-5px;
  left:37px;
  width:53px;
  height:21px;
  border-radius:50% 50% 34% 34%;
  background:radial-gradient(circle at 25% 55%,#26201b 0 3px,transparent 4px) 0 0/9px 8px,#120f0d;
  opacity:.94;
}

.caricature .neck {
  position:absolute;
  z-index:5;
  left:52px;
  top:58px;
  width:24px;
  height:21px;
  border-radius:8px;
  background:linear-gradient(90deg,#9b5935,var(--skin) 48%,#8d4e31);
  box-shadow:inset 0 -4px rgba(0,0,0,.09);
}

.caricature .body {
  left:24px;
  top:70px;
  width:80px;
  height:82px;
  border-radius:27px 27px 16px 16px / 22px 22px 18px 18px;
  background:linear-gradient(90deg,var(--kit-dark),var(--kit) 38%,#2f78cf 53%,var(--kit-dark));
  box-shadow:inset 0 -12px rgba(0,0,0,.13),inset 8px 0 rgba(255,255,255,.05),0 3px 5px rgba(0,0,0,.22);
}

.caricature .body::before,
.caricature .body::after {
  content:"";
  position:absolute;
  top:8px;
  width:21px;
  height:35px;
  border-radius:12px;
  background:linear-gradient(180deg,var(--kit),var(--kit-dark));
}

.caricature .body::before { left:-10px; transform:rotate(16deg); }
.caricature .body::after { right:-10px; transform:rotate(-16deg); }

.caricature .shirt-detail {
  position:absolute;
  left:50%;
  top:12px;
  width:20px;
  height:34px;
  transform:translateX(-50%);
  border-radius:8px;
  border-left:2px solid rgba(255,255,255,.3);
  opacity:.72;
}

.caricature .shorts {
  position:absolute;
  z-index:4;
  left:29px;
  top:139px;
  width:70px;
  height:36px;
  border-radius:10px 10px 17px 17px;
  background:linear-gradient(90deg,#081b2b,var(--shorts) 38%,#173e62 58%,#081b2b);
  box-shadow:inset 0 -7px rgba(0,0,0,.16),0 3px 4px rgba(0,0,0,.18);
}

.caricature .shorts::after {
  content:"";
  position:absolute;
  left:50%;
  top:8px;
  width:2px;
  height:24px;
  background:rgba(0,0,0,.24);
}

.caricature .arm {
  z-index:3;
  top:82px;
  width:24px;
  height:58px;
  border-radius:13px;
  background:linear-gradient(180deg,var(--kit) 0 34%,var(--skin) 35% 100%);
  box-shadow:inset 4px 0 rgba(255,255,255,.08),inset -5px 0 rgba(0,0,0,.11);
}

.caricature .arm::after {
  content:"";
  position:absolute;
  left:3px;
  top:44px;
  width:18px;
  height:49px;
  border-radius:11px;
  transform-origin:50% 2px;
  background:linear-gradient(90deg,#9d5a38,var(--skin) 48%,#8f4c30);
  box-shadow:inset -4px 0 rgba(0,0,0,.1);
}

.caricature .arm-left { left:12px; transform:rotate(17deg); }
.caricature .arm-right { right:10px; transform:rotate(-17deg); }
.caricature .arm-left::after { transform:rotate(-8deg); }
.caricature .arm-right::after { transform:rotate(8deg); }

.caricature .leg {
  z-index:3;
  top:164px;
  width:28px;
  height:58px;
  border-radius:13px 13px 10px 10px;
  background:linear-gradient(180deg,var(--skin) 0 37%,var(--socks) 38% 100%);
  box-shadow:inset 5px 0 rgba(255,255,255,.06),inset -5px 0 rgba(0,0,0,.12);
}

.caricature .leg::after {
  content:"";
  position:absolute;
  left:-5px;
  bottom:-4px;
  width:41px;
  height:16px;
  border-radius:12px 18px 8px 8px;
  background:linear-gradient(180deg,#f8f8f6,#c8c8c5 62%,#4d4d4d 64%);
  box-shadow:0 4px 4px rgba(0,0,0,.22);
}

.caricature .leg-left { left:34px; transform:rotate(4deg); }
.caricature .leg-right { right:31px; transform:rotate(-4deg); }

.keeper-character {
  --kit:#e58e1e;
  --kit-dark:#9c4e0c;
  --shorts:#783306;
  --socks:#e18a17;
  left:50%;
  top:58%;
  bottom:auto;
  transform:translate(-50%,-50%) scale(.73);
  cursor:grab;
  transition:left .1s linear,top .1s linear,transform .22s ease,filter .2s ease;
  will-change:left,top,transform;
}

.keeper-character::after {
  content:"";
  position:absolute;
  inset:-18px -28px -12px;
  z-index:-1;
}

.keeper-character.dragging {
  cursor:grabbing;
  transition:none;
  filter:drop-shadow(0 0 10px rgba(71,218,139,.58));
}

.keeper-shirt {
  background:linear-gradient(90deg,#9d4b08,#ec971f 36%,#ffbd47 53%,#a8540b) !important;
}

.keeper-shorts {
  background:linear-gradient(90deg,#652803,#9b4508 48%,#5c2402) !important;
}

.keeper-character .arm-left {
  left:5px;
  transform:rotate(63deg);
}

.keeper-character .arm-right {
  right:3px;
  transform:rotate(-63deg);
}

.keeper-character .arm-left::after { transform:rotate(-8deg); }
.keeper-character .arm-right::after { transform:rotate(8deg); }

.glove {
  z-index:6;
  top:151px;
  width:29px;
  height:24px;
  border-radius:48% 48% 42% 42%;
  background:linear-gradient(180deg,#f7fbff,#c7dcea 58%,#8ca8ba);
  border:2px solid #607f94;
  box-shadow:0 3px 5px rgba(0,0,0,.24);
}

.glove-left { left:-10px; transform:rotate(-22deg); }
.glove-right { right:-10px; transform:rotate(22deg); }

.keeper-character.diving-left {
  transform:translate(calc(-50% - 72px),calc(-50% + 18px)) rotate(-62deg) scale(.79);
}

.keeper-character.diving-right {
  transform:translate(calc(-50% + 72px),calc(-50% + 18px)) rotate(62deg) scale(.79);
}

.keeper-character.diving-up-left {
  transform:translate(calc(-50% - 62px),calc(-50% - 42px)) rotate(-49deg) scale(.78);
}

.keeper-character.diving-up-right {
  transform:translate(calc(-50% + 62px),calc(-50% - 42px)) rotate(49deg) scale(.78);
}

.shooter-character {
  --kit:#145eb7;
  --kit-dark:#082e60;
  --shorts:#0b2947;
  --socks:#14559b;
  left:25%;
  top:66%;
  width:142px;
  height:252px;
  transform:translate(-50%,-50%) scale(1.12);
  z-index:18;
  transition:transform .28s ease,left .28s ease,top .28s ease;
}

.shooter-character .head {
  left:41px;
  width:64px;
  height:73px;
}

.shooter-character .hair { left:44px; width:57px; }
.shooter-character .neck { left:62px; top:64px; }
.shooter-character .body { left:29px; top:77px; width:88px; height:89px; }
.shooter-character .shorts { left:35px; top:153px; width:76px; height:39px; }
.shooter-character .arm { top:90px; height:65px; }
.shooter-character .arm-left { left:14px; transform:rotate(13deg); }
.shooter-character .arm-right { right:12px; transform:rotate(-21deg); }
.shooter-character .leg { top:181px; height:67px; width:30px; }
.shooter-character .leg-left { left:41px; }
.shooter-character .leg-right { right:35px; }

.shooter-character.shooting {
  transform:translate(-13%,-61%) rotate(-9deg) scale(1.12);
}

.shooter-character .kicking {
  transform:rotate(-44deg) translateY(-3px);
}

.football {
  z-index:31;
  top:70.4%;
  width:42px;
  height:42px;
  background:
    radial-gradient(circle at 33% 27%,rgba(255,255,255,.98),rgba(238,238,235,.96) 48%,#a9aaa8 76%,#6e706f 100%);
  box-shadow:inset -7px -8px 10px rgba(0,0,0,.22),inset 5px 4px 7px rgba(255,255,255,.7),0 10px 13px rgba(0,0,0,.36);
}

.football::before {
  inset:11px;
  background:#111;
}

.football::after {
  inset:5px;
  border-color:rgba(0,0,0,.34);
}

.goal.keeper-mode .goal-zone,
.goal.readonly .goal-zone { pointer-events:none; }
.goal.attacker-mode .goal-zone { pointer-events:auto; }

@media (max-width: 840px) {
  .pitch { height:590px; }
  .goal { width:78%; top:6%; }
  .shooter-character { left:23%; top:67%; transform:translate(-50%,-50%) scale(1.01); }
  .shooter-character.shooting { transform:translate(-15%,-61%) rotate(-9deg) scale(1.01); }
}

@media (max-width: 560px) {
  .crowd { height:86px; }
  .pitch { height:540px; }
  .goal { width:91%; top:7%; }
  .goal-zone::before { width:48px; height:34px; }
  .shooter-character { left:21%; top:68%; transform:translate(-50%,-50%) scale(.86); }
  .shooter-character.shooting { transform:translate(-13%,-62%) rotate(-9deg) scale(.86); }
  .football { top:70.4%; width:38px; height:38px; }
}
