chess-add-modal dialog { width: min(580px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 40px); overflow-y: auto; padding: 0; border: 1px solid #ffffffb0; border-radius: 26px; background: #fffdf7; color: #4a3f2b; box-shadow: 0 32px 100px #211b2d40, 0 4px 16px #211b2d18; }
chess-add-modal dialog::backdrop { background: #252c36a6; backdrop-filter: blur(7px); }
chess-add-modal dialog svg { width: 22px; height: 22px; display: block; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
chess-add-modal dialog .add-header { position: relative; display: flex; align-items: flex-start; gap: 16px; padding: 32px 64px 28px 30px; background: radial-gradient(ellipse at 0 0, #f6e3be, transparent 75%), #faf5e9; border-bottom: 1px solid #ede3d1; }
chess-add-modal dialog .add-emblem { display: grid; place-items: center; flex-shrink: 0; width: 52px; height: 52px; margin-top: 6px; border: 1px solid #c58745; border-radius: 16px; background: linear-gradient(145deg, #dda359, #bf702d); color: #fffaf0; box-shadow: 0 5px 12px #ac662726, inset 0 1px 0 #ffffff60; transform: rotate(-6deg); }
chess-add-modal dialog .add-emblem svg { width: 28px; height: 28px; }
.add-eyebrow { font-size: .59rem; font-weight: 750; letter-spacing: .13em; color: #a77a44; }
chess-add-modal dialog h2 { margin: 6px 0 8px; font-size: 1.7rem; line-height: 1.15; letter-spacing: -.04em; }
chess-add-modal dialog .add-heading p { margin: 0; color: #91806a; font-size: .81rem; line-height: 1.55; }
chess-add-modal dialog #add-cancel { position: absolute; right: 18px; top: 18px; display: grid; place-items: center; width: max(34px, var(--add-touch-target, 0px)); min-height: max(34px, var(--add-touch-target, 0px)); padding: 0; border: 1px solid #e5dac7; border-radius: 50%; background: #fffdf780; color: #9b8b74; transition: background .15s, color .15s; }
chess-add-modal dialog #add-cancel:hover { background: #fffdf7; color: #4a3f2b; }
chess-add-modal dialog #add-cancel svg { width: 16px; height: 16px; }
.add-body { padding: 24px 30px 20px; }
chess-add-modal dialog .add-tabs { display: flex; gap: 8px; margin: 0; padding: 5px; border: 1px solid #e9e0d0; border-radius: 14px; background: #f3eee4; }
chess-add-modal dialog .add-tab { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; min-width: 0; min-height: 44px; padding: 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #968773; font-size: .79rem; font-weight: 650; transition: background .15s, color .15s; }
chess-add-modal dialog .add-tab svg { width: 18px; height: 18px; }
chess-add-modal dialog .add-tab:hover { color: #785633; background: #fffdf770; }
chess-add-modal dialog .add-tab[aria-selected=true] { border-color: #e6dac5; background: #fffdf7; color: #a3642c; box-shadow: 0 2px 5px #6b502b0c; }
chess-add-modal dialog .add-panel { padding-top: 24px; }
chess-add-modal dialog .add-panel[hidden] { display: none; }
chess-add-modal dialog label { display: block; margin-top: 18px; font-size: .73rem; font-weight: 650; color: #79674f; }
chess-add-modal dialog .add-upload { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; margin: 0; padding: 28px 16px 24px; border: 1.5px dashed #d2ba94; border-radius: 18px; background: linear-gradient(150deg, #fcf8ef, #f9f1e2); text-align: center; transition: border-color .15s, background .15s; }
chess-add-modal dialog .add-upload:hover { border-color: #bd7939; background: #fbefdb; }
.add-upload-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 6px; border: 1px solid #e6d3b4; border-radius: 16px; background: #fffaf0; color: #ba8349; }
chess-add-modal dialog .add-upload-icon svg { width: 26px; height: 26px; }
chess-add-modal dialog .add-upload strong { font-size: 1rem; font-weight: 650; color: #695035; }
.add-upload-copy { color: #9b8970; font-size: .77rem; font-weight: 400; }
.add-upload-cta { display: flex; align-items: center; gap: 24px; margin-top: 8px; padding: 10px 16px; border: 1px solid #c17d3c; border-radius: 10px; background: linear-gradient(#dba05b, #c67b36); color: #fffaf0; font-size: .77rem; box-shadow: 0 3px 8px #ac662718; }
chess-add-modal dialog .add-upload input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.add-panel-note { margin: 13px 0 0; color: #a19480; font-size: .65rem; line-height: 1.6; text-align: center; }
chess-add-modal dialog h3 { margin: 0 0 8px; font-size: 1.15rem; letter-spacing: -.025em; }
.add-panel-description { margin: 0; color: #998973; font-size: .78rem; line-height: 1.6; }
chess-add-modal dialog input:not([type=file]), chess-add-modal dialog textarea { display: block; width: 100%; margin-top: 8px; padding: 13px 14px; border: 1px solid #e0d5c2; border-radius: 12px; background: #fff; font: inherit; font-size: .82rem; color: #4a3f2b; }
chess-add-modal dialog input::placeholder, chess-add-modal dialog textarea::placeholder { color: #b4a995; }
chess-add-modal dialog textarea { min-height: 165px; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: .74rem; line-height: 1.7; }
.add-field-help { margin: 9px 0 0; color: #a19480; font-size: .67rem; line-height: 1.6; }
chess-add-modal dialog .add-action { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 20px; min-height: 46px; padding: 12px 16px; border: 1px solid #bf7837; border-radius: 12px; background: linear-gradient(#d99c53, #c57b37); color: #fffaf0; font-size: .82rem; font-weight: 650; box-shadow: 0 3px 9px #ac66271a; }
chess-add-modal dialog .add-action:hover:not(:disabled) { background: linear-gradient(#e1a861, #cc8440); }
chess-add-modal dialog .add-action:disabled { opacity: .5; }
chess-add-modal dialog a.add-action { text-decoration: none; }
chess-add-modal dialog :focus-visible { outline: 3px solid #bd7939; outline-offset: 3px; }
chess-add-modal dialog .add-upload:focus-within { outline: 3px solid #bd7939; outline-offset: 3px; }
chess-add-modal [role=status] { margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; background: #f2eddf; color: #807152; font-size: .77rem; line-height: 1.5; }
chess-add-modal [role=status]:empty { display: none; }
chess-add-modal [role=status][data-error=true] { color: #9a442b; background: #fcf0e9; border: 1px solid #efd0be; }
chess-add-modal dialog .add-footer { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 24px; border-top: 1px solid #eee5d6; color: #a39682; font-size: .67rem; background: #fcf9f2; }
chess-add-modal dialog .add-footer svg { width: 14px; height: 14px; }
@media (max-width: 600px) {
  chess-add-modal dialog { border-radius: 20px; max-height: calc(100dvh - 24px); }
  chess-add-modal dialog .add-header { padding: 24px 50px 22px 20px; gap: 12px; }
  chess-add-modal dialog .add-emblem { width: 40px; height: 40px; border-radius: 12px; }
  chess-add-modal dialog .add-emblem svg { width: 24px; height: 24px; }
  chess-add-modal dialog h2 { font-size: 1.4rem; }
  .add-body { padding: 20px; }
  chess-add-modal dialog .add-tab { gap: 6px; font-size: .72rem; }
  chess-add-modal dialog .add-upload { padding: 24px 12px; }
}

chess-add-modal { display: contents; }
chess-add-modal dialog { box-sizing: border-box; font-family: system-ui, sans-serif; color-scheme: light; }
chess-add-modal dialog *, chess-add-modal dialog *::before, chess-add-modal dialog *::after { box-sizing: border-box; }
chess-add-modal [hidden] { display: none !important; }
chess-add-modal .add-tabs { flex-wrap: wrap; }

@media (pointer: coarse) { chess-add-modal dialog { --add-touch-target: 44px; } chess-add-modal dialog :is(button, a[href], input:not([type=file]), textarea) { min-width: 44px; min-height: 44px; } }
