/* Shared Frontend 2.0 appearance. Generator layout, visibility and canvas rules
   stay in their original files. Important declarations supersede legacy inline
   presentation without changing the controls' JavaScript contracts. */
@font-face { font-family: 'TRMC Editor Seven'; src: url('/fonts/Minecraft-Seven_v2.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'TRMC Editor Ten'; src: url('/fonts/Minecraft-Tenv2.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@layer trmc-editor-theme {
  .trmc-editor-v2 {
    --editor-font: 'TRMC Editor Seven', monospace;
    --editor-title: 'TRMC Editor Ten', monospace;
    --editor-shadow: 2px 2px 0 #242424;
    --panel-background: rgb(0 0 0 / 50%);
    --panel-bg: #464748; --panel-border-light: #666768; --panel-border-dark: #303132;
    --slot-bg: #353637; --letters: #fff; --ink: #fff;
    --primary: #3e8428; --accent: #347322;
    /* Match the host document. A dark embedded canvas inside a light iframe
       is painted opaque by Chromium even when html/body are transparent. */
    color-scheme: light !important;
    font-synthesis: none;
    background: transparent !important;
  }
  .trmc-editor-v2 body {
    margin: 0 !important; padding: 0 !important;
    background: transparent !important; color: #fff !important;
    font: 400 20px/1.5 var(--editor-font) !important;
    text-shadow: var(--editor-shadow) !important;
  }
  .trmc-editor-v2 *, .trmc-editor-v2 *::before, .trmc-editor-v2 *::after { box-sizing: border-box; }
  .trmc-editor-v2 :is(span,li,div[data-i18n],.home-logo-prefix,.home-logo-subtitle) { font-family: var(--editor-font) !important; }
  .trmc-editor-v2 .inventory-slot > span, .trmc-editor-v2 #imageCount { color: #fff !important; text-shadow: var(--editor-shadow) !important; }
  .trmc-editor-v2 .editor-panel ul { font-size: 16px !important; line-height: 1.5 !important; list-style-type: square; padding-left: 20px; }
  .trmc-editor-v2 .editor-panel > div[style*="rgba(255"] { color: #fff !important; background: var(--panel-background) !important; border: 2px solid #666768 !important; font-size: 16px !important; }
  .trmc-editor-v2 #customMusicScope {
    --cm-panel: #464748 !important; --cm-panel-light: #666768 !important;
    --cm-panel-dark: #303132 !important; --cm-slot: #353637 !important;
    --cm-ink: #fff !important; --cm-green: #3e8428 !important;
    min-width: 0 !important; font-family: var(--editor-font) !important;
  }
  .trmc-editor-v2 :is(.container, .minecraft-home-container, .editor-container) {
    width: 100% !important; max-width: none !important;
    background: var(--panel-background) !important;
    border: 0 !important; border-radius: 0 !important;
    color: #fff !important; box-shadow: none !important;
    padding: 24px !important;
  }
  /* One translucent surface per region, not three stacked 50% overlays. */
  .trmc-editor-v2 :is(.container,.editor-container) { background: transparent !important; }
  .trmc-editor-v2 .container > #homeView { background: var(--panel-background) !important; padding: 20px; }
  .trmc-editor-v2 :is(.minecraft-home-container, .container) { min-height: 0 !important; }
  .trmc-editor-v2 .minecraft-home-content { width: 100%; max-width: 900px; padding: 16px 0 !important; gap: 24px !important; }
  .trmc-editor-v2 :is(.editor-panel, .mc-panel, .progress-dialog) {
    color: #fff !important; background: var(--panel-background) !important;
    border: 4px solid #28292b !important; border-radius: 0 !important;
    box-shadow: inset 0 0 0 2px #666768, 4px 4px 0 rgb(0 0 0 / 35%) !important;
    padding: 20px !important;
  }
  .trmc-editor-v2 :is(.language-toolbar, #appRoot > div:has(> .lang-flag), .panel-titlebar, .editor-heading, .piskel-toolbar) {
    color: #fff !important; background: var(--panel-background) !important;
    padding: 16px !important; gap: 12px !important; flex-wrap: wrap;
    border: 0 !important; border-bottom: 4px solid #303132 !important;
    box-shadow: inset 0 2px #666768 !important;
  }
  .trmc-editor-v2 :is(h1,h2,h3,h4,h5,h6,.home-brand-title,.brand-title,.home-logo-title,.home-option-title,.panel-title,.editor-name) {
    font-family: var(--editor-title) !important; font-weight: 400 !important;
    color: #fff !important; text-shadow: var(--editor-shadow) !important;
    letter-spacing: 0 !important; line-height: 1.2 !important;
  }
  .trmc-editor-v2 :is(h1,.home-brand-title,.brand-title,.home-logo-title) { font-size: 40px !important; }
  .trmc-editor-v2 :is(h2,.editor-name) { font-size: 30px !important; }
  .trmc-editor-v2 :is(h3,h4,.panel-title,.home-option-title) { font-size: 24px !important; }
  .trmc-editor-v2 :is(p,label,small,.field-label,.home-intro,.home-tip,.home-option-copy,.home-option-card span,.option-card p,.panel-kicker,.editor-kicker,.project-summary,.track-info,.now-playing-meta,.drop-copy,.empty-state,.brand-kicker,.language-label,.file-summary,.status-message) {
    font-family: var(--editor-font) !important; font-weight: 400 !important;
    color: #fff !important; text-shadow: var(--editor-shadow) !important;
    line-height: 1.5 !important; letter-spacing: 0 !important;
    font-size: 18px !important;
  }
  .trmc-editor-v2 :is(.field-help,.home-option-copy,.home-logo-subtitle,.track-info,.drop-formats,.timeline-times,.export-hint) { font-size: 16px !important; }
  .trmc-editor-v2 :is(.home-intro-accent,.home-logo-prefix) { color: #a5df86 !important; }
  .trmc-editor-v2 :is(.home-logo,.home-title) { margin: 0 auto 20px !important; }
  .trmc-editor-v2 :is(.home-options,.options-grid) { gap: 20px !important; width: 100%; }
  .trmc-editor-v2 :is(.home-option-card,.option-card) {
    font-family: var(--editor-font) !important;
    max-height: none !important; min-width: 0 !important; flex-shrink: 0 !important;
    background: #464748 !important; color: #fff !important;
    min-height: 180px !important; height: auto !important;
    padding: 24px !important; gap: 16px !important;
    border: 2px solid #292a2b !important;
    box-shadow: inset 0 -5px #303132, 3px 3px rgb(0 0 0 / 30%) !important;
    text-shadow: var(--editor-shadow) !important;
  }
  /* The same grey face, light inner rim and five-pixel base as mc-button. */
  .trmc-editor-v2 :is(button,.minecraft-button):not(.home-option-card,.option-card,.sim-btn,.profile-icon-btn,.addon-icon-button,.button-toggle) {
    --ed-face: #d0d1d3; --ed-hover: #bfc0c2; --ed-rim: #e8e9eb;
    --ed-base: #58585a; --ed-seam: #6b6c6e; --ed-text: #252525;
    --ed-shadow: none;
    height: auto !important; min-height: 52px !important;
    padding: 8px 16px 13px !important;
    border: 2px solid #202122 !important; border-radius: 0 !important;
    background: var(--ed-face) !important; color: var(--ed-text) !important;
    font: 400 18px/22px var(--editor-font) !important;
    text-shadow: none !important; cursor: pointer;
    box-shadow: inset 0 -5px var(--ed-base), inset 0 -6px var(--ed-seam), inset 0 -8px var(--ed-rim), inset 2px 2px var(--ed-rim), inset -2px 0 var(--ed-rim) !important;
    transition: none !important; white-space: normal !important;
    transform: none !important;
  }
  .trmc-editor-v2 :is(button,.minecraft-button):is(.export-button,.export-btn,.primary,#exportButton,#exportBtn,[onclick*="exportAddon"],[onclick*="exportPack"]) {
    --ed-face: #3e8428; --ed-hover: #347322; --ed-rim: #8ac174;
    --ed-base: #245616; --ed-seam: #327020; --ed-text: #fff;
    --ed-shadow: 2px 2px #28551b;
    font-family: var(--editor-title) !important; text-shadow: 2px 2px #28551b !important;
  }
  .trmc-editor-v2 :is(.danger-button,.remove-track,.nav-button-patreon) {
    --ed-face: #c94735 !important; --ed-hover: #b83d2d !important; --ed-rim: #ffac97 !important;
    --ed-base: #9b3026 !important; --ed-seam: #b13e30 !important; --ed-text: #fff !important;
  }
  .trmc-editor-v2 :is(button,.minecraft-button):not(.home-option-card,.option-card,.sim-btn,.profile-icon-btn,.addon-icon-button,.button-toggle):hover:not(:disabled) { background: var(--ed-hover) !important; }
  .trmc-editor-v2 :is(button,.minecraft-button):not(.sim-btn,.profile-icon-btn,.addon-icon-button,.button-toggle):active:not(:disabled) {
    translate: 0 5px; clip-path: inset(0 0 5px);
    box-shadow: inset 2px 2px var(--ed-rim,#666768), inset -2px -2px var(--ed-rim,#666768) !important;
  }
  .trmc-editor-v2 :is(button,.minecraft-button):disabled { opacity: .55 !important; cursor: not-allowed !important; }
  .trmc-editor-v2 button :is(span,small,strong) { color: inherit !important; text-shadow: inherit !important; }
  /* Translated labels may carry their own inline or panel text styling. */
  .trmc-editor-v2 :is(button,.minecraft-button):not(.home-option-card,.option-card,.sim-btn,.profile-icon-btn,.addon-icon-button,.button-toggle),
  .trmc-editor-v2 :is(button,.minecraft-button):not(.home-option-card,.option-card,.sim-btn,.profile-icon-btn,.addon-icon-button,.button-toggle) :is(span,small,strong,p,b,label,h2,h3) {
    color: var(--ed-text, #252525) !important;
    text-shadow: var(--ed-shadow, none) !important;
  }
  .trmc-editor-v2 :is(#exportBtn,#exportButton) > span { font-family: var(--editor-title) !important; }
  .trmc-editor-v2 :is(.inventory-slot,.track-card,.drop-zone,.dropzone,.image-preview-box) {
    border: 2px solid #292a2b !important; border-radius: 0 !important;
    background-color: #464748 !important; color: #fff !important;
    box-shadow: inset 0 -5px #303132, 3px 3px rgb(0 0 0 / 30%) !important;
  }
  .trmc-editor-v2 :is(#previewZone,#detailsImagesGrid) {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)) !important;
    gap: 16px !important; align-items: stretch;
    padding: 6px 10px 10px 6px !important;
  }
  .trmc-editor-v2 :is(#previewZone,#detailsImagesGrid) > .inventory-slot {
    width: 100% !important; min-width: 0 !important; max-width: none !important;
    height: auto !important; padding: 12px 12px 18px !important;
  }
  .trmc-editor-v2 .inventory-slot > input[type=text] { width: 100% !important; min-width: 0 !important; }
  .trmc-editor-v2 .inventory-slot > div:has(> button) {
    display: flex !important; width: 100% !important; flex-wrap: wrap !important;
    gap: 8px !important; margin-top: 8px !important;
  }
  .trmc-editor-v2 .inventory-slot > div > button {
    flex: 1 1 100px !important; min-width: 0 !important; max-width: 100% !important;
    overflow-wrap: anywhere;
  }
  .trmc-editor-v2 :is(.home-option-card,.option-card,.inventory-slot,.track-card,.drop-zone,.dropzone):hover {
    outline: 2px solid rgb(255 255 255 / 65%) !important; outline-offset: 3px !important;
  }
  .trmc-editor-v2 :is(.home-option-card,.option-card,.inventory-slot):active { outline-color: #fff !important; }
  .trmc-editor-v2 :is(input:not([type=file],[type=checkbox],[type=radio],[type=range],[type=color],[type=hidden]),textarea,select) {
    border: 2px solid #252627 !important; border-radius: 0 !important;
    background: #464748 !important; color: #fff !important;
    box-shadow: inset 2px 2px #303132, inset -2px -2px #666768 !important;
    font: 400 18px/1.5 var(--editor-font) !important; text-shadow: var(--editor-shadow) !important;
    min-height: 44px !important; padding: 8px 12px !important; max-width: 100%;
  }
  .trmc-editor-v2 input::placeholder, .trmc-editor-v2 textarea::placeholder { color: #d0d1d3; opacity: 1; }
  .trmc-editor-v2 :is(input[type=checkbox],input[type=radio],input[type=range]) { accent-color: #a5df86; }
  .trmc-editor-v2 :is(button,a,input,select,textarea,[tabindex]):focus-visible { outline: 2px solid #fff !important; outline-offset: 4px !important; }
  .trmc-editor-v2 .lang-flag { width: 28px !important; height: 21px !important; border-radius: 0 !important; filter: drop-shadow(2px 2px #242424); }
  .trmc-editor-v2 :is(.minecraft-note,.home-tip,.empty-state) { background: var(--panel-background) !important; border-radius: 0 !important; color: #fff !important; padding: 16px !important; }
  .trmc-editor-v2 :is(.xp-bar,.progress-track) { border: 2px solid #292a2b !important; border-radius: 0 !important; background: #303132 !important; }
  .trmc-editor-v2 :is(.xp-fill,#importProgressBar,#loaderBar) { background: #a5df86 !important; border-radius: 0 !important; }
  .trmc-editor-v2 hr { height: 8px !important; border: 0 !important; border-bottom: 4px solid rgb(0 0 0 / 30%) !important; background: rgb(255 255 255 / 44%) !important; }
  .trmc-editor-v2 .editor-layout > *, .trmc-editor-v2 .editor-grid > * { min-width: 0; }
  .trmc-editor-v2 :is(.modal-content,.dialog-content) {
    max-width: calc(100vw - 32px) !important;
    background: #464748 !important; color: #fff !important;
    border: 4px solid #28292b !important; border-radius: 0 !important;
    box-shadow: inset 0 0 0 2px #666768, 4px 4px rgb(0 0 0 / 35%) !important;
    padding: 24px !important; font-family: var(--editor-font) !important;
  }
  .trmc-editor-v2 :is(.home-title img,.home-logo img,img.logo) { max-width: 100% !important; height: auto; }
  @media (max-width: 767px) {
    .trmc-editor-v2 body { font-size: 16px !important; }
    .trmc-editor-v2 :is(.container,.minecraft-home-container,.editor-container,.editor-panel,.mc-panel) { padding: 14px !important; }
    .trmc-editor-v2 :is(h1,.brand-title,.home-brand-title,.home-logo-title) { font-size: 30px !important; }
    .trmc-editor-v2 :is(h2,.editor-name) { font-size: 24px !important; }
    .trmc-editor-v2 :is(p,label,small,.home-intro,.home-option-copy,.brand-kicker) { font-size: 16px !important; }
    .trmc-editor-v2 :is(button,.minecraft-button):not(.home-option-card,.option-card,.sim-btn,.profile-icon-btn,.addon-icon-button,.button-toggle) { min-height: 44px !important; font-size: 16px !important; padding: 5px 10px 9px !important; }
    .trmc-editor-v2 :is(.home-options,.options-grid) { grid-template-columns: minmax(0,1fr) !important; flex-wrap: wrap; gap: 14px !important; }
    .trmc-editor-v2 :is(.home-option-card,.option-card) { min-height: 140px !important; width: 100% !important; flex: 0 0 auto !important; }
    .trmc-editor-v2 :is(.editor-layout,.editor-grid) { display: grid !important; grid-template-columns: minmax(0,1fr) !important; width: 100% !important; gap: 16px !important; }
    .trmc-editor-v2 :is(.editor-layout,.editor-grid) > * { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
  }
}
