:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #101317;
  color: #edf3f8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

html,
body,
.app {
  min-height: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 36px;
  border: 0;
  background: #eac45a;
  color: #151515;
  font-weight: 700;
  cursor: pointer;
}

.button-link {
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  background: #eac45a;
  color: #151515;
  font-weight: 700;
  text-decoration: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input,
select,
textarea {
  min-height: 40px;
  border: 1px solid #3a4652;
  background: #10161c;
  color: #fff;
  padding: 0 10px;
}

textarea {
  min-height: 84px;
  padding: 10px;
  resize: vertical;
}

.hidden {
  display: none !important;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9998;
  width: 100vw;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 36%, rgba(234, 196, 90, 0.16), transparent 28%),
    radial-gradient(circle at 28% 68%, rgba(117, 197, 162, 0.12), transparent 28%),
    #101317;
}

.loading-card {
  width: min(420px, 92vw);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 30px 24px;
}

.game-logo-frame {
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  position: relative;
}

.game-logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(234, 196, 90, 0.26));
}

.game-logo-frame img.missing {
  display: none;
}

.game-logo-mark {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 2px solid #eac45a;
  border-radius: 50%;
  color: #eac45a;
  font-weight: 900;
  font-size: 38px;
  letter-spacing: 0;
  box-shadow: 0 0 24px rgba(234, 196, 90, 0.28), inset 0 0 18px rgba(234, 196, 90, 0.12);
  background: rgba(16, 22, 28, 0.92);
}

.game-logo-frame img:not(.missing) + .game-logo-mark {
  display: none;
}

.loading-screen h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1;
}

.loading-screen p {
  margin: 0;
  color: #c8d3df;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(260px, 380px);
  gap: 24px;
  align-content: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(rgba(16, 19, 23, 0.68), rgba(16, 19, 23, 0.88)),
    radial-gradient(circle at 20% 20%, #3f735b, transparent 32%),
    radial-gradient(circle at 80% 72%, #663340, transparent 36%),
    #101317;
}

.admin-page {
  align-content: start;
  align-items: start;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
}

.admin-page .auth-card {
  width: 100%;
  min-width: 0;
}

.admin-section {
  align-content: start;
  max-height: calc(100vh - 48px);
  overflow: auto;
  min-height: 0;
}

.admin-section h2 {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #303b47;
}

.admin-section h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.field-label {
  display: block;
  margin: 4px 0 2px;
  color: #c8d3df;
  font-size: 12px;
  font-weight: 700;
}

.auth-copy h1 {
  margin: 0 0 12px;
  font-size: 52px;
}

.auth-copy p,
.message,
.log {
  color: #c2cbd6;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.modal-message {
  max-width: 100%;
  margin: 0;
  color: #ffb4a6;
}

.auth-card,
.modal-card,
.left-panel,
.right-panel {
  background: #1a222b;
  border: 1px solid #303b47;
  padding: 16px;
}

.auth-card,
.modal-card {
  display: grid;
  gap: 10px;
}

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

.form-links button,
.tabs button {
  background: #303a46;
  color: #edf3f8;
}

.game {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  padding: 7px 8px;
  background: #19212a;
  border-bottom: 1px solid #303b47;
  overflow-x: auto;
  overflow-y: hidden;
}

.topbar h1 {
  flex: 0 0 auto;
  margin: 0;
  font-size: 18px;
  white-space: nowrap;
}

.topbar button,
.topbar .button-link {
  flex: 0 0 auto;
  padding: 6px 7px;
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
}

#locationLabel {
  flex: 1 1 80px;
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(288px, 300px) 1fr 300px;
  gap: 12px;
  padding: 12px;
}

.left-panel,
.right-panel {
  display: flex;
  flex-direction: column;
  align-content: start;
  gap: 12px;
  max-height: calc(100vh - 76px);
  overflow: auto;
  min-height: 0;
}

.left-panel #bag.bag {
  max-height: none;
  overflow-y: visible;
  overflow-x: hidden;
  flex-shrink: 0;
  width: 100%;
}

.left-panel #equipment.equipment {
  flex-shrink: 0;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid #2c3540;
  width: 100%;
  max-width: 276px;
  margin-left: auto;
  margin-right: auto;
}


h2,
p {
  margin: 0;
}

.world-wrap {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 8px;
}

canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  border: 1px solid #303b47;
  background: #111;
}

.hud {
  position: static;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.hud div {
  min-width: 0;
  padding: 5px 6px;
  background: #10161c;
  border: 1px solid #303b47;
  font-size: 11px;
  white-space: nowrap;
}

meter {
  display: block;
  width: 100%;
  height: 10px;
}

.bag {
  display: grid;
  grid-template-columns: repeat(5, 44px);
  gap: 5px;
  align-items: start;
  justify-content: start;
}

.forge-layout {
  display: grid;
  grid-template-columns: minmax(252px, 36%) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
  width: 100%;
}

.forge-left-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.forge-right-col {
  min-width: 280px;
}

@media (max-width: 720px) {
  .forge-layout {
    grid-template-columns: 1fr;
  }
}

.forge-bag-grid {
  display: grid;
  grid-template-columns: repeat(5, 52px);
  gap: 6px;
  justify-content: start;
}

.forge-bag-cell {
  cursor: grab;
}

.forge-bag-cell:not(.filled) {
  cursor: default;
}

.slot {
  width: 52px;
  height: 52px;
  padding: 0;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 8px;
  line-height: 1.05;
  overflow: hidden;
  background: #10161c;
  border: 1px solid #34404d;
  position: relative;
}

.bag > .slot {
  width: 44px;
  height: 44px;
}

.item-icon {
  width: 28px;
  height: 28px;
  display: inline-block;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid #34404d;
  background-color: #0d1218;
  vertical-align: middle;
}

.world-icon {
  width: 34px;
  height: 34px;
  margin-right: 8px;
}

.slot.filled {
  border-color: #d0a84e;
}

.slot .item-icon {
  width: 100%;
  height: 100%;
  border: 0;
  background-color: transparent;
}

.bag > .slot .item-icon {
  width: 100%;
  height: 100%;
}

.slot .item-name {
  display: none;
}

.slot.rarity-mythic,
.equip-slot.rarity-mythic {
  border-color: #f2d851;
  box-shadow: 0 0 0 1px rgba(242,216,81,0.28) inset;
}

.slot.rarity-mythic,
.slot.rarity-mythic .item-icon,
.equip-slot.rarity-mythic,
.equip-slot.rarity-mythic .item-icon,
.shop-item.rarity-mythic .item-icon {
  animation: rarityPulseGold 1.7s ease-in-out infinite;
}

.slot.rarity-legendary,
.equip-slot.rarity-legendary {
  border-color: #ff8b3d;
  box-shadow: 0 0 0 1px rgba(255,139,61,0.25) inset;
}

.slot.rarity-legendary,
.slot.rarity-legendary .item-icon,
.equip-slot.rarity-legendary,
.equip-slot.rarity-legendary .item-icon,
.shop-item.rarity-legendary .item-icon {
  animation: rarityPulseFlame 1.9s ease-in-out infinite;
}

.slot.rarity-elite,
.equip-slot.rarity-elite {
  border-color: #ff4a4a;
  box-shadow: 0 0 0 1px rgba(255,74,74,0.22) inset;
}

.slot.rarity-elite,
.slot.rarity-elite .item-icon,
.equip-slot.rarity-elite,
.equip-slot.rarity-elite .item-icon,
.shop-item.rarity-elite .item-icon,
.slot.rarity-rare,
.slot.rarity-rare .item-icon,
.equip-slot.rarity-rare,
.equip-slot.rarity-rare .item-icon,
.shop-item.rarity-rare .item-icon {
  animation: rarityPulseSpark 2.1s ease-in-out infinite;
}

.slot.rarity-rare,
.equip-slot.rarity-rare {
  border-color: #4d84ff;
  box-shadow: 0 0 0 1px rgba(77,132,255,0.22) inset;
}

.slot.rarity-uncommon,
.equip-slot.rarity-uncommon {
  border-color: #5fd6a6;
  box-shadow: 0 0 0 1px rgba(95,214,166,0.2) inset;
}

.slot.rarity-normal,
.equip-slot.rarity-normal {
  border-color: #34404d;
}

.slot.rarity-bad,
.equip-slot.rarity-bad {
  border-color: #777;
}

@keyframes rarityPulseGold {
  0%, 100% { box-shadow: 0 0 5px rgba(242,216,81,0.35); }
  50% { box-shadow: 0 0 16px rgba(242,216,81,0.78), 0 0 22px rgba(215,168,255,0.38); }
}

@keyframes rarityPulseFlame {
  0%, 100% { box-shadow: 0 0 4px rgba(255,139,61,0.35); }
  50% { box-shadow: 0 0 15px rgba(255,139,61,0.78), 0 0 20px rgba(255,191,77,0.32); }
}

@keyframes rarityPulseSpark {
  0%, 100% { box-shadow: 0 0 3px rgba(128,185,255,0.25); }
  50% { box-shadow: 0 0 12px rgba(128,185,255,0.7); }
}

.qty {
  position: absolute;
  right: 4px;
  bottom: 2px;
  color: #eac45a;
}

.equipment,
.leaderboard,
.statgrid,
.portal-list {
  display: grid;
  gap: 8px;
  max-height: 58vh;
  overflow: auto;
  min-height: 0;
}

.leaderboard div,
.statgrid > span,
.portal-list button {
  padding: 8px;
  background: #10161c;
  border: 1px solid #34404d;
}

.admin-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

#adminList,
#adminResults {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 6px;
  scrollbar-gutter: stable;
}

.admin-table th,
.admin-table td {
  padding: 7px;
  border: 1px solid #34404d;
  text-align: left;
  white-space: nowrap;
}

.admin-table th {
  background: #232f3b;
}

.admin-table tr {
  cursor: pointer;
}

.admin-table tbody tr:hover {
  background: #263342;
}

.admin-table button {
  min-height: 28px;
  margin: 2px;
  padding: 0 8px;
  font-size: 11px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-nav {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-modal.hidden { display: none; }
.admin-modal.open {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 18, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}
.admin-modal-panel {
  width: min(1100px, 96vw);
  max-height: 92vh;
  background: #0f151c;
  border: 1px solid #2b3742;
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #0b1016;
  border-bottom: 1px solid #22303b;
}
.admin-modal-header h2 {
  margin: 0;
  font-size: 16px;
}
.admin-modal-body {
  padding: 14px;
  overflow: auto;
}
.admin-modal-body .admin-section { margin: 0; }
.admin-modal-body .auth-card { box-shadow: none; }
.admin-modal-placeholder { display: none; }

/* Sections used as modal content should not be shown in the normal page flow. */
body[data-admin-modal="closed"] .is-modal-source {
  display: none;
}

.button-link.active {
  background: #75c5a2;
  color: #101317;
}

.muted {
  color: #9aa8b6;
  font-size: 12px;
  line-height: 1.4;
}

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

.admin-quick-panel {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #303b47;
  background: #121a22;
}

.admin-quick-panel h3 {
  margin: 0 0 6px;
}

.admin-form-subtitle {
  grid-column: 1 / -1;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid #303b47;
  color: #eac45a;
}

.admin-effect-badge {
  display: inline-grid;
  min-width: 64px;
  min-height: 24px;
  place-items: center;
  padding: 2px 8px;
  border: 1px solid #34404d;
  background: #10161c;
  color: #d8e2ec;
  font-size: 11px;
  font-weight: 700;
}

.admin-effect-badge.effect-wind { border-color: #75c5a2; box-shadow: 0 0 8px rgba(117,197,162,0.45); }
.admin-effect-badge.effect-lightning { border-color: #80b9ff; box-shadow: 0 0 8px rgba(128,185,255,0.55); }
.admin-effect-badge.effect-flame { border-color: #ff8b3d; box-shadow: 0 0 8px rgba(255,139,61,0.55); }
.admin-effect-badge.effect-mythic { border-color: #f2d851; box-shadow: 0 0 9px rgba(242,216,81,0.55), 0 0 14px rgba(215,168,255,0.35); }
.admin-effect-badge.effect-holy { border-color: #fff6bf; box-shadow: 0 0 8px rgba(255,246,191,0.55); }
.admin-effect-badge.effect-shadow { border-color: #b46bff; box-shadow: 0 0 8px rgba(180,107,255,0.55); }
.admin-effect-badge.effect-none { color: #8793a0; }

.settings-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.settings-help-grid article {
  padding: 10px;
  border: 1px solid #27323d;
  background: #0f161d;
}

.settings-help-grid h4 {
  margin: 0 0 6px;
  color: #eac45a;
}

.settings-help-grid p {
  margin: 6px 0;
  color: #c8d3df;
  font-size: 12px;
  line-height: 1.35;
}

.admin-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-section textarea {
  width: 100%;
  resize: vertical;
}

.admin-thumb {
  width: 38px;
  height: 38px;
  display: block;
  object-fit: contain;
  background: #10161c;
  border: 1px solid #34404d;
}

.admin-thumb.empty {
  opacity: 0.4;
}

.empty-table {
  padding: 10px;
  border: 1px solid #34404d;
  color: #8793a0;
}

.portal-heading {
  padding: 10px;
  background: #232f3b;
  border: 1px solid #4f6172;
  font-weight: 700;
  color: #edf3f8;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.shop-box {
  min-height: 240px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  background: #10161c;
  border: 1px solid #34404d;
  max-height: 44vh;
  overflow: auto;
}

.shop-item {
  padding: 8px;
  border: 1px solid #34404d;
  background: #18212a;
  cursor: grab;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.shop-item .item-icon {
  width: 48px;
  height: 48px;
}

.third-party-ad-wrap {
  margin-top: 12px;
  padding: 10px;
  border-top: 1px solid #2f3b46;
  background: #0d1217;
}

.third-party-ad-slot {
  min-height: 90px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.third-party-ad-slot ins,
.third-party-ad-slot iframe {
  max-width: 100%;
}

.map-object-help {
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid #3b4b59;
  background: #10161c;
  color: #d7e3ee;
}

.map-object-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.map-object-actions button {
  min-height: 48px;
}

.map-object-list .shop-item {
  cursor: pointer;
}

.map-object-list .shop-item.selected {
  border-color: #eac45a;
  box-shadow: 0 0 0 2px rgba(234,196,90,0.25) inset;
}

.item-name,
.shop-item .item-name {
  font-weight: 800;
}

.rarity-text-mythic,
.shop-item.rarity-mythic .item-name {
  color: #ff6cff;
}

.rarity-text-legendary,
.shop-item.rarity-legendary .item-name {
  color: #ffbf4d;
}

.rarity-text-elite,
.shop-item.rarity-elite .item-name {
  color: #bb83ff;
}

.rarity-text-rare,
.shop-item.rarity-rare .item-name {
  color: #75a7ff;
}

.rarity-text-uncommon,
.shop-item.rarity-uncommon .item-name {
  color: #75c5a2;
}

.rarity-text-bad,
.shop-item.rarity-bad .item-name {
  color: #999;
}

.shop-item.rarity-mythic {
  border-color: #ff6cff;
}

.shop-item.rarity-legendary {
  border-color: #ffbf4d;
}

.shop-item.rarity-elite {
  border-color: #bb83ff;
}

.shop-item.rarity-rare {
  border-color: #75a7ff;
}

.effect-wind .item-icon {
  box-shadow: 0 0 10px rgba(117, 197, 162, 0.75);
}

.slot.effect-wind,
.equip-slot.effect-wind {
  box-shadow: 0 0 10px rgba(117, 197, 162, 0.65), 0 0 0 1px rgba(117, 197, 162, 0.35) inset;
}

.effect-lightning .item-icon {
  box-shadow: 0 0 12px rgba(128, 185, 255, 0.85);
}

.slot.effect-lightning,
.equip-slot.effect-lightning {
  box-shadow: 0 0 12px rgba(128, 185, 255, 0.72), 0 0 0 1px rgba(128, 185, 255, 0.38) inset;
}

.effect-flame .item-icon {
  box-shadow: 0 0 12px rgba(255, 139, 61, 0.88);
}

.slot.effect-flame,
.equip-slot.effect-flame {
  box-shadow: 0 0 13px rgba(255, 139, 61, 0.75), 0 0 0 1px rgba(255, 139, 61, 0.4) inset;
}

.effect-mythic .item-icon {
  box-shadow: 0 0 14px rgba(242, 216, 81, 0.9), 0 0 22px rgba(215, 168, 255, 0.45);
}

.slot.effect-mythic,
.equip-slot.effect-mythic {
  box-shadow: 0 0 15px rgba(242, 216, 81, 0.82), 0 0 24px rgba(215, 168, 255, 0.45), 0 0 0 1px rgba(242, 216, 81, 0.45) inset;
}

.effect-holy .item-icon {
  box-shadow: 0 0 14px rgba(255, 246, 191, 0.92);
}

.slot.effect-holy,
.equip-slot.effect-holy {
  box-shadow: 0 0 14px rgba(255, 246, 191, 0.78), 0 0 0 1px rgba(255, 246, 191, 0.44) inset;
}

.effect-shadow .item-icon {
  box-shadow: 0 0 14px rgba(180, 107, 255, 0.85);
}

.slot.effect-shadow,
.equip-slot.effect-shadow {
  box-shadow: 0 0 14px rgba(180, 107, 255, 0.75), 0 0 0 1px rgba(180, 107, 255, 0.42) inset;
}

.shop-item.empty {
  cursor: default;
  color: #8793a0;
}

.premium-offer {
  grid-template-columns: 52px minmax(0, 1fr) 72px;
}

.item-info-hero {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.item-info-hero .item-info-icon {
  width: 72px;
  height: 72px;
}

.premium-offer .item-name,
.premium-offer small {
  overflow-wrap: anywhere;
}

.premium-buy {
  width: 72px;
  min-height: 34px;
  padding: 6px 8px;
  justify-self: end;
  text-align: center;
  white-space: nowrap;
}

.forge-drop {
  border: 1px dashed rgba(117, 197, 162, 0.7);
  min-height: 64px;
  align-items: center;
}

.npc-message {
  padding: 10px;
  background: #232f3b;
  border: 1px solid #4f6172;
  color: #d8e2ec;
  line-height: 1.35;
}

.hero-portrait {
  min-height: 180px;
  background: #10161c center / contain no-repeat;
  border: 1px solid #34404d;
}

.sell-zone {
  margin-top: 10px;
  padding: 10px;
  text-align: center;
  color: #8793a0;
  background: rgba(16, 22, 28, 0.65);
  border: 1px dashed #34404d;
  border-radius: 10px;
  user-select: none;
  min-height: 58px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.sell-zone.ready {
  border-color: #eac45a;
  color: #eac45a;
  background: rgba(234, 196, 90, 0.12);
}

.map-template-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.map-template-card {
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 8px;
  min-height: 146px;
}

.map-template-thumb {
  width: 100%;
  aspect-ratio: 11 / 7;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 6px;
  background: #10161c;
}

.equipment {
  display: block;
  max-height: none;
  overflow: visible;
}

.equipment-paperdoll {
  box-sizing: border-box;
  width: 252px;
  min-height: 306px;
  margin: 0 auto 10px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 70px);
  grid-template-rows: repeat(4, 66px);
  grid-template-areas:
    "necklace head cape"
    "weapon body shield"
    "arms body shield"
    "book feet ring";
  gap: 7px;
  padding: 9px;
  background:
    radial-gradient(ellipse at center, rgba(117, 197, 162, 0.12), rgba(16, 22, 28, 0.96) 68%),
    #10161c;
  border: 1px solid #34404d;
}

#arenaEquipment.equipment {
  display: block;
}

#arenaEquipment .equipment-paperdoll,
#heroInspectEquip .equipment-paperdoll {
  display: grid;
  grid-template-columns: repeat(3, 70px);
  grid-template-rows: repeat(4, 66px);
  grid-template-areas:
    "necklace head cape"
    "weapon body shield"
    "arms body shield"
    "book feet ring";
}

.equipment-silhouette {
  position: absolute;
  left: 82px;
  top: 49px;
  width: 72px;
  height: 198px;
  border-radius: 30px 30px 18px 18px;
  border: 1px solid rgba(237, 243, 248, 0.15);
  background:
    radial-gradient(circle at 50% 22%, rgba(237,243,248,0.11), rgba(237,243,248,0.0) 56%),
    linear-gradient(180deg, rgba(237,243,248,0.08), rgba(117,197,162,0.06));
  pointer-events: none;
  z-index: 0;
}

.left-panel .equipment {
  margin-bottom: 0;
}

.combat-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  width: 100%;
}

.combat-mode button {
  min-height: 54px;
  background: #10161c;
  border: 1px solid #34404d;
  color: #edf3f8;
  font-size: 11px;
}

.combat-mode button.active {
  background: #75c5a2;
  color: #101317;
}

.combat-mode small {
  color: inherit;
  opacity: 0.8;
}

#itemInfoBody.player-inspect-body {
  max-height: min(58vh, 480px);
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 12px;
}

.inspect-equip-heading {
  font-weight: 700;
  margin-bottom: 8px;
  color: #c8d4e0;
}

.player-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.player-stat {
  min-height: 46px;
  padding: 7px;
  background: #10161c;
  border: 1px solid #34404d;
  border-radius: 6px;
}

.player-stat span {
  display: block;
  color: #8fa3b5;
  font-size: 10px;
  font-weight: 700;
}

.player-stat strong {
  display: block;
  color: #edf3f8;
  font-size: 14px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.pvp-inspect-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
  padding: 8px;
  background: #10161c;
  border: 1px solid #34404d;
  border-radius: 6px;
}

.pvp-inspect-row .item-icon {
  flex-shrink: 0;
}

.pvp-inspect-row-text {
  min-width: 0;
  flex: 1;
}

.inspect-substats {
  font-size: 11px;
  margin-top: 4px;
  color: #8fa3b5;
}

.world-actions {
  margin-top: 10px;
  display: grid;
  gap: 6px;
  flex-shrink: 0;
}

.world-actions button {
  min-height: 38px;
  background: #10161c;
  border: 1px solid #34404d;
  color: #edf3f8;
  font-size: 11px;
  text-align: left;
  padding: 8px;
}

.world-actions button strong {
  display: block;
  font-size: 12px;
}

.equip-slot {
  width: 70px;
  min-height: 66px;
  padding: 4px;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 11px 32px minmax(18px, 1fr);
  place-items: center;
  text-align: center;
  font-size: 9px;
  line-height: 1.08;
  overflow: hidden;
  background: rgba(16, 22, 28, 0.94);
  border: 1px solid #34404d;
}

.equip-head { grid-area: head; }
.equip-body { grid-area: body; grid-template-rows: 11px 38px minmax(28px, 1fr); }
.equip-necklace { grid-area: necklace; }
.equip-book { grid-area: book; }
.equip-feet { grid-area: feet; }
.equip-cape { grid-area: cape; }
.equip-weapon { grid-area: weapon; }
.equip-shield { grid-area: shield; grid-template-rows: 11px 38px minmax(28px, 1fr); }
.equip-ring { grid-area: ring; }
.equip-arms { grid-area: arms; }

.equip-label {
  color: #8793a0;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.equip-empty {
  color: #52606d;
  font-size: 9px;
}

.equip-slot .item-icon {
  width: 36px;
  height: 36px;
  border: 0;
  background-color: transparent;
}

.equip-body .item-icon,
.equip-shield .item-icon {
  width: 42px;
  height: 42px;
}

.equip-slot .item-name {
  display: none;
}

.equip-body .item-name,
.equip-shield .item-name {
  max-width: 68px;
  font-size: 10px;
}

.skill-table {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
}

.skill-table button {
  width: 100%;
}

.portal-list button {
  display: flex;
  align-items: center;
  text-align: left;
  color: #edf3f8;
}

.equip-slot.ready {
  border-color: #75c5a2;
}

.slot[draggable="true"] {
  cursor: grab;
}

.house-skills button.active,
.tabs button.active {
  background: #75c5a2;
  color: #101317;
}

.house-skills {
  display: none;
}

.house-skills:not(:empty) {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  background: #1a222b;
  border: 1px solid #303b47;
}

.house-skills .npc-message {
  grid-column: 1 / -1;
  margin: 0;
}

.house-skills button {
  min-height: 52px;
  display: grid;
  grid-template-columns: 1fr 24px;
  gap: 4px;
  align-items: center;
  padding: 6px;
  background: #10161c;
  border: 1px solid #34404d;
  color: #edf2f7;
  font-size: 11px;
  text-align: left;
}

.house-skills button strong {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: #75c5a2;
  color: #101317;
}

.house-skills button em {
  grid-column: 1 / -1;
  color: #eac45a;
  font-size: 10px;
  font-style: normal;
}

.statgrid {
  grid-template-columns: 1fr 1fr;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.admin-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.log {
  margin-top: 8px;
  min-height: 40px;
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
}

dialog::backdrop {
  background: rgba(0,0,0,0.68);
}

.modal-card {
  width: min(420px, 92vw);
}

.modal-card.wide {
  width: min(900px, 96vw);
  max-height: 82vh;
  overflow: auto;
}

.story-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.story-content {
  line-height: 1.55;
}

.story-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.news-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.news-row {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 12px;
  background: #111820;
  border: 1px solid #2f3b47;
}

.news-row small {
  color: #b8c2cc;
}

.news-post-view {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.asset-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.asset-card {
  display: grid;
  gap: 8px;
  padding: 8px;
  background: #10161c;
  border: 1px solid #303b47;
  border-radius: 6px;
  min-width: 0;
}

.asset-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  background: #0b1016;
  border: 1px solid #26313d;
  overflow: hidden;
}

.asset-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.asset-file-fallback {
  color: #b8c2cc;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.asset-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.asset-meta strong,
.asset-meta small,
.asset-meta code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-meta code {
  display: block;
  padding: 5px;
  background: #0b1016;
  border: 1px solid #26313d;
  font-size: 11px;
}

.asset-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.asset-actions button {
  padding: 6px;
  font-size: 11px;
}

@media (max-width: 1100px) {
  .auth-page,
  .game-layout,
  .shop-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-wrap: nowrap;
  }

  .left-panel,
  .right-panel {
    max-height: none;
  }
}
