/* --- JÁTÉKOS NEVEK ÉS ROOSTEREK (Felső sarok HUD-ok) --- */
.player-names-header {
  position: fixed;
  top: 15px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 15px;
  z-index: 100;
  pointer-events: none;
  box-sizing: border-box;
}

.player-hud-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  pointer-events: auto; /* Engedi a tooltip hovereket és a roster interakciót */
}

.player-name {
  font-size: clamp(0.85rem, 1.4vw, 1.1rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fff;
  background: rgba(10, 10, 20, 0.55);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-top: 1.5px solid rgba(197, 160, 89, 0.6);
  border-radius: 30px;
  padding: 7px 20px;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.5),
    inset 0 0 12px rgba(197, 160, 89, 0.1);
  text-shadow: 0 0 10px rgba(197, 160, 89, 0.5);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes pulseTurn {
  0% { box-shadow: 0 0 15px rgba(46, 204, 113, 0.5), inset 0 0 10px rgba(46, 204, 113, 0.3); border-color: rgba(46, 204, 113, 0.8); }
  50% { box-shadow: 0 0 30px rgba(46, 204, 113, 0.9), inset 0 0 20px rgba(46, 204, 113, 0.6); border-color: #2ecc71; }
  100% { box-shadow: 0 0 15px rgba(46, 204, 113, 0.5), inset 0 0 10px rgba(46, 204, 113, 0.3); border-color: rgba(46, 204, 113, 0.8); }
}

.player-name.active-turn {
  animation: pulseTurn 2s infinite;
  color: #2eff8b;
  text-shadow: 0 0 10px rgba(46, 255, 139, 0.6);
}

.player-name-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.turn-timer-container {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: conic-gradient(#2ecc71 100%, transparent 0);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
}

.turn-timer-container.active {
  opacity: 1;
  transform: scale(1);
}

.turn-timer-inner {
  width: 48px;
  height: 48px;
  background-color: #1a1a2e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: bold;
  font-family: 'Inter', sans-serif;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  transition: background-color 0.3s;
}

.turn-timer-container.warning {
  box-shadow: 0 0 12px rgba(241, 196, 15, 0.6);
}

.turn-timer-container.danger {
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.8);
  animation: timerPulse 0.5s infinite alternate;
}

@keyframes timerPulse {
  from { box-shadow: 0 0 5px #e74c3c; }
  to { box-shadow: 0 0 20px #ff7675; }
}

/* --- JÁTÉKTÉR --- */
#game-screen {
  flex: 1;
  width: 100%;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 85px !important;
  box-sizing: border-box !important;
  position: relative !important;
}

#turn-indicator {
  position: absolute !important;
  top: 15px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
  z-index: 100 !important;
  font-size: 1.1rem;
  font-weight: bold;
  padding: 6px 25px;
  border-radius: 20px;
  background: rgba(10, 10, 20, 0.4);
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid rgba(197, 160, 89, 0.6);
  border-left: 1.5px solid rgba(197, 160, 89, 0.4);
  text-align: center;
  width: fit-content;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.5),
    inset 0 0 15px rgba(197, 160, 89, 0.2);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.arena {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: clamp(20px, 3.8vw, 76px);
  flex: 1;
  min-height: 0;
  align-items: center;
  margin-top: 0;
  width: 100%;
}

/* ÚJ: Kártya konténer és Csapatjelző (Roster) */
.card-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  position: relative;
  gap: clamp(10px, 1.5vw, 30px);
}

.team-roster {
  display: flex;
  flex-direction: row;
  gap: 10px;
  background: rgba(10, 10, 20, 0.5);
  backdrop-filter: blur(15px);
  padding: 8px 12px;
  border-radius: 24px;
  border: 1px solid rgba(197, 160, 89, 0.3);
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.team-roster:empty {
  display: none !important;
}

.roster-dot {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background-color: #333;
  border: 2px solid #111;
  transition:
    transform 0.3s,
    background-color 0.3s,
    border-color 0.3s,
    box-shadow 0.3s;
  will-change: transform;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}
.roster-img {
  width: 100%;
  height: 130%;
  border-radius: 50%;
  background-size: 192%; /* 20%-kal nagyobb zoom (eredeti: 160%) */
  background-position: center top;
  position: absolute;
  top: -30%; /* 10%-kal feljebb tolva (eredeti: -20%) */
  transition: filter 0.3s;
}

.roster-dot.alive {
  background-color: #39a2db;
  border-color: #fff;
  box-shadow: 0 0 8px #39a2db;
}
.roster-dot.active-battler {
  background-color: #2ecc71;
  border-color: #fff;
  transform: scale(1.2);
  box-shadow: 0 0 12px #2ecc71;
}
.roster-dot.ko {
  border-color: #e74c3c;
  opacity: 0.8;
}
.roster-dot.ko .roster-img {
  filter: grayscale(100%) brightness(0.9);
}

.roster-dot.ko::before,
.roster-dot.ko::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 6px;
  background-color: #e74c3c;
  border-radius: 2px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
  z-index: 5;
}
.roster-dot.ko::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.roster-dot.ko::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.card {
  background: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: clamp(12px, 2.4vh, 18px);
  margin: 2.5rem 0 !important;
  display: grid !important;
  row-gap: 8px !important;
  align-content: center !important;
  justify-content: center !important;
  width: clamp(320px, 33vw, 634px) !important;
  height: auto;
  min-height: clamp(420px, 55vh, 792px) !important;
  box-sizing: border-box;
  transition:
    transform 0.2s ease,
    filter 0.3s,
    box-shadow 0.3s;
  will-change: transform;
  position: relative;
  z-index: 1;
  overflow: visible; /* Engedi, hogy a körök kilógjanak a sarkokon */
}
.card.active-card {
  /* transform removed to prevent up/down jumping */
}
.active-card .card-body,
.active-card .attacks {
  box-shadow:
    0 0 30px rgba(197, 160, 89, 0.4),
    0 10px 40px rgba(0, 0, 0, 0.9) !important;
}

/* --- JÁTÉKOS SPECIFIKUS SYMMETRIC ELRENDEZÉS ÉS BADGE STÍLUSOK --- */
#p1-card,
#p1-card-top,
#p1-card-bottom {
  grid-template-columns: 48% 56% !important;
  column-gap: 4% !important;
}
#p2-card,
#p2-card-top,
#p2-card-bottom {
  grid-template-columns: 56% 48% !important;
  column-gap: 4% !important;
}

#p1-card .card-header,
#p2-card .card-header,
#p1-card-top .card-header,
#p2-card-top .card-header,
#p1-card-bottom .card-header,
#p2-card-bottom .card-header {
  grid-column: span 2 !important;
  grid-row: 1 !important;
}
#p1-card .hp-bar,
#p2-card .hp-bar,
#p1-card-top .hp-bar,
#p2-card-top .hp-bar,
#p1-card-bottom .hp-bar,
#p2-card-bottom .hp-bar {
  grid-column: span 2 !important;
  grid-row: 2 !important;
}

#p1-card .attacks,
#p1-card-top .attacks,
#p1-card-bottom .attacks {
  grid-column: 1 !important;
  grid-row: 3 !important;
  transform: translateX(35px) !important;
  margin: 0 !important;
}
#p1-card .card-body,
#p1-card-top .card-body,
#p1-card-bottom .card-body {
  grid-column: 2 !important;
  grid-row: 3 !important;
}

#p2-card .card-body,
#p2-card-top .card-body,
#p2-card-bottom .card-body {
  grid-column: 1 !important;
  grid-row: 3 !important;
}
#p2-card .attacks,
#p2-card-top .attacks,
#p2-card-bottom .attacks {
  grid-column: 2 !important;
  grid-row: 3 !important;
  transform: translateX(-35px) !important;
  margin: 0 !important;
}

/* Symmetrical status badges are positioned dynamically on the inner/outer sides via flex status-container */

/* ITEM ÉS SUPPORTER KÁRTYÁK */
.item-container {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vh, 12px);
  margin-top: 0;
  justify-content: center;
  width: clamp(108px, 9vw, 146px); /* 10%-kal kisebb (eredeti: clamp(120px, 10vw, 162px)) */
  z-index: 5;
}
#p1-items {
  order: -1;
}
#p2-items {
  order: 1;
}

.item-btn {
  background:
    radial-gradient(circle at top left, rgba(60, 60, 80, 0.3), transparent), rgba(10, 10, 20, 0.4) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-top: 2px solid rgba(197, 160, 89, 0.6) !important;
  border-left: 2px solid rgba(197, 160, 89, 0.4) !important;
  border-radius: 16px !important;
  padding: 0 9px 10px 8px !important;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    border-color 0.2s;
  width: 100%;
  color: white;
  font-size: 0.76rem; /* 10%-kal kisebb (eredeti: 0.85rem) */
  font-weight: bold;
  text-align: left;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.6),
    inset 0 0 20px rgba(0, 0, 0, 0.3) !important;
  box-sizing: border-box;
}
.item-btn .btn-title {
  font-size: 0.68rem !important; /* 10%-kal kisebb a szöveg-illeszkedésért */
}
.item-btn .btn-row {
  font-size: 0.58rem !important; /* 10%-kal kisebb a szöveg-illeszkedésért */
}
.item-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow:
    0 10px 25px rgba(197, 160, 89, 0.4),
    inset 0 0 20px rgba(197, 160, 89, 0.2) !important;
  border-color: #f1c40f !important;
}
.item-btn:disabled {
  filter: grayscale(100%);
  opacity: 0.5;
  cursor: not-allowed;
}
.item-img-wrapper {
  width: calc(100% + 17px) !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  border-radius: 14px 14px 0 0 !important;
  margin: 0 -9px 8px -8px !important;
  position: relative !important;
}
.item-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transform: scale(1.6) translateY(18%) !important;
  transition: filter 0.3s;
}

.card-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: calc(-1 * clamp(12px, 2.4vh, 18px)) calc(-1 * clamp(12px, 2.4vh, 18px)) 10px
    calc(-1 * clamp(12px, 2.4vh, 18px));
  padding: clamp(7px, 1.8vh, 12px) 6px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(197, 160, 89, 0.3);
  box-shadow: inset 0 0 15px rgba(197, 160, 89, 0.15);
  border-radius: 16px 16px 0 0;
  order: 1;
  height: auto;
}
.card h2 {
  margin: 0;
  font-size: clamp(1.08rem, 2.4vh, 1.32rem);
  color: #fff;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: none;
  width: 100%;
  text-align: center;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.card-stats {
  font-size: 0;
  color: transparent;
  position: static;
}

/* --- ÚJ: Látványos sarok körök a HP és AP számára --- */
#p1-hp,
#p2-hp,
#p1-ap,
#p2-ap {
  position: static !important;
  width: auto !important;
  height: auto !important;
  border: none !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: inline !important;
  visibility: visible !important;
}
#p1-hp::after,
#p2-hp::after,
#p1-ap::after,
#p2-ap::after {
  display: none !important;
}

.hp-bar {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: 14px !important;
  background-color: rgba(10, 10, 20, 0.7) !important;
  backdrop-filter: blur(10px) !important;
  border: none !important;
  border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 0 0 16px 16px !important;
  margin: 0 !important;
  overflow: hidden !important;
  z-index: 26 !important;
  flex-shrink: 0;
}
.hp-fill {
  height: 100%;
  background-color: #2ecc71;
  transition:
    width 0.4s ease-in-out,
    background-color 0.4s;
  will-change: width, background-color;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3) !important;
}

.card-body {
  width: 100% !important;
  aspect-ratio: 2 / 3 !important;
  height: auto;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  position: relative !important;
  z-index: 10 !important;
  margin-bottom: 0 !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-top: 2px solid rgba(197, 160, 89, 0.6) !important;
  border-left: 2px solid rgba(197, 160, 89, 0.4) !important;
  background:
    radial-gradient(circle at top left, rgba(60, 60, 80, 0.3), transparent), rgba(10, 10, 20, 0.4) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  padding: 0 !important;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.6),
    inset 0 0 20px rgba(0, 0, 0, 0.3) !important;
  overflow: visible;
  align-self: center !important;
  flex-shrink: 0;
  box-sizing: border-box !important;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.2s ease !important;
}

.card-body-stats {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  left: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 6px !important;
  z-index: 26 !important;
  pointer-events: none !important;
}
.stat-hp,
.stat-ap {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgba(10, 10, 20, 0.65) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  padding: 5px 12px !important;
  border-radius: 20px !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}
.stat-hp {
  border-color: rgba(46, 204, 113, 0.45) !important;
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.2) !important;
}
.stat-ap {
  border-color: rgba(52, 152, 219, 0.45) !important;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2) !important;
}
.stat-hp span {
  font-size: 1.05rem !important;
  font-weight: 900 !important;
  color: #2eff8b !important;
  text-shadow: 0 0 8px rgba(46, 255, 139, 0.6) !important;
}
.stat-ap span {
  font-size: 1.05rem !important;
  font-weight: 900 !important;
  color: #00f0ff !important;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6) !important;
}

.card-image {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 2 / 3 !important;
  object-fit: cover !important;
  display: block;
  border-radius: 14px 14px 0 0 !important;
  margin: 0 0 14px 0 !important;
}

.status-container {
  position: absolute !important;
  top: 90px !important; /* HP/AP kijelzők alatt kezdődik */
  width: 72px !important;
  pointer-events: none !important;
  z-index: 30 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  margin-top: 0 !important;
}

#p1-card .status-container,
#p1-card-top .status-container,
#p1-card-bottom .status-container {
  right: -36px !important;
  left: auto !important;
  align-items: center !important;
}

#p2-card .status-container,
#p2-card-top .status-container,
#p2-card-bottom .status-container {
  left: -36px !important;
  right: auto !important;
  align-items: center !important;
}

.status-container .status-badge {
  position: relative !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
}
.status-badge {
  width: 72px !important;
  height: 72px !important;
  min-width: 72px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  position: absolute !important;
  right: -36px !important;
  display: none; /* JS toggles to flex */
  align-items: center !important;
  justify-content: center !important;
  pointer-events: auto !important;
  z-index: 30 !important;
  box-sizing: border-box !important;
  /* High fidelity glassmorphism effect */
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.03) 100%
  ) !important;
  backdrop-filter: blur(12px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-top: 1.5px solid rgba(255, 255, 255, 0.45) !important;
  border-left: 1.5px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.7),
    inset 0 0 8px rgba(255, 255, 255, 0.05) !important;
  transition:
    transform 0.2s ease,
    filter 0.2s ease !important;
  will-change: transform, filter;
}

.status-badge:hover {
  transform: scale(1.15) !important;
  z-index: 31 !important;
}

.status-img-icon {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 50% !important;
  padding: 0px !important; /* Maximized artwork size inside 72px circle */
  box-sizing: border-box !important;
}

.status-stack {
  position: absolute !important;
  bottom: 0px !important;
  right: 0px !important;
  background: #e74c3c !important;
  color: white !important;
  font-size: 0.85rem !important;
  font-weight: 900 !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  z-index: 5 !important;
}

.badge-para {
  top: 45px !important;
  filter: drop-shadow(0 0 6px rgba(241, 196, 15, 0.6)) !important;
  border-color: rgba(241, 196, 15, 0.45) !important;
}
.badge-immune {
  top: 45px !important;
  filter: drop-shadow(0 0 6px rgba(52, 152, 219, 0.6)) !important;
  border-color: rgba(52, 152, 219, 0.45) !important;
}
.badge-burn {
  top: 133px !important;
  filter: drop-shadow(0 0 6px rgba(231, 76, 60, 0.6)) !important;
  border-color: rgba(231, 76, 60, 0.45) !important;
}
.badge-poison {
  top: 221px !important;
  filter: drop-shadow(0 0 6px rgba(46, 204, 113, 0.6)) !important;
  border-color: rgba(46, 204, 113, 0.45) !important;
}
.badge-mark {
  top: 309px !important;
  filter: drop-shadow(0 0 6px rgba(230, 126, 34, 0.6)) !important;
  border-color: rgba(230, 126, 34, 0.45) !important;
}
.badge-counter {
  top: 397px !important;
  filter: drop-shadow(0 0 6px rgba(149, 165, 166, 0.6)) !important;
  border-color: rgba(149, 165, 166, 0.45) !important;
}

.badge-shield {
  background-color: transparent !important;
  background: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: auto !important;
  height: 14px !important;
  min-width: unset !important;
  padding: 0 !important;
  border-radius: 0 !important;
  display: flex; /* Removed !important to allow inline JS style="display:none;" to function */
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  box-shadow: none !important;
  border: none !important;
  font-size: 2.75rem !important;
  filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 18px rgba(52, 152, 219, 0.9)) !important;
  z-index: 30 !important;
  overflow: visible !important;
  transition: none !important;
  will-change: auto !important;
  pointer-events: none !important; /* Disable cursor interaction to prevent hover movements */
}

.badge-shield:hover {
  transform: translateX(-50%) !important; /* Ensure it stays centered if hovered */
}

/* KÉPESSÉG RÁCS */
.attacks {
  display: flex !important;
  flex-direction: column !important;
  gap: 11px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  align-self: center !important;
  background:
    radial-gradient(circle at top left, rgba(60, 60, 80, 0.3), transparent), rgba(10, 10, 20, 0.4) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-top: 2px solid rgba(197, 160, 89, 0.6) !important;
  border-left: 2px solid rgba(197, 160, 89, 0.4) !important;
  border-radius: 16px !important;
  padding: 0.75rem !important;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.6),
    inset 0 0 20px rgba(0, 0, 0, 0.3) !important;
  position: relative !important;
  z-index: 5 !important;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.2s ease !important;
}
.attacks button {
  width: 100% !important;
  min-width: 0 !important;
  height: 64px !important;
  min-height: 64px !important;
  max-height: 64px !important;
  padding: 0 12px 0 0 !important;
  /* Glassmorphism background - dark blue gradient */
  background: linear-gradient(
    180deg,
    rgba(20, 35, 65, 0.6) 0%,
    rgba(10, 15, 30, 0.75) 100%
  ) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  color: white;
  border: none !important;
  border-radius: 32px 12px 12px 32px !important;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.7rem !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  line-height: 1.2;
  transition:
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.2s,
    background 0.2s;
  will-change: transform, filter;
  box-sizing: border-box !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  box-shadow: none !important;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  overflow: visible !important;
  /* Continuous border silhouette using 4-directional drop-shadow */
  filter: drop-shadow(1px 0 0 rgba(42, 74, 122, 0.75)) drop-shadow(-1px 0 0 rgba(42, 74, 122, 0.75))
    drop-shadow(0 1px 0 rgba(42, 74, 122, 0.75)) drop-shadow(0 -1px 0 rgba(42, 74, 122, 0.75)) !important;
}
.spell-icon {
  width: 68px !important;
  height: 68px !important;
  border-radius: 50% !important;
  border: none !important;
  /* Darker glassmorphism background framing the transparent spell artwork */
  background: rgba(5, 5, 12, 0.8) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  box-shadow: none !important;
  transition:
    transform 0.2s ease,
    filter 0.2s ease,
    background 0.2s ease !important;
  will-change: transform, filter;
  margin-left: -8px !important;
  position: relative !important;
  z-index: 5 !important;
  padding: 0px !important;
  box-sizing: border-box !important;
}
.attacks button:hover:not(:disabled) .spell-icon {
  background: rgba(10, 10, 22, 0.9) !important;
  filter: brightness(1.25) !important;
  transform: scale(1.05) !important;
  box-shadow: none !important;
}
.btn-text-content {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: center !important;
  flex-grow: 1 !important;
  min-width: 0 !important;
}
.btn-title {
  width: 100% !important;
  text-align: left;
  font-size: 0.75rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding-bottom: 1px !important;
  margin-bottom: 1px !important;
  display: flex;
  align-items: center;
  overflow: hidden;
  justify-content: flex-start;
}
.btn-row {
  display: flex !important;
  justify-content: space-between !important;
  width: 100% !important;
  font-size: 0.65rem !important;
  color: #4cc9f0;
  font-weight: 700;
  margin-bottom: 0;
  gap: 8px !important;
}
.btn-row span {
  flex: none !important;
  text-align: left !important;
  white-space: nowrap !important;
}
.btn-row span:last-child {
  text-align: right !important;
}
.btn-eff {
  color: #f1c40f !important;
  font-style: italic;
}

.attacks button:hover:not(:disabled) {
  background: linear-gradient(
    180deg,
    rgba(30, 50, 90, 0.7) 0%,
    rgba(15, 25, 45, 0.8) 100%
  ) !important;
  transform: translateY(-2px);
  /* Crimson continuous outline and subtle glow */
  filter: drop-shadow(1px 0 0 #e94560) drop-shadow(-1px 0 0 #e94560) drop-shadow(0 1px 0 #e94560)
    drop-shadow(0 -1px 0 #e94560) drop-shadow(0 4px 12px rgba(233, 69, 96, 0.45)) !important;
}
.attacks button:active:not(:disabled) {
  transform: translateY(0);
}
.attacks button > span {
  font-size: 0.7rem;
  color: #4cc9f0;
  margin-top: 5px;
  font-weight: 700;
  opacity: 0.9;
  display: block;
  width: 100%;
}
.attacks button:disabled {
  background: rgba(20, 20, 30, 0.4) !important;
  color: #444;
  border: none !important;
  cursor: not-allowed;
  box-shadow: none;
  /* Desaturated gray/dark outline for disabled state */
  filter: grayscale(0.8) drop-shadow(1px 0 0 rgba(40, 40, 50, 0.4))
    drop-shadow(-1px 0 0 rgba(40, 40, 50, 0.4)) drop-shadow(0 1px 0 rgba(40, 40, 50, 0.4))
    drop-shadow(0 -1px 0 rgba(40, 40, 50, 0.4)) !important;
}

.attacks .charge-btn {
  width: 100% !important;
  height: 64px !important;
  min-height: 64px !important;
  max-height: 64px !important;
  /* Orange glassy gradient background */
  background: linear-gradient(
    90deg,
    rgba(211, 84, 0, 0.55) 0%,
    rgba(230, 126, 34, 0.55) 100%
  ) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  color: #fff;
  padding: 0 12px 0 0 !important;
  font-size: 0.75rem !important;
  border: none !important;
  box-shadow: none !important;
  line-height: 1.3;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  font-weight: 800 !important;
  overflow: visible !important;
  /* Signature orange continuous outline */
  filter: drop-shadow(1px 0 0 rgba(230, 126, 34, 0.75))
    drop-shadow(-1px 0 0 rgba(230, 126, 34, 0.75)) drop-shadow(0 1px 0 rgba(230, 126, 34, 0.75))
    drop-shadow(0 -1px 0 rgba(230, 126, 34, 0.75)) !important;
}
.attacks .charge-btn span {
  display: none !important;
}
.attacks .charge-btn:hover:not(:disabled) {
  background: linear-gradient(
    90deg,
    rgba(230, 126, 34, 0.75) 0%,
    rgba(243, 156, 18, 0.75) 100%
  ) !important;
  transform: translateY(-2px);
  /* Orange glow and outline on hover */
  filter: drop-shadow(1px 0 0 #ff9f43) drop-shadow(-1px 0 0 #ff9f43) drop-shadow(0 1px 0 #ff9f43)
    drop-shadow(0 -1px 0 #ff9f43) drop-shadow(0 4px 12px rgba(230, 126, 34, 0.45)) !important;
}
.attacks .charge-btn:active:not(:disabled) {
  transform: translateY(0);
}
.attacks .charge-btn:disabled {
  background: rgba(34, 34, 34, 0.4) !important;
  color: #555 !important;
  border: none !important;
  filter: grayscale(0.8) drop-shadow(1px 0 0 rgba(40, 40, 50, 0.4))
    drop-shadow(-1px 0 0 rgba(40, 40, 50, 0.4)) drop-shadow(0 1px 0 rgba(40, 40, 50, 0.4))
    drop-shadow(0 -1px 0 rgba(40, 40, 50, 0.4)) !important;
}

/* Symmetrical mirrored layout for P2 attacks panel (right side) */
#p2-card .attacks button,
#p2-card .attacks .charge-btn,
#p2-card-top .attacks button,
#p2-card-top .attacks .charge-btn,
#p2-card-bottom .attacks button,
#p2-card-bottom .attacks .charge-btn {
  flex-direction: row-reverse !important;
  padding: 0 0 0 12px !important;
  justify-content: flex-end !important;
  border-radius: 12px 32px 32px 12px !important;
}

#p2-card .attacks .spell-icon,
#p2-card-top .attacks .spell-icon,
#p2-card-bottom .attacks .spell-icon {
  border-radius: 50% !important;
  margin-left: 0 !important;
  margin-right: -8px !important;
}

/* LOG */
#log-container {
  width: 100%;
  max-width: 924px;
  height: clamp(96px, 18vh, 168px);
  margin: 18px auto 6px auto;
}

#log {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 18px;
  overflow-y: auto;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  box-sizing: border-box;
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.7),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
}

#log::-webkit-scrollbar {
  width: 6px;
}
#log::-webkit-scrollbar-track {
  background: transparent;
}
#log::-webkit-scrollbar-thumb {
  background: rgba(233, 69, 96, 0.3);
  border-radius: 10px;
}
#log::-webkit-scrollbar-thumb:hover {
  background: rgba(233, 69, 96, 0.6);
}

.log-entry {
  margin-bottom: 2px;
  font-size: 0.85rem;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.85);
  border-bottom: none;
  padding-bottom: 0px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.highlight {
  color: #e94560;
  font-weight: bold;
}
.status-effect {
  color: #f39c12;
  font-weight: bold;
}
.success {
  color: #2ecc71;
  font-weight: bold;
}
.crit {
  color: #e74c3c;
  font-weight: bold;
  font-style: italic;
}
.heal {
  color: #2ecc71;
  font-weight: bold;
}

/* Napló specifikus színek */
.log-dmg {
  color: #e74c3c;
}
.log-heal {
  color: #2ecc71;
}
.log-shield {
  color: #3498db;
}
.log-ap {
  color: #f1c40f;
}
.log-system {
  color: #39a2db;
}

/* --- RESPONSIVE ADJUSTMENTS FOR SMALLER SCREEN WIDTHS --- */
@media (max-width: 1300px) {
  .card-container {
    gap: clamp(6px, 1.2vw, 15px);
  }
  .item-container {
    width: clamp(85px, 7.6vw, 115px); /* 10%-kal kisebb (eredeti: clamp(94px, 8.5vw, 128px)) */
  }
}

@media (max-width: 1080px) {
  /* Fold side items under the cards when horizontal space is constrained */
  .card-container {
    flex-direction: column !important;
    gap: 15px !important;
    width: 100%;
    max-width: 500px;
  }
  .item-container {
    flex-direction: row !important;
    width: 100% !important;
    gap: 10px !important;
    order: 2 !important; /* Always place them below the cards */
  }
  .item-btn {
    flex: 1 !important;
    height: auto !important;
  }
}

/* --- 2v2 NÉZET STÍLUSOK --- */
#game-screen-2v2 {
  height: 100vh;
  width: 100%;
  display: none; /* will be changed to flex when active */
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 55px 15px 114px 15px !important;
  box-sizing: border-box !important;
  position: relative !important;
  overflow: hidden;
}

#turn-indicator-2v2 {
  position: absolute !important;
  top: 15px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
  z-index: 100 !important;
  font-size: 1.1rem;
  font-weight: bold;
  padding: 6px 25px;
  border-radius: 20px;
  background: rgba(10, 10, 20, 0.4);
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid rgba(197, 160, 89, 0.6);
  border-left: 1.5px solid rgba(197, 160, 89, 0.4);
  text-align: center;
  width: fit-content;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.5),
    inset 0 0 15px rgba(197, 160, 89, 0.2);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
  color: white;
}

.arena-2v2 {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: clamp(10px, 1.5vw, 25px);
  flex: 1;
  min-height: 0;
  align-items: center;
  width: 100%;
  transform-origin: center center;
  transition:
    transform 0.15s ease,
    margin 0.15s ease;
}

.cards-grid-2v2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  row-gap: 25px;
  column-gap: 50px;
  justify-items: center;
  align-items: center;
}

.cards-grid-2v2 .card {
  margin: 0 !important; /* Remove 1v1 margin of 2.5rem to pull rows closer */
  min-height: unset !important;
  height: auto !important;
}

/* Override 1v1 display: none for headers to show character names in 2v2 */
.cards-grid-2v2 .card .card-header {
  display: flex !important;
}

.card-container-2v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.item-container-2v2 {
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1vh, 8px);
  justify-content: center;
  width: clamp(90px, 8vw, 130px);
  z-index: 5;
}

/* Ensure 6 items fit nicely - we make them slightly more compact */
.item-container-2v2 .item-btn {
  padding: 0 7px 8px 6px !important;
  font-size: 0.65rem !important;
}

.player-names-header-2v2-top,
.player-names-header-2v2-bottom {
  position: fixed;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 15px;
  z-index: 100;
  pointer-events: none;
  box-sizing: border-box;
}

.player-names-header-2v2-top {
  top: 15px;
}

.player-names-header-2v2-bottom {
  top: auto;
  bottom: 15px;
}

/* 2v2 Log styling - 25% smaller than original clamp(80px, 12vh, 110px) */
#log-container-2v2 {
  display: none !important;
}

#log-2v2 {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 18px;
  overflow-y: auto;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  box-sizing: border-box;
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.7),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
}

#log-2v2::-webkit-scrollbar {
  width: 6px;
}
#log-2v2::-webkit-scrollbar-track {
  background: transparent;
}
#log-2v2::-webkit-scrollbar-thumb {
  background: rgba(233, 69, 96, 0.3);
  border-radius: 10px;
}
#log-2v2::-webkit-scrollbar-thumb:hover {
  background: rgba(233, 69, 96, 0.6);
}

/* --- TARGETING MODE --- */
.card.targetable-card {
  cursor: crosshair !important;
}

/* Opponent Targetable (Offensive) */
.card.targetable-card.target-opponent .card-body {
  animation: targetPulseOpponent 1.2s infinite alternate;
  border: 2px solid rgba(233, 69, 96, 0.7) !important;
}
.card.targetable-card.target-opponent:hover .card-body {
  transform: scale(1.02) !important;
  box-shadow:
    0 0 35px rgba(233, 69, 96, 0.9),
    0 10px 40px rgba(0, 0, 0, 0.9) !important;
}

/* Friendly Targetable (Supportive) */
.card.targetable-card.target-friendly .card-body {
  animation: targetPulseFriendly 1.2s infinite alternate;
  border: 2px solid rgba(46, 204, 113, 0.7) !important;
}
.card.targetable-card.target-friendly:hover .card-body {
  transform: scale(1.02) !important;
  box-shadow:
    0 0 35px rgba(46, 204, 113, 0.9),
    0 10px 40px rgba(0, 0, 0, 0.9) !important;
}

@keyframes targetPulseOpponent {
  0% {
    box-shadow:
      0 0 15px rgba(233, 69, 96, 0.3),
      inset 0 0 15px rgba(233, 69, 96, 0.1);
    border-color: rgba(233, 69, 96, 0.4) !important;
  }
  100% {
    box-shadow:
      0 0 30px rgba(233, 69, 96, 0.8),
      inset 0 0 20px rgba(233, 69, 96, 0.3);
    border-color: rgba(233, 69, 96, 0.9) !important;
  }
}

@keyframes targetPulseFriendly {
  0% {
    box-shadow:
      0 0 15px rgba(46, 204, 113, 0.3),
      inset 0 0 15px rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.4) !important;
  }
  100% {
    box-shadow:
      0 0 30px rgba(46, 204, 113, 0.8),
      inset 0 0 20px rgba(46, 204, 113, 0.3);
    border-color: rgba(46, 204, 113, 0.9) !important;
  }
}

/* Overlay for target selection - put inside card-body */
.card-body {
  position: relative;
}
.target-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  z-index: 10;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card.targetable-card:hover .target-overlay {
  opacity: 1;
}
.target-badge {
  background: #e94560;
  color: white;
  padding: 6px 16px;
  font-size: 0.9rem;
  font-weight: 900;
  border-radius: 20px;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
}
.card.targetable-card.target-friendly .target-badge {
  background: #2ecc71;
}
