* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #262626;
  color: #fff;
  font-family: "Saira", sans-serif;
  min-height: 100vh;
}

button,
select,
input {
  font-family: inherit;
}

button {
  border: none;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  padding: 28px;
}

/* ========================================================= */
/* TOP BRAND */
/* ========================================================= */

.top-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.top-brand-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.create-roster-btn {
  width: 150px;
  height: 40px;
  border-radius: 10px;
  background: #D23636;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.18s ease;
}

.create-roster-btn:hover {
  background: #e54545;
  transform: translateY(-2px);
}

.brand-logo {
  width: 110px;
  height: auto;
  object-fit: contain;
}

.brand-text h1 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  line-height: 1;
  margin: 0;
}

.brand-text p {
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  margin-top: 2px;
  margin-bottom: 0;
}

/* ========================================================= */
/* MAIN LAYOUT */
/* ========================================================= */

.main-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* ========================================================= */
/* MAP SECTION */
/* ========================================================= */

.map-section {
  flex: 1;
  min-width: 0;
}

.map-wrapper {
  background: #2a2a2a;
  border-radius: 28px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 12px 40px rgba(0,0,0,0.38);
  overflow: hidden;
}

.map-canvas {
  position: relative;
  width: 100%;
  border-radius: 28px;
  overflow: hidden;
}

.battle-map {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 28px;
  background-image: url("../images/war-map.webp");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #2a2a2a;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

#drawCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  z-index: 5;
  pointer-events: none;
}

/* ========================================================= */
/* PLACED MAP MARKERS */
/* ========================================================= */

.map-marker {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 20;
  user-select: none;
  box-shadow: 0 8px 18px rgba(0,0,0,0.28);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.map-marker:hover {
  transform: scale(1.08);
  filter: brightness(1.08);
}

.map-marker:active {
  cursor: grabbing;
}

.map-marker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.map-marker.tactical {
  padding: 10px;
}

.map-marker.tactical img {
  width: 72%;
  height: 72%;
  filter: brightness(0) invert(1);
}

/* ========================================================= */
/* MAP PARTY + PLAYER CARDS */
/* ========================================================= */

.map-party-card,
.map-player-card {
  position: absolute;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: grab;
  user-select: none;
}

.map-party-card:active,
.map-player-card:active {
  cursor: grabbing;
}

.map-party-badge,
.map-player-badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--map-card-color);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.32);
  border: 2px solid rgba(255,255,255,0.18);
}

.map-party-badge img,
.map-player-badge img {
  width: 25px;
  height: 25px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  pointer-events: none;
}

.map-player-badge {
  background: #555;
}

.map-card-info {
  min-width: 118px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(0,0,0,0.58);
  backdrop-filter: blur(6px);
}

.map-card-info strong {
  display: block;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.15;
}

.map-card-info span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.2;
}

/* ========================================================= */
/* BOTTOM TOOLBAR */
/* ========================================================= */

.bottom-toolbar {
  margin-top: 18px;
  background: #0f0f0f;
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 92px;
}

.toolbar-icons,
.toolbar-ping,
.toolbar-tactical,
.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-icons {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-divider {
  width: 1px;
  height: 42px;
  background: rgba(255,255,255,0.10);
  margin: 0 14px;
  flex: 0 0 1px;
}

.toolbar-ping {
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.08);
}

.toolbar-tactical {
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.08);
}

.toolbar-controls {
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.08);
}

.tool-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: transparent;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.tool-icon:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.tool-icon:active {
  cursor: grabbing;
}

.tool-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.tactical-marker {
  padding: 10px;
}

.tactical-marker img {
  width: 72%;
  height: 72%;
  filter: brightness(0) invert(1);
}

.tactical-marker.purple {
  background: #8E4DFF;
}

.tactical-marker.gold {
  background: #C99D28;
}

.tactical-marker.orange {
  background: #F86B22;
}

.tactical-marker.green {
  background: #5CAA22;
}


/* ========================================================= */
/* PING TOOL */
/* ========================================================= */

.ping-tool {
  cursor: pointer;
  background: transparent;
  border: 2px solid transparent;
}

.ping-tool:active {
  cursor: pointer;
}

.ping-tool.is-active {
  border-color: var(--ping-tool-color, #ffffff);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.08);
}

.ping-tool-mask {
  width: 34px;
  height: 34px;
  display: block;
  background: var(--ping-tool-color, #ffffff);
  -webkit-mask: url("../icons/ping.svg") center / contain no-repeat;
  mask: url("../icons/ping.svg") center / contain no-repeat;
}

/* ========================================================= */
/* PING EFFECT */
/* ========================================================= */

.ping-wave,
.ping-dot {
  position: absolute;
  left: var(--ping-x);
  top: var(--ping-y);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.ping-wave {
  width: 42px;
  height: 42px;
  border: 5px solid var(--ping-color);
  border-radius: 50%;
  z-index: 60;
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 18px var(--ping-color),
    0 0 30px var(--ping-color),
    0 0 45px var(--ping-color);
  animation: pingWave 1.2s ease-out forwards;
}

.ping-wave::before,
.ping-wave::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 4px solid var(--ping-color);
  transform: translate(-50%, -50%) scale(0.4);
  transform-origin: center center;
  opacity: 1;
  box-shadow:
    0 0 14px var(--ping-color),
    0 0 26px var(--ping-color);
  animation: pingWaveRing 1.2s ease-out forwards;
}

.ping-wave::before {
  width: 72px;
  height: 72px;
}

.ping-wave::after {
  width: 110px;
  height: 110px;
  animation-delay: 0.12s;
}

.ping-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ping-color);
  z-index: 61;
  box-shadow:
    0 0 0 3px rgba(0,0,0,0.45),
    0 0 30px var(--ping-color),
    0 0 50px var(--ping-color),
    0 0 70px var(--ping-color);
  animation: pingDotFade 2.5s ease-out forwards;
}

/* ========================================================= */
/* ANIMATIONS */
/* ========================================================= */

@keyframes pingWave {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.45);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.4);
  }
}

@keyframes pingWaveRing {
  0% {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(0.4);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.6);
  }
}

@keyframes pingDotFade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
  }
}

.ping-color-panel {
  z-index: 1200;
}

/* ========================================================= */
/* COLOR PANELS */
/* ========================================================= */

.color-pop-wrap {
  position: relative;
}

.mini-color-panel {
  position: fixed;
  top: 0;
  left: 0;
  transform: translateX(-50%);
  width: 64px;
  background: #0b0b0b;
  border-radius: 14px;
  padding: 10px 8px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
  box-shadow: 0 14px 28px rgba(0,0,0,0.42);
}

.mini-color-panel.show {
  display: flex;
}

.mini-color-panel button {
  width: 48px;
  height: 18px;
  border-radius: 20px;
  cursor: pointer;
}

.brush-color-panel {
  position: absolute;
  bottom: 66px;
  right: 0;
  width: 238px;
  background: #f5f5f5;
  border-radius: 10px;
  padding: 12px;
  display: none;
  z-index: 90;
  box-shadow: 0 14px 28px rgba(0,0,0,0.42);
}

.brush-color-panel.show {
  display: block;
}

.brush-color-panel input[type="color"] {
  width: 100%;
  height: 140px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.rgb-row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.rgb-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  color: #000;
  font-size: 12px;
}

.rgb-row input {
  width: 62px;
  height: 36px;
  border: 1px solid #ccc;
  text-align: center;
}

/* ========================================================= */
/* CONTROL BUTTONS */
/* ========================================================= */

.control-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #060606;
  color: #fff;
  cursor: pointer;
  font-size: 28px;
  border: 2px solid rgba(255,255,255,0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.control-btn:hover,
.control-btn.active {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.55);
}

.palette-btn {
  background: transparent;
  border: none;
}

.palette-btn span {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: block;
  background: #FF2929;
}

.icon-control img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  pointer-events: none;
}

.draw-btn.active img {
  filter: brightness(0) saturate(100%) invert(51%) sepia(88%) saturate(3178%) hue-rotate(239deg) brightness(101%) contrast(101%);
}

.clear-btn {
  width: 78px;
  height: 74px;
  border-radius: 16px;
  background: #0a0a0a;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease;
}

.clear-btn:hover {
  transform: translateY(-2px);
}

.clear-btn img {
  width: 29px;
  height: 29px;
  filter: brightness(0) invert(1);
}

.clear-btn span {
  font-size: 10px;
  font-weight: 700;
}

/* ========================================================= */
/* NEW SIDEBAR PARTIES */
/* ========================================================= */

.sidebar {
  width: 360px;
  flex: 0 0 360px;
}

.party-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.party-sidebar-head h2 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.party-sidebar-head button {
  background: transparent;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.18s ease;
}

.party-sidebar-head button:hover {
  opacity: 0.72;
}

.party-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.party-block {
  height: 64px;
  border-radius: 12px;
  background: var(--party-color);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: grab;
  border: 1px solid rgba(255,255,255,0.14);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.party-block:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.party-block:active {
  cursor: grabbing;
}

.party-flag {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.party-flag img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
  pointer-events: none;
}

.party-info {
  flex: 1;
  min-width: 0;
  text-align: right;
}

.party-info strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.party-info span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1;
}

.add-player-btn {
  width: 100%;
  height: 45px;
  margin-top: 28px;
  border-radius: 14px;
  background: #D23636;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.add-player-btn:hover {
  background: #ef4141;
  transform: translateY(-2px);
}

.player-list-panel {
  margin-top: 18px;
  background: #70706f;
  border-radius: 14px;
  padding: 22px 16px;
  min-height: 318px;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-player-row {
  min-height: 44px;
  background: rgba(0,0,0,0.22);
  border-bottom: 4px solid rgba(255,255,255,0.08);
  display: grid;
  grid-template-columns: 30px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: grab;
}

.sidebar-player-row:active {
  cursor: grabbing;
}

.sidebar-player-row img {
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
  opacity: 0.96;
}

.sidebar-player-name {
  font-size: 14px;
  font-weight: 400;
}

.sidebar-player-art {
  background: #252525;
  color: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.sidebar-player-role {
  color: #fff;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.sidebar-player-role.dps {
  background: #127DE8;
}

.sidebar-player-role.heal {
  background: #0B9B31;
}

.sidebar-player-role.tank {
  background: #9B530B;
}

.player-empty-slot {
  height: 44px;
  background: rgba(0,0,0,0.18);
  border-bottom: 4px solid rgba(255,255,255,0.08);
}

.sidebar-player-row {
  grid-template-columns: 30px 1fr auto auto 18px;
}

.sidebar-player-remove {
  width: 15px;
  height: 15px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-player-remove img {
  width: 15px;
  height: 15px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  pointer-events: none;
}

.sidebar-player-remove:hover img {
  opacity: 1;
}



/* ========================================================= */
/* MODALS */
/* ========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.22);
  backdrop-filter: blur(2px);
}

.modal-overlay.show {
  display: flex;
}

.modal-panel {
  position: relative;
  width: min(560px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 36px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.48);
}

.modal-panel h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.modal-panel p {
  margin-top: 8px;
  font-size: 15px;
  color: #fff;
}

.modal-close {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 23px;
  height: 23px;
  background: transparent;
  cursor: pointer;
}

.modal-close img {
  width: 100%;
  height: 100%;
  filter: brightness(0) invert(1);
}

.party-edit-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 36px;
}

.party-edit-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.party-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 17px;
}

.party-color-options {
  display: flex;
  align-items: center;
  gap: 10px;
}

.party-color-options button {
  width: 26px;
  height: 26px;
  cursor: pointer;
  border: 2px solid transparent;
}

.party-color-options button.active {
  border-color: #fff;
}

.party-edit-item input,
.player-form input,
.player-form select {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: rgba(20,20,20,0.82);
  border: 1px solid rgba(90, 90, 90, 0.55);
  color: #fff;
  padding: 0 46px 0 18px;
  font-size: 16px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.player-form select {
  background:
    linear-gradient(45deg, transparent 50%, #ffffff 50%),
    linear-gradient(135deg, #ffffff 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.player-form select option {
  background: #121212;
  color: #ffffff;
}

.modal-save-btn {
  width: 100%;
  height: 56px;
  margin-top: 34px;
  border-radius: 12px;
  background: #D23636;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.modal-save-btn:hover {
  background: #ef4141;
  transform: translateY(-2px);
}

.player-modal-panel {
  width: min(500px, calc(100vw - 48px));
}

.player-form {
  margin-top: 38px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.player-form label {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 400;
}

.role-options {
  display: flex;
  gap: 10px;
}

.role-btn {
  min-width: 82px;
  height: 38px;
  border-radius: 9px;
  background: #127DE8;
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  border: 2px solid transparent;
  cursor: pointer;
}

.role-btn.heal {
  background: #0B9B31;
}

.role-btn.tank {
  background: #9B530B;
}

.role-btn.jungle {
  background: #ca1d17;
}
.role-btn.active {
  border-color: #fff;
}

.add-player-submit {
  margin-top: 54px;
}

.marker-remove-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ff3b3b;
  border: 4px solid #fff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}

.marker-remove-btn img {
  width: 14px;
  height: 14px;
  filter: brightness(0) invert(1);
  pointer-events: none;
}

.map-marker.is-selected .marker-remove-btn,
.map-party-card.is-selected .marker-remove-btn,
.map-player-card.is-selected .marker-remove-btn {
  display: flex;
}

/* ========================================================= */
/* RESPONSIVE */
/* ========================================================= */

@media (max-width: 1200px) {
  .main-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex: none;
  }

  .bottom-toolbar {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .toolbar-icons {
    flex: none;
  }
}

@media (max-width: 1100px) {
  .roster-party-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title actions"
      "commander actions";
    align-items: center;
    gap: 6px 10px;
  }

  .roster-party-header h2 {
    grid-area: title;
  }

  .roster-commander {
    grid-area: commander;
    width: 100%;
    font-size: 13px;
  }

  .roster-party-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 8px;
  }
}
/* ========================================================= */
/* ROSTER PAGE */
/* ========================================================= */

.roster-page {
  padding: 28px 64px 48px;
}

.roster-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 140px;
  align-items: start;
  margin-top: 90px;
}

/* ========================================================= */
/* ROSTER IMPORT PANEL */
/* ========================================================= */

.roster-import-panel {
  width: 360px;
}

.roster-import-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 28px;
  width: 100%;
}

.roster-import-actions button,
.roster-import-actions label {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  background: #666666;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roster-import-actions input {
  display: none;
}

.roster-search-box {
  height: 44px;
  margin: 0 0 18px;
  border-radius: 10px;
  background: #1e1e1e;
  display: flex;
  align-items: center;
  padding: 0 14px;
}

.roster-search-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 13px;
  font-weight: 400;
}

.roster-search-box span {
  font-size: 24px;
  line-height: 1;
  color: #ffffff;
}

.roster-clear-search {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: none;
  margin-right: 14px;
}

.roster-clear-search.show {
  display: block;
}

.roster-search-icon {
  font-size: 24px;
  line-height: 1;
  color: #ffffff;
  flex-shrink: 0;
  transform: translateY(-2px);
}

.roster-player-pool {
  min-height: 840px;
  background: #525252;
  border-radius: 10px;
  padding: 20px;
}

/* ========================================================= */
/* ROSTER PARTY AREA */
/* ========================================================= */

.roster-party-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}

.roster-party-card {
  min-height: 430px;
  background: #202020;
  border-radius: 12px;
  padding: 22px 20px;
}

.roster-party-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.roster-party-header h2 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.roster-commander {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #898989;
  font-size: 15px;
  font-weight: 400;
}

.roster-commander img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.roster-commander strong {
  color: #ffffff;
  font-weight: 500;
  outline: none;
  min-width: 20px;
}

.roster-party-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.roster-party-clear-btn {
  width: 34px;
  height: 30px;
  border-radius: 10px;
  background: #3a3a3a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.18s ease;
}

.roster-party-clear-btn:hover {
  background: #D23636;
  transform: translateY(-1px);
}

.roster-party-clear-btn img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  pointer-events: none;
}

.roster-add-party-card {
  min-height: 430px;
  border-radius: 12px;
  background: #202020;
  border: 1px dashed rgba(255,255,255,0.18);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.roster-add-party-card:hover {
  background: #252525;
  border-color: rgba(255,255,255,0.38);
  transform: translateY(-2px);
}

.roster-add-party-card span {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #4e4e4e;
  color: #ffffff;
  font-size: 42px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 6px;
}


/* ========================================================= */
/* OBJECTIVE BAR */
/* ========================================================= */

.roster-objective-list {
  min-height: 38px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: #171717;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.roster-objective-item {
  flex: 1;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}

.roster-objective-item span {
  color: #7f7f7f;
  font-size: 12px;
  font-weight: 400;
}

.roster-objective-item strong {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  min-width: 40px;
}

/* ========================================================= */
/* PARTY DROPZONE */
/* ========================================================= */

.roster-party-dropzone {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roster-party-dropzone.is-drag-over {
  outline: 1px dashed rgba(255,255,255,0.22);
  outline-offset: 6px;
}

/* ========================================================= */
/* ROSTER PLAYER ROW */
/* ========================================================= */

.roster-player-row {
  position: relative;
  height: 43px;
  display: grid;
  grid-template-columns: 12px 44px 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  cursor: grab;
}

.roster-player-color {
  grid-column: 1;
  width: 12px;
  height: 45px;
  background: var(--spec-color);
}

.roster-player-icon {
  width: 45px;
  height: 45px;
  background: #2e2e2e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roster-player-icon img {
  width: 35px;
  height: 35px;
  object-fit: contain;
}

.roster-player-name {
  grid-column: 4;
  height: 45px;
  background: #454545;
  display: flex;
  align-items: center;
  padding: 0 380px 0 28px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 400;
  min-width: 0;
}

.roster-player-role-pill {
  position: absolute;
  right: 120px;
  top: 8px;
  width: 150px;
  height: 30px;
  border-radius: 10px;
  background: #171717;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  z-index: 3;
}

.roster-player-edit {
  position: absolute;
  right: 60px;
  top: 10;
  width: 52px;
  height: 52px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.roster-player-return {
  grid-column: 5;
  width: 45px;
  height: 45px;
  background: #454545;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roster-player-edit img,
.roster-player-return img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

/* ========================================================= */
/* SIDEBAR PLAYER ROW VARIANT */
/* ========================================================= */

.roster-player-pool .roster-player-row {
  grid-template-columns: 8px 34px 34px 1fr;
  gap: 2px;
  height: 37px;
  margin-bottom: 2px;
}

.roster-player-pool .roster-player-color {
  width: 8px;
  height: 40px;
}

.roster-player-pool .roster-player-icon {
  width: 34px;
  height: 34px;
}

.roster-player-pool .roster-player-icon img {
  width: 30px;
  height: 30px;
}

.roster-player-pool .roster-player-name {
  grid-column: 4;
  height: 34px;
  padding: 0 12px;
  font-size: 14px;
}

.roster-player-pool .roster-player-role-pill,
.roster-player-pool .roster-player-edit,
.roster-player-pool .roster-player-return {
  display: none;
}

/* ========================================================= */
/* RESPONSIVE ROSTER */
/* ========================================================= */

@media (max-width: 1400px) {
  .roster-layout {
    gap: 60px;
  }

  .roster-player-row {
    grid-template-columns: 10px 40px 40px 1fr 140px 28px 40px;
  }
}

@media (max-width: 1100px) {
  .roster-page {
    padding: 24px;
  }

  .roster-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .roster-import-panel {
    width: 100%;
  }

  .roster-player-pool {
    min-height: 260px;
  }

  .roster-party-area {
    grid-template-columns: 1fr;
  }
}

/* ========================================================= */
/* ROSTER PLAYER EDITOR */
/* ========================================================= */

.roster-party-card {
  position: relative;
  overflow: hidden;
}

.roster-add-player-open {
  height: 30px;
  padding: 0 18px;
  border-radius: 10px;
  background: #5e5e5e;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.roster-add-player-open:hover {
  background: #ad7909;
  transform: translateY(-1px);
  transition: 0.18s ease;
}

.roster-player-editor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -100%;
  background: #181818;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 24px;
  transition: 0.35s ease;
  z-index: 20;
}

.roster-player-editor.is-open {
  bottom: 0;
}

.roster-editor-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  color: #ffffff;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.roster-player-editor h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

.roster-editor-top {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.roster-editor-name {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  background: #2b2b2b;
  border: none;
  outline: none;
  padding: 0 16px;
  color: #ffffff;
  font-size: 14px;
}

.roster-color-tags {
  display: flex;
  align-items: center;
  gap: 10px;
}

.roster-color-tags span {
  font-size: 13px;
  color: #9a9a9a;
}

.roster-color-tags button {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
}

.roster-editor-row {
  margin-bottom: 20px;
}

.roster-editor-row > span {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  color: #9a9a9a;
}

.roster-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.roster-choice-list button {
  width: 48px;
  height: 48px;
  background: #2b2b2b;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roster-choice-list button img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.roster-choice-list button.is-active {
  outline: 2px solid #D23636;
}

.roster-editor-submit {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  background: #D23636;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* ========================================================= */
/* ENERGY CALCULATOR PAGE */
/* ========================================================= */

.energy-page {
  width: 100%;
  min-height: 100vh;
  background-image: url("../images/bge.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #262626;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.energy-wrapper {
  position: relative;
  width: min(1060px, calc(100vw - 48px));
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.energy-goose {
  position: absolute;
  left: -40px;
  bottom: 8px;
  z-index: 5;
  width: 590px;
  pointer-events: none;
}

.energy-goose img {
  width: 100%;
  height: auto;
  display: block;
}

.energy-card {
  position: relative;
  z-index: 2;
  width: 800px;
  min-height: 340px;
  margin-left: 200px;
  padding: 58px 48px 36px;
  border-radius: 26px;

  background: rgba(0, 0, 0, 0.541);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);

  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.energy-brand {
  position: absolute;
  top: -70px;
  left: 260px;
  right: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.energy-brand img {
  width: 146px;
  height: auto;
  display: block;
  object-fit: contain;
}

.energy-brand p {
  color: #050505;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.08;
}

.energy-input-section {
  width: 440px;
  margin-left: auto;
  padding-top: 0;
}

.energy-input-section label {
  display: block;
  margin-bottom: 10px;
  padding-right: 18px;
  color: #9e9e9e;
  font-size: 13px;
  font-weight: 400;
  text-align: right;
}

.energy-input-box {
  height: 56px;
  width: 100%;
  border-radius: 10px;
  background: #111111;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  padding: 0 18px;
}
.energy-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.energy-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.energy-input-box input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 28px;
  font-weight: 400;
  text-align: right;
}

.energy-input-box input::-webkit-outer-spin-button,
.energy-input-box input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.energy-input-box input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.energy-max {
  color: #ffffff;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

.energy-result {
  margin-top: 54px;
  margin-left: 120px;
  text-align: center;
}

.energy-result span {
  display: block;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

.energy-result h2 {
  margin-top: 14px;
  color: #ffffff;
  font-size: 38px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 1px;
}

.energy-actions {
  margin-top: 54px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 32px;
}

.energy-home-btn {
  color: #d7d7d7;
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.18s ease;
}

.energy-home-btn:hover {
  color: #ffffff;
}

.energy-calendar-btn {
  height: 44px;
  padding: 0 32px;
  border-radius: 9px;
  background: #df8840;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.energy-calendar-btn:hover {
  background: #ee984d;
  transform: translateY(-1px);
}

.energy-calendar-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ========================================================= */
/* ENERGY RESPONSIVE */
/* ========================================================= */

@media (max-width: 980px) {
  .energy-page {
    align-items: flex-start;
    padding: 56px 16px 36px;
    overflow-y: auto;
  }

  .energy-wrapper {
    width: 100%;
    min-height: auto;
    flex-direction: column;
  }

  .energy-goose {
    position: relative;
    left: auto;
    bottom: auto;
    z-index: 5;
    width: min(420px, 100%);
    margin: 0 auto -66px;
  }

  .energy-card {
    width: 100%;
    max-width: 560px;
    min-height: auto;
    margin-left: 0;
    padding: 82px 18px 30px;
    border-radius: 24px;
  }

  .energy-brand {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    justify-content: center;
    gap: 12px;
    margin-bottom: 34px;
  }

  .energy-brand img {
    width: 118px;
  }

  .energy-brand p {
    font-size: 13px;
  }

  .energy-input-section {
    width: 100%;
    margin-left: 0;
    padding-top: 0;
  }

  .energy-input-section label {
    width: 100%;
    margin-bottom: 10px;
    padding-right: 0;
    text-align: center;
    white-space: normal;
    overflow: visible;
  }

  .energy-input-box {
    width: 100%;
    height: 58px;
    grid-template-columns: 50px 1fr auto;
    padding: 0 18px;
  }

  .energy-result {
    margin-top: 44px;
    margin-left: 0;
    text-align: center;
  }

  .energy-result h2 {
    font-size: 34px;
    line-height: 1.12;
  }

  .energy-actions {
    margin-top: 44px;
    justify-content: center;
    gap: 22px;
  }
}

@media (max-width: 520px) {
  .energy-page {
    padding: 42px 10px 28px;
  }

  .energy-wrapper {
    width: 100%;
  }

  .energy-goose {
    width: min(390px, 100%);
    margin-bottom: -52px;
  }

  .energy-card {
    width: 100%;
    max-width: none;
    border-radius: 22px;
    padding: 76px 18px 28px;
  }

  .energy-brand {
    margin-bottom: 34px;
  }

  .energy-brand img {
    width: 108px;
  }

  .energy-brand p {
    font-size: 12px;
    line-height: 1.08;
  }

  .energy-input-section {
    width: 100%;
    margin-left: 0;
  }

  .energy-input-section label {
    font-size: 12px;
    text-align: center;
    padding-right: 0;
  }

  .energy-input-box {
    width: 100%;
    height: 58px;
    grid-template-columns: 46px 1fr auto;
    padding: 0 16px;
  }

  .energy-icon {
    width: 28px;
    height: 28px;
  }

  .energy-input-box input,
  .energy-max {
    font-size: 25px;
  }

  .energy-result {
    margin-top: 44px;
    margin-left: 0;
    text-align: center;
  }

  .energy-result span {
    font-size: 12px;
  }

  .energy-result h2 {
    margin-top: 14px;
    font-size: 30px;
    line-height: 1.12;
    letter-spacing: 0.5px;
  }

  .energy-actions {
    margin-top: 42px;
    flex-direction: column;
    gap: 18px;
  }

  .energy-calendar-btn {
    width: 100%;
  }
}