/* Tiefen-Klapptafel: große Fallblatt-Anzeige der Tiefe mitten im HUD. Nach hud-polish.css laden. */
#hud .depth-board{
  --db-c:#f3e7d3;--db-glow:rgba(243,231,211,.35);--db-cell-w:26px;--db-cell-h:36px;--db-font:27px;
  grid-column:1/-1;grid-row:2;justify-self:center;position:relative;display:flex;align-items:flex-end;gap:6px;
  padding:4px 2px 3px;margin:2px 0 1px;pointer-events:none;isolation:isolate
}
#hud .depth-board[data-digits="2"]{--db-c:#3fd6a0;--db-glow:rgba(63,214,160,.45)}
#hud .depth-board[data-digits="3"]{--db-c:#59a6ff;--db-glow:rgba(89,166,255,.5)}
#hud .depth-board[data-digits="4"]{--db-c:#b48cff;--db-glow:rgba(180,140,255,.55)}
#hud .depth-board[data-digits="5"]{--db-c:#ffb53c;--db-glow:rgba(255,181,60,.55)}
#hud .depth-board[data-digits="6"]{--db-c:#ff5d7a;--db-glow:rgba(255,93,122,.55)}
#hud .depth-board[data-digits="7"]{--db-c:#82fff5;--db-glow:rgba(130,255,245,.55)}
#hud .depth-board[data-digits="8"]{--db-c:#fff36b;--db-glow:rgba(255,243,107,.6)}
#hud .db-cells{display:flex;gap:3px;perspective:220px}
#hud .db-cell{position:relative;width:var(--db-cell-w);height:var(--db-cell-h);border-radius:5px;
  background:#120d22;box-shadow:0 0 0 2px #0d0a1a,0 0 0 3px color-mix(in srgb,var(--db-c) 45%,#4a3d78),0 3px 0 3px rgba(13,10,26,.6),0 0 14px var(--db-glow);
  transition:box-shadow .35s ease;transform-style:preserve-3d}
#hud .db-cell>span{position:absolute;left:0;right:0;height:50%;overflow:hidden;backface-visibility:hidden}
#hud .db-cell .db-top,#hud .db-cell .db-ftop{top:0;border-radius:5px 5px 0 0;background:linear-gradient(#2a2148,#1d1636);transform-origin:50% 100%}
#hud .db-cell .db-bot,#hud .db-cell .db-fbot{bottom:0;border-radius:0 0 5px 5px;background:linear-gradient(#171130,#120d22);transform-origin:50% 0}
#hud .db-cell .db-ftop,#hud .db-cell .db-fbot{visibility:hidden;z-index:2}
#hud .db-cell i{position:absolute;left:0;right:0;height:var(--db-cell-h);line-height:var(--db-cell-h);text-align:center;font-style:normal;
  font-weight:800;font-size:var(--db-font);font-variant-numeric:tabular-nums;color:var(--db-c);transition:color .35s ease;
  text-shadow:0 2px 0 #0d0a1a,0 0 10px var(--db-glow)}
#hud .db-cell .db-bot i,#hud .db-cell .db-fbot i{top:-100%}
#hud .db-cell .db-top i,#hud .db-cell .db-ftop i{top:0}
/* Trennfuge des Fallblatts */
#hud .db-cell::after{content:"";position:absolute;left:0;right:0;top:calc(50% - 1px);height:2px;background:#0d0a1a;z-index:3;box-shadow:0 1px 0 rgba(255,255,255,.06)}
/* Scharnierstifte links und rechts der Fuge */
#hud .db-cell::before{content:"";position:absolute;top:calc(50% - 3px);left:-3px;width:3px;height:6px;z-index:4;
  background:#0d0a1a;border-radius:1px;box-shadow:calc(var(--db-cell-w) + 3px) 0 0 #0d0a1a}
#hud .db-unit{font-size:13px;font-weight:800;color:var(--db-c);opacity:.85;line-height:1;padding-bottom:3px;transition:color .35s ease;
  text-shadow:1px 1px 0 #0d0a1a}
/* Meilenstein-Effekte */
#hud .db-fx{position:absolute;left:50%;top:50%;width:0;height:0;pointer-events:none;z-index:-1}
#hud .db-fx .db-ring{position:absolute;left:0;top:0;width:60px;height:60px;margin:-30px 0 0 -30px;border-radius:50%;
  border:3px solid var(--db-c);box-shadow:0 0 18px var(--db-glow),inset 0 0 12px var(--db-glow)}
#hud .db-fx .db-bit{position:absolute;left:-3px;top:-3px;width:6px;height:6px;background:var(--db-c);box-shadow:0 0 8px var(--db-glow);border-radius:1px}
.db-banner{position:fixed;left:50%;top:34%;transform:translate(-50%,-50%);white-space:nowrap;pointer-events:none;
  font-family:var(--mono);font-weight:900;font-size:46px;letter-spacing:.03em;line-height:1;color:var(--db-c);z-index:40;opacity:0;
  text-shadow:3px 3px 0 #0d0a1a,-2px -2px 0 #0d0a1a,2px -2px 0 #0d0a1a,-2px 2px 0 #0d0a1a,0 0 24px var(--db-glow),0 0 48px var(--db-glow)}
.db-banner[data-level="1"]{font-size:36px}.db-banner[data-level="2"]{font-size:42px}
.db-banner[data-level="4"],.db-banner[data-level="5"],.db-banner[data-level="6"]{font-size:54px}
#hud .depth-board .db-shine{position:absolute;inset:0;overflow:hidden;border-radius:6px;z-index:4;pointer-events:none}
#hud .depth-board .db-shine::before{content:"";position:absolute;top:-20%;bottom:-20%;width:40%;left:-60%;
  background:linear-gradient(100deg,transparent,rgba(255,255,255,.55),transparent);transform:skewX(-18deg)}
#hud .depth-board.db-level .db-shine::before{animation:db-shine .7s ease-out}
@keyframes db-shine{to{left:130%}}
#hud .depth-board[data-digits="8"] .db-cell i,#hud .depth-board[data-digits="9"] .db-cell i{animation:db-rainbow 2.4s linear infinite}
@keyframes db-rainbow{0%{color:#ff5d7a}25%{color:#ffb53c}50%{color:#3fd6a0}75%{color:#59a6ff}100%{color:#ff5d7a}}

/* Münzen wandern in die Mitte der dritten Zeile, Tiefe-Zeile bleibt nur für Screenreader */
#hud .hud-depth{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
/* Zeilen: Name · Klapptafel · Münzen · Werkzeug/Forschung · Dash · Leben */
#hud #hCoinCard{grid-column:1/-1!important;grid-row:3!important;padding:13px 0 0!important;justify-self:center}
#hud #hCoinCard #hCoins{font-size:18px}
#hud #hCoinCard[data-gold-digits="long"] #hCoins{font-size:16px}
#hud #hCoinCard>div::before{width:10px;height:10px;right:calc(100% + 4px)}
#hud #hCoinGain{top:0!important}
#hud #hCoinGain b.hud-gold-gain{font-size:10px}
#hud .hud-research{grid-column:3!important;grid-row:4!important;justify-self:end}
#hud .tier{grid-row:4!important}
#hud .hud-dash{grid-row:5!important}
#hud .dash{grid-row:5!important}
#hud .hpbar{grid-row:6!important}

@media (max-width:620px){
  #hud .depth-board{--db-cell-w:21px;--db-cell-h:30px;--db-font:22px;gap:4px}
  #hud .db-cells{gap:2px}
  #hud .db-unit{font-size:11px}
  #hud #hCoinCard #hCoins{font-size:16px}
  .db-banner{font-size:34px}.db-banner[data-level="1"]{font-size:28px}.db-banner[data-level="4"],.db-banner[data-level="5"],.db-banner[data-level="6"]{font-size:40px}
}
@media (max-width:360px){
  #hud .depth-board{--db-cell-w:18px;--db-cell-h:26px;--db-font:19px}
  #hud #hCoinCard #hCoins{font-size:14px}
}
@media (max-height:420px) and (orientation:landscape){
  #hud .depth-board{--db-cell-w:18px;--db-cell-h:25px;--db-font:18px;padding:2px 2px 1px}
}
@media (prefers-reduced-motion:reduce){
  #hud .depth-board.db-level .db-shine::before{animation:none}
  #hud .depth-board .db-cell i{animation:none!important}
}
