/* Blood Castle (lab): the shooter canvas, its bar and dock, the start menu, on top of hanzo.css and lab.css. */
.castle { --c-blood: #c8322a; }

/* an orb picture outside the canvas (menu, how-to, game-over card) */
.castle__orb { display: inline-block; flex: none; width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .7)); }
.castle__orb.is-big { width: 46px; height: 46px; }
.hanzo__overimg .castle__orb { width: 44px; height: 44px; max-width: none; max-height: none; }

/* start menu: a dim wall over the gate */
.castle__menu { background: linear-gradient(rgba(8, 3, 3, .55), rgba(8, 3, 3, .8)), url("../images/lab/castle/hall.webp") center / cover, #0b0706; }
.castle__demo { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding-top: 4%; opacity: .4; }
.castle__drow { display: flex; gap: 0; margin-bottom: -10px; }
.castle__drow.is-odd { padding-left: 0; }
.castle__drow .castle__orb { width: 9.5vmin; height: 9.5vmin; max-width: 52px; max-height: 52px; }
.castle__dgate { position: absolute; bottom: 0; left: 0; width: 100%; opacity: .8; }
.castle__menuicon { width: 110px; height: 110px; filter: drop-shadow(0 0 18px rgba(255, 50, 40, .55)) drop-shadow(0 6px 12px rgba(0, 0, 0, .8)); }

/* how-to pictures */
.castle__howpic { gap: 6px; position: relative; overflow: hidden; }
.castle__howpic img { max-height: 70px; object-fit: contain; }
.castle__howaim { justify-content: center; align-items: flex-end; padding-bottom: 6px; box-sizing: border-box; }
.castle__howline { position: absolute; left: 50%; bottom: 40px; width: 4px; height: 70px; transform-origin: bottom center; transform: rotate(32deg);
    background: repeating-linear-gradient(to top, rgba(255, 140, 90, .9) 0 4px, transparent 4px 9px); animation: castle-sway 3s ease-in-out infinite; }
@keyframes castle-sway { 50% { transform: rotate(-32deg); } }
.castle__burst { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(var(--c), .9); box-shadow: 0 0 14px rgba(var(--c), .8); animation: castle-burst 1.4s ease-out infinite; }
@keyframes castle-burst { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
.castle__howfall .castle__orb.is-fall { animation: castle-drop 1.8s ease-in infinite; }
.castle__howfall .castle__orb.is-fall2 { animation: castle-drop 1.8s .2s ease-in infinite; }
@keyframes castle-drop { 0%, 30% { transform: none; opacity: 1; } 100% { transform: translateY(60px) rotate(40deg); opacity: 0; } }
.castle__howgate img { width: 150px; max-height: none; align-self: flex-end; }
.castle__howdead { position: absolute; left: 10px; right: 10px; top: 22px; height: 0; border-top: 3px dashed rgba(255, 60, 40, .8); }
.castle__howboss { width: 76px; height: 76px; max-height: none; object-fit: contain; filter: drop-shadow(0 0 10px rgba(255, 40, 30, .6)); }
.castle__howskill { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--hz-line); }

/* the game */
.castle__game { display: flex; justify-content: center; }
.castle__left { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 760px; align-items: center; }
.castle__bar, .castle__dock { width: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--hz-line); border-radius: 12px; background: var(--hz-card); }
.castle__bartext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.castle__bartext b { font-size: 16px; color: #ffe39a; letter-spacing: .04em; }
.castle__drop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.castle__drop .is-low { color: #ff8f7a; font-weight: 700; }
.castle__pips { display: inline-flex; gap: 3px; }
.castle__pips i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.castle__pips i.is-on { background: #e7be6a; box-shadow: 0 0 4px rgba(231, 190, 106, .6); }
.castle__frozen { color: #9fd8ff; font-weight: 700; }
.castle__saint img { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; filter: drop-shadow(0 0 4px rgba(150, 200, 255, .8)); }
.castle__score { font-size: 28px; font-weight: 800; color: #ffbe6b; font-variant-numeric: tabular-nums; }

.castle__boardwrap { position: relative; max-width: 100%; border-radius: 14px; overflow: hidden; border: 1px solid var(--hz-line); box-shadow: 0 10px 30px rgba(0, 0, 0, .6), inset 0 0 40px rgba(0, 0, 0, .8); }
.castle__canvas { display: block; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: crosshair; }
.castle__pops { position: absolute; inset: 0; pointer-events: none; }
.castle__pop { position: absolute; transform: translate(-50%, -50%); font-weight: 800; font-size: 18px; color: #ffe39a; white-space: nowrap; text-shadow: 0 2px 6px #000, 0 0 10px rgba(0, 0, 0, .8); animation: castle-float 1.3s ease-out forwards; }
.castle__pop.is-combo { color: #ff9be6; font-size: 20px; }
.castle__pop.is-fall { color: #8fe0ff; font-size: 21px; }
.castle__pop.is-boss { color: #ff7a5a; font-size: 30px; }
.castle__pop.is-chaos { color: #d9b0ff; font-size: 16px; }
@keyframes castle-float { from { opacity: 0; transform: translate(-50%, -20%) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } to { opacity: 0; transform: translate(-50%, -170%); } }
.castle__banner { position: absolute; left: 50%; top: 42%; z-index: 5; transform: translate(-50%, -50%); padding: 10px 24px; border-radius: 14px; pointer-events: none; white-space: nowrap;
    border: 1px solid rgba(255, 90, 68, .55); background: rgba(20, 8, 6, .88); color: #ffe0d6; font-size: 24px; font-weight: 800; letter-spacing: .03em;
    text-shadow: 0 0 16px rgba(255, 60, 40, .8); animation: castle-banner 1.7s ease-out forwards; }
.castle__banner.is-gold { color: #ffe39a; border-color: var(--gold); text-shadow: 0 0 16px rgba(231, 190, 106, .9); }
.castle__banner.is-red { color: #ffd2c8; background: rgba(40, 6, 4, .9); }
.castle__banner.is-ice { color: #d6f0ff; border-color: rgba(140, 210, 255, .7); text-shadow: 0 0 16px rgba(120, 200, 255, .9); }
@keyframes castle-banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; } }

/* skills and rage */
.castle__skills { display: flex; gap: 8px; flex: none; }
.castle__skill { position: relative; width: 48px; height: 48px; padding: 0; border-radius: 10px; border: 1px solid var(--hz-line); background: #0d0a07; cursor: pointer; overflow: hidden; transition: transform .12s, box-shadow .2s; }
.castle__skill img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.85) brightness(.5); transition: filter .2s; }
.castle__skill b { position: absolute; right: 2px; bottom: 1px; font-size: 11px; color: #fff; text-shadow: 0 1px 3px #000; }
.castle__skill.is-ready img { filter: none; }
.castle__skill.is-ready { border-color: rgba(231, 190, 106, .7); box-shadow: 0 0 10px rgba(231, 190, 106, .35); }
.castle__skill.is-ready:hover { transform: translateY(-2px); }
.castle__skill.is-armed { border-color: #ffe39a; box-shadow: 0 0 0 2px #ffe39a, 0 0 18px rgba(255, 210, 120, .8); animation: castle-armed 1s ease-in-out infinite; }
.castle__skill.is-armed img { filter: none; }
.castle__skill:disabled { cursor: default; }
@keyframes castle-armed { 50% { transform: translateY(-3px); } }
.castle__rage { position: relative; flex: 1; height: 22px; border-radius: 11px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.castle__rage i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #102a8a, #2c6be8, #47c8ff); transition: width .4s; box-shadow: 0 0 10px rgba(40, 120, 255, .6); }
.castle__rage span { position: relative; z-index: 1; display: block; text-align: center; line-height: 22px; font-size: 12px; font-weight: 700; text-shadow: 0 1px 3px #000; }
.castle__seg { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(0, 0, 0, .55); z-index: 1; }

.castle__sound.is-off { opacity: .4; text-decoration: line-through; }
.castle__overtitle { color: #ff9b85; }

@media (max-width: 560px) {
    .castle__bar, .castle__dock { padding: 6px 8px; gap: 8px; }
    .castle__score { font-size: 22px; }
    .castle__skill { width: 42px; height: 42px; }
    .castle__dock { flex-wrap: wrap; }
}


/* A skill shot not opened in the mastery yet (castle.js drawPanel). */
.castle__skill.is-locked img { filter: grayscale(1) brightness(.55); }
.castle__skill.is-locked b { opacity: .45; }
.castle__skill.is-locked::after { content: '🔒'; position: absolute; left: 3px; top: 2px; font-size: 12px; }
