body.majlis-game-standalone #majlis-game .game-workspace,
  .majlis-game-section .game-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(384px, 456px) !important;
  }
  body.majlis-game-standalone .game-sidebar,
  .majlis-game-section .game-sidebar { padding: 18px !important; }
  .majlis-game-section .game-sidebar-tabs,
  .majlis-game-section #gameCollectionTabs,
  .majlis-game-section #gameShapeButtons,
  .majlis-game-section #gameFrameDesigns {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .majlis-game-section #gamePileButtons {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .framed-design-picker .framed-design-option,
  .framed-design-picker .framed-design-more-toggle {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: center !important;
    text-align: left !important;
    letter-spacing: .08em !important;
  }
  .framed-design-picker .framed-design-more-toggle {
    grid-column: 1 / -1 !important;
    display: flex !important;
    justify-content: center !important;
    text-align: center !important;
  }
  .framed-design-preview {
    display: block;
    position: relative;
    width: 42px;
    aspect-ratio: 1;
    background: #65160f;
    overflow: hidden;
    contain: paint;
    isolation: isolate;
  }
  .framed-design-preview svg {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    pointer-events: none;
  }
  .framed-design-more {
    grid-column: 1 / -1;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .framed-design-more.open { display: grid; }
  .majlis-game-section .game-sidebar-tabs button,
  .majlis-game-section .game-editor-tabs button,
  .majlis-game-section .game-mini-grid button,
  .majlis-game-section .mini-btn,
  .majlis-game-section .game-code-row button {
    min-height: 42px !important;
    padding: 9px 8px !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
    letter-spacing: 0.18em !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .majlis-game-section #gamePileButtons button {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
  }
  #gameLoadCurrentDesign,
  .game-toolbar button[id="gameLoadCurrentDesign"],
  .game-toolbar button[data-act="load-current"],
  .game-toolbar button[data-game-action="load-current"] { display: none !important; }
  .majlis-game-section .game-swatch-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)) !important;
    grid-auto-rows: 48px !important;
    gap: 7px !important;
    align-items: start !important;
    max-height: 188px !important;
    overflow: auto !important;
    padding: 2px 4px 2px 2px !important;
    box-sizing: border-box !important;
  }
  .majlis-game-section .game-swatch-grid .swatch,
  .majlis-game-section .game-swatch-grid button {
    display: block !important;
    width: 100% !important;
    height: 48px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    aspect-ratio: auto !important;
    overflow: hidden !important;
    border: 1px solid rgba(84, 13, 0, 0.20) !important;
    background-size: cover !important;
    background-position: center center !important;
    box-shadow: inset 0 0 0 6px rgba(255, 248, 234, 0.88) !important;
    transform: none !important;
  }
  .majlis-game-section .game-swatch-grid .swatch > *,
  .majlis-game-section .game-swatch-grid button > * {
    display: none !important;
  }
  .majlis-game-section .game-swatch-grid .swatch.selected,
  .majlis-game-section .game-swatch-grid .swatch.active,
  .majlis-game-section .game-swatch-grid button.selected,
  .majlis-game-section .game-swatch-grid button.active {
    outline: 3px solid rgba(84, 13, 0, 0.34) !important;
    outline-offset: 2px !important;
    box-shadow: inset 0 0 0 6px rgba(255, 248, 234, 0.88), 0 0 0 1px rgba(84, 13, 0, 0.34) !important;
  }
  .majlis-game-section .game-framed-color-section-label {
    grid-column: 1 / -1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 10px 0 4px !important;
    padding-top: 10px !important;
    border-top: 1px solid rgba(84, 13, 0, 0.30) !important;
    color: #540D00 !important;
    font-family: var(--mono, "Inter", sans-serif) !important;
    font-size: 10px !important;
    letter-spacing: 0.22em !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
  }
  .majlis-game-section .game-framed-color-section-label::after {
    content: "" !important;
    height: 1px !important;
    flex: 1 1 auto !important;
    background: rgba(84, 13, 0, 0.30) !important;
  }
  .majlis-game-section .majlis-live-swatch-toggle,
  .game-full-stage.in-game .majlis-live-swatch-toggle,
  .preview-stage.in-game .majlis-live-swatch-toggle,
  #majlisGameStage > .majlis-live-swatch-toggle {
    min-height: 25px !important;
    height: 33px !important;
    padding: 5px 9px !important;
    min-width: 99px !important;
    width: 134px !important;
    font-size: inherit !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
  }
  @media (max-width: 980px) {
    body.majlis-game-standalone #majlis-game .game-workspace,
    .majlis-game-section .game-workspace {
      grid-template-columns: 1fr !important;
      height: auto !important;
      min-height: 100vh !important;
    }
  }

body.majlis-game-standalone #majlis-game,
  body.majlis-game-standalone #majlisGameStage,
  body.majlis-game-standalone .game-main,
  body.majlis-game-standalone .game-full-stage.in-game,
  body.majlis-game-standalone .preview-stage.in-game {
    background: #f7f7f4 !important;
  }
  body.majlis-game-standalone #game3DCanvas {
    background: #f7f7f4 !important;
  }

  
  body.majlis-game-standalone #majlisGameStage.in-game::after,
  body.majlis-game-standalone .game-full-stage.in-game::after,
  body.majlis-game-standalone .preview-stage.in-game::after {
    display: none !important;
  }

  
  body.majlis-game-standalone #majlisGameStage .game-toolbar,
  body.majlis-game-standalone #majlisGameStage .game-fab,
  body.majlis-game-standalone #majlisGameStage .game-panel,
  body.majlis-game-standalone #majlisGameStage .game-float-panel,
  body.majlis-game-standalone #majlisGameStage .animal-picker,
  body.majlis-game-standalone #majlisGameStage .game3d-controls,
  body.majlis-game-standalone #majlisGameStage .majlis-live-swatch-toggle,
  body.majlis-game-standalone #majlisGameStage .majlis-live-swatch-stack {
    z-index: 78 !important;
  }

  
  body.majlis-game-standalone #majlisGameStage > .majlis-live-swatch-toggle,
  body.majlis-game-standalone .game-full-stage.in-game .majlis-live-swatch-toggle,
  body.majlis-game-standalone .preview-stage.in-game .majlis-live-swatch-toggle {
    position: absolute !important;
    top: 62px !important;
    right: 14px !important;
    left: auto !important;
    bottom: auto !important;
    width: 278px !important;
    min-width: 0 !important;
    max-width: calc(100% - 28px) !important;
    min-height: 34px !important;
    padding: 9px 12px !important;
    font-size: 9px !important;
    letter-spacing: .18em !important;
    line-height: 1 !important;
    text-align: center !important;
  }

  body.majlis-game-standalone #majlisGameStage > .majlis-live-swatch-stack,
  body.majlis-game-standalone .game-full-stage.in-game .majlis-live-swatch-stack,
  body.majlis-game-standalone .preview-stage.in-game .majlis-live-swatch-stack,
  body.majlis-game-standalone.majlis-v308-ls-on .preview-stage.in-game .majlis-live-swatch-stack,
  body.majlis-game-standalone.majlis-v218-ls-on .preview-stage.in-game .majlis-live-swatch-stack,
  body.majlis-game-standalone.majlis-v210-ls-on .preview-stage.in-game .majlis-live-swatch-stack {
    position: absolute !important;
    top: 108px !important;
    right: 14px !important;
    left: auto !important;
    bottom: auto !important;
    width: 278px !important;
    max-width: calc(100% - 28px) !important;
    display: grid !important;
    gap: 8px !important;
    pointer-events: auto !important;
    align-items: start !important;
  }

  
  body.majlis-game-standalone #majlisGameStage .majlis-live-swatch-card,
  body.majlis-game-standalone .game-full-stage.in-game .majlis-live-swatch-card,
  body.majlis-game-standalone .preview-stage.in-game .majlis-live-swatch-card {
    display: grid !important;
    grid-template-columns: 78px minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: center !important;
    min-height: 92px !important;
    padding: 9px !important;
    border-radius: 16px !important;
    background: #fffaf1 !important;
    box-shadow: 0 18px 42px rgba(42,32,24,.16) !important;
    border: 1px solid rgba(84,13,0,.14) !important;
  }
  body.majlis-game-standalone #majlisGameStage .majlis-live-swatch-card .mls-photo,
  body.majlis-game-standalone .game-full-stage.in-game .majlis-live-swatch-card .mls-photo,
  body.majlis-game-standalone .preview-stage.in-game .majlis-live-swatch-card .mls-photo {
    width: 78px !important;
    height: 78px !important;
    min-height: 78px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 12px !important;
    border: 1px solid rgba(42,32,24,.14) !important;
  }
  body.majlis-game-standalone #majlisGameStage .majlis-live-swatch-card .mls-role,
  body.majlis-game-standalone .game-full-stage.in-game .majlis-live-swatch-card .mls-role,
  body.majlis-game-standalone .preview-stage.in-game .majlis-live-swatch-card .mls-role {
    display: none !important;
  }
  body.majlis-game-standalone #majlisGameStage .majlis-live-swatch-card .mls-copy,
  body.majlis-game-standalone .game-full-stage.in-game .majlis-live-swatch-card .mls-copy,
  body.majlis-game-standalone .preview-stage.in-game .majlis-live-swatch-card .mls-copy {
    display: grid !important;
    gap: 5px !important;
    align-content: center !important;
    padding: 0 4px 0 0 !important;
  }
  body.majlis-game-standalone #majlisGameStage .majlis-live-swatch-card .mls-name,
  body.majlis-game-standalone .game-full-stage.in-game .majlis-live-swatch-card .mls-name,
  body.majlis-game-standalone .preview-stage.in-game .majlis-live-swatch-card .mls-name {
    margin: 0 !important;
    color: var(--wine, #540D00) !important;
    font-family: "Brandon Grotesque","Brandon Text","Avenir Next",Avenir,Inter,system-ui,sans-serif !important;
    font-size: clamp(18px, 1.35vw, 24px) !important;
    font-weight: 800 !important;
    line-height: 1.02 !important;
    letter-spacing: -0.02em !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  body.majlis-game-standalone #majlisGameStage .majlis-live-swatch-card .mls-meta,
  body.majlis-game-standalone .game-full-stage.in-game .majlis-live-swatch-card .mls-meta,
  body.majlis-game-standalone .preview-stage.in-game .majlis-live-swatch-card .mls-meta {
    margin: 0 !important;
    color: rgba(42,32,24,.72) !important;
    font-family: var(--mono, system-ui, sans-serif) !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    letter-spacing: .14em !important;
    text-transform: uppercase !important;
  }

  
  body.majlis-game-standalone #gamePanel .game-tray {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)) !important;
    gap: 10px !important;
  }
  body.majlis-game-standalone #gamePanel .game-sprite {
    min-height: 122px !important;
    padding: 9px 8px 10px !important;
    background: #fffdf8 !important;
    border-color: rgba(42,32,24,.20) !important;
  }
  body.majlis-game-standalone #gamePanel .game-sprite .sp-art {
    height: 70px !important;
    background: linear-gradient(180deg, rgba(240,232,213,.82), rgba(255,255,255,1)) !important;
  }
  body.majlis-game-standalone #gamePanel .game-sprite .sp-name,
  body.majlis-game-standalone .animal-picker .ap-choices button,
  body.majlis-game-standalone .animal-picker .ap-cancel {
    color: #241A14 !important;
    -webkit-text-fill-color: #241A14 !important;
    font-family: var(--mono, system-ui, sans-serif) !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    line-height: 1.18 !important;
    letter-spacing: .06em !important;
    text-transform: uppercase !important;
    text-shadow: 0 1px 0 rgba(255,255,255,.7) !important;
    opacity: 1 !important;
  }

  @media (max-width: 760px) {
    body.majlis-game-standalone #majlisGameStage > .majlis-live-swatch-toggle,
    body.majlis-game-standalone .game-full-stage.in-game .majlis-live-swatch-toggle,
    body.majlis-game-standalone .preview-stage.in-game .majlis-live-swatch-toggle {
      top: 58px !important;
      right: 12px !important;
      width: min(256px, calc(100% - 24px)) !important;
    }
    body.majlis-game-standalone #majlisGameStage > .majlis-live-swatch-stack,
    body.majlis-game-standalone .game-full-stage.in-game .majlis-live-swatch-stack,
    body.majlis-game-standalone .preview-stage.in-game .majlis-live-swatch-stack {
      top: 102px !important;
      right: 12px !important;
      width: min(256px, calc(100% - 24px)) !important;
    }
    body.majlis-game-standalone #majlisGameStage .majlis-live-swatch-card,
    body.majlis-game-standalone .game-full-stage.in-game .majlis-live-swatch-card,
    body.majlis-game-standalone .preview-stage.in-game .majlis-live-swatch-card {
      grid-template-columns: 64px minmax(0, 1fr) !important;
      min-height: 78px !important;
    }
    body.majlis-game-standalone #majlisGameStage .majlis-live-swatch-card .mls-photo,
    body.majlis-game-standalone .game-full-stage.in-game .majlis-live-swatch-card .mls-photo,
    body.majlis-game-standalone .preview-stage.in-game .majlis-live-swatch-card .mls-photo {
      width: 64px !important;
      height: 64px !important;
      min-height: 64px !important;
    }
  }

.tabs .tab[data-coll="BRIGHT"],
  .game-editor-tabs [data-game-coll="BRIGHT"] { color: inherit; }
  .framed-color-section-label[data-family="BRIGHT"] { border-top: 2px solid rgba(139,36,24,0.42); margin-top: 12px; padding-top: 10px; }
  .swatch.texture-bright { background-image: linear-gradient(115deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.10) 24%, rgba(255,255,255,0.02) 46%, transparent 58%, rgba(255,255,255,0.10) 100%); }


/* Clean Game UI additions: gameplay-only rounded corner preview and variable faceted sides. */
.game-corner-preview {
  position: absolute;
  right: 18px;
  bottom: 332px;
  z-index: 28;
  width: min(260px, calc(100% - 36px));
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid rgba(84,13,0,.18);
  border-radius: 20px;
  background: rgba(255,250,241,.94);
  color: var(--ink, #2A2018);
  box-shadow: 0 18px 42px rgba(42,32,24,.18);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(.985);
  transition: opacity .22s ease, transform .22s ease;
}
.game-corner-preview.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.game-corner-preview svg {
  width: 76px;
  height: 76px;
  background: #fff;
  border: 1px solid rgba(42,32,24,.10);
  border-radius: 14px;
}
.game-corner-preview .gcp-edges {
  fill: none;
  stroke: rgba(42,32,24,.34);
  stroke-width: 5;
  stroke-linecap: round;
}
.game-corner-preview .gcp-radius {
  fill: none;
  stroke: var(--wine, #540D00);
  stroke-width: 5;
  stroke-linecap: round;
}
.game-corner-preview .gcp-dot { fill: #40D0D0; }
.game-corner-preview .gcp-copy { display: grid; gap: 4px; }
.game-corner-preview strong {
  font-family: var(--mono, Inter, sans-serif);
  font-size: 8px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--wine, #540D00);
}
.game-corner-preview span {
  font-family: var(--serif, Georgia, serif);
  font-size: 12px;
  line-height: 1.25;
  opacity: .84;
}
.game-corner-preview .gcp-value {
  font-family: var(--mono, Inter, sans-serif);
  font-size: 10px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--wine, #540D00);
  opacity: .95;
}
.game-full-stage:not(.in-game) .game-corner-preview,
.preview-stage:not(.in-game) .game-corner-preview { display: none; }
@media (max-width: 980px) {
  .game-corner-preview { bottom: 286px; right: 12px; width: min(244px, calc(100% - 24px)); }
}
.facet-sides-row { margin-top: 10px; }
.sh-icon.faceted i {
  position: absolute;
  inset: 1px 5px;
  border: 2px solid currentColor;
  clip-path: polygon(50% 0, 94% 26%, 94% 74%, 50% 100%, 6% 74%, 6% 26%);
}

/* Studio concept: unframed color field shared by Game and Build. */
.majlis-game-section .game-swatch-grid .swatch,
.majlis-game-section .game-swatch-grid button {
  border: 1px solid rgba(84, 13, 0, 0.22) !important;
  box-shadow: none !important;
}
.majlis-game-section .game-swatch-grid .swatch.selected,
.majlis-game-section .game-swatch-grid .swatch.active,
.majlis-game-section .game-swatch-grid button.selected,
.majlis-game-section .game-swatch-grid button.active {
  outline: 2px solid #540D00 !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

/* Studio concept typography and object-thumbnail refinement. */
body.majlis-game-standalone,
body.majlis-game-standalone input,
body.majlis-game-standalone textarea,
body.majlis-game-standalone select {
  font-weight: 300 !important;
}
body.majlis-game-standalone button,
body.majlis-game-standalone button *,
body.majlis-game-standalone .sp-name {
  font-family: "Brandon Grotesque", "Brandon Text", "Avenir Next", Avenir, Inter, system-ui, sans-serif !important;
  font-weight: 500 !important;
}
body.majlis-game-standalone .game-sidebar,
body.majlis-game-standalone .game-panel,
body.majlis-game-standalone .game-toolbar,
body.majlis-game-standalone .game-float-panel {
  font-size: 110% !important;
}
body.majlis-game-standalone #gamePanel .game-sprite .sp-art {
  display: grid !important;
  place-items: center !important;
  padding: 8px !important;
  background: #F7F1E7 !important;
  overflow: hidden !important;
  border: 1px solid rgba(84, 13, 0, 0.16) !important;
}
body.majlis-game-standalone #gamePanel .game-sprite .sp-art svg,
body.majlis-game-standalone #gamePanel .game-sprite .sp-art img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 92% !important;
  max-height: 92% !important;
  filter: contrast(1.14) saturate(1.08) drop-shadow(0 2px 5px rgba(42,32,24,0.18)) !important;
  margin: auto !important;
  transform-origin: center center !important;
}


/* v327: MAJLIS Game button hierarchy cleanup */
.majlis-game-section .game-toolbar {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

/* Top Game controls are always wine with ivory text. */
.majlis-game-section .game-toolbar .mini-btn,
.majlis-game-section .game-toolbar .btn-game,
.majlis-game-section .game-fab,
.majlis-game-section #gameRequestQuoteTop,
.majlis-game-section #gameShareDesignTop,
.majlis-game-section #gameShareDesign,
.majlis-game-section #gameShareDesignCode,
.majlis-game-section #gameRequestQuote,
.majlis-game-section #sendInquiryGame {
  background: #540D00 !important;
  color: #F0E8D5 !important;
  border: 1px solid #540D00 !important;
  font-weight: 800 !important;
  text-shadow: none !important;
  box-shadow: 0 8px 18px rgba(42, 32, 24, 0.16) !important;
}

.majlis-game-section .game-toolbar .mini-btn:hover,
.majlis-game-section .game-fab:hover,
.majlis-game-section #gameRequestQuoteTop:hover,
.majlis-game-section #gameShareDesignTop:hover,
.majlis-game-section #gameShareDesign:hover,
.majlis-game-section #gameShareDesignCode:hover,
.majlis-game-section #gameRequestQuote:hover,
.majlis-game-section #sendInquiryGame:hover {
  background: #6B1A14 !important;
  color: #F0E8D5 !important;
  border-color: #6B1A14 !important;
}

/* Interface-panel buttons default to white with bold red text. */
.majlis-game-section .game-sidebar-tabs button,
.majlis-game-section .game-editor-tabs button,
.majlis-game-section .game-mini-grid button,
.majlis-game-section .game-actions button,
.majlis-game-section .mini-actions button:not(#sendInquiryGame),
.majlis-game-section #copyGameNotes,
.majlis-game-section #saveGameNotes,
.majlis-game-section #copySpecGame,
.majlis-game-section #addSecondRugGame {
  background: #FFFFFF !important;
  color: #540D00 !important;
  border: 1px solid rgba(84, 13, 0, 0.45) !important;
  font-weight: 800 !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

/* Selected or active panel buttons switch to red with bold ivory text. */
.majlis-game-section .game-sidebar-tabs button.active,
.majlis-game-section .game-editor-tabs button.active,
.majlis-game-section .game-mini-grid button.active,
.majlis-game-section .game-actions button.active,
.majlis-game-section .mini-actions button.active:not(#sendInquiryGame),
.majlis-game-section .game-sidebar-tabs button[aria-pressed="true"],
.majlis-game-section .game-editor-tabs button[aria-pressed="true"],
.majlis-game-section .game-mini-grid button[aria-pressed="true"],
.majlis-game-section .game-actions button[aria-pressed="true"] {
  background: #540D00 !important;
  color: #F0E8D5 !important;
  border-color: #540D00 !important;
  font-weight: 800 !important;
}

.majlis-game-section .game-sidebar-tabs button:hover,
.majlis-game-section .game-editor-tabs button:hover,
.majlis-game-section .game-mini-grid button:hover,
.majlis-game-section .game-actions button:hover,
.majlis-game-section .mini-actions button:not(#sendInquiryGame):hover {
  border-color: #540D00 !important;
}

.majlis-game-section #gameRequestQuote,
.majlis-game-section #gameShareDesign {
  width: 100% !important;
  margin-top: 8px !important;
}

/* v328: Object selection toolbar with rotation, copy/delete, and conditional size fields. */
.majlis-game-section .game3d-controls,
body.majlis-game-standalone .game3d-controls {
  align-items: center !important;
  gap: 6px !important;
  padding: 7px !important;
  background: rgba(42, 32, 24, 0.96) !important;
  border: 1px solid rgba(240, 232, 213, 0.12) !important;
  box-shadow: 0 16px 32px rgba(42, 32, 24, 0.24) !important;
}
.majlis-game-section .game3d-controls button,
body.majlis-game-standalone .game3d-controls button {
  width: auto !important;
  min-width: 64px !important;
  height: 38px !important;
  padding: 0 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: "Brandon Grotesque","Brandon Text","Avenir Next",Avenir,Inter,system-ui,sans-serif !important;
  font-size: 10px !important;
  line-height: 1 !important;
  letter-spacing: .15em !important;
  text-transform: uppercase !important;
  font-weight: 800 !important;
  color: #F0E8D5 !important;
  background: transparent !important;
  border: 1px solid rgba(240, 232, 213, 0.20) !important;
}
.majlis-game-section .game3d-controls button:hover,
body.majlis-game-standalone .game3d-controls button:hover {
  background: #540D00 !important;
  border-color: #540D00 !important;
  color: #F0E8D5 !important;
}
.majlis-game-section .game3d-controls button.del:hover,
body.majlis-game-standalone .game3d-controls button.del:hover {
  background: #8B2418 !important;
  border-color: #8B2418 !important;
}
.game3d-size-control {
  display: none;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 5px 7px 5px 10px;
  border: 1px solid rgba(240, 232, 213, 0.18);
  color: #F0E8D5;
  font-family: var(--mono, Inter, sans-serif);
  font-size: 8.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 800;
  white-space: nowrap;
}
.game3d-controls.object-resizable .game3d-size-control { display: inline-flex; }
.game3d-size-control input {
  width: 76px;
  height: 28px;
  padding: 4px 6px;
  border: 1px solid rgba(240, 232, 213, 0.30);
  background: rgba(255, 255, 255, 0.94);
  color: #540D00;
  font-family: var(--mono, Inter, sans-serif);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  outline: 0;
}
.game3d-size-control input:focus {
  border-color: #40D0D0;
  box-shadow: 0 0 0 2px rgba(64,208,208,0.18);
}
@media (max-width: 980px) {
  .majlis-game-section .game3d-controls,
  body.majlis-game-standalone .game3d-controls {
    left: 12px !important;
    right: 12px !important;
    top: 72px !important;
    transform: none !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
}

/* Final Studio typography layer. */
body.majlis-game-standalone .game-workspace *,
body.majlis-game-standalone .game-panel *,
body.majlis-game-standalone .game-float-panel * {
  font-weight: 500 !important;
}
body.majlis-game-standalone button,
body.majlis-game-standalone button *,
body.majlis-game-standalone .game-sprite .sp-name {
  font-family: "Brandon Grotesque", "Brandon Text", "Avenir Next", Avenir, Inter, system-ui, sans-serif !important;
  font-weight: 700 !important;
}
body.majlis-game-standalone .game-sidebar-tabs button,
body.majlis-game-standalone .game-editor-tabs button,
body.majlis-game-standalone .game-mini-grid button,
body.majlis-game-standalone .mini-btn,
body.majlis-game-standalone .game-fab,
body.majlis-game-standalone .game-actions button,
body.majlis-game-standalone .mini-actions button {
  font-size: 11px !important;
}
body.majlis-game-standalone .game-sidebar h4,
body.majlis-game-standalone .tool-field label,
body.majlis-game-standalone .game-sidebar .tool-label {
  font-size: 9.9px !important;
  font-weight: 500 !important;
}
body.majlis-game-standalone .game-sidebar input,
body.majlis-game-standalone .game-sidebar select,
body.majlis-game-standalone .game-sidebar textarea {
  font-size: 15.4px !important;
  font-weight: 500 !important;
}
body.majlis-game-standalone #gamePanel .game-sprite .sp-name {
  font-size: 11px !important;
}
body.majlis-game-standalone #gamePanel .game-sprite.small-object-thumb .sp-art {
  padding: 6px !important;
}
body.majlis-game-standalone #gamePanel .game-sprite.small-object-thumb .sp-art svg,
body.majlis-game-standalone #gamePanel .game-sprite.small-object-thumb .sp-art img {
  max-width: 96% !important;
  max-height: 96% !important;
  filter: contrast(1.16) saturate(1.1) drop-shadow(0 2px 5px rgba(42,32,24,0.18)) !important;
  transform: none !important;
}

/* Studio type lockup: every visible Game surface uses Brandon Grotesque. */
body.majlis-game-standalone {
  --serif: "Brandon Grotesque", "Brandon Text", "Avenir Next", Avenir, Inter, system-ui, sans-serif !important;
  --sans: "Brandon Grotesque", "Brandon Text", "Avenir Next", Avenir, Inter, system-ui, sans-serif !important;
  --mono: "Brandon Grotesque", "Brandon Text", "Avenir Next", Avenir, Inter, system-ui, sans-serif !important;
}
body.majlis-game-standalone,
body.majlis-game-standalone *,
body.majlis-game-standalone *::before,
body.majlis-game-standalone *::after {
  font-family: "Brandon Grotesque", "Brandon Text", "Avenir Next", Avenir, Inter, system-ui, sans-serif !important;
  font-style: normal !important;
}

/* Keep editor controls identical before and after their first interaction. */
body.majlis-game-standalone .game-sidebar-tabs button,
body.majlis-game-standalone .game-editor-tabs button,
body.majlis-game-standalone .game-mini-grid button,
body.majlis-game-standalone #gameCollectionTabs button,
body.majlis-game-standalone #gamePileButtons button,
body.majlis-game-standalone #gameShapeButtons button {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 42px !important;
  height: 42px !important;
  padding: 8px 7px !important;
  font-size: 10px !important;
  line-height: 1.15 !important;
  transform: none !important;
}

body.majlis-game-standalone #gameFrameDesigns > button,
body.majlis-game-standalone #gameFrameDesigns .framed-design-more > button {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 58px !important;
  height: 58px !important;
  padding: 7px !important;
  transform: none !important;
  overflow: hidden !important;
}

body.majlis-game-standalone #gameFrameDesigns > .framed-design-more-toggle {
  grid-column: 1 / -1 !important;
  justify-content: center !important;
  text-align: center !important;
}

body.majlis-game-standalone.majlis-sunset-mode #majlis-game,
body.majlis-game-standalone.majlis-sunset-mode #majlisGameStage,
body.majlis-game-standalone.majlis-sunset-mode .game-main,
body.majlis-game-standalone.majlis-sunset-mode .game-full-stage.in-game,
body.majlis-game-standalone.majlis-sunset-mode .preview-stage.in-game,
body.majlis-game-standalone.majlis-sunset-mode #game3DCanvas {
  background: #FFFFFF !important;
}


/* MAJLIS framed design picker precision pass */
body.majlis-game-standalone #gameFrameDesigns,
.majlis-game-section #gameFrameDesigns,
.game-mini-grid.framed-design-picker {
  align-items: stretch !important;
}
body.majlis-game-standalone #gameFrameDesigns .framed-design-option,
.majlis-game-section #gameFrameDesigns .framed-design-option,
.game-mini-grid.framed-design-picker .framed-design-option {
  display: grid !important;
  grid-template-columns: 84px minmax(0, 1fr) !important;
  align-items: center !important;
  justify-items: start !important;
  column-gap: 16px !important;
  min-height: 112px !important;
  height: 112px !important;
  padding: 16px 20px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
body.majlis-game-standalone #gameFrameDesigns .framed-design-preview,
.majlis-game-section #gameFrameDesigns .framed-design-preview,
.game-mini-grid.framed-design-picker .framed-design-preview {
  width: 72px !important;
  height: 72px !important;
  min-width: 72px !important;
  min-height: 72px !important;
  max-width: 72px !important;
  max-height: 72px !important;
  display: grid !important;
  place-items: center !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}
body.majlis-game-standalone #gameFrameDesigns .framed-design-preview svg,
.majlis-game-section #gameFrameDesigns .framed-design-preview svg,
.game-mini-grid.framed-design-picker .framed-design-preview svg {
  inset: 10px !important;
  width: calc(100% - 20px) !important;
  height: calc(100% - 20px) !important;
}
body.majlis-game-standalone #gameFrameDesigns .framed-design-option > span:last-child,
.majlis-game-section #gameFrameDesigns .framed-design-option > span:last-child,
.game-mini-grid.framed-design-picker .framed-design-option > span:last-child {
  display: block !important;
  width: 100% !important;
  line-height: 1.25 !important;
  align-self: center !important;
}
body.majlis-game-standalone #gameFrameDesigns .framed-design-more,
.majlis-game-section #gameFrameDesigns .framed-design-more,
.game-mini-grid.framed-design-picker .framed-design-more {
  align-items: stretch !important;
}
@media (max-width: 720px) {
  body.majlis-game-standalone #gameFrameDesigns,
  .majlis-game-section #gameFrameDesigns,
  .game-mini-grid.framed-design-picker {
    grid-template-columns: 1fr !important;
  }
  body.majlis-game-standalone #gameFrameDesigns .framed-design-option,
  .majlis-game-section #gameFrameDesigns .framed-design-option,
  .game-mini-grid.framed-design-picker .framed-design-option {
    grid-template-columns: 64px minmax(0, 1fr) !important;
    min-height: 88px !important;
    height: 88px !important;
    padding: 12px 14px !important;
    column-gap: 14px !important;
  }
  body.majlis-game-standalone #gameFrameDesigns .framed-design-preview,
  .majlis-game-section #gameFrameDesigns .framed-design-preview,
  .game-mini-grid.framed-design-picker .framed-design-preview {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
  }
  body.majlis-game-standalone #gameFrameDesigns .framed-design-preview svg,
  .majlis-game-section #gameFrameDesigns .framed-design-preview svg,
  .game-mini-grid.framed-design-picker .framed-design-preview svg {
    inset: 8px !important;
    width: calc(100% - 16px) !important;
    height: calc(100% - 16px) !important;
  }
}

/* Object tray refinement: 20% smaller thumbnails, even horizontal rhythm. */
body.majlis-game-standalone #gamePanel .game-tray {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(78px, 78px)) !important;
  justify-content: space-between !important;
  align-items: stretch !important;
  column-gap: 10px !important;
  row-gap: 12px !important;
}
body.majlis-game-standalone #gamePanel .game-sprite {
  width: 78px !important;
  min-width: 78px !important;
  min-height: 98px !important;
  padding: 7px 6px 8px !important;
  display: grid !important;
  grid-template-rows: 56px auto !important;
  align-items: center !important;
  justify-items: center !important;
}
body.majlis-game-standalone #gamePanel .game-sprite .sp-art {
  width: 56px !important;
  height: 56px !important;
  min-height: 56px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 5px !important;
  box-sizing: border-box !important;
}
body.majlis-game-standalone #gamePanel .game-sprite .sp-art svg,
body.majlis-game-standalone #gamePanel .game-sprite .sp-art img {
  max-width: 88% !important;
  max-height: 88% !important;
  object-fit: contain !important;
}
body.majlis-game-standalone #gamePanel .game-sprite.small-object-thumb .sp-art {
  padding: 5px !important;
}
body.majlis-game-standalone #gamePanel .game-sprite.small-object-thumb .sp-art svg,
body.majlis-game-standalone #gamePanel .game-sprite.small-object-thumb .sp-art img {
  max-width: 88% !important;
  max-height: 88% !important;
}
body.majlis-game-standalone #gamePanel .game-sprite .sp-name {
  width: 100% !important;
  min-height: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-size: 9px !important;
  line-height: 1.1 !important;
  letter-spacing: .045em !important;
  overflow-wrap: anywhere !important;
}
@media (max-width: 760px) {
  body.majlis-game-standalone #gamePanel .game-tray {
    grid-template-columns: repeat(auto-fit, minmax(72px, 72px)) !important;
    justify-content: space-between !important;
    column-gap: 8px !important;
    row-gap: 10px !important;
  }
  body.majlis-game-standalone #gamePanel .game-sprite {
    width: 72px !important;
    min-width: 72px !important;
    min-height: 92px !important;
    grid-template-rows: 52px auto !important;
    padding: 6px 5px 7px !important;
  }
  body.majlis-game-standalone #gamePanel .game-sprite .sp-art {
    width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
  }
  body.majlis-game-standalone #gamePanel .game-sprite .sp-name {
    font-size: 8.5px !important;
  }
}


/* White-stage correction: keep 3D Studio interface/preview on a pure white page background. */
body.majlis-game-standalone,
body.majlis-game-standalone #majlis-game,
body.majlis-game-standalone #majlisGameStage,
body.majlis-game-standalone .game-main,
body.majlis-game-standalone .game-full-stage.in-game,
body.majlis-game-standalone .preview-stage.in-game,
body.majlis-game-standalone #game3DCanvas{
  background:#FFFFFF!important;
}


/* MAJLIS framed picker compact pass: 50% smaller thumbnails/buttons and single-line labels. */
body.majlis-game-standalone #gameFrameDesigns,
.majlis-game-section #gameFrameDesigns,
.game-mini-grid.framed-design-picker {
  grid-template-columns: repeat(2, minmax(150px, 1fr)) !important;
  gap: 8px !important;
}
body.majlis-game-standalone #gameFrameDesigns .framed-design-option,
.majlis-game-section #gameFrameDesigns .framed-design-option,
.game-mini-grid.framed-design-picker .framed-design-option,
body.majlis-game-standalone #gameFrameDesigns > button,
body.majlis-game-standalone #gameFrameDesigns .framed-design-more > button {
  grid-template-columns: 36px minmax(0, 1fr) !important;
  column-gap: 10px !important;
  min-height: 56px !important;
  height: 56px !important;
  padding: 7px 10px !important;
  align-items: center !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
body.majlis-game-standalone #gameFrameDesigns .framed-design-preview,
.majlis-game-section #gameFrameDesigns .framed-design-preview,
.game-mini-grid.framed-design-picker .framed-design-preview {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  margin: 0 !important;
}
body.majlis-game-standalone #gameFrameDesigns .framed-design-preview svg,
.majlis-game-section #gameFrameDesigns .framed-design-preview svg,
.game-mini-grid.framed-design-picker .framed-design-preview svg {
  inset: 5px !important;
  width: calc(100% - 10px) !important;
  height: calc(100% - 10px) !important;
}
body.majlis-game-standalone #gameFrameDesigns .framed-design-option > span:last-child,
.majlis-game-section #gameFrameDesigns .framed-design-option > span:last-child,
.game-mini-grid.framed-design-picker .framed-design-option > span:last-child {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.05 !important;
  font-size: 10px !important;
  letter-spacing: .14em !important;
}
body.majlis-game-standalone #gameFrameDesigns > .framed-design-more-toggle,
.majlis-game-section #gameFrameDesigns > .framed-design-more-toggle,
.game-mini-grid.framed-design-picker .framed-design-more-toggle {
  min-height: 34px !important;
  height: 34px !important;
  padding: 6px 10px !important;
}
body.majlis-game-standalone #gameFrameDesigns .framed-design-more,
.majlis-game-section #gameFrameDesigns .framed-design-more,
.game-mini-grid.framed-design-picker .framed-design-more {
  grid-template-columns: repeat(2, minmax(150px, 1fr)) !important;
  gap: 8px !important;
}
@media (max-width: 720px) {
  body.majlis-game-standalone #gameFrameDesigns,
  .majlis-game-section #gameFrameDesigns,
  .game-mini-grid.framed-design-picker {
    grid-template-columns: 1fr !important;
  }
  body.majlis-game-standalone #gameFrameDesigns .framed-design-option,
  .majlis-game-section #gameFrameDesigns .framed-design-option,
  .game-mini-grid.framed-design-picker .framed-design-option {
    grid-template-columns: 32px minmax(0, 1fr) !important;
    min-height: 50px !important;
    height: 50px !important;
    padding: 6px 9px !important;
  }
  body.majlis-game-standalone #gameFrameDesigns .framed-design-preview,
  .majlis-game-section #gameFrameDesigns .framed-design-preview,
  .game-mini-grid.framed-design-picker .framed-design-preview {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
  }
}

/* v328: object tray thumbnail fit pass  -  keep existing button dimensions, but scale
   artwork and labels so Accessories / Modern Designs and other long labels remain
   side-by-side and contained. */
body.majlis-game-standalone #gamePanel .game-tray {
  grid-auto-flow: row !important;
  grid-template-columns: repeat(auto-fill, 78px) !important;
  justify-content: start !important;
  align-items: stretch !important;
  gap: 10px !important;
}
body.majlis-game-standalone #gamePanel .game-sprite {
  box-sizing: border-box !important;
  overflow: hidden !important;
}
body.majlis-game-standalone #gamePanel .game-sprite .sp-art {
  box-sizing: border-box !important;
  overflow: hidden !important;
  line-height: 0 !important;
}
body.majlis-game-standalone #gamePanel .game-sprite .sp-art img,
body.majlis-game-standalone #gamePanel .game-sprite .sp-art svg {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  transform: scale(.88) !important;
  transform-origin: center center !important;
  margin: 0 auto !important;
}
body.majlis-game-standalone #gamePanel .game-sprite.small-object-thumb .sp-art img,
body.majlis-game-standalone #gamePanel .game-sprite.small-object-thumb .sp-art svg {
  transform: scale(.78) !important;
}
body.majlis-game-standalone #gamePanel .game-sprite .sp-name {
  box-sizing: border-box !important;
  max-width: 100% !important;
  overflow: hidden !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
  text-wrap: balance !important;
  padding: 0 1px !important;
  font-size: clamp(7.2px, 0.58vw, 8.4px) !important;
  line-height: 1.06 !important;
  letter-spacing: .032em !important;
}
@media (max-width: 760px) {
  body.majlis-game-standalone #gamePanel .game-tray {
    grid-template-columns: repeat(auto-fill, 72px) !important;
    justify-content: start !important;
    gap: 8px !important;
  }
  body.majlis-game-standalone #gamePanel .game-sprite .sp-art img,
  body.majlis-game-standalone #gamePanel .game-sprite .sp-art svg {
    transform: scale(.84) !important;
  }
  body.majlis-game-standalone #gamePanel .game-sprite.small-object-thumb .sp-art img,
  body.majlis-game-standalone #gamePanel .game-sprite.small-object-thumb .sp-art svg {
    transform: scale(.74) !important;
  }
  body.majlis-game-standalone #gamePanel .game-sprite .sp-name {
    font-size: 7.2px !important;
    line-height: 1.04 !important;
    letter-spacing: .026em !important;
  }
}

/* MAJLIS Studio view toggle: align the 2D button with Sunset and Objects and make it 50% wider. */
body.majlis-game-standalone #gameViewToggleFab,
.majlis-game-section #gameViewToggleFab{
  right:194px!important;
  min-width:84px!important;
  justify-content:center!important;
  text-align:center!important;
}
body.majlis-game-standalone #sunsetFab,
.majlis-game-section #sunsetFab{right:104px!important;}
body.majlis-game-standalone #objectsFab,
.majlis-game-section #objectsFab{right:14px!important;}
@media(max-width:720px){
  body.majlis-game-standalone #gameViewToggleFab,
  .majlis-game-section #gameViewToggleFab{right:168px!important;min-width:72px!important;}
  body.majlis-game-standalone #sunsetFab,
  .majlis-game-section #sunsetFab{right:90px!important;}
}


/* v340: Compact object tray  -  horizontal chips (icon + label side by side),
   ~half the height of the tile grid, and larger, legible tab names. */
body.majlis-game-standalone #gamePanel .game-tray{
  display:grid !important;
  grid-template-columns:repeat(auto-fill, minmax(132px, 1fr)) !important;
  grid-auto-flow:row !important;
  justify-content:stretch !important;
  align-items:stretch !important;
  column-gap:8px !important;
  row-gap:8px !important;
}
body.majlis-game-standalone #gamePanel .game-sprite{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:9px !important;
  width:auto !important;
  min-width:0 !important;
  height:auto !important;
  min-height:0 !important;
  padding:6px 10px !important;
  text-align:left !important;
  overflow:hidden !important;
}
body.majlis-game-standalone #gamePanel .game-sprite .sp-art,
body.majlis-game-standalone #gamePanel .game-sprite.small-object-thumb .sp-art{
  flex:0 0 30px !important;
  width:30px !important;
  height:30px !important;
  min-height:0 !important;
  padding:1px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}
body.majlis-game-standalone #gamePanel .game-sprite .sp-art img,
body.majlis-game-standalone #gamePanel .game-sprite .sp-art svg,
body.majlis-game-standalone #gamePanel .game-sprite.small-object-thumb .sp-art img,
body.majlis-game-standalone #gamePanel .game-sprite.small-object-thumb .sp-art svg{
  width:100% !important;
  height:100% !important;
  max-width:100% !important;
  max-height:100% !important;
  object-fit:contain !important;
  transform:none !important;
  margin:0 !important;
}
body.majlis-game-standalone #gamePanel .game-sprite .sp-name{
  flex:1 1 auto !important;
  width:auto !important;
  min-height:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  text-align:left !important;
  font-size:11.5px !important;
  line-height:1.14 !important;
  letter-spacing:.01em !important;
  font-weight:600 !important;
  white-space:normal !important;
  overflow-wrap:normal !important;
  word-break:normal !important;
  hyphens:none !important;
  text-wrap:balance !important;
}
@media (max-width:760px){
  body.majlis-game-standalone #gamePanel .game-tray{
    grid-template-columns:repeat(auto-fill, minmax(126px, 1fr)) !important;
    column-gap:7px !important; row-gap:7px !important;
  }
  body.majlis-game-standalone #gamePanel .game-sprite .sp-name{ font-size:10.5px !important; }
}
