/* ===== Hammer (молоток) — 4×4 cards — server-authoritative ===== */
.art.art-hammer {
  background: radial-gradient(120% 120% at 30% 20%, #3a2f1e 0%, #241a0d 55%, #120c05 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
}

#screen-hammer { background: #0b0c0f; overflow-x: hidden; }
#hammer-root { width: 100%; }

.hm-wrap {
  --hm-gold: #ffd257;
  --hm-green: #2fd07a;
  --hm-red: #ff4d5e;
  --hm-blue: #3d7bff;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 14px 90px;
  color: #eef2ff;
  font-family: 'Manrope', system-ui, sans-serif;
}

/* ---- topbar ---- */
.hm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.hm-bal {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 8px 14px;
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.hm-bal .hm-cur { color: #7d8db0; font-weight: 700; font-size: 12px; }
.hm-rtp {
  font-size: 11px;
  color: #7d8db0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  border-radius: 14px;
  font-weight: 700;
}
.hm-rtp b { color: var(--hm-gold); }

/* ---- stage: множитель + сетка ---- */
.hm-card-board {
  background: linear-gradient(180deg, #14161d 0%, #0e1016 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 16px 14px 18px;
  margin-bottom: 14px;
}
.hm-stage-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}
.hm-mult {
  line-height: 1;
}
.hm-mult .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: #7d8db0; font-weight: 800; }
.hm-mult .val {
  font-size: 44px;
  font-weight: 900;
  font-family: 'Russo One', system-ui, sans-serif;
  color: #fff;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.hm-mult .val.gold { color: var(--hm-gold); text-shadow: 0 0 22px rgba(255, 210, 87, 0.4); }
.hm-mult .val.lose { color: var(--hm-red); }
.hm-pot {
  text-align: right;
}
.hm-pot .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: #7d8db0; font-weight: 800; }
.hm-pot .val {
  font-size: 16px;
  font-weight: 800;
  margin-top: 4px;
  color: #b9c6e4;
  font-variant-numeric: tabular-nums;
}
.hm-pot .val b { color: #fff; }

.hm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}
.hm-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    radial-gradient(120% 100% at 50% 0%, #232838 0%, #151923 55%, #10131c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  overflow: hidden;
}
.hm-card:not(.revealed):not(.disabled):active { transform: scale(0.93); }
.hm-card .hm-back {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
  background:
    radial-gradient(120% 100% at 50% 0%, #232838 0%, #151923 55%, #10131c 100%);
  border-radius: 12px;
}
.hm-card .hm-back .pat {
  font-size: 22px;
  opacity: 0.55;
  filter: grayscale(0.4);
}
.hm-card .hm-back .q {
  position: absolute;
  top: 7px;
  right: 9px;
  font-size: 10px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.28);
  font-family: 'Russo One', sans-serif;
}
.hm-card .hm-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.15s ease;
  border-radius: 12px;
}
.hm-card.revealed .hm-back { opacity: 0; }
.hm-card.revealed .hm-face { opacity: 1; }

/* множитель */
.hm-card.mult {
  background: radial-gradient(120% 120% at 50% 0%, #123b28 0%, #0d2419 60%, #0a1a12 100%);
  border-color: rgba(47, 208, 122, 0.45);
  box-shadow: 0 0 18px rgba(47, 208, 122, 0.22);
}
.hm-card.mult .hm-face .ic { font-size: 21px; }
.hm-card.mult .hm-face .step {
  font-size: 15px;
  font-weight: 900;
  color: #4de394;
  font-variant-numeric: tabular-nums;
}
.hm-card.mult .hm-face .plus { font-size: 9px; color: #7fdbb0; font-weight: 800; }

/* бомба */
.hm-card.bomb {
  background: radial-gradient(120% 120% at 50% 0%, #4a1620 0%, #2b0d14 60%, #1d0910 100%);
  border-color: rgba(255, 77, 94, 0.5);
  box-shadow: 0 0 20px rgba(255, 77, 94, 0.3);
}
.hm-card.bomb .hm-face .ic { font-size: 30px; }

/* битая карточка (обломки после удара молотка) */
.hm-card.smashed.mult { animation: hmPop 0.34s cubic-bezier(.2,.9,.3,1.4); }
.hm-card.smashed.bomb { animation: hmShake 0.4s ease; }
@keyframes hmPop {
  0% { transform: scale(0.9); }
  55% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes hmShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* молоток, который бьёт по карточке */
.hm-hammer {
  position: fixed;
  left: 0;
  top: 0;
  width: 52px;
  height: 52px;
  pointer-events: none;
  z-index: 60;
  display: none;
  font-size: 40px;
  line-height: 1;
  text-align: center;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
}
.hm-hammer.strike {
  display: block;
  animation: hmStrike 0.4s cubic-bezier(.25,.8,.35,1);
}
@keyframes hmStrike {
  0% { transform: translateY(-42px) rotate(-28deg) scale(0.7); }
  40% { transform: translateY(8px) rotate(4deg) scale(1.05); }
  70% { transform: translateY(-14px) rotate(-10deg) scale(0.95); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}

/* вспышка взрыва бомбы */
.hm-boom {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 61;
  display: none;
  font-size: 56px;
  text-align: center;
  filter: drop-shadow(0 0 22px rgba(255, 90, 70, 0.85));
}
.hm-boom.on {
  display: block;
  animation: hmBoom 0.55s ease forwards;
}
@keyframes hmBoom {
  0% { transform: scale(0.3) rotate(-14deg); opacity: 0; }
  25% { transform: scale(1.25) rotate(5deg); opacity: 1; }
  60% { transform: scale(1.05) rotate(0deg); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ---- история ---- */
.hm-histcard {
  background: linear-gradient(180deg, #14161d 0%, #0e1016 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 14px;
}
.hm-hlab {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #7d8db0;
  margin-bottom: 10px;
}
.hm-hist { min-height: 24px; }
.hm-hchip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 5px 9px;
  margin: 0 6px 6px 0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.06);
  color: #aab6d4;
}
.hm-hchip.w { background: rgba(47, 208, 122, 0.16); color: #4de394; }
.hm-hchip.l { background: rgba(255, 77, 94, 0.16); color: #ff7583; }
.hm-hist-empty { font-size: 12px; color: #5b6b8c; }

/* ---- сообщения ---- */
.hm-msg {
  min-height: 22px;
  margin: 4px 2px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #8fa0c2;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.hm-msg.show { opacity: 1; }
.hm-msg.win { color: #4de394; }
.hm-msg.lose { color: #ff7583; }

/* ---- панель управления ---- */
.hm-panel {
  background: linear-gradient(180deg, #171a23 0%, #101218 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 14px;
}
.hm-flab {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #7d8db0;
  margin-bottom: 8px;
}
.hm-bombs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-bottom: 14px;
}
.hm-bomb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 2px 7px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #aab6d4;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.hm-bomb .ic { font-size: 16px; }
.hm-bomb .tx { font-size: 12px; font-weight: 800; }
.hm-bomb.on {
  background: rgba(255, 77, 94, 0.16);
  border-color: rgba(255, 77, 94, 0.55);
  color: #ff8b96;
}
.hm-bomb:disabled { opacity: 0.45; cursor: default; }

.hm-betrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.hm-betbtn {
  flex: 0 0 44px;
  height: 46px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.hm-betbtn:active { transform: scale(0.92); }
.hm-betbtn:disabled { opacity: 0.4; cursor: default; }
.hm-betfield {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  padding: 0 12px;
  height: 46px;
}
.hm-betfield small {
  position: absolute;
  top: -7px;
  left: 10px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7d8db0;
  background: #14161d;
  padding: 0 5px;
  border-radius: 5px;
}
.hm-betfield input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.hm-betfield .hm-cur {
  font-size: 11px;
  font-weight: 800;
  color: #7d8db0;
  white-space: nowrap;
}

.hm-main {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 15px;
  font-size: 16px;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.hm-main small { font-size: 11px; font-weight: 700; opacity: 0.85; }
.hm-main:active:not(:disabled) { transform: scale(0.97); }
.hm-main:disabled { opacity: 0.5; cursor: default; }
.hm-main.play {
  background: linear-gradient(135deg, #3d7bff 0%, #2a5fe0 100%);
  color: #fff;
  box-shadow: 0 6px 22px rgba(61, 123, 255, 0.35);
}
.hm-main.wait {
  background: linear-gradient(135deg, #ffd257 0%, #f0a820 100%);
  color: #2b1c02;
  box-shadow: 0 6px 22px rgba(255, 210, 87, 0.3);
}
.hm-main.cash {
  background: linear-gradient(135deg, #2fd07a 0%, #1ca35a 100%);
  color: #04150b;
  box-shadow: 0 6px 22px rgba(47, 208, 122, 0.32);
}
