/* tglgames.com — Trick Shot mode styles.
 *
 * NOTE FOR AGENT C: add this stylesheet to pool/index.html alongside the
 * existing pool stylesheets:
 *   <link rel="stylesheet" href="./css/trick-shot.css">
 *
 * Class names are prefixed `ts-` to avoid colliding with main.css. Design
 * tokens (--bg, --text, --muted, --accent, --panel, --warn, --ok) come
 * from /assets/theme.css. Border-radius capped at 8px on rectangles per
 * project rule; pill (999px) is fine for badges.
 */

#trickShotSelector,
#trickShotResult,
#trickShotStreak {
	color: var(--text);
}

/* ----- Selector ----- */
.ts-selector {
	position: fixed;
	inset: 0;
	z-index: 40;
	background: rgba(10, 12, 16, 0.92);
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
}
.ts-selector__head {
	max-width: 720px;
	margin: 8px auto 0;
	text-align: center;
}
.ts-selector__title {
	margin: 0;
	font-size: 22px;
	letter-spacing: 0.02em;
}
.ts-selector__sub {
	margin: 4px 0 0;
	color: var(--muted, #aab);
	font-size: 14px;
}
.ts-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	max-width: 720px;
	width: 100%;
	margin: 0 auto;
}
@media (min-width: 560px) {
	.ts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 880px) {
	.ts-grid { grid-template-columns: repeat(3, 1fr); }
}

.ts-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 12px;
	background: var(--panel, #161a22);
	color: inherit;
	border: 1px solid var(--rail-border, rgba(255,255,255,0.08));
	border-radius: 8px;
	text-align: left;
	cursor: pointer;
	transition: transform 0.08s ease, border-color 0.12s ease, background 0.12s ease;
	font: inherit;
}
.ts-card:hover,
.ts-card:focus-visible {
	border-color: var(--accent, #f1c40f);
	transform: translateY(-1px);
	outline: none;
}
.ts-card:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.ts-card--daily {
	border-color: var(--accent, #f1c40f);
	box-shadow: 0 0 0 1px rgba(241, 196, 15, 0.35) inset;
}
.ts-card__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.ts-card__name {
	font-size: 16px;
	font-weight: 600;
}
.ts-card__desc {
	margin: 0;
	font-size: 13px;
	color: var(--muted, #aab);
	line-height: 1.35;
}
.ts-card__stars {
	font-size: 14px;
	letter-spacing: 2px;
	color: var(--accent, #f1c40f);
}
.ts-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
	font-size: 12px;
	color: var(--muted, #aab);
}
.ts-card__best { font-variant-numeric: tabular-nums; }
.ts-card__best--empty { font-style: italic; }
.ts-card__top { opacity: 0.85; }

.ts-badge {
	display: inline-block;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	border-radius: 999px;
	background: var(--accent, #f1c40f);
	color: #1a1a1a;
}

.ts-teaser {
	max-width: 720px;
	margin: 0 auto;
	text-align: center;
	font-size: 12px;
	color: var(--muted, #aab);
	font-style: italic;
}

.ts-selector__foot {
	max-width: 720px;
	margin: 0 auto;
	display: flex;
	justify-content: center;
}

/* ----- Buttons ----- */
.ts-btn {
	-webkit-appearance: none;
	appearance: none;
	border: 1px solid var(--rail-border, rgba(255,255,255,0.12));
	background: var(--panel, #1c2230);
	color: var(--text, #f4f4f4);
	padding: 8px 14px;
	font: inherit;
	font-size: 14px;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease;
	min-height: 40px;
}
.ts-btn:hover,
.ts-btn:focus-visible {
	border-color: var(--accent, #f1c40f);
	outline: none;
}
.ts-btn--primary {
	background: var(--accent, #f1c40f);
	border-color: var(--accent, #f1c40f);
	color: #1a1a1a;
	font-weight: 600;
}
.ts-btn--primary:hover,
.ts-btn--primary:focus-visible {
	filter: brightness(1.05);
}
.ts-btn--ghost {
	background: transparent;
}

/* ----- Result banner ----- */
.ts-banner {
	position: fixed;
	left: 50%;
	top: 12px;
	transform: translateX(-50%) translateY(-110%);
	z-index: 45;
	width: min(520px, calc(100vw - 24px));
	background: var(--panel, #161a22);
	border: 1px solid var(--rail-border, rgba(255,255,255,0.12));
	border-radius: 8px;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	box-shadow: 0 12px 40px rgba(0,0,0,0.5);
	animation: ts-slide-in 0.22s ease forwards;
}
.ts-banner[hidden] { display: none !important; }
@keyframes ts-slide-in {
	to { transform: translateX(-50%) translateY(0); }
}
.ts-banner__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
}
.ts-banner__title {
	font-weight: 700;
	font-size: 16px;
}
.ts-banner__head--made .ts-banner__title { color: var(--ok, #6ee7b7); }
.ts-banner__head--miss .ts-banner__title { color: var(--warn, #fbbf24); }
.ts-banner__shot {
	font-size: 13px;
	color: var(--muted, #aab);
}
.ts-banner__detail {
	font-size: 13px;
	color: var(--muted, #cbd2e1);
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.ts-banner__score {
	font-size: 14px;
	color: var(--text, #f4f4f4);
	font-weight: 600;
}
.ts-banner__rank { font-variant-numeric: tabular-nums; }
.ts-banner__close { color: var(--accent, #f1c40f); }
.ts-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

/* ----- Streak HUD ----- */
.ts-streak {
	position: fixed;
	top: 12px;
	right: 12px;
	z-index: 35;
	padding: 6px 10px;
	background: rgba(20, 24, 32, 0.92);
	border: 1px solid var(--accent, #f1c40f);
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	color: var(--accent, #f1c40f);
	pointer-events: none;
	animation: ts-pulse 1.4s ease-in-out infinite;
}
.ts-streak[hidden] { display: none !important; }
@keyframes ts-pulse {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.05); }
}

/* ----- Tutorial dialog ----- */
.ts-tutorial {
	border: 1px solid var(--rail-border, rgba(255,255,255,0.12));
	background: var(--panel, #161a22);
	color: var(--text, #f4f4f4);
	border-radius: 8px;
	padding: 16px 18px;
	max-width: 360px;
	width: calc(100vw - 32px);
	box-shadow: 0 18px 60px rgba(0,0,0,0.55);
}
.ts-tutorial::backdrop {
	background: rgba(0,0,0,0.6);
}
.ts-tutorial__step {
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted, #aab);
	margin-bottom: 4px;
}
.ts-tutorial__title {
	margin: 0 0 6px;
	font-size: 17px;
}
.ts-tutorial__body {
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.4;
	color: var(--muted, #cbd2e1);
}
.ts-tutorial__actions {
	display: flex;
	justify-content: space-between;
	gap: 8px;
}

/* ----- Info panel (right-rail card while a trick shot is loaded) -----
 *
 * When body has class `ts-mode-active`, the standard #scorePanel hides
 * (it sits in the same right-side slot as #trickShotInfoPanel). The info
 * panel itself lives inside #railRight when present, falling back to body.
 * Border-radius capped at 8px on rectangles per project rule.
 */
body.ts-mode-active #scorePanel,
body.ts-mode-active #telemetryRail {
	display: none !important;
}
.ts-info-panel {
	display: block;
	background: var(--panel, #161a22);
	border: 1px solid var(--rail-border, rgba(255,255,255,0.12));
	border-radius: 8px;
	padding: 14px 14px 12px;
	margin: 0 0 12px;
	color: var(--text, #f4f4f4);
	font-size: 13px;
	line-height: 1.4;
}
.ts-info-panel[hidden] { display: none !important; }
.ts-info-panel__name {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--text, #f4f4f4);
}
.ts-info-panel__goal {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
}
.ts-info-panel__goal-pill {
	display: inline-block;
	padding: 2px 8px;
	background: var(--accent, #f1c40f);
	color: #111;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.ts-info-panel__goal-text {
	font-size: 13px;
	color: var(--text, #f4f4f4);
	font-weight: 600;
}
.ts-info-panel__desc {
	margin: 0 0 8px;
	font-size: 13px;
	color: var(--muted, #cbd2e1);
}
.ts-info-panel__hint-wrap {
	margin: 0 0 12px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.ts-info-panel__hint-head {
	display: flex;
	align-items: center;
	gap: 6px;
}
.ts-info-panel__hint-badge {
	display: inline-block;
	padding: 2px 7px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border-radius: 999px;
	background: rgba(241, 196, 15, 0.15);
	color: var(--accent, #f1c40f);
	border: 1px solid rgba(241, 196, 15, 0.4);
}
.ts-info-panel__hint {
	margin: 0;
	padding: 8px 10px;
	background: rgba(255,255,255,0.04);
	border-left: 2px solid var(--accent, #f1c40f);
	border-radius: 4px;
	font-size: 12px;
	font-style: italic;
	color: var(--muted, #aab);
}
.ts-info-panel__hint.is-new {
	animation: ts-hint-reveal 0.6s ease;
}
@keyframes ts-hint-reveal {
	0%   { background: rgba(241, 196, 15, 0.25); }
	100% { background: rgba(255, 255, 255, 0.04); }
}
.ts-info-panel__stuck {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--accent, #f1c40f);
	padding: 4px 8px;
	background: rgba(241, 196, 15, 0.10);
	border: 1px dashed rgba(241, 196, 15, 0.5);
	border-radius: 6px;
	align-self: flex-start;
	animation: ts-stuck-fade 3.5s ease forwards;
}
@keyframes ts-stuck-fade {
	0%   { opacity: 0; transform: translateY(-2px); }
	8%   { opacity: 1; transform: translateY(0); }
	85%  { opacity: 1; }
	100% { opacity: 0; }
}
.ts-info-panel__stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin: 0 0 12px;
}
.ts-info-stat {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 8px 10px;
	background: rgba(255,255,255,0.03);
	border: 1px solid var(--rail-border, rgba(255,255,255,0.08));
	border-radius: 6px;
}
.ts-info-stat__label {
	font-size: 10px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted, #aab);
	margin-bottom: 2px;
}
.ts-info-stat__val {
	font-size: 20px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--text, #f4f4f4);
}
.ts-info-panel__lb {
	border-top: 1px solid var(--rail-border, rgba(255,255,255,0.08));
	padding-top: 10px;
}
.ts-info-panel__lb-head {
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted, #aab);
	margin: 0 0 6px;
}
.ts-info-panel__lb-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.ts-info-panel__lb-row,
.ts-info-panel__lb-viewer {
	display: grid;
	grid-template-columns: 32px 1fr auto;
	gap: 8px;
	align-items: center;
	padding: 4px 6px;
	border-radius: 4px;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}
.ts-info-panel__lb-row.is-me,
.ts-info-panel__lb-viewer {
	background: rgba(241, 196, 15, 0.10);
	color: var(--accent, #f1c40f);
	font-weight: 600;
}
.ts-info-panel__lb-viewer {
	margin-top: 4px;
	border-top: 1px dashed var(--rail-border, rgba(255,255,255,0.08));
	padding-top: 6px;
	border-radius: 0;
}
.ts-info-panel__lb-rank {
	color: var(--muted, #aab);
	font-weight: 600;
}
.ts-info-panel__lb-row.is-me .ts-info-panel__lb-rank,
.ts-info-panel__lb-viewer .ts-info-panel__lb-rank {
	color: var(--accent, #f1c40f);
}
.ts-info-panel__lb-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.ts-info-panel__lb-score { text-align: right; }
.ts-info-panel__lb-empty {
	font-size: 12px;
	color: var(--muted, #aab);
	font-style: italic;
	padding: 4px 6px;
}

/* Mobile collapse: under 900px the right rail is hidden in the existing
 * responsive layout. Move the info panel to a fixed bottom drawer that
 * shows just name + stats (no leaderboard) so the table stays readable. */
@media (max-width: 899px) {
	.ts-info-panel {
		position: fixed;
		left: 8px;
		right: 8px;
		bottom: 8px;
		z-index: 30;
		margin: 0;
		padding: 10px 12px;
		max-height: 40vh;
		overflow-y: auto;
		box-shadow: 0 8px 24px rgba(0,0,0,0.5);
	}
	.ts-info-panel__name { font-size: 15px; margin-bottom: 4px; }
	.ts-info-panel__desc,
	.ts-info-panel__hint,
	.ts-info-panel__lb { display: none; }
	.ts-info-panel__goal { margin-bottom: 6px; }
	.ts-info-panel__stats { margin-bottom: 0; gap: 6px; }
	.ts-info-stat { padding: 6px 8px; }
	.ts-info-stat__val { font-size: 16px; }
}
