/* ---------- HUD ---------- */
.hud { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 10px 14px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.brand { font-family: "Anton", Impact, sans-serif; font-size: 1.4rem; letter-spacing: .04em; line-height: 1; white-space: nowrap; text-shadow: 0 2px 0 #000, 0 0 20px rgba(0,0,0,.5); }
.brand b { font-weight: 400; color: var(--gold); }
.chips { display: flex; gap: 10px; flex: 1; justify-content: center; }
.chip {
	min-width: 178px; padding: 7px 12px 8px; border-radius: 14px;
	background: var(--glass); border: 1px solid var(--line);
	backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
	box-shadow: 0 10px 30px -12px rgba(0,0,0,.6);
}
.chip .lbl { display: block; font-size: .6rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 800; }
.chip b { display: block; font-family: "Anton", Impact, sans-serif; font-weight: 400; font-size: 1.4rem; letter-spacing: .02em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.bank b { background: linear-gradient(180deg, #fff6c8, var(--gold) 50%, var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 10px rgba(255,212,59,.35)); }
.chip small { display: block; font-size: .7rem; font-weight: 800; color: #5fdca4; white-space: nowrap; }
.chip small.fr { color: #ffb02e; text-shadow: 0 0 10px rgba(255,140,40,.8); }
.chip small.dim { color: var(--muted); font-weight: 600; }
.chip.bump { animation: chipbump .3s; }
@keyframes chipbump { 40% { transform: scale(1.07); } }
.bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #4dabf7, #b07cff); transition: width .3s, background .3s; }
.tools { display: flex; gap: 6px; }
.icon-btn {
	width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.05rem;
	background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
	transition: transform .15s, background .15s, opacity .15s;
}
.icon-btn:hover { transform: translateY(-2px); background: rgba(255,255,255,.14); }
.icon-btn.off { opacity: .45; }

/* ---------- Meme captions ---------- */
.cap {
	position: fixed; left: 12px; right: calc(var(--panel) + 12px); z-index: 5; margin: 0;
	text-align: center; pointer-events: none;
	font-family: Impact, "Anton", "Arial Narrow Bold", sans-serif; text-transform: uppercase; color: #fff;
	font-size: clamp(1.2rem, 3.6vw, 2.7rem); line-height: 1.05; letter-spacing: .02em;
	-webkit-text-stroke: 2px #000; paint-order: stroke fill;
	text-shadow: 3px 3px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 0 30px rgba(0,0,0,.45);
	transition: opacity .3s, transform .3s;
}
.cap.top { top: calc(var(--hud) + 6px); }
.cap.bottom { bottom: calc(var(--tick) + var(--bar) + 22px); }
.cap.out { opacity: 0; transform: translateY(-14px) scale(.96); }
.cap span { display: inline-block; animation: slam .55s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes slam { from { opacity: 0; transform: scale(2.4) rotate(-5deg); filter: blur(6px); } }

/* ---------- Action bar ---------- */
.actionbar { position: fixed; left: 0; right: var(--panel); bottom: calc(var(--tick) + 12px); z-index: 8; display: flex; justify-content: center; align-items: flex-end; gap: 10px; padding: 0 12px; pointer-events: none; }
.actionbar > * { pointer-events: auto; }
.btn { position: relative; overflow: hidden; font-weight: 800; font-size: 1rem; padding: 13px 22px; border-radius: 16px; white-space: nowrap; transition: transform .12s, filter .15s, box-shadow .12s; }
.btn:hover { transform: translateY(-3px); filter: brightness(1.08); }
.btn:active { transform: translateY(2px) scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn small { display: block; font-size: .68rem; opacity: .85; font-weight: 800; letter-spacing: .04em; }
.btn.gold {
	color: #2a1d00; font-family: "Anton", Impact, sans-serif; font-weight: 400; font-size: 1.45rem; letter-spacing: .07em; padding: 11px 34px;
	background: linear-gradient(180deg, #fff1a1, var(--gold) 45%, var(--gold-2));
	box-shadow: 0 6px 0 #b07800, 0 18px 40px -12px rgba(250,176,5,.9);
}
.btn.gold small { font-family: "Inter", sans-serif; letter-spacing: .02em; }
.btn.gold:active { box-shadow: 0 2px 0 #b07800, 0 10px 30px -12px rgba(250,176,5,.9); }
.btn.gold::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent); transform: skewX(-20deg); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn.purple { color: #fff; background: linear-gradient(180deg, #c39bff, #7b3fe4); box-shadow: 0 6px 0 #4b1fa0, 0 18px 40px -12px rgba(123,63,228,.9); }
.btn.purple.jiggle { animation: jiggle 4.5s ease-in-out infinite; }
.btn.broke { opacity: .6; }
.btn.deny { animation: deny .35s; }
@keyframes jiggle { 0%, 84%, 100% { transform: none; } 86% { transform: rotate(-5deg) scale(1.05); } 88% { transform: rotate(5deg) scale(1.05); } 90% { transform: rotate(-3deg); } 92% { transform: rotate(2deg); } }
.btn.ghost { background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#shop-toggle { display: none; }
.badge { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #e03131; color: #fff; font-size: .68rem; line-height: 18px; text-align: center; }
.badge:empty { display: none; }

#combo { position: fixed; z-index: 7; left: 0; top: 0; font-family: "Press Start 2P", monospace; font-size: .72rem; color: #fff; text-shadow: 0 2px 0 #000, 0 0 12px rgba(255,212,59,.9); opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap; }
#combo.show { opacity: 1; }
#combo b { color: var(--gold); font-size: 1.35em; font-weight: 400; }
#combo.hit { animation: combohit .2s; }
@keyframes combohit { 50% { transform: scale(1.4) rotate(-5deg); } }

#say {
	position: fixed; z-index: 6; left: 0; top: 0; max-width: 230px; padding: 10px 14px; border-radius: 16px;
	background: #fff; color: #111; font-weight: 800; font-size: .86rem; line-height: 1.25;
	box-shadow: 0 10px 30px -10px rgba(0,0,0,.6); transform-origin: 18px 100%;
	opacity: 0; transform: scale(.3); transition: opacity .2s, transform .35s cubic-bezier(.2,1.6,.4,1); pointer-events: none;
}
#say.show { opacity: 1; transform: scale(1); }
#say::after { content: ""; position: absolute; left: 18px; bottom: -9px; border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }

/* ---------- Ticker ---------- */
.ticker { position: fixed; left: 0; right: 0; bottom: 0; height: var(--tick); z-index: 12; display: flex; align-items: center; overflow: hidden; background: linear-gradient(90deg, #a4161a, #e5383b); border-top: 2px solid var(--gold); font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.ticker .live { flex: none; height: 100%; display: flex; align-items: center; padding: 0 12px; background: #0a0d14; font-family: "Anton", sans-serif; font-weight: 400; letter-spacing: .12em; z-index: 1; }
.ticker .live::before { content: "● "; color: #ff4d4d; animation: blink 1s steps(2) infinite; }
.track-wrap { flex: 1; overflow: hidden; height: 100%; display: flex; align-items: center; }
.track { display: inline-flex; white-space: nowrap; animation: ticker 60s linear infinite; will-change: transform; }
.track span { padding-right: 34px; }
.track span::before { content: "⚓"; margin-right: 12px; color: var(--gold); }
@keyframes ticker { to { transform: translateX(-50%); } }
@keyframes blink { 50% { opacity: .2; } }

/* Player level badge (opens the leaderboard) */
.lv-badge { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px; border-radius: 12px; background: var(--glass); border: 1px solid rgba(255,212,59,.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-family: "Anton", sans-serif; font-size: .95rem; letter-spacing: .04em; color: var(--gold); white-space: nowrap; transition: transform .15s, background .15s; }
.lv-badge:hover { transform: translateY(-2px); background: rgba(255,212,59,.12); }
.lv-track { display: block; width: 52px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.lv-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #5fdca4); transition: width .3s; }

/* Leaderboard button */
.rank-btn { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 12px; font-weight: 900; font-size: .8rem; white-space: nowrap; color: #fff; background: linear-gradient(180deg, rgba(77,171,247,.35), rgba(123,63,228,.35)); border: 1px solid rgba(160,190,255,.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .15s, filter .15s; }
.rank-btn:hover { transform: translateY(-2px); filter: brightness(1.2); }
