.mp-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  height: 100%;
}

.mp-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid rgba(244, 240, 223, 0.1);
}

.mp-panel {
  overflow: auto;
}

#mpGame {
  display: block;
  width: 100%;
  height: 100%;
  background: #10120f;
}

.mp-form,
.mp-actions {
  display: grid;
  gap: 8px;
}

.mp-login-section[hidden],
.mp-account-section[hidden] {
  display: none;
}

.mp-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.mp-form button,
.mp-actions button:last-child {
  grid-column: 1 / -1;
}

.mp-form input,
.mp-actions input,
.mp-actions select {
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(244, 240, 223, 0.14);
  border-radius: 8px;
  background: #272b23;
  color: var(--ink);
  font: inherit;
}

.mp-form input[type="color"] {
  padding: 4px;
}

.mp-remember {
  display: flex;
  grid-column: 1 / -1;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.mp-remember input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--gold);
}

.mp-actions {
  grid-template-columns: 1fr 74px 1fr;
}

.mp-actions select {
  grid-column: 1 / -1;
}

.mp-account-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
}

.mp-account-section strong {
  display: block;
  min-width: 0;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-account-section .camp-action {
  min-height: 34px;
  padding-inline: 10px;
}

.mp-disclosure {
  padding: 0;
  overflow: hidden;
}

.mp-disclosure summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  cursor: pointer;
  list-style: none;
}

.mp-disclosure summary::-webkit-details-marker {
  display: none;
}

.mp-disclosure summary::after {
  content: ">";
  color: var(--gold);
  font-weight: 900;
  transform: rotate(90deg);
}

.mp-disclosure[open] summary {
  border-bottom: 1px solid var(--line);
}

.mp-disclosure[open] summary::after {
  transform: rotate(-90deg);
}

.mp-disclosure summary span {
  font-size: 0.95rem;
  font-weight: 800;
}

.mp-disclosure summary strong {
  color: var(--gold);
  font-size: 0.82rem;
}

.mp-disclosure .mp-actions {
  padding: 14px;
}

.camp-services .mp-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.mp-tabs button {
  min-width: 0;
  min-height: 30px;
  border: 1px solid rgba(244, 240, 223, 0.12);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.mp-tabs button.is-active,
.mp-tabs button:hover {
  border-color: rgba(231, 184, 79, 0.55);
  color: var(--ink);
}

.mp-camp-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.mp-resource-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.mp-resource-line span {
  padding: 5px 8px;
  border: 1px solid rgba(244, 240, 223, 0.1);
  border-radius: 8px;
  background: var(--panel-2);
}

.mp-camp-grid {
  display: grid;
  gap: 7px;
}

.mp-camp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: stretch;
}

.mp-camp-card,
.mp-note {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(244, 240, 223, 0.1);
  border-radius: 8px;
  background: var(--panel-2);
}

.mp-camp-card strong,
.mp-camp-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-camp-card strong {
  font-size: 0.82rem;
}

.mp-camp-card span,
.mp-note {
  color: var(--muted);
  font-size: 0.72rem;
}

.mp-branch-title {
  margin-top: 4px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mp-exp-row {
  display: grid;
  gap: 5px;
  margin-bottom: 9px;
}

.mp-exp-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.mp-exp-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(244, 240, 223, 0.1);
  border-radius: 999px;
  background: #171a15;
}

.mp-exp-track div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6cc4a1, #e7b84f);
  transition: width 180ms ease;
}

.mp-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mp-stats div,
.mp-item-detail {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(244, 240, 223, 0.1);
  border-radius: 8px;
  background: var(--panel-2);
}

.mp-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.mp-stats strong {
  display: block;
  margin-top: 2px;
}

.mp-inventory {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  max-height: 190px;
  margin-top: 8px;
}

.bag-slot.is-selected {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(231, 184, 79, 0.55);
}

.mp-item-icon small {
  position: absolute;
  right: 4px;
  bottom: 2px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
}

.mp-item-icon.element-poison {
  box-shadow: inset 0 0 0 1px rgba(126, 224, 109, 0.42), 0 0 14px rgba(126, 224, 109, 0.12);
  color: #baff8f;
}

.mp-item-icon.element-fire {
  box-shadow: inset 0 0 0 1px rgba(255, 157, 77, 0.46), 0 0 14px rgba(255, 123, 66, 0.15);
  color: #ffd080;
}

.mp-item-icon.element-ice {
  box-shadow: inset 0 0 0 1px rgba(143, 216, 255, 0.46), 0 0 14px rgba(143, 216, 255, 0.14);
  color: #d8f6ff;
}

.mp-item-detail {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.mp-growth {
  display: grid;
  gap: 12px;
}

.mp-class-choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.mp-stat-upgrades {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.mp-stat-upgrades .mp-camp-row {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.mp-skill-tree {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
}

.mp-skill-branch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}

.mp-skill-branch .mp-branch-title {
  grid-column: 1 / -1;
}

.mp-skill-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(244, 240, 223, 0.1);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(244, 240, 223, 0.045), rgba(244, 240, 223, 0.018));
}

.branch-attack .mp-skill-card {
  border-color: rgba(214, 80, 77, 0.24);
}

.branch-defense .mp-skill-card {
  border-color: rgba(108, 196, 161, 0.24);
}

.branch-magic .mp-skill-card {
  border-color: rgba(153, 138, 232, 0.25);
}

.branch-thief .mp-skill-card {
  border-color: rgba(126, 224, 109, 0.26);
}

.branch-mage .mp-skill-card {
  border-color: rgba(143, 216, 255, 0.26);
}

.branch-fighter .mp-skill-card {
  border-color: rgba(231, 184, 79, 0.26);
}

.branch-ranger .mp-skill-card {
  border-color: rgba(108, 196, 161, 0.26);
}

.mp-skill-card.is-locked {
  opacity: 0.58;
}

.mp-skill-card.is-maxed {
  box-shadow: inset 0 0 0 1px rgba(231, 184, 79, 0.28);
}

.mp-skill-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
}

.mp-skill-head span,
.mp-skill-head em {
  color: var(--gold);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
}

.mp-skill-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.74rem;
  line-height: 1.12;
}

.mp-skill-desc {
  min-height: 34px;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.25;
}

.mp-rank-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
}

.mp-rank-bar div {
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.mp-skill-card .camp-action {
  min-height: 27px;
  padding: 0 8px;
  font-size: 0.7rem;
}

@media (max-width: 900px) {
  .mp-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, 62vh) auto;
    height: auto;
  }

  .mp-stage {
    border-right: 0;
    border-bottom: 1px solid rgba(244, 240, 223, 0.1);
  }

  .mp-skill-tree,
  .mp-stat-upgrades,
  .mp-skill-branch {
    grid-template-columns: 1fr;
  }
}
