/* Rocket Peaks: the table, the peaks, the dock (boosters, stock, pile, streak meter), goals, feedback and sheets.
   Cards, backs, tables, buttons and sheets come from games/card-kit/kit.css. */
.tp { --cw: 60px; --ch: 84px; --fs: 16px; --dcw: 70px; --dch: 98px; --dfs: 20px; max-width: 980px; margin: 0 auto; padding: 8px 6px 14px; }
.tp-table { position: relative; border-radius: 12px; padding: 10px 10px 12px; touch-action: manipulation; outline: none; overflow: hidden; display: flex; flex-direction: column; gap: 8px; }
.stage.is-immersive .tp { display: flex; flex-direction: column; max-width: none; padding: 6px 4px 6px; }
.stage.is-immersive .tp-table { flex: 1 1 auto; min-height: 0; }
.stage.is-immersive .tp { margin: 0; width: 100%; box-sizing: border-box; }
/* wide, short screens (a phone on its side): the dock stands beside the peaks so the cards can be bigger */
.tp.tp-side .tp-table { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); column-gap: 14px; row-gap: 6px; }
.tp.tp-side .tp-goal { grid-column: 1 / -1; grid-row: 1; }
.tp.tp-side .tp-board { grid-column: 1; grid-row: 2; align-self: center; }
.tp.tp-side .tp-dock { grid-column: 2; grid-row: 2; align-self: center; margin: 0; padding: 0; grid-template-columns: auto auto; grid-template-areas: "boosts boosts" "stock waste" "streak streak"; justify-items: center; gap: 10px 14px; }
.tp.tp-side .tp-boosts { grid-area: boosts; justify-content: center; }
.tp.tp-side .tp-stock { grid-area: stock; }
.tp.tp-side .tp-waste { grid-area: waste; }
.tp.tp-side .tp-streak { grid-area: streak; width: 100%; }
.stage.is-immersive .tp .ck-help, .stage.is-immersive .tp .ck-status { display: none; }

/* ---- goal bar (levels: stars; other modes: progress) ---- */
.tp-goal { display: flex; align-items: center; gap: 10px; min-height: 22px; }
.tp-goal[hidden] { display: none; }
.tp-goal-bar { position: relative; flex: 1 1 auto; height: 8px; border-radius: 99px; background: rgba(0,0,0,0.32); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); }
.tp-goal-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, #55d6ff, #ffd166); transition: width .35s cubic-bezier(.2,.8,.3,1); }
.tp-mark { position: absolute; top: -4px; width: 2px; height: 16px; margin-left: -1px; background: rgba(255,255,255,0.55); border-radius: 2px; }
.tp-mark[hidden] { display: none; }
.tp-goal-stars { display: flex; gap: 8px; flex: none; font-size: 12.5px; font-weight: 800; color: rgba(255,255,255,0.45); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-gstar.on { color: #ffd166; text-shadow: 0 0 8px rgba(255,209,102,0.6); }
.tp-gtxt { color: #cfe0f5; font-weight: 700; }
.tp-gtxt b { color: #fff; }

/* ---- the peaks ---- */
.tp-board { position: relative; flex: none; }
.tp-slot { position: absolute; width: var(--cw); height: var(--ch); touch-action: none; }
.tp-slot .ck-card { transition: box-shadow .15s, filter .15s; }
.tp-slot.tp-free .ck-card:not(.ck-down) { cursor: pointer; }
.tp-slot:not(.tp-free) .ck-card:not(.ck-down) { filter: brightness(0.93); }
.tp-slot.tp-can .ck-card { box-shadow: 0 0 0 0.6px rgba(0,0,0,0.38), 0 0 0 2px rgba(124,242,154,0.0), 0 2px 5px rgba(0,0,0,0.35); }
@media (hover: hover) { .tp-slot.tp-free:hover .ck-card:not(.ck-down) { transform: translateY(-3px); box-shadow: 0 0 0 0.6px rgba(0,0,0,0.38), 0 8px 14px rgba(0,0,0,0.35); } }
.tp-slot .ck-card { transition: transform .12s, box-shadow .15s, filter .15s; }
.tp-slot.tp-hint .ck-card, .tp-stock.tp-hint .ck-card:last-of-type { animation: ck-pulse 0.85s ease-in-out 3; box-shadow: 0 0 0 3px #55d6ff, 0 0 18px rgba(85,214,255,0.6); }
.tp-slot.tp-sel .ck-card { box-shadow: 0 0 0 3px #ffd166, 0 0 14px rgba(255,209,102,0.55); transform: translateY(-3px); }
.tp-slot:empty { pointer-events: none; }
.tp-slot .ck-ix { font-size: var(--fs); }

/* ---- the dock: boosters, stock, pile, streak ---- */
.tp-dock { position: relative; display: grid; grid-template-columns: 1fr auto auto 1fr; align-items: center; gap: 10px 14px; margin-top: auto; padding-top: 4px; }
.tp-dock .ck-card { width: var(--dcw); height: var(--dch); --cw: var(--dcw); --ch: var(--dch); --fs: var(--dfs); }
.tp-stock, .tp-waste { position: relative; width: var(--dcw); height: var(--dch); border-radius: calc(var(--dcw) * 0.1); }
.tp-stock { border: 0; padding: 0; background: rgba(0,0,0,0.18); box-shadow: inset 0 0 0 1.5px var(--ck-slot); cursor: pointer; font: inherit; color: inherit; touch-action: manipulation; }
.tp-stock:focus-visible { outline: 2px solid #55d6ff; outline-offset: 3px; }
.tp-stock .ck-card { left: 0; top: 0; }
.tp-stock.tp-empty { cursor: default; }
.tp-stock.tp-empty::after { content: '∅'; position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--dcw) * 0.4); color: rgba(255,255,255,0.25); }
.tp-stock-n { position: absolute; right: -8px; bottom: -8px; z-index: 5; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 99px; background: #0b1328; color: #fff; border: 1px solid #2a3d63; font-size: 13px; font-weight: 800; line-height: 24px; text-align: center; font-variant-numeric: tabular-nums; box-sizing: border-box; }
.tp-waste .ck-card { left: 0; top: 0; transform-origin: 50% 90%; }
.tp-waste .ck-card.tp-under { filter: brightness(0.8); }
.tp-waste::before { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1.5px var(--ck-slot); }
.tp-waste.tp-target .ck-card:last-child { box-shadow: 0 0 0 3px #7cf29a, 0 0 20px rgba(124,242,154,0.55); }
.tp-wildcard { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: linear-gradient(150deg, #ffe7a3, #ffd166 45%, #ff9f6b); color: #4a2a00; }
.tp-wildcard svg { width: 54%; height: auto; fill: currentColor; }
.tp-wildcard span { font-weight: 900; font-size: calc(var(--cw) * 0.2); letter-spacing: 0.08em; }
.tp-boosts { display: flex; gap: 8px; justify-content: flex-end; }
.tp-boost { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 58px; height: 62px; border-radius: 12px; border: 1px solid #2a3d63; background: rgba(11,19,40,0.85); color: #dfe9ff; font: inherit; cursor: pointer; touch-action: manipulation; transition: transform .1s, opacity .15s, border-color .15s; }
.tp-boost:active { transform: scale(0.94); }
.tp-boost:focus-visible { outline: 2px solid #55d6ff; outline-offset: 2px; }
@media (hover: hover) { .tp-boost:hover { border-color: #ffd166; } }
.tp-boost.tp-off { opacity: 0.45; }
.tp-boost-ic { display: grid; place-items: center; width: 24px; height: 24px; font-weight: 900; font-size: 15px; color: #ffd166; }
.tp-boost-ic svg { width: 22px; height: 22px; fill: #ffd166; }
.tp-boost-lbl { font-size: 11px; font-weight: 700; color: #a9bfdd; }
.tp-boost b { position: absolute; top: -7px; right: -7px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 99px; background: #ffd166; color: #1a1200; font-size: 12px; line-height: 22px; box-sizing: border-box; }
.tp-boost.tp-off b { background: #42506b; color: #dfe9ff; }
.tp-hint-boost .tp-boost:not(.tp-off) { animation: ck-pulse 0.85s ease-in-out 3; }
.tp-streak { display: flex; flex-direction: column; gap: 5px; width: 110px; }
.tp-streak-num { display: flex; align-items: baseline; gap: 6px; color: #a9bfdd; font-size: 12px; font-weight: 700; }
.tp-streak-num b { font-size: 26px; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; transition: color .2s, text-shadow .2s; }
.tp-streak-meter { height: 8px; border-radius: 99px; background: rgba(0,0,0,0.32); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); }
.tp-streak-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #55d6ff, #7cf29a); border-radius: 99px; transition: width .25s cubic-bezier(.2,.8,.3,1); }
.tp-streak.hot1 .tp-streak-num b { color: #7cf29a; }
.tp-streak.hot2 .tp-streak-num b { color: #ffd166; text-shadow: 0 0 10px rgba(255,209,102,0.6); }
.tp-streak.hot2 .tp-streak-meter i { background: linear-gradient(90deg, #7cf29a, #ffd166); }
.tp-streak.hot3 .tp-streak-num b { color: #ff8f6b; text-shadow: 0 0 14px rgba(255,120,80,0.8); }
.tp-streak.hot3 .tp-streak-meter i { background: linear-gradient(90deg, #ffd166, #ff6b81); }
.tp-streak.tp-pulse .tp-streak-num b { animation: tp-pulse .3s ease; }

/* ---- drag, feedback ---- */
.tp-drag { position: absolute; left: 0; top: 0; z-index: 60; pointer-events: none; width: var(--cw); height: var(--ch); }
.tp-drag .ck-card { box-shadow: 0 0 0 0.5px rgba(0,0,0,0.25), 0 14px 28px rgba(0,0,0,0.5); transform: rotate(-3deg) scale(1.06); }
.tp-fx { position: absolute; inset: 0; z-index: 62; pointer-events: none; overflow: hidden; }
.tp-pop { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 18px; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,0.6); white-space: nowrap; animation: tp-float 1.1s cubic-bezier(.2,.8,.3,1) forwards; }
.tp-pop-warm { color: #7cf29a; font-size: 21px; }
.tp-pop-hot { color: #ffd166; font-size: 25px; text-shadow: 0 0 12px rgba(255,160,60,0.9), 0 2px 6px rgba(0,0,0,0.6); }
.tp-pop-peak { color: #55d6ff; font-size: 24px; opacity: 0; }
.tp-pop-small { font-size: 14px; color: #ffb3a0; }
.tp-banner { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); padding: 10px 22px; border-radius: 999px; background: rgba(5,10,24,0.78); color: #fff; font-size: clamp(20px, 5vw, 34px); font-weight: 900; letter-spacing: -0.01em; white-space: nowrap; box-shadow: 0 0 0 2px rgba(85,214,255,0.6), 0 10px 40px rgba(0,0,0,0.5); animation: tp-banner 1.6s cubic-bezier(.2,1.2,.4,1) forwards; }
.tp-banner.hot { box-shadow: 0 0 0 2px #ffd166, 0 0 40px rgba(255,160,60,0.6); color: #ffe7a3; }
.tp-spark { position: absolute; width: 8px; height: 8px; border-radius: 2px; }

/* ---- sheets ---- */
.tp-intro { margin: 8px 0 4px; padding-left: 18px; display: grid; gap: 7px; font-size: 14.5px; line-height: 1.45; color: #cfdcf2; }
.tp-intro b { color: #fff; }
.tp-modes { display: grid; gap: 8px; margin-top: 10px; }
.tp-mode { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 11px 14px; border-radius: 12px; border: 1px solid #1c2b4a; background: #0b1328; color: #dfe9ff; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; }
.tp-mode b { font-size: 15px; }
.tp-mode span { font-size: 12.5px; color: #8aa3c4; }
@media (hover: hover) { .tp-mode:hover { border-color: #55d6ff; } }
.tp-mode:focus-visible { outline: 2px solid #55d6ff; outline-offset: 2px; }
.tp-levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.tp-lv { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px 5px; border-radius: 10px; border: 1px solid #1c2b4a; background: #0b1328; color: #fff; font: inherit; cursor: pointer; touch-action: manipulation; min-width: 0; }
.tp-lv b { font-size: 16px; }
.tp-lv.cur { border-color: #55d6ff; }
.tp-lv.locked { opacity: 0.45; cursor: default; }
.tp-lv:focus-visible { outline: 2px solid #55d6ff; }
.tp-lock { font-size: 11px; line-height: 14px; }
.tp-stars { display: inline-flex; gap: 1px; font-size: 12px; line-height: 14px; color: rgba(255,255,255,0.22); }
.tp-stars i { font-style: normal; }
.tp-stars i.on { color: #ffd166; }
.tp-stars-big { display: flex; justify-content: center; gap: 6px; font-size: 44px; line-height: 1.1; margin: 6px 0 10px; }
.tp-stars-big i.on { text-shadow: 0 0 18px rgba(255,209,102,0.7); animation: tp-star .5s cubic-bezier(.2,1.4,.4,1) backwards; }
.tp-stars-big i:nth-child(2) { animation-delay: .2s; } .tp-stars-big i:nth-child(3) { animation-delay: .4s; }

@keyframes tp-float { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
@keyframes tp-banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } 25%, 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -70%) scale(0.96); } }
@keyframes tp-pulse { 50% { transform: scale(1.35); } }
@keyframes tp-star { from { opacity: 0; transform: scale(0.2) rotate(-40deg); } }

@media (max-width: 560px) {
  .tp { padding: 6px 2px 10px; }
  .tp-table { padding: 8px 6px 10px; border-radius: 10px; }
  .tp-dock { gap: 8px 10px; }
  .tp-boost { width: 50px; height: 56px; }
  .tp-streak { width: 78px; }
  .tp-streak-num b { font-size: 22px; }
  .tp-goal-stars { font-size: 11.5px; gap: 6px; }
  .tp-time-stat { display: none; }
}
@media (max-width: 380px) { .tp-boosts { flex-direction: column; gap: 6px; } .tp-boost { width: 52px; height: 40px; flex-direction: row; gap: 4px; } .tp-boost-lbl { display: none; } }
/* phones held sideways (full screen): boosters and streak beside the pile */
@media (max-height: 500px) and (orientation: landscape) {
  .tp-table { padding: 6px 8px 8px; gap: 4px; }
  .tp-boost { height: 52px; }
}
@media (prefers-reduced-motion: reduce) { .tp-pop, .tp-banner, .tp-stars-big i.on { animation-duration: .01s; } .tp-goal-bar i, .tp-streak-meter i { transition: none; } }
