/* Crypt Crew interface (on top of /css/arcade.css) */
body.game { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

.cc-wave { top: 54px; left: 14px; display: flex; gap: 14px; align-items: baseline; }
.cc-wave b { font-size: 20px; color: var(--accent); letter-spacing: .04em; }
.cc-wave span { font-size: 13px; color: var(--muted); }

.cc-invite { top: 54px; right: 14px; pointer-events: auto; cursor: pointer; font: inherit; font-weight: 700; color: var(--text); display: flex; gap: 8px; align-items: center; }
.cc-invite:hover { filter: brightness(1.25); }
.cc-invite code { font-family: ui-monospace, Consolas, monospace; color: var(--accent); letter-spacing: .12em; }
.cc-invite.off { opacity: .55; cursor: default; }

.cc-me { left: 14px; bottom: 14px; width: min(300px, 46vw); }
.cc-me .nm { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.cc-me .nm span:last-child { color: var(--muted); }
.cc-hp { height: 14px; border-radius: 8px; background: rgba(255, 255, 255, .12); overflow: hidden; position: relative; }
.cc-hp i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, #ff5266, #ff8a5c); border-radius: 8px; transition: width .18s; }
.cc-hp i.ghost { background: #fff; opacity: .55; transition: width .6s .15s; }
.cc-stats { display: flex; gap: 14px; margin-top: 7px; font-size: 13px; color: var(--muted); }
.cc-stats b { color: var(--text); }

.cc-tags { position: absolute; inset: 0; overflow: hidden; }
.cc-tag { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); text-align: center; white-space: nowrap; font-size: 13px; will-change: transform; }
.cc-tag .n { padding: 1px 6px; }
.cc-tag .b { width: 58px; height: 6px; margin: 2px auto 0; border-radius: 4px; background: rgba(0, 0, 0, .55); overflow: hidden; border: 1px solid rgba(0, 0, 0, .6); }
.cc-tag .b i { display: block; height: 100%; background: #5ff2c0; }
.cc-tag.low .b i { background: #ff6b7d; }
.cc-tag .r { display: none; margin-top: 3px; font-size: 12px; color: #ffd98a; }
.cc-tag.down .r { display: block; }
.cc-tag.down .n { opacity: .7; }
.cc-tag .rv { width: 74px; height: 8px; margin: 2px auto 0; border-radius: 5px; background: rgba(0, 0, 0, .6); overflow: hidden; }
.cc-tag .rv i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #5ff2c0, #d9ff8a); }

.cc-vignette { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(255, 30, 50, 0) 55%, rgba(255, 30, 50, .42) 100%); }
.cc-lowhp { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; background: radial-gradient(ellipse at center, rgba(150, 0, 20, 0) 68%, rgba(150, 0, 20, .42) 100%); }
.cc-banner { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%) scale(.8); font-size: clamp(34px, 7vw, 64px); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #ffe9b0; text-shadow: 0 0 24px rgba(255, 150, 40, .8), 0 4px 18px rgba(0, 0, 0, .8); opacity: 0; transition: opacity .35s, transform .35s; white-space: nowrap; }
.cc-banner small { display: block; font-size: .32em; letter-spacing: .2em; color: #cfd6ff; text-shadow: 0 2px 8px rgba(0, 0, 0, .8); margin-top: 4px; }
.cc-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.cc-downmsg { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); font-size: 18px; color: #ffd98a; opacity: 0; transition: opacity .3s; text-align: center; }
.cc-downmsg.show { opacity: 1; }

.cc-lowhp.on { animation: cc-beat .85s ease-in-out infinite; }
@keyframes cc-beat { 0%, 100% { opacity: .45; } 18% { opacity: 1; } 36% { opacity: .6; } }
.cc-me.low { border-color: rgba(255, 80, 100, .8); box-shadow: 0 0 18px rgba(255, 40, 70, .45); }
.cc-me.low .nm span:last-child { color: #ff8a98; }

/* ability row: special cooldown + dodge charges */
.cc-abil { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.cc-sp { position: relative; flex: 1; height: 20px; border-radius: 7px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.cc-sp i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #3d6fd8, #6cc7ff); opacity: .55; }
.cc-sp.ready i { background: linear-gradient(90deg, #ffb53d, #ffe07a); opacity: .95; }
.cc-sp span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 20px; letter-spacing: .05em; text-transform: uppercase; color: #fff; }
.cc-sp.ready span { color: #2a1a00; }
.cc-pips { display: flex; gap: 4px; }
.cc-pips i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); }
.cc-pips i.on { background: var(--good); border-color: var(--good); box-shadow: 0 0 6px var(--good); }
.cc-perkrow { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; min-height: 0; }
.cc-perkrow .pk { position: relative; font-size: 15px; line-height: 1; padding: 3px 4px; border-radius: 6px; background: rgba(255, 255, 255, .09); pointer-events: auto; }
.cc-perkrow .pk sub { position: absolute; right: -2px; bottom: -3px; font-size: 10px; font-weight: 800; color: var(--accent); text-shadow: 0 0 3px #000, 0 0 3px #000; }

/* combo */
.cc-combo { position: absolute; right: 22px; top: 34%; text-align: right; opacity: 0; transition: opacity .25s; color: #ffe9b0; text-shadow: 0 0 14px rgba(255, 150, 40, .7), 0 2px 8px rgba(0, 0, 0, .8); }
.cc-combo.show { opacity: 1; }
.cc-combo b { font-size: 46px; font-weight: 900; line-height: 1; margin-right: 6px; }
.cc-combo span { font-size: 16px; letter-spacing: .14em; }
.cc-combo small { display: block; font-size: 12px; color: #cfd6ff; letter-spacing: .06em; text-shadow: 0 2px 6px rgba(0, 0, 0, .8); }
.cc-combo[data-tier="1"] b { color: #ffd060; } .cc-combo[data-tier="2"] b { color: #ff9a40; } .cc-combo[data-tier="3"] b { color: #ff5a50; }
.cc-combo[data-tier="1"] small, .cc-combo[data-tier="2"] small, .cc-combo[data-tier="3"] small { color: var(--accent); }
.cc-combo.pop b { display: inline-block; animation: cc-pop .16s ease-out; }
@keyframes cc-pop { 0% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* boss bar */
.cc-boss { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); width: min(520px, 56vw); text-align: center; opacity: 0; transition: opacity .4s; }
.cc-boss.show { opacity: 1; }
.cc-boss span { font-size: 15px; letter-spacing: .18em; text-transform: uppercase; color: #ffd0b0; }
.cc-boss .bar { height: 12px; margin-top: 4px; border-radius: 7px; background: rgba(0, 0, 0, .6); border: 1px solid rgba(255, 120, 80, .5); overflow: hidden; }
.cc-boss .bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #b01030, #ff5a3a); transition: width .2s; }

/* damage numbers */
.cc-nums { position: absolute; inset: 0; overflow: hidden; }
.cc-num { position: absolute; transform: translate(-50%, -50%); font-size: 15px; font-weight: 800; color: #d8dcea; white-space: nowrap; animation: cc-num .7s ease-out forwards; text-shadow: 0 0 4px #000, 0 2px 4px #000; }
.cc-num.mine { color: #fff; font-size: 19px; }
.cc-num.crit { color: #ffb030; font-size: 27px; }
.cc-num.blk { color: #8ec4ff; font-size: 14px; }
.cc-num.soft { color: #ff9a50; font-size: 13px; }
.cc-num.hurt { color: #ff5a6a; font-size: 22px; }
.cc-num.heal { color: #6dffa0; font-size: 22px; }
@keyframes cc-num { 0% { opacity: 0; margin-top: 6px; } 15% { opacity: 1; margin-top: 0; } 70% { opacity: 1; } 100% { opacity: 0; margin-top: -42px; } }

/* banner variants */
.cc-banner.boss { color: #ffb0a0; text-shadow: 0 0 30px rgba(255, 40, 30, .9), 0 4px 18px rgba(0, 0, 0, .9); }
.cc-banner.clear { color: #c8ffd8; text-shadow: 0 0 24px rgba(60, 255, 150, .7), 0 4px 18px rgba(0, 0, 0, .8); }

/* perk picker (not an .overlay: the fight HUD stays live and the pause menu still works) */
.cc-perks { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -40%) scale(.94); width: min(760px, 94vw); text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.cc-perks.show { opacity: 1; transform: translate(-50%, -46%) scale(1); }
.cc-perks h2 { font-size: 20px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.cc-perks .cards { display: flex; gap: 12px; justify-content: center; }
.cc-perks .card { flex: 1 1 0; min-width: 0; width: auto; padding: 16px 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); color: var(--text); font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: center; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); transition: transform .12s, border-color .12s; text-shadow: none; }
.cc-perks.show .card { pointer-events: auto; }
.cc-perks .card:hover { transform: translateY(-4px); border-color: var(--accent); }
.cc-perks .card i { font-style: normal; font-size: 34px; line-height: 1.1; }
.cc-perks .card b { font-size: 16px; color: var(--accent); }
.cc-perks .card span { font-size: 13px; font-weight: 600; color: var(--text); opacity: .9; }
.cc-perks .card small { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.cc-perks .timer { height: 5px; margin: 12px auto 0; width: 60%; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.cc-perks .timer i { display: block; height: 100%; width: 100%; background: var(--accent); }

/* phones: keep the bottom corners for the stick and buttons */
body.touch .cc-me { bottom: auto; top: 100px; width: min(230px, 46vw); }
body.touch .cc-combo { top: 22%; }
@media (max-width: 640px) { .cc-perks .card { padding: 12px 6px; } .cc-perks .card i { font-size: 26px; } .cc-perks .card span { font-size: 12px; } .cc-boss { top: 96px; width: 44vw; } }
.cc-vignette.hit { animation: cc-hit .5s ease-out; }
@keyframes cc-hit { 0% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 640px) {
  .cc-wave, .cc-invite { top: 84px; padding: 6px 10px; }
  .cc-wave b { font-size: 16px; } .cc-wave span { font-size: 12px; }
  body.touch .cc-me { top: 132px; }
  .cc-banner { white-space: normal; width: 92vw; text-align: center; font-size: 36px; }
  .cc-banner small { font-size: 12px; letter-spacing: .12em; }
  body.touch .cc-combo { top: 56%; right: 14px; }
  .cc-combo b { font-size: 34px; }
}

/* boss bar on phones: never under the wave chip (portrait) or the hero card (landscape) */
@media (max-width: 640px) {
  .cc-boss { top: 124px; width: 88vw; }
  .cc-boss span { font-size: 12px; }
  body.touch.cc-bossfight .cc-me { top: 172px; }
}
@media (max-height: 500px) and (min-width: 641px) {
  .cc-boss { top: 58px; width: min(360px, 38vw); }
  .cc-boss span { font-size: 12px; }
  .cc-boss .bar { height: 9px; }
  .cc-banner { top: 42%; font-size: 40px; }
}
