/* This form owns a content-sized paper, including on the shared phone stage. */
#game-container[data-approved-ui] #modal-root>.modal-backdrop>.approved-modal-shell:has(#village-profile-form) {
  box-sizing:border-box;display:block!important;flex:none!important;
  width:min(90cqw,500px)!important;min-width:0!important;max-width:none!important;
  height:fit-content!important;min-height:0!important;max-height:92cqh!important;aspect-ratio:auto!important;
}
#game-container[data-approved-ui] #modal-root>.modal-backdrop>.approved-modal-shell:has(#village-profile-form)>.modal {
  box-sizing:border-box;position:relative!important;inset:auto!important;display:block!important;flex:none!important;
  width:100%!important;min-width:0!important;max-width:none!important;
  height:fit-content!important;min-height:0!important;max-height:calc(92cqh - 18px)!important;aspect-ratio:auto!important;
  margin:0!important;padding:5px 8px 8px!important;overflow-x:hidden!important;overflow-y:auto!important;
  overscroll-behavior:contain;scrollbar-width:thin;
}
#game-container[data-approved-ui] #modal-root .modal:has(>.village-profile-editor)>.modal-heading {
  position:relative!important;inset:auto!important;flex:none!important;height:auto!important;min-height:0!important;
  margin:0 0 8px;padding:0 34px 7px 0;
}
#game-container[data-approved-ui] #modal-root .modal:has(>.village-profile-editor)>.modal-heading p:empty {display:none;}
#game-container[data-approved-ui] #modal-root .modal:has(>.village-profile-editor)>.modal-heading:has(>.village-profile-close) {
  --profile-close-size:32px;align-items:center;min-height:calc(var(--profile-close-size) + 8px)!important;
  padding-right:calc(var(--profile-close-size) + 8px);
}
#game-container[data-approved-ui] #modal-root .modal:has(>.village-profile-editor)>.modal-heading>.village-profile-close {
  appearance:none;box-sizing:border-box;position:absolute;z-index:4;top:0;right:0;display:grid;place-items:center;flex:none;
  width:var(--profile-close-size)!important;height:var(--profile-close-size)!important;
  min-width:var(--profile-close-size)!important;min-height:var(--profile-close-size)!important;
  max-width:none;max-height:none;margin:0;padding:0;border:2px solid #bc925a;border-image:none;border-radius:7px;
  background:#fff2d8;box-shadow:inset 0 1px #fffdf0;color:#f26a17;
  font:900 calc(var(--profile-close-size) * .82)/1 Arial,sans-serif!important;text-shadow:0 1px #fffdf0;
  pointer-events:auto;cursor:pointer;touch-action:manipulation;
}
#game-container[data-approved-ui] #modal-root .modal:has(>.village-profile-editor)>.modal-heading>.village-profile-close:hover {background:#fff9e9;color:#ea4d0d;}
#game-container[data-approved-ui] #modal-root .modal:has(>.village-profile-editor)>.modal-heading>.village-profile-close:focus-visible {outline:3px solid #248bc1;outline-offset:2px;}
#game-container[data-approved-ui][data-phone-layout="true"] #modal-root .modal:has(>.village-profile-editor)>.modal-heading:has(>.village-profile-close) {--profile-close-size:calc(36 * var(--phone-pixel));}
#game-container .village-profile-editor {box-sizing:border-box;position:static;width:100%;max-width:none;height:auto;min-height:0;margin:0;padding:4px 6px;color:#5b412c;font:14px/1.35 Arial,sans-serif;}
#game-container .village-profile-editor header p {margin:0 0 12px;color:#7c684e;}
#game-container #village-profile-form {display:flex;flex-direction:column;flex:none;width:100%;height:auto;min-width:0;min-height:0;margin:0;}
#game-container .village-profile-photo-field {display:flex;flex-wrap:wrap;align-items:center;gap:12px 14px;margin-bottom:12px;}
#game-container .village-profile-preview {width:110px;height:100px;flex:none;}
#game-container .village-profile-preview-art {display:block;width:100%;height:100%;}
#game-container .village-profile-photo-controls {display:flex;flex:1 1 180px;flex-direction:column;align-items:flex-start;gap:6px;min-width:0;}
#game-container .village-profile-editor label {font-weight:700;margin-bottom:4px;}
#game-container .village-profile-editor input[type="text"] {box-sizing:border-box;width:100%;min-width:0;min-height:40px;padding:7px 10px;border:1px solid #bea473;border-radius:7px;background:#fffdf4;color:#513c2b;font:inherit;}
#game-container .village-profile-editor input[type="file"] {box-sizing:border-box;display:block;width:100%;max-width:340px;min-height:40px;margin:0;padding:0;border:0;border-radius:6px;background:none;color:#624c35;font:12px/40px Arial,sans-serif;cursor:pointer;}
#game-container #village-profile-form .button,#game-container #village-profile-form input[type="file"]::file-selector-button {appearance:none;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-width:130px;min-height:40px;margin:0;padding:7px 14px;border:2px solid #245a8a;border-image:none;border-radius:7px;background:linear-gradient(#55b4ef,#218dd7 48%,#1475bf);box-shadow:inset 0 2px #8ed7f5;color:#fffdf0;font:700 13px/1.2 Arial,sans-serif;text-shadow:0 1px #245a88;white-space:nowrap;cursor:pointer;touch-action:manipulation;}
#game-container .village-profile-editor input[type="file"]::file-selector-button {margin-right:10px;}
#game-container .village-profile-editor small {display:block;margin-top:4px;color:#827155;font-size:12px;}
#game-container .village-profile-editor .village-profile-error {min-height:1.35em;margin:8px 0;color:#ad342a;font-size:13px;}
#game-container .village-profile-editor .village-profile-error:empty {display:none;}
#game-container .village-profile-editor footer {position:static;display:flex;flex:none;justify-content:flex-end;margin-top:12px;padding:0;}
#game-container .village-profile-editor .village-profile-save {min-width:154px;}
#game-container .village-profile-editor .village-profile-remove {margin-top:3px;}
#game-container .village-profile-editor .button:not(:disabled):hover,#game-container .village-profile-editor input[type="file"]:not(:disabled):hover::file-selector-button {filter:brightness(1.08);}
#game-container .village-profile-editor :is(button,input):focus-visible {outline:3px solid #e4af29;outline-offset:2px;}
#game-container #village-profile-form .button:disabled,#game-container #village-profile-form input[type="file"]:disabled::file-selector-button {border-color:#92988e;background:linear-gradient(#c5cec2,#909d8b);box-shadow:inset 0 2px #dae1d7;color:#f7f7ee;text-shadow:0 1px #7a8375;filter:none;cursor:default;}
#game-container .village-profile-editor input:disabled {cursor:default;opacity:.7;}
#game-container[data-approved-ui][data-phone-layout="true"] #modal-root>.modal-backdrop>.approved-modal-shell:has(#village-profile-form) {width:min(90cqw,640px)!important;}
#game-container[data-phone-layout="true"] .village-profile-editor {padding:2px 4px;font-size:12px;}
#game-container[data-phone-layout="true"] .village-profile-editor header p {margin:0 0 10px;}
#game-container[data-phone-layout="true"] .village-profile-photo-field {gap:12px;margin-bottom:8px;}
#game-container[data-phone-layout="true"] .village-profile-preview {width:92px;height:84px;}
#game-container[data-phone-layout="true"] .village-profile-editor :is(.button,input[type="text"]),#game-container[data-phone-layout="true"] .village-profile-editor input[type="file"]::file-selector-button {min-height:36px;}
#game-container[data-phone-layout="true"] .village-profile-editor .button,#game-container[data-phone-layout="true"] .village-profile-editor input[type="file"]::file-selector-button {min-width:116px;padding:7px 10px;font-size:12px;}
#game-container[data-phone-layout="true"] .village-profile-editor input[type="file"] {min-height:36px;font-size:11px;line-height:36px;}
#game-container[data-phone-layout="true"] .village-profile-editor small {font-size:10px;}
