/* Pig Sports — a hall with a door to every sport. The hall is a grid of
   cards; each sport then takes the whole canvas and draws itself. */

:root {
  --ink:   #f2eefb;
  --dim:   #a79ec0;
  --bg:    #140f1c;
  --panel: #211a2e;
  --line:  #3a2f4f;
  --hot:   #ffbe3d;
  --boar:  #c0392b;
  --pig:   #f2a0b6;
  --court: #b4763c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 30;
  background: var(--hot); color: #241700; padding: .5rem .8rem; border-radius: 0 0 .5rem 0;
}
.skip-link:focus { left: 0; }

.bar {
  display: flex; align-items: center; gap: .9rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #150f1f70;
  position: sticky; top: 0; z-index: 8;
  backdrop-filter: blur(6px);
}
.bar h1 { font-size: 1.1rem; margin: 0; }
.bar .home { color: var(--dim); text-decoration: none; font-size: .9rem; }
.bar .home:hover { color: var(--ink); }
.bar .tag { margin: 0 0 0 auto; color: var(--dim); font-size: .78rem; }

main { padding: 1rem; max-width: 980px; margin: 0 auto; }

.screen { display: none; }
.screen.active { display: block; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
}
.panel.wide { max-width: none; }
.panel h2 { margin: 0 0 .4rem; }
.lede { color: var(--dim); margin: 0 0 1rem; }

.btn {
  font: inherit; color: var(--ink); cursor: pointer;
  background: #30254a; border: 1px solid var(--line);
  border-radius: .7rem; padding: .55rem .9rem;
}
.btn:hover:not(:disabled) { border-color: rgba(255,230,190,.5); }
.btn.big { background: var(--hot); color: #241700; font-weight: 800; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; }

/* ---- the hall ---- */
.sports { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .7rem; }
.sport {
  display: flex; gap: .7rem; align-items: flex-start; text-align: left;
  font: inherit; color: inherit; cursor: pointer;
  background: #2a2140; border: 2px solid var(--line);
  border-radius: .9rem; padding: .7rem .8rem;
}
.sport:hover { border-color: rgba(255,190,61,.55); background: #332750; }
.sport .si { font-size: 2rem; line-height: 1; }
/* the film's pig, doing the sport, once he has been built */
.sport .si-pic { width: 4.6rem; height: 4.6rem; object-fit: contain; margin: -.6rem -.3rem -.6rem -.5rem; flex: none;
                 filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }
.sport .sn { display: block; font-weight: 800; }
.sport .sb { display: block; color: var(--dim); font-size: .85rem; }
.sport .sx { display: block; color: var(--hot); font-size: .78rem; font-weight: 700; margin-top: .2rem; }
.sport.away { border-style: dashed; }

/* ---- playing ---- */
.hud { display: flex; gap: .5rem; align-items: center; margin-bottom: .6rem; flex-wrap: wrap; }
.pill {
  background: #2a2140; border: 1px solid var(--line);
  border-radius: 999px; padding: .25rem .7rem; font-weight: 800;
}
.pill.ghost { background: transparent; color: var(--dim); font-weight: 600; }
.hud .btn { margin-left: auto; }
/* 🔊 sits right beside ✕ Stop, not halfway across the bar */
.hud .btn + .btn { margin-left: 0; }

canvas {
  display: block; width: 100%; height: auto;
  background: #1b1428; border: 1px solid var(--line); border-radius: .8rem;
  touch-action: none;
}
.tip { color: var(--dim); font-size: .9rem; min-height: 1.5em; margin: .5rem 0 0; }

.facts { color: var(--dim); margin: .4rem 0 0; padding-left: 1.1rem; }
.facts li { margin: .15rem 0; }

/* ---- the touch row, for a phone ---- */
.touchrow { display: flex; gap: .8rem; justify-content: center; margin-top: .7rem; }
/* The phone buttons are hidden on a mouse-and-keyboard computer (wireTouch sets [hidden]);
   display:flex above used to win over [hidden], so they showed on every desktop. */
.touchrow[hidden] { display: none; }
.tbtn {
  font: inherit; font-size: 1.4rem; color: var(--ink); cursor: pointer;
  background: #30254a; border: 1px solid var(--line);
  border-radius: 999px; width: 4rem; height: 3.2rem;
  display: grid; place-items: center; user-select: none; touch-action: manipulation;
}
.tbtn.big { width: 6rem; background: var(--hot); color: #241700; border-color: transparent; }
.tbtn:active { transform: translateY(1px); }
.tbtn[hidden] { display: none; }

/* 🤼 Sumo's row: walking on the left thumb (◀ ▶), the three moves on the
   right (🌀 dodge, ⚡ charge, ✋ shove), and five buttons still fit a
   phone 390 wide. The DOM order is the other sports' order; `order` moves
   them here so nothing any other sport presses has changed. */
.touchrow.sumo { gap: .5rem; justify-content: space-between; }
.touchrow.sumo .tbtn { width: 3.5rem; height: 3.5rem; }
.touchrow.sumo .tbtn.big { width: 4.6rem; }
.touchrow.sumo #t-aim-down { order: 1; }
.touchrow.sumo #t-aim-up { order: 2; margin-right: auto; }
.touchrow.sumo #t-dodge { order: 3; background: #2c3f6a; }
.touchrow.sumo #t-charge { order: 4; background: #6a2c3a; }
.touchrow.sumo #t-shoot { order: 5; }

@media (max-width: 560px) {
  main { padding: .6rem; }
  .sports { grid-template-columns: 1fr; }
}

/* 🏒 Hockey's row (v1.7): skate ◀ ▲ ▼ ▶ on the left thumb, 💥 check and
   🏒 shoot on the right — six buttons, still inside a phone 390 wide. */
.touchrow.hockey { gap: .35rem; justify-content: space-between; }
.touchrow.hockey .tbtn { width: 3.1rem; height: 3.4rem; font-size: 1.25rem; }
.touchrow.hockey .tbtn.big { width: 4.2rem; }
.touchrow.hockey #t-aim-down { order: 1; }
.touchrow.hockey #t-up { order: 2; }
.touchrow.hockey #t-down { order: 3; }
.touchrow.hockey #t-aim-up { order: 4; margin-right: auto; }
.touchrow.hockey #t-charge { order: 5; background: #6a2c3a; }
.touchrow.hockey #t-shoot { order: 6; }

/* 🏅 the Pig Olympics: its own big button at the top of the hall */
.olympics {
  display: flex; gap: .9rem; align-items: center; width: 100%; text-align: left;
  font: inherit; color: #241700; cursor: pointer; margin: 0 0 .9rem;
  background: linear-gradient(100deg, #ffd35a, #ffbe3d 45%, #ff9a3d);
  border: 2px solid #ffe7a0; border-radius: 1rem; padding: .8rem 1rem;
  box-shadow: 0 6px 22px rgba(255,170,60,.25);
}
.olympics:hover, .olympics:focus-visible { filter: brightness(1.06); box-shadow: 0 6px 28px rgba(255,190,80,.45); }
.olympics .oi { font-size: 2.6rem; line-height: 1; }
.olympics .on { display: block; font-weight: 900; font-size: 1.25rem; }
.olympics .ob { display: block; font-size: .92rem; }
.olympics .ox { display: block; font-size: .8rem; font-weight: 800; margin-top: .15rem; color: #5a2a00; }
#s-olympics h3, #s-podium h3 { margin: 1rem 0 .4rem; font-size: 1rem; }
.oly-going { background: #3a2a14; border: 1px solid #7a5a20; border-radius: .7rem; padding: .5rem .7rem; }
.oly-going .done { opacity: .45; }
.oly-going .now { font-size: 1.4rem; }
.oly-total { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin: .2rem 0 .5rem; }
.oly-cab { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.oly-cab li { display: grid; grid-template-columns: 1.4fr 1.2fr 1fr; gap: .4rem; background: #2a2140; border-radius: .5rem; padding: .3rem .6rem; font-size: .9rem; }
.oly-cab .rec { color: var(--dim); text-align: right; }
.oly-best { color: var(--dim); font-size: .85rem; }
.oly-beat { background: #3a2a14; border: 1px solid #7a5a20; border-radius: .7rem; padding: .5rem .8rem; margin-bottom: .6rem; }
.oly-beat ul { margin: .2rem 0 0; padding-left: 1.1rem; }
#over-facts li.you { color: var(--ink); }
.medal { font-size: 4.5rem; line-height: 1; margin: 0 0 .3rem; text-align: center; animation: medal-in .7s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes medal-in { from { transform: scale(.2) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.medal-table { border-collapse: collapse; width: 100%; max-width: 30rem; }
.medal-table th, .medal-table td { padding: .3rem .6rem; text-align: center; border-bottom: 1px solid var(--line); }
.medal-table td:nth-child(2) { text-align: left; font-weight: 700; }
.medal-table tr.you td { color: var(--hot); }
#podium { margin-top: .4rem; }
@media (prefers-reduced-motion: reduce) { .medal { animation: none; } }
@media (max-width: 560px) {
  .olympics .oi { font-size: 2rem; }
  .oly-cab li { grid-template-columns: 1fr 1fr; }
  .oly-cab .rec { grid-column: 1 / -1; text-align: left; }
}
/* 🏅 awards, quips and the table so far (v1.7) */
.oly-awards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .4rem; }
.oly-awards li { background: #2a2140; border: 1px solid var(--line); border-radius: .6rem; padding: .4rem .5rem; opacity: .5; font-size: .82rem; display: grid; gap: .1rem; }
.oly-awards li.got { opacity: 1; border-color: #c8a040; background: #3a2a14; }
.oly-awards .ai { font-size: 1.4rem; }
.quip { font-style: italic; color: var(--ink); margin: .6rem 0 0; }
.award { background: #3a2a14; border: 1px solid #c8a040; border-radius: .6rem; padding: .4rem .7rem; font-weight: 800; color: var(--hot); }
.oly-table-line { color: var(--dim); font-size: .85rem; margin: .5rem 0 0; }
.award[hidden], .quip[hidden], .oly-table-line[hidden] { display: none; }

/* ⛳ Mini-golf's row (v1.8): aim ◀ ▶ on the left thumb, then power ▼ ▲,
   the 🧭 caddie, and the big ⛳ putt — six buttons inside a phone 390 wide.
   The green itself is the main control: pull back and let go. */
.touchrow.golf { gap: .35rem; justify-content: space-between; }
.touchrow.golf .tbtn { width: 3.1rem; height: 3.4rem; font-size: 1.25rem; }
.touchrow.golf .tbtn.big { width: 4.2rem; }
.touchrow.golf #t-aim-down { order: 1; }
.touchrow.golf #t-aim-up { order: 2; margin-right: auto; }
.touchrow.golf #t-down { order: 3; background: #2c3f6a; }
.touchrow.golf #t-up { order: 4; background: #6a2c3a; }
.touchrow.golf #t-dodge { order: 5; background: #2c5a4a; }
.touchrow.golf #t-shoot { order: 6; }

/* ⛳ the practice holes under the how-to */
.how-extra h3 { margin: 1rem 0 .2rem; font-size: 1rem; }
.how-extra .lede { margin-bottom: .5rem; font-size: .9rem; }
.golf-holes { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.2rem, 1fr)); gap: .4rem; }
.golf-hole {
  font: inherit; color: var(--ink); cursor: pointer; text-align: left;
  background: #24402e; border: 1px solid #3f6a4a; border-radius: .6rem; padding: .35rem .55rem;
  display: grid; gap: 0; min-height: 44px;
}
.golf-hole:hover:not(:disabled) { border-color: #9fe8a8; }
.golf-hole:disabled { opacity: .45; cursor: not-allowed; background: #2a2140; border-color: var(--line); }
.golf-hole .gh-n { font-weight: 900; }
.golf-hole .gh-name { font-size: .82rem; }
.golf-hole .gh-best { font-size: .74rem; color: #9fe8a8; }
.golf-bestcard { color: var(--hot); font-size: .9rem; margin: .6rem 0 0; }

/* ⛳ the scorecard on the end screen: birdies ringed, bogeys boxed, the way a club prints them */
.over-card { margin: .7rem 0 0; overflow-x: auto; }
.over-card[hidden] { display: none; }
.scorecard { border-collapse: collapse; background: #fbf6e8; color: #2a2030; border-radius: .5rem; overflow: hidden; min-width: 100%; font-size: .9rem; }
.scorecard th { background: #2f7a3e; color: #fff; padding: .3rem .35rem; }
.scorecard td { text-align: center; padding: .25rem .3rem; border-top: 1px solid #e2dccb; }
.scorecard td:first-child, .scorecard th:first-child { text-align: left; padding-left: .55rem; white-space: nowrap; }
.scorecard tr.par td { color: #5a6a7a; }
.scorecard .gc { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; font-weight: 800; }
.scorecard .gc.birdie { border: 2px solid #2a9a4a; border-radius: 50%; }
.scorecard .gc.eagle { border: 4px double #2a9a4a; border-radius: 50%; }
.scorecard .gc.ace { background: #ffd23a; border-radius: 50%; }
.scorecard .gc.bogey { border: 2px solid #c8402a; }
.scorecard .gc.double { border: 4px double #c8402a; }
/* 🆕 the newest sport says so */
.sport .sx.new { display: inline-block; margin-top: .3rem; padding: .05rem .5rem; border-radius: 999px; background: #3ac85a; color: #062a10; }
.sport:has(.sx.new) { border-color: #3ac85a; box-shadow: 0 0 18px rgba(58,200,90,.25); }

/* ===== v1.9 (7 November 2026) ===== */
/* 🏆 the Pig League: a second big button under the Olympics, in the trophy's green and gold */
.olympics.league { background: linear-gradient(100deg, #3ac87a, #2aa868 45%, #1f8a6a); border-color: #9af0c0; color: #04240f;
                   box-shadow: 0 6px 22px rgba(60,200,120,.25); }
.olympics.league:hover, .olympics.league:focus-visible { box-shadow: 0 6px 28px rgba(80,220,140,.45); }
.olympics.league .ox { color: #063a1c; }
.new-tag { display: inline-block; vertical-align: middle; font-size: .7rem; font-weight: 900; letter-spacing: .04em;
           background: #ffd23a; color: #3a2400; border-radius: 999px; padding: .05rem .45rem; margin-left: .3rem; }
.lg-table td:nth-child(2) { white-space: nowrap; }
.lg-table .up { color: #6ae88a; font-size: .75rem; }
.lg-table .down { color: #ff7a7a; font-size: .75rem; }
.lg-cups { font-size: 1.6rem; letter-spacing: .1rem; margin: .2rem 0; }
.lg-beat { background: #14382a; border-color: #2a8a5a; }
.lg-beat .lg-pos { display: block; color: var(--dim); font-size: .85rem; margin-top: .2rem; }
#s-league h3, #s-trophy h3 { margin: 1rem 0 .4rem; font-size: 1rem; }
#over-table .medal-table { margin-top: .3rem; font-size: .88rem; }
#trophy { margin: .4rem 0 .6rem; }
@media (max-width: 560px) {
  .lg-table th, .lg-table td { padding: .25rem .3rem; }
  .lg-table td:nth-child(2) { white-space: normal; }
}

/* 🎾 tennis's row: run ◀ ▶, ▲ jump, ▼ lob, ⚡ super shot and the big 🎾 swing — six, like hockey's */
.touchrow.tennis, .touchrow.bowl, .touchrow.ski, .touchrow.bow { gap: .35rem; justify-content: space-between; }
.touchrow.tennis .tbtn, .touchrow.bowl .tbtn, .touchrow.ski .tbtn, .touchrow.bow .tbtn { width: 3.1rem; height: 3.4rem; font-size: 1.25rem; }
.touchrow.tennis .tbtn.big, .touchrow.bowl .tbtn.big, .touchrow.ski .tbtn.big, .touchrow.bow .tbtn.big { width: 4.4rem; }
.touchrow.tennis #t-aim-down { order: 1; }
.touchrow.tennis #t-aim-up { order: 2; margin-right: auto; }
.touchrow.tennis #t-up { order: 3; background: #2c3f6a; }
.touchrow.tennis #t-down { order: 4; background: #2c3f6a; }
.touchrow.tennis #t-charge { order: 5; background: #6a4a1c; }
.touchrow.tennis #t-shoot { order: 6; }
/* 🎳 bowling's: step ◀ ▶, spin ▲ ▼, and the big 🎳 (hold, let go) */
.touchrow.bowl #t-aim-down { order: 1; }
.touchrow.bowl #t-aim-up { order: 2; margin-right: auto; }
.touchrow.bowl #t-up { order: 3; background: #4a2c6a; }
.touchrow.bowl #t-down { order: 4; background: #4a2c6a; }
.touchrow.bowl #t-shoot { order: 5; }
/* ⛷️ skiing's: turn ◀ ▶, ▲ flip (in the air), ▼ tuck, and the big ⛷️ jump */
.touchrow.ski #t-aim-down { order: 1; }
.touchrow.ski #t-aim-up { order: 2; margin-right: auto; }
.touchrow.ski #t-up { order: 3; background: #4a2c6a; }
.touchrow.ski #t-down { order: 4; background: #2c3f6a; }
.touchrow.ski #t-shoot { order: 5; }
/* 🏹 archery's: aim ◀ ▲ ▼ ▶ and the big 🏹 (hold to draw, let go) */
.touchrow.bow #t-aim-down { order: 1; }
.touchrow.bow #t-up { order: 2; }
.touchrow.bow #t-down { order: 3; }
.touchrow.bow #t-aim-up { order: 4; margin-right: auto; }
.touchrow.bow #t-shoot { order: 5; }
