/* Turkey Tracks v41: Chapter cards on the game menu, the Chapter 2 lock, and the Chapter 2 games.
   Art ids come from the Asset Tracker (Round 21). Every picture has an emoji stand-in until it is made. */

/* ---------- the two big Chapter cards ---------- */
.chcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2vw, 30px); }
.chcard { position: relative; display: grid; grid-template-rows: auto 1fr auto auto; gap: clamp(6px, 1vh, 12px); padding: clamp(10px, 1.2vw, 18px); border: 0; border-radius: 26px; cursor: pointer; color: #fff; text-align: center; font: inherit;
  background: linear-gradient(180deg, #5a2f12, #2a150a); box-shadow: inset 0 0 0 4px #7b4519, inset 0 0 0 8px #2a150a, 0 14px 30px rgba(0, 0, 0, .55); transition: transform .12s; }
.chcard[data-ch="2"] { background: linear-gradient(180deg, #123a5a, #0a1a2a); box-shadow: inset 0 0 0 4px #2e7bb4, inset 0 0 0 8px #0a1a2a, 0 14px 30px rgba(0, 0, 0, .55); }
.chcard:hover, .chcard:focus-visible { transform: translateY(-4px); }
.chcard:focus-visible { outline: 4px solid var(--slime, #8cff3a); outline-offset: 3px; }
.chtop { display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 0; }
.chart { flex: none; width: clamp(48px, 5vw, 76px); aspect-ratio: 1; }
.chart img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
.chtt { display: grid; text-align: left; min-width: 0; }
.chtt b { font: 400 clamp(24px, 2.8vw, 44px) var(--f-display); line-height: 1; color: var(--pill, #ffd27a); -webkit-text-stroke: .04em #14100c; paint-order: stroke fill; }
.chtt small { font: 400 clamp(15px, 1.4vw, 22px) var(--f-display); color: #f3dfc0; overflow-wrap: anywhere; }
.chprev { position: relative; display: block; width: auto; max-width: 100%; height: clamp(170px, calc(100dvh - var(--hudh, 72px) - 330px), 62vw); aspect-ratio: 4 / 3; margin-inline: auto; border-radius: 18px; overflow: hidden; background: #000; border: 5px solid #111; box-shadow: inset 0 0 24px rgba(0, 0, 0, .8); }
.chpv { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease; }
.chpv.on { opacity: 1; }
.chpv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chpv img.stand { object-fit: contain; padding: 14%; background: radial-gradient(circle, #3a2a52, #120a20); }
.chpvname { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); max-width: calc(100% - 20px); padding: 4px 14px; border-radius: 999px; background: rgba(10, 5, 2, .82); border: 2px solid var(--amber, #ffb02e); color: #fff; font: 400 clamp(15px, 1.5vw, 24px) var(--f-display); line-height: 1.15; overflow-wrap: anywhere; }
.chcard.locked .chpv img { filter: saturate(.55) brightness(.75); }
.chlock { position: absolute; right: 10px; top: 10px; width: clamp(54px, 6vw, 90px); aspect-ratio: 1; z-index: 2; animation: chwob 2.4s ease-in-out infinite; }
.chlock img, .glock img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .7)); }
.glock img { width: clamp(54px, 40%, 110px); height: auto; aspect-ratio: 1; }
@keyframes chwob { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
.chdots { display: flex; justify-content: center; gap: 7px; flex-wrap: wrap; }
.chdots i { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, .28); transition: background .3s, transform .3s; }
.chdots i.on { background: var(--pill, #ffd27a); transform: scale(1.3); }
.chfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; font: 400 clamp(16px, 1.4vw, 22px) var(--f-display); color: #f3dfc0; }
.chgo { display: inline-flex; align-items: center; gap: 6px; padding: 6px 22px; border-radius: 999px; background: var(--cran, #d7263d); color: #fff; box-shadow: 0 4px 0 #8f1424; }
.chgo svg { width: 22px; height: 22px; }
.chcard.locked .chfoot { color: #9fe7ff; font-size: clamp(20px, 2vw, 30px); }
.chbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.chhere { margin: 0; font: 400 clamp(20px, 2.2vw, 34px) var(--f-display); color: #fff; -webkit-text-stroke: .04em #14100c; paint-order: stroke fill; overflow-wrap: anywhere; min-width: 0; }
.chbackbtn { min-height: 48px; }
.chlockchip { border-color: #9fe7ff; color: #9fe7ff; }
.gcab[aria-disabled="true"] { cursor: pointer; }
@media (max-width: 700px) and (orientation: portrait) { .chcards { grid-template-columns: minmax(0, 1fr); } .chprev { max-height: 34vh; } }
@media (max-height: 500px) and (orientation: landscape) { .chprev { max-height: 46vh; min-height: 120px; } .chtt b { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { .chpv { transition: none; } .chlock { animation: none; } .chcard { transition: none; } .chcard:hover { transform: none; } .chdots i { transition: none; } }

/* ---------- Teacher Tools: Chapter 2 switch ---------- */
.ch2box { margin: 4px 0 14px; padding: 12px 16px; border-radius: 16px; border: 3px solid #9fe7ff; background: rgba(46, 123, 180, .16); }
.ch2box h3 { margin-top: 0; }
.ch2state { margin: 0 0 10px; font-size: 1.05em; }
.ch2state b { color: #ff8a8a; }
.ch2state.open b { color: var(--slime, #8cff3a); }
.ch2box .btn.big { width: 100%; justify-content: center; }
.ch2ask { margin-top: 10px; }
.ch2ask input { font-size: 1.3em; letter-spacing: .12em; text-transform: uppercase; min-width: 0; flex: 1; }

/* ---------- Chapter 2 shooters (Gremlin Invaders, Gift Train): the field fills the display ---------- */
main.incab .c2field { flex: 1 1 0; min-height: 260px; }
.c2field { position: relative; width: 100%; border-radius: 20px; overflow: hidden; border: 3px solid var(--line, #6b4a2a); background: radial-gradient(circle at 50% 30%, #23305e, #0a0f24);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; cursor: crosshair; }
.c2.train .c2field { background: linear-gradient(#0f3b2a, #0a1f18); }
.c2bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; opacity: .9; }
.c2bg.stand { object-fit: contain; padding: 30%; opacity: .12; }
.c2field canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.c2lay { position: absolute; inset: 0; pointer-events: none; }
.c2sign { position: absolute; left: 0; top: 0; box-sizing: border-box; padding: 5px 8px 6px; border-radius: 12px; background: #fff7e6; color: #2a1408; border: 3px solid #2a1408; box-shadow: 0 4px 0 rgba(0, 0, 0, .45);
  font: 700 clamp(13px, 2vmin, 24px)/1.18 var(--f-body, sans-serif); text-align: center; overflow-wrap: anywhere; will-change: transform; transition: opacity .5s, background .3s; }
.c2sign b { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; margin-right: 5px; border-radius: 50%; background: #2a1408; color: #ffd27a; font-family: var(--f-display); font-weight: 400; vertical-align: middle; }
.c2sign.out { background: #ffd6dc; border-color: #d1001f; color: #8a0014; text-decoration: line-through; opacity: .75; }
.c2sign.out b { background: #d1001f; color: #fff; }
.c2sign.right { background: #d9ffbf; border-color: #2f8a12; box-shadow: 0 0 0 4px rgba(140, 255, 58, .6), 0 0 26px rgba(140, 255, 58, .9); }
.c2sign.poof { opacity: 0; }
.c2key { flex: none; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.c2key li { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px 4px 4px; border-radius: 12px; background: rgba(255, 247, 230, .95); color: #2a1408; border: 2px solid #2a1408;
  font: 700 clamp(13px, 1.05vw, 20px)/1.2 var(--f-body, sans-serif); overflow-wrap: anywhere; min-width: 0; }
.c2key li span { min-width: 0; }
.c2key i { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--c); color: #fff; border: 3px solid #fff; box-shadow: 0 0 0 2px #2a1408; font: 400 19px var(--f-display); font-style: normal; }
.c2key li.out { opacity: .5; text-decoration: line-through; background: #ffd6dc; }
@media (max-width: 700px) { .c2key { grid-template-columns: minmax(0, 1fr); gap: 4px; } .c2key li { min-height: 34px; } .c2key i { width: 28px; height: 28px; font-size: 16px; } }
@media (max-height: 520px) and (orientation: landscape) { .c2key { grid-template-columns: repeat(2, minmax(0, 1fr)); } .c2key li { min-height: 30px; font-size: 12px; } .c2key i { width: 24px; height: 24px; font-size: 14px; } }
@media (min-width: 1600px) and (min-height: 900px) { .c2key li { font-size: 22px; min-height: 52px; } .c2key i { width: 44px; height: 44px; font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { .c2sign { transition: none; } }
.gcab .glock img, .gcab .glock img.stand { position: static; width: clamp(56px, 46%, 120px); height: auto; aspect-ratio: 1; padding: 0; background: none; object-fit: contain; }
.gcab.locked .gscreen > img { filter: saturate(.5) brightness(.7); }
/* phones: the shooters fit ONE screen, same as Fruit Slice (no scrolling, nothing cut off) */
@media (max-width: 700px) {
  main.incab .c2field { flex: none !important; height: max(300px, calc(var(--vis) - 210px)) !important; }
}
@media (max-width: 700px) and (orientation: portrait) {
  body.cmp:is([data-screen="invaders"], [data-screen="train"], [data-screen="flakes"], [data-screen="plinko"]) main.incab {
    height: calc(100svh - var(--hudh, 60px)) !important; min-height: 420px !important; overflow: hidden !important; padding-top: 6px !important; padding-bottom: max(6px, env(safe-area-inset-bottom, 0px)) !important; }
  body.cmp:is([data-screen="invaders"], [data-screen="train"], [data-screen="flakes"], [data-screen="plinko"]) main.incab > .wrap {
    flex: 1 1 auto !important; min-height: 0 !important; overflow-x: hidden !important; overflow-y: auto !important; padding: 8px !important; }
  body.cmp:is([data-screen="invaders"], [data-screen="train"], [data-screen="flakes"], [data-screen="plinko"]) main.incab .lockhead { padding-top: 46px !important; gap: 4px 8px !important; }
  body.cmp:is([data-screen="invaders"], [data-screen="train"], [data-screen="flakes"], [data-screen="plinko"]) main.incab .c2field { flex: 1 1 0 !important; height: auto !important; min-height: 240px !important; }
}
@media (orientation: landscape) and (max-height: 500px) {
  main.incab .c2field { flex: 1 1 0 !important; height: auto !important; min-height: 0 !important; }
  main.incab .c2key { gap: 3px 8px; }
}
@media (max-height: 520px) and (orientation: landscape) { .c2sign { font-size: 12px; padding: 3px 5px 4px; border-width: 2px; } }

/* ---------- v42 Snowflake Catch ---------- */
.c2.sfc .c2field { background: linear-gradient(#1d3f6e, #0b1a33 70%, #e8f4ff 70.5%, #c9e3f7); }
.sfflake { position: absolute; left: 0; top: 0; box-sizing: border-box; padding: 5px 8px 6px; border-radius: 14px; background: rgba(255, 255, 255, .96); color: #10243f; border: 3px solid #2e7bb4;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35); font: 400 clamp(14px, 1.5vw, 24px) var(--f-display); line-height: 1.12; text-align: center; overflow-wrap: anywhere; hyphens: auto; opacity: 0; will-change: transform; }
.sfflake.good { background: #d9ffbf; border-color: #2f8a12; transition: opacity .3s; }
.sfflake.bad { background: #ffd6dc; border-color: #d1001f; }
.sfsack { position: absolute; left: 0; top: 0; box-sizing: border-box; padding: 4px 6px; border-radius: 12px; background: rgba(42, 20, 8, .86); color: #fff; border: 2px solid #ffd27a;
  font: 400 clamp(13px, 1.4vw, 22px) var(--f-display); line-height: 1.1; text-align: center; overflow-wrap: anywhere; hyphens: auto; pointer-events: none; }
.sfsack b { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; margin-right: 5px; border-radius: 50%; background: #ffd27a; color: #2a1408; font-weight: 400; vertical-align: middle; }
.sfkey b { font-weight: 400; color: #8a3a00; }
.sfkey li + li b { color: #1d4f80; }
@media (max-height: 520px) and (orientation: landscape) { .sfflake, .sfsack { font-size: 12px; padding: 3px 5px; border-width: 2px; } }

/* ---------- v42 Present Plinko ---------- */
.c2.plk .c2field { background: linear-gradient(#123a5a, #0a1a2a); }
.pkans { flex: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.pkans[hidden] { display: none; }
.pkbtn { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 6px 12px 6px 6px; border-radius: 14px; border: 3px solid #2a1408; background: #fff7e6; color: #2a1408; cursor: pointer; text-align: left;
  font: 400 clamp(15px, 1.5vw, 24px) var(--f-display); line-height: 1.15; box-shadow: 0 4px 0 rgba(0, 0, 0, .45); }
.pkbtn span { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.pkbtn i { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--c); color: #fff; border: 3px solid #fff; box-shadow: 0 0 0 2px #2a1408; font: 400 19px var(--f-display); font-style: normal; }
.pkbtn:hover:not(:disabled), .pkbtn:focus-visible { transform: translateY(-2px); outline: 3px solid var(--slime, #8cff3a); outline-offset: 2px; }
.pkbtn.out { opacity: .55; text-decoration: line-through; background: #ffd6dc; cursor: default; }
.pkbtn.right { background: #d9ffbf; border-color: #2f8a12; box-shadow: 0 0 0 4px rgba(140, 255, 58, .6); }
.pkcover { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(5, 12, 24, .62); z-index: 2; pointer-events: none; }
.pkcover[hidden] { display: none; }
.pkcover p { margin: 0; max-width: 26ch; text-align: center; font: 400 clamp(20px, 2.4vw, 38px) var(--f-display); color: #fff; -webkit-text-stroke: .03em #14100c; paint-order: stroke fill; }
.c2.plk.dropping .c2field { cursor: crosshair; }
@media (max-width: 700px) { .pkans { grid-template-columns: minmax(0, 1fr); gap: 5px; } .pkbtn { min-height: 44px; } .pkbtn i { width: 30px; height: 30px; font-size: 16px; } }
@media (max-height: 520px) and (orientation: landscape) { .pkbtn { min-height: 34px; font-size: 13px; padding: 3px 8px 3px 4px; } .pkbtn i { width: 24px; height: 24px; font-size: 14px; } .pkans { gap: 4px 8px; } }
@media (min-width: 1600px) and (min-height: 900px) { .pkbtn { min-height: 70px; } .pkbtn i { width: 46px; height: 46px; font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { .pkbtn:hover:not(:disabled) { transform: none; } .sfflake.good { transition: none; } }
