/* ToonMud v3.8 Clean Isometric Tile & Studio Theme (60fps GPU Optimized) */
:root {
  --tm-bg-deep: #070913;
  --tm-bg-panel: rgba(14, 19, 36, 0.95);
  --tm-border-neon: rgba(99, 102, 241, 0.45);
  --tm-accent-gold: #fbbf24;
  --tm-accent-crimson: #f43f5e;
  --tm-accent-cyan: #22d3ee;
}

body {
  background: radial-gradient(circle at 50% 0%, #161d3a 0%, #070913 70%) !important;
}

/* Fix 1: Remove rectangular border/outline/box-shadow on isometric tiles so diamond corners NEVER bleed white triangles */
.tile, .cell, .tile-cell {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.tile:focus, .tile.sel, .tile:hover {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}
.tile::after, .tile.sel::after, .tile:focus::after {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
/* Highlight only the diamond polygon surface smoothly */
.tile:hover .top {
  filter: brightness(1.28) contrast(1.05);
}
/* Prevent dual floating labels (selected tile + hovered tile showing together) */
#board:hover .tile.sel:not(:hover) .tip,
#board:hover .tile:focus:not(:hover) .tip {
  display: none !important;
  opacity: 0 !important;
}

/* Fix label & coordinate collision on tiles (v3.8 Clean Badge Layout) */
.tile .coord {
  display: none !important;
}
.tile .label {
  bottom: 22px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 2px !important;
  pointer-events: none !important;
  width: auto !important;
}
.tile .nm {
  font-size: 11px !important;
  font-weight: 800 !important;
  padding: 2px 7px !important;
  border-radius: 4px !important;
  background: rgba(10, 14, 26, 0.88) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6) !important;
  max-width: 140px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.tile .cs {
  font-size: 10px !important;
  color: #e2e8f0 !important;
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 3px !important;
  padding: 1px 6px !important;
  margin: 0 !important;
  max-width: 130px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Fix 2: Completely hide duplicate yellow-bordered mini/HQ avatar boxes & raw emblems on tiles */
.cell-emblem, .tile-emblem, .emblem, .emb, .tile .emb, [data-emblem],
.hq-avatar, .mini-avatar, .tile-avatar, .hq-badge, .pawn-mini {
  display: none !important;
}

.tile-building, .cell-building, .bld {
  display: flex !important;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.65));
  pointer-events: none;
}

/* Street-Battle VS Banner & Judge Comment */
.tm-judge-comment {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(251,191,36,0.16), rgba(244,63,94,0.14));
  border-left: 4px solid var(--tm-accent-gold);
  color: #fef3c7;
  font-weight: 700;
  font-size: 0.92rem;
}

/* Studio Modal & Quick Tile Decorator Toolbar */
#tm-studio-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 17, 0.82);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#tm-studio-modal.open {
  display: flex;
}
.tm-studio-card {
  width: min(760px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  padding: 20px;
  color: #f8fafc;
  box-shadow: 0 20px 50px rgba(0,0,0,0.75);
}
.tm-studio-sec {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 14px;
  margin-top: 14px;
}
.tm-studio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.tm-btn {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.tm-btn:hover, .tm-btn.active {
  background: #4f46e5;
  color: #fff;
  border-color: #818cf8;
}
.tm-input {
  background: #090d16;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}
#tm-tile-quickbar {
  position: fixed;
  bottom: 58px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--tm-accent-gold);
  border-radius: 999px;
  padding: 6px 14px;
  display: none;
  gap: 6px;
  align-items: center;
  z-index: 9000;
  box-shadow: 0 10px 28px rgba(0,0,0,0.7);
}
#tm-tile-quickbar.open {
  display: flex;
}
