.game-details-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
.game-assets { min-width: 0; container: materials-preview / inline-size; }
.game-assets > h2:has(> .materials-open[aria-expanded="false"]) { margin-bottom: 0; }
.game-details:has(> .game-details-side > .game-assets:last-child > h2 > .materials-open) {
  padding-block-end: 18px;
}
.game-details:has(> .game-details-side > .game-assets:last-child > h2 > .materials-open) + .more-games {
  padding-block-start: 18px;
}
.materials-admin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 16px;
}
.materials-open {
  display: inline-flex; align-items: baseline; gap: 10px; padding: 0;
  vertical-align: top; text-align: start; letter-spacing: inherit;
}
.materials-open::after {
  content: "";
  flex: none;
  align-self: center;
  border-inline: 5px solid transparent;
  border-top: 6px solid currentColor;
}
.materials-open[aria-expanded="true"]::after { transform: rotate(180deg); }
.materials-open:hover { text-decoration: underline; }
.materials-upload:hover, .materials-action:hover { background: #ede8f2; }
.materials-open span, .materials-slot span {
  padding: 1px 6px; border-radius: 99px;
  background: #ece6f0; color: #5b4770; font-size: .85em; font-variant-numeric: tabular-nums;
}
.materials-open span {
  display: inline-flex; justify-content: center; min-width: 1.6em;
  font-size: calc(1em / 1.3); line-height: 1; letter-spacing: normal;
}
.materials-admin { display: grid; gap: 5px; container: materials-admin / inline-size; }
.materials-admin-group { padding: 4px 10px; }
.materials-admin-group-heading { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.game-details .materials-admin-group-heading h3 { margin: 0; font-size: 13px; }
.materials-admin-group > .materials-admin-row { justify-content: flex-start; gap: 4px; }
.materials-admin-group.inline-slots {
  display: grid; grid-template-columns: repeat(var(--material-columns), minmax(0, max-content)) minmax(0, 1fr);
  column-gap: 8px;
}
.materials-admin-group.inline-slots > .materials-admin-group-heading { grid-column: 1 / -1; }
.materials-admin-group.inline-slots > .materials-admin-row { flex-wrap: wrap; }
.materials-admin-group.playable-tags { display: flex; flex-wrap: wrap; gap: 3px 4px; }
.materials-admin-group.playable-tags > .materials-admin-group-heading { flex-basis: 100%; }
.materials-admin-group:is(.inline-slots, .playable-tags) > .materials-admin-row { align-self: start; gap: 2px; }
.materials-admin-group.playable-tags > .materials-admin-row { border: 1px solid var(--line); border-radius: 99px; padding-inline: 7px 3px; }
.materials-admin-group:is(.inline-slots, .playable-tags) .materials-slot { font-size: 13px; white-space: nowrap; }
.materials-slot { display: block; align-content: center; min-width: 0; min-height: 26px; text-align: left; }
.materials-admin button.materials-slot { padding: 0; }
.materials-slot:is(button, a):hover { text-decoration: underline; }
.materials-action, .materials-upload {
  position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 33px;
  padding: 4px 8px; border-radius: 7px; color: #5c3c78; font: inherit; font-size: 13px;
  text-decoration: none; text-align: center; cursor: pointer;
}
.materials-admin :is(.materials-action, .materials-upload) { min-height: 26px; }
.materials-upload { outline: 1px solid var(--line); outline-offset: -1px; }
.materials-upload.icon-only { width: 26px; flex: 0 0 auto; padding: 0; }
.materials-download { width: 24px; padding: 0; flex: 0 0 auto; }
.materials-admin-group:is(.inline-slots, .playable-tags) .materials-slot span { padding-inline: 3px; }
@container materials-admin (width < 240px) {
  .materials-admin-group:is(.inline-slots, .playable-tags) > .materials-admin-row { gap: 1px; }
  .materials-admin-group:is(.inline-slots, .playable-tags) .materials-slot { font-size: 12px; }
  .materials-admin-group:is(.inline-slots, .playable-tags) .materials-slot span { padding-inline: 2px; }
}
.materials-upload:focus-visible { outline: 2px solid var(--purple); }
.materials-upload:disabled, .materials-action:disabled { opacity: .5; cursor: default; }
.materials-error { color: #9b2424; overflow-wrap: anywhere; }
.materials-category-title { padding: 0; font: inherit; text-align: left; }
.materials-category-title:hover { text-decoration: underline; }
.materials-categories {
  --category-padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-inline-start: calc(-1px - var(--category-padding));
}
.materials-categories .materials-slot { padding: 4px var(--category-padding); border: 1px solid var(--line); border-radius: 8px; }
.materials-modal.modal.wide {
  --gallery-width: 728px;
  --gallery-columns: 4;
  --gallery-inset: clamp(14px, 3vw, 21px);
  --gallery-line: #e9e0d8;
  --gallery-paper: #faf6f0;
  --gallery-accent: #6949c6;
  width: min(100%, var(--gallery-width));
  padding: var(--gallery-inset);
  background: var(--gallery-paper);
  color: #494052;
  border-radius: var(--radius);
  container: materials-dialog / inline-size;
}
.materials-modal.modal.materials-gallery-1 { --gallery-width: 350px; --gallery-columns: 1; }
.materials-modal.modal.materials-gallery-2 { --gallery-width: 454px; --gallery-columns: 2; }
.materials-modal.modal.materials-gallery-3 { --gallery-width: 585px; --gallery-columns: 3; }
.materials-modal.modal.materials-preview-modal { --gallery-width: 680px; }
.materials-modal.modal.preview-image { --gallery-width: 560px; }
.materials-modal.modal.materials-upload-modal { --gallery-width: 420px; }
.materials-upload-modal h2 { margin: 0 42px 12px 0; font-size: 21px; line-height: 1.3; }
.materials-upload-drop {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 24px 14px;
  border: 1px dashed #b9a9ce;
  border-radius: 12px;
  background: #f3edf6;
  color: #57416b;
  text-align: center;
}
.materials-upload-drop.is-dragging { border-color: var(--gallery-accent); background: #e8dcf5; }
.materials-upload-drop p { margin: 0; font-weight: 700; }
.materials-upload-modal > .materials-error { margin: 10px 0 0; }
.materials-modal .modal-close {
  inset: var(--gallery-inset) var(--gallery-inset) auto auto;
  width: 32px;
  height: 32px;
}
.materials-dialog-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding-inline-end: 42px;
}
.materials-modal .materials-dialog-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.materials-modal :is(.modal-close, .materials-preview-control, .materials-archive-action) {
  border: 1px solid var(--gallery-line);
  background: #fffaf5;
  color: #57416b;
  border-radius: 10px;
}
.materials-modal :is(.modal-close, .materials-preview-control, .materials-archive-action):not([aria-disabled="true"]):hover { background: #f0e8f2; }
.materials-modal .materials-archive-action, .materials-modal .materials-primary {
  gap: 6px;
  min-height: 33px;
  font-weight: 700;
  white-space: nowrap;
}
.materials-modal .materials-archive-action { padding-inline: 9px; }
.materials-archive-short-label { display: none; }
.materials-gallery-actions { display: flex; align-items: center; gap: 6px; }
.materials-gallery {
  display: grid;
  grid-template-columns: repeat(var(--gallery-columns), minmax(0, 1fr));
  gap: 9px;
  margin: 11px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--gallery-line);
  list-style: none;
}
.materials-tile { position: relative; min-width: 0; }
.materials-tile-preview {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100%;
  max-height: 155px;
  padding: 4px;
  aspect-ratio: 16 / 11;
  border: 1px solid var(--gallery-line);
  border-radius: var(--media-radius, 12px);
  background: #f3ede6;
  color: inherit;
}
.materials-tile-preview[data-kind="playable"] { background: #eee7f4; }
.materials-tile-preview:is(a, button):hover { border-color: var(--gallery-accent); }
.materials-tile.is-selected .materials-tile-preview { outline: 2px solid var(--gallery-accent); outline-offset: -2px; }
.materials-tile-preview > :is(img, video) { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.materials-highlight { margin-block-end: 14px; }
.materials-highlight .materials-tile-preview { padding: 0; border: 0; }
.materials-highlight:not([data-section="screenshots"]) .materials-tile-preview {
  width: min(100%, 280px);
  max-height: none;
  aspect-ratio: 16 / 9;
}
.materials-highlight .materials-tile-preview[data-slot$="-9-16"] { aspect-ratio: 9 / 16; }
.materials-highlight:not([data-section="screenshots"]) .materials-tile-preview[data-slot$="-9-16"] {
  width: min(100%, 100px);
}
.materials-highlight[data-section="logos"] .materials-tile-preview { width: min(100%, 180px); }
.materials-highlight[data-section="screenshots"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(72px, 100%), 1fr));
  gap: 8px;
}
@container materials-preview (width < 392px) {
  .materials-highlight[data-section="screenshots"] > :nth-child(n+5) { display: none; }
}
@container materials-preview (width < 312px) {
  .materials-highlight[data-section="screenshots"] > :nth-child(n+4) { display: none; }
}
@container materials-preview (width < 232px) {
  .materials-highlight[data-section="screenshots"] > :nth-child(n+3) { display: none; }
}
@container materials-preview (width < 152px) {
  .materials-highlight[data-section="screenshots"] > :nth-child(n+2) { display: none; }
}
.materials-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #fff9;
  border-radius: 50%;
  background: #372846e8;
  color: #fff;
}
.materials-play-icon svg { fill: currentColor; }
.materials-tile-name { max-width: 100%; padding: 28px 7px 12px; text-align: center; overflow-wrap: anywhere; font-size: 13px; font-weight: 700; }
.materials-tile-name.has-play { position: absolute; inset-inline: 6px; bottom: 7px; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.materials-tile-check, .materials-tile-tools summary {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  cursor: pointer;
}
.materials-tile-check { position: absolute; top: 1px; right: 1px; }
.materials-tile-check input { position: absolute; inset: 0; opacity: 0; margin: 0; padding: 0; width: 100%; height: 100%; cursor: inherit; }
.materials-checkmark, .materials-tile-tools summary span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #cabcca;
  border-radius: 50%;
  background: #fffaf5;
  color: #57416b;
}
.materials-checkmark svg { opacity: 0; }
.materials-tile-check:hover .materials-checkmark { border-color: var(--gallery-accent); }
.materials-tile-check input:checked + .materials-checkmark { border-color: var(--gallery-accent); background: var(--gallery-accent); color: #fff; }
.materials-tile-check input:checked + .materials-checkmark svg { opacity: 1; }
.materials-tile-check input:focus-visible + .materials-checkmark { outline: 2px solid var(--gallery-accent); outline-offset: 2px; }
.materials-tile-check:has(input:disabled) { opacity: .6; cursor: default; }
.materials-tile-tools { position: absolute; top: 1px; left: 1px; }
.materials-tile-tools[open] { z-index: 2; }
.materials-tile-tools summary { list-style: none; }
.materials-tile-tools summary::-webkit-details-marker { display: none; }
.materials-tile-tools summary:focus-visible span { outline: 2px solid var(--gallery-accent); outline-offset: 2px; }
.materials-tool-menu {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  display: grid;
  gap: 2px;
  width: max-content;
  min-width: 112px;
  padding: 4px;
  border: 1px solid var(--gallery-line);
  border-radius: 10px;
  background: #fffaf5;
  box-shadow: 0 5px 18px #30263d28;
}
.materials-action.materials-primary { padding-inline: 13px; border-radius: 10px; color: #fff; background: var(--gallery-accent); }
.materials-action.materials-primary:not(:disabled):hover { background: #5739a8; }
.materials-action.materials-primary:disabled { opacity: 1; color: #716683; background: #eee7f0; }
.materials-preview-heading { grid-template-columns: auto minmax(0, 1fr) auto; }
.materials-modal .materials-preview-heading h2 { font-size: clamp(15px, 3vw, 21px); }
.materials-preview-controls { display: flex; gap: 5px; }
.materials-modal .materials-preview-control { display: grid; place-items: center; width: 32px; height: 32px; min-height: 32px; padding: 0; }
.materials-preview-control[aria-disabled="true"] { opacity: .45; cursor: default; }
.materials-modal .materials-preview-delete { color: #9b2424; }
.materials-preview-previous svg { transform: rotate(180deg); }
.materials-preview-stage { margin-top: 11px; display: grid; place-items: center; }
.materials-visual, .materials-frame { display: block; max-width: 100%; border-radius: var(--media-radius, 12px); }
.materials-visual { max-height: min(56dvh, 500px); object-fit: contain; }
.materials-visual:is(video) { width: 100%; background: #292330; }
.materials-frame { width: 100%; height: min(56dvh, 500px); border: 0; background: #f3ede6; }
.modal.materials-delete-modal { width: min(100%, 370px); display: grid; gap: 12px; padding: 20px; }
.modal.materials-delete-modal h2 { margin: 0; padding-inline-end: 36px; font-size: 21px; }
.materials-delete-modal p { overflow-wrap: anywhere; }
.materials-delete-actions { display: flex; justify-content: flex-end; gap: 8px; }
.materials-delete-actions .button { min-height: 36px; padding: 6px 14px; }
@container materials-dialog (width < 465px) {
  .materials-gallery { grid-template-columns: repeat(min(var(--gallery-columns), 2), minmax(0, 1fr)); }
}
@container materials-dialog (width < 480px) {
  .materials-archive-label { display: none; }
  .materials-archive-short-label { display: inline; }
}
@container materials-dialog (width < 395px) {
  .materials-download-label { display: none; }
  .materials-modal .materials-gallery-actions .materials-action { padding-inline: 6px; }
}
@container materials-dialog (width < 300px) {
  .materials-modal .materials-gallery-heading h2 { font-size: 16px; }
  .materials-modal .materials-gallery-actions .materials-action { gap: 4px; }
  .materials-gallery-actions .materials-archive-action svg { display: none; }
}
@container materials-dialog (width < 235px) {
  .materials-gallery { grid-template-columns: 1fr; }
}

.game-editor {
  --editor-width: 1080px;
  --editor-gutter: clamp(12px, 3vw, 28px);
  --editor-inset: max(var(--editor-gutter), calc((100% - var(--editor-width)) / 2));
  --editor-paper: #fffefa;
  --editor-line: #e8e2da;
  --editor-accent: #6949bd;
  background: #f5f2ec;
}

.game-editor-header {
  display: flex;
  align-items: center;
  gap: 10px 24px;
  flex-shrink: 0;
  padding: 12px max(62px, var(--editor-inset)) 12px var(--editor-inset);
  border-bottom: 1px solid var(--editor-line);
  background: var(--editor-paper);
}

.game-editor .game-editor-header h2 { margin: 0; font-size: 25px; }
.game-editor .modal-close { top: 10px; right: var(--editor-gutter); width: 38px; height: 38px; }
.game-editor-header nav { display: flex; align-items: center; gap: 3px; margin-inline-start: auto; }
.game-editor-header nav button { min-height: 34px; padding: 5px 11px; border-radius: 7px; color: #5d4e6f; font-size: 14px; font-weight: 650; }
.game-editor-header nav button:hover { background: #f0eaf7; color: var(--editor-accent); }

.game-editor-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 14px;
  padding: 14px var(--editor-inset) 20px;
}

.game-editor .game-editor-fields { gap: 12px; }
.game-editor-card {
  min-width: 0;
  padding: clamp(12px, 2vw, 20px);
  border: 1px solid var(--editor-line);
  border-radius: 14px;
  background: var(--editor-paper);
}
.game-editor-card:focus { outline: none; }
.game-editor-card:focus-visible { outline: 2px solid var(--editor-accent); outline-offset: -2px; }
.game-editor-card > h3, .game-editor-section-heading h3 { margin: 0 0 12px; font-size: 18px; line-height: 1.25; }
.game-editor-section-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 12px; }
.game-editor-section-heading h3 { margin: 0; }
.game-editor .game-editor-fields { --admin-text-size: 15px; --admin-caption-size: 12px; }
.game-editor .editor-section { min-width: 0; gap: 8px; padding: 0; border: 0; }
.game-editor .editor-section h3 { margin: 0; }
.game-editor .game-editor-fields label:not(.upload-zone):not(.checkbox),
.game-editor .game-editor-fields .required-field-label,
.game-editor .game-editor-fields .editor-section h3,
.game-editor .game-editor-fields .publication-status legend { gap: 5px; font-size: 14px; }
.game-editor .game-editor-fields :is(input[type="text"], input[type="url"], textarea, input[type="file"]) {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border-color: #ded8e4;
}
.game-editor .game-editor-fields input[type="file"] { padding: 4px 6px; color: #655c70; font-size: 12px; }
.game-editor .game-editor-fields input::file-selector-button { padding: 4px 8px; margin-inline-end: 6px; }
.game-editor .game-editor-fields :is(input, textarea):focus-visible { outline: 2px solid var(--editor-accent); outline-offset: 1px; }
.game-editor .game-editor-fields textarea { min-height: 76px; resize: vertical; }

.game-editor-basics {
  display: grid;
  grid-template-columns: clamp(138px, 20vw, 164px) minmax(0, 1fr);
  gap: clamp(10px, 2vw, 20px);
}
.game-editor .game-editor-fields label.game-square-cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #ddd1ea;
  border-radius: 12px;
  background: #f5effb;
}
.game-square-cover img { display: block; width: 100%; height: 100%; object-fit: contain; }
.game-square-cover input { position: absolute; inset: 0; height: 100%; opacity: 0; cursor: pointer; }
.game-square-cover:focus-within { outline: 2px solid var(--editor-accent); outline-offset: 2px; }
.game-editor .game-editor-fields label.game-square-cover:hover { border-color: var(--editor-accent); }
.game-square-cover-placeholder { display: grid; justify-items: center; gap: 8px; text-align: center; }
.game-square-cover-plus { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--editor-accent); color: white; }
.game-editor .game-square-cover-placeholder small { font-size: 11px; line-height: 1.3; }
.game-editor-title-fields { display: flex; flex-direction: column; justify-content: space-between; gap: 7px; min-width: 0; }
.game-editor .game-editor-fields .game-editor-title-fields :is(input, textarea) { min-height: 0; padding-block: 4px; line-height: 20px; }
.game-editor .game-editor-fields .game-editor-title-fields textarea { resize: none; }
@media (min-width: 810px) {
  .game-editor .game-editor-fields .game-editor-title-fields :is(input, textarea) { padding-block: 7px; line-height: 22px; }
}
@media (max-width: 360px) {
  .game-editor .game-editor-title-fields .required-field-label { font-size: 13px; }
}
.game-editor-long-description { margin-top: 12px; }

.game-editor-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(max-content, 1fr) minmax(0, .9fr);
  gap: 12px;
  margin-top: 14px;
  border-top: 1px solid var(--editor-line);
  padding-top: 12px;
}
.game-editor-settings .genre-picker > label, .game-editor-settings .publication-status legend { margin-bottom: 5px; }
.game-editor-settings .publication-options { flex-wrap: nowrap; gap: 5px; white-space: nowrap; }
.game-editor .game-editor-settings .genre-trigger,
.game-editor .game-editor-settings .publication-options label { min-height: 36px; padding: 5px 9px; }
.game-editor .game-editor-settings > .checkbox { align-self: start; min-height: 36px; gap: 7px; font-size: 14px; cursor: pointer; }
.game-editor-settings .publication-options input { width: 16px; height: 16px; }
.game-editor-settings > .checkbox input { margin: 0; }
@media (min-width: 521px) {
  .game-editor-settings { position: relative; }
  .game-editor-settings .genre-picker { position: static; }
  .game-editor .game-editor-settings > .checkbox { margin-block-start: calc(1.4em + 5px); }
}
.game-editor .game-editor-fields .source-options button { min-height: 34px; padding-block: 4px; font-size: 14px; }
.game-editor .game-editor-fields .upload-zone { min-height: 96px; padding: 10px; gap: 3px; }
.game-editor .game-editor-fields .upload-zone strong { font-size: 14px; }
.game-editor .game-editor-fields .upload-zone:focus-within { outline: 2px solid var(--editor-accent); }
.game-editor .online-source-status { display: flex; align-items: center; gap: 10px; color: #655c70; font-size: 13px; }
.game-editor .online-source-status .text-button { min-height: 32px; color: var(--editor-accent); }
.game-editor .game-editor-platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.game-editor-platforms h3 { grid-column: 1 / -1; margin-bottom: 4px; }
.game-editor .platform-editor { padding: 0; gap: 7px; min-width: 0; align-content: start; }

.game-editor-materials { margin-top: 12px; }
.game-editor .game-editor-materials h2 { margin: 0 0 10px; font-size: 18px; }
.game-editor .game-editor-materials h2:has(.materials-open[aria-expanded="false"]) { margin-bottom: 0; }
.game-editor-materials .materials-admin { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; }
.game-editor-materials .materials-admin-group { padding: 4px 0; min-width: 0; }
.game-editor-materials .materials-admin-group-heading h3 { margin: 0; font-size: 14px; }
.game-editor-materials .materials-admin-group.materials-admin-row { grid-column: 1 / -1; }
.game-editor-materials-start { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.game-editor-materials-start p { margin: 0; color: #655c70; font-size: 14px; }

.game-editor-actions { border-top: 1px solid var(--editor-line); background: var(--editor-paper); }
.game-editor-actions > .error { margin: 10px var(--editor-inset) 0; }
.game-editor .editor-footer {
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 9px var(--editor-inset) max(9px, env(safe-area-inset-bottom));
}
.game-editor .editor-footer .button, .game-editor-materials-start .button {
  min-height: 40px;
  padding: 7px 15px;
  font-size: 14px;
}
.game-editor .editor-footer > .text-button { min-height: 34px; }

@media (max-width: 520px) {
  .game-editor-header { flex-wrap: wrap; gap: 3px; padding: 8px var(--editor-gutter) 5px; }
  .game-editor .game-editor-header h2 { width: 100%; padding-inline-end: 48px; font-size: 22px; }
  .game-editor .modal-close { top: 6px; }
  .game-editor-header nav { margin-inline-start: -5px; }
  .game-editor-header nav button { min-height: 32px; padding-inline: 8px; font-size: 13px; }
  .game-editor-settings { grid-template-columns: 1fr; }
  .game-editor-materials .materials-admin { grid-template-columns: 1fr; }
  .game-editor .editor-footer > :is(.text-button, .delete-confirm) { margin-bottom: 0; }
}
