.marketplace-main { display: block; width: 100%; max-width: none; margin: 0; padding: 0; }
.marketplace-page .site-footer { margin-top: 0; }
.marketplace-game { width: 100%; margin: 0; padding: 0; border: 0; }
.marketplace-stage { position: relative; width: 100%; height: calc(100vh - var(--marketplace-header-height, 124px)); height: calc(100dvh - var(--marketplace-header-height, 124px)); min-height: 0; overflow: hidden; background: #80aa78; isolation: isolate; }
#marketplace-canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; outline: none; }
#marketplace-canvas:focus-visible { outline: 3px solid #fff0ad; outline-offset: -5px; }
.marketplace-tools { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); left: max(18px, env(safe-area-inset-left)); display: flex; gap: 8px; }
.marketplace-tool { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #f8f2d77a; border-radius: 6px; background: #243c3ce6; color: #fff0ca; font-size: 23px; cursor: pointer; }
.marketplace-tool:hover:enabled { background: #4f7157; }
.marketplace-tool:disabled { opacity: .4; cursor: default; }
.marketplace-tool:focus-visible, .marketplace-touch button:focus-visible { outline: 3px solid #fff0ad; outline-offset: 3px; }
.marketplace-touch { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); right: max(18px, env(safe-area-inset-right)); display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 44px); gap: 5px; }
.marketplace-touch button { border: 1px solid #f8f2d788; border-bottom-width: 3px; border-radius: 7px; background: #243c3ce6; color: #f7e9bd; font-size: 22px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.marketplace-touch button:active, .marketplace-touch button.is-held { background: #5e8159; }
.marketplace-touch [data-direction="up"] { grid-column: 2; }
.marketplace-touch [data-direction="left"] { grid-column: 1; grid-row: 2; }
.marketplace-touch [data-direction="down"] { grid-column: 2; grid-row: 2; }
.marketplace-touch [data-direction="right"] { grid-column: 3; grid-row: 2; }
.marketplace-network-status { position: absolute; top: 16px; right: 16px; max-width: calc(100% - 58px); padding: 8px 12px; border: 1px solid #f8f2d755; border-radius: 5px; background: #243c3ce6; color: #f7e9bd; font-size: 11px; pointer-events: none; }
.marketplace-fallback { position: absolute; inset: 20%; display: grid; align-items: center; padding: 24px; border-radius: 8px; background: #243c3cef; color: #fff0ca; font-size: 14px; }
.marketplace-noscript { margin: 0; padding: 18px; color: #fff0ca; background: #243c3c; }
.marketplace-guest { position: absolute; top: 18px; left: 18px; display: flex; gap: 12px; box-sizing: border-box; width: min(360px, calc(100% - 36px)); padding: 17px 19px; border: 1px solid #f8f2d766; border-radius: 8px; background: #243c3cef; color: #fff0ca; box-shadow: 0 6px 18px #182c3333; }
.marketplace-guest-icon { padding-top: 1px; color: #f1d38d; font-size: 22px; }
.marketplace-guest strong { font-size: 12px; font-weight: 600; }
.marketplace-guest p { margin: 6px 0 12px; color: #d2dfd5; font-size: 11px; line-height: 1.7; }
.marketplace-guest-login { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; box-sizing: border-box; padding: 8px 12px; border: 1px solid #dfc994; border-radius: 5px; background: #f5dfa8; color: #30443b; font-size: 11px; font-weight: 600; text-decoration: none; }
.marketplace-guest-login:hover { background: #ffedbf; color: #26382f; }
.marketplace-guest-login:focus-visible { outline: 3px solid #fff0ad; outline-offset: 3px; }
.marketplace-interact { position: absolute; left: 12px; bottom: max(116px, calc(env(safe-area-inset-bottom) + 104px)); max-width: calc(100% - 24px); min-height: 44px; padding: 10px 14px; border: 2px solid #654e40; border-bottom-width: 4px; border-radius: 3px; background: #fff0cc; color: #3e5048; font: 600 12px monospace; cursor: pointer; box-shadow: 0 3px 0 #3e504840; }
.marketplace-interact:disabled { opacity: .75; cursor: wait; }
.marketplace-shop { --shop-awning: #d87f70; position: fixed; top: calc(var(--marketplace-dialog-offset, 0px) + var(--marketplace-dialog-height, 100dvh) / 2); bottom: auto; left: 0; right: 0; transform: translateY(-50%); width: min(480px, calc(100% - 24px)); max-width: 480px; max-height: calc(var(--marketplace-dialog-height, 100dvh) - 24px); box-sizing: border-box; margin: 0 auto; padding: 0; overflow: hidden; border: 4px solid #654e40; border-radius: 3px; background: #f1dfb4; color: #3e5048; box-shadow: 0 0 0 2px #d5ad76, 8px 8px 0 #263d3b66; font-family: monospace; }
.marketplace-shop[open] { display: flex; flex-direction: column; }
.marketplace-shop::backdrop { background: #243c3c99; }
.marketplace-shop[data-variant="1"] { --shop-awning: #769bc2; }
.marketplace-shop[data-variant="2"] { --shop-awning: #a58bbd; }
.marketplace-shop[data-variant="3"] { --shop-awning: #78a489; }
.marketplace-shop[data-variant="4"] { --shop-awning: #d9ad62; }
.marketplace-shop[data-variant="5"] { --shop-awning: #6ea6ae; }
.marketplace-shop-roof { flex: 0 0 24px; border-bottom: 4px solid #654e40; background: repeating-linear-gradient(90deg, #fff0ce66 0 24px, transparent 24px 48px), var(--shop-awning); }
.marketplace-shop-heading { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 14px; border-bottom: 3px solid #b89063; background: #e7cea0; }
.marketplace-shop-heading > div { flex: 1; min-width: 0; }
.marketplace-shop-location { margin: 0 0 8px; color: #6b5947; font-size: 11px; line-height: 1.5; }
.marketplace-shop h2 { margin: 0; color: #3e5048; font-family: monospace; font-size: 21px; line-height: 1.25; overflow-wrap: anywhere; }
.marketplace-shop-close { flex: 0 0 44px; width: 44px; height: 44px; border: 2px solid #93684a; border-bottom-width: 4px; border-radius: 2px; background: #fff0cc; color: #654e40; font-size: 26px; cursor: pointer; }
.marketplace-shop-content { min-height: 0; padding: 16px; overflow-y: auto; overscroll-behavior: contain; font-size: 13px; line-height: 1.6; }
.marketplace-shop-content > p:first-child { margin-top: 0; }
.marketplace-shop-content p { color: #3e5048; }
.marketplace-shop fieldset { display: flex; flex-direction: column; gap: 0; min-width: 0; margin: 0; padding: 0; border: 0; }
.marketplace-shop label { display: block; margin: 14px 0 5px; font-size: 13px; font-weight: 700; }
.marketplace-shop label:first-child { margin-top: 2px; }
.marketplace-shop input, .marketplace-shop textarea, .marketplace-shop select { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; margin: 0; padding: 10px; border: 2px solid #b89063; border-radius: 2px; background: #fff4d8; color: #3e5048; font: 16px/1.5 monospace; }
.marketplace-shop-preview { display: flex; align-items: center; gap: 12px; margin: 8px 0 2px; padding: 8px; border: 1px dashed #b89063; background: #e7d3a7; }
.marketplace-shop-preview canvas { flex: 0 0 auto; width: 114px; height: 88px; image-rendering: pixelated; }
.marketplace-shop-preview p { margin: 0; font-size: 11px; line-height: 1.6; }
.marketplace-shop .marketplace-shop-image-fields { margin-top: 18px; padding-top: 14px; border-top: 1px dashed #b89063; }
.marketplace-shop-image-fields legend { padding: 0; font-size: 13px; font-weight: 700; }
.marketplace-shop-image-fields legend span { font-size: 11px; font-weight: 400; }
.marketplace-shop-image-fields .marketplace-shop-button { margin-top: 8px; font-size: 12px; }
.marketplace-shop input[type="file"] { padding: 7px; font-size: 12px; overflow: hidden; }
.marketplace-shop input[type="file"]::file-selector-button { min-height: 32px; margin-right: 8px; padding: 5px 8px; border: 1px solid #93684a; background: #e7cea0; color: #3e5048; font: 12px monospace; cursor: pointer; }
.marketplace-shop-image-preview { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.marketplace-shop-image-preview img, .marketplace-shop-flag-view { flex: 0 0 auto; width: 64px; height: 64px; padding: 4px; border: 2px solid #b89063; background: #fff0cc; image-rendering: pixelated; object-fit: contain; box-sizing: border-box; }
.marketplace-shop-image-preview p { margin: 0; font-size: 11px; overflow-wrap: anywhere; }
.marketplace-shop-image-preview p.is-error { color: #914c3b; }
.marketplace-shop-flag-view { margin-bottom: 12px; }
#marketplace-shop-image-configure, #marketplace-shop-image-form { margin-bottom: 12px; }
#marketplace-shop-image-cancel { margin-top: 8px; }
.marketplace-shop-content .marketplace-shop-theme-label { margin: 0 0 12px; color: #6b5947; font-size: 11px; }
.marketplace-shop textarea { resize: vertical; max-height: 180px; }
.marketplace-shop input::placeholder, .marketplace-shop textarea::placeholder { color: #7d7462; opacity: 1; }
.marketplace-shop small { margin-top: 4px; color: #6b5947; font-size: 10px; line-height: 1.5; }
.marketplace-shop-content .marketplace-shop-note, .marketplace-shop-content .marketplace-shop-test { font-size: 11px; line-height: 1.6; color: #6b5947; }
.marketplace-shop-test { margin: 18px 0 0; padding-top: 12px; border-top: 1px dashed #b89063; }
.marketplace-shop-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 44px; box-sizing: border-box; padding: 10px 12px; border: 2px solid #3e5048; border-bottom-width: 4px; border-radius: 2px; background: #567c5b; color: #fff0cc; font: 700 13px/1.4 monospace; text-align: center; text-decoration: none; cursor: pointer; }
.marketplace-shop-button:hover { background: #466b4c; color: #fff0cc; }
.marketplace-shop-button-danger { border-color: #845346; background: #b46f5d; color: #fff4d8; }
.marketplace-shop-button-danger:hover { background: #9d5b4b; }
.marketplace-shop-button-secondary { background: #fff0cc; color: #3e5048; border-color: #93684a; }
.marketplace-shop-button-secondary:hover { background: #e7cea0; color: #3e5048; }
.marketplace-shop button:disabled { opacity: .6; cursor: wait; }
.marketplace-shop :is(input, textarea, select, button, a):focus-visible, .marketplace-interact:focus-visible { outline: 3px solid #3e6480; outline-offset: 2px; }
.marketplace-shop-description { margin-top: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.marketplace-shop-content .marketplace-shop-address { margin: 8px 0 20px; font-size: 11px; overflow-wrap: anywhere; color: #6b5947; }
.marketplace-shop-confirm { padding: 12px; border: 2px solid #b46f5d; background: #edd5af; }
.marketplace-shop-confirm p { margin-top: 0; overflow-wrap: anywhere; }
.marketplace-shop-confirm-actions { display: flex; flex-direction: column; gap: 8px; }
.marketplace-shop-message { padding: 10px; border: 2px solid #8ca16c; background: #e2e5b9; overflow-wrap: anywhere; }
.marketplace-shop-message.is-error { border-color: #b46f5d; background: #f0cdb2; }
@media (min-width: 600px) { .marketplace-shop-heading, .marketplace-shop-content { padding: 20px 24px; } .marketplace-shop-confirm-actions { flex-direction: row; } }
@media (max-width: 480px) {
  .marketplace-tools { left: 12px; bottom: max(12px, env(safe-area-inset-bottom)); gap: 6px; }
  .marketplace-touch { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .marketplace-guest { top: 12px; left: 12px; width: calc(100% - 24px); padding: 14px 15px; gap: 9px; }
  .marketplace-network-status { top: auto; bottom: 72px; }
}
.marketplace-screen-notice { box-sizing: border-box; width: calc(100% - 2rem); max-width: 42rem; margin: 3rem auto; padding: 1.5rem; border-radius: 12px; background: #102a3c; color: #fff; text-align: center; line-height: 1.7; }
.marketplace-screen-notice h2 { color: inherit; font-size: clamp(1.5rem, 5vw, 2rem); }
.marketplace-screen-notice a { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1rem; color: #ffdc91; }
.marketplace-screen-blocked .marketplace-main { display: none !important; }
@media (max-width: 1023px) {
  .marketplace-main { display: none !important; }
  .marketplace-screen-notice[hidden] { display: block !important; }
}
.marketplace-tool.marketplace-requests-button { width: auto; padding-inline: .8rem; font-size: .85rem; }
.marketplace-requests-item { border-bottom: 1px solid #9a754f; padding-block: .75rem; overflow-wrap: anywhere; }
