.gpc-settings {
  display: block;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(145, 153, 176, .2);
  border-radius: 12px;
  background: rgba(145, 153, 176, .045);
}

.gpc-settings-overview {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid rgba(145, 153, 176, .2);
  border-radius: 8px;
  background: rgba(145, 153, 176, .035);
}

.gpc-settings-preview {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 128px;
  height: 128px;
  flex: 0 0 128px;
  margin: auto;
  aspect-ratio: 1;
  overflow: visible;
}

.gpc-settings-preview-avatar {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  background: rgba(145, 153, 176, .12);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: clip-path .2s ease, border-radius .2s ease;
}

.gpc-settings-preview.is-circle .gpc-settings-preview-avatar {
  border-radius: 50%;
  clip-path: circle(50%);
}

.gpc-settings .gpc-settings-preview-avatar > img {
  display: block;
  box-sizing: border-box;
  width: 100% !important;
  min-width: 100%;
  max-width: none;
  height: 100% !important;
  min-height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
  clip-path: inherit;
}

.gpc-settings-copy {
  min-width: 0;
}

.gpc-settings-copy h3 {
  margin: 0 0 8px;
  color: inherit;
  font-size: 22px;
  font-weight: 700;
}

.gpc-settings-section--cosmetics > p {
  margin: 0 0 12px;
  color: inherit;
  opacity: .72;
  font-size: 13px;
  line-height: 1.5;
}

.gpc-settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.gpc-settings-toggle > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.gpc-settings-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  border-radius: 999px;
  background: #8b90a0;
  transition: background .18s ease;
}

.gpc-settings-switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform .18s ease;
}

.gpc-settings-toggle input:checked + .gpc-settings-switch {
  background: #615dfa;
}

.gpc-settings-toggle input:checked + .gpc-settings-switch::after {
  transform: translateX(16px);
}

.gpc-settings-toggle input:focus-visible + .gpc-settings-switch {
  outline: 2px solid #41efff;
  outline-offset: 3px;
}

.gpc-settings-toggle input:disabled + .gpc-settings-switch {
  opacity: .6;
}

.gpc-settings-section--cosmetics > .gpc-settings-help {
  margin: 9px 0 0;
  font-size: 12px;
}

.gpc-cosmetics {
  margin-top: 18px;
}

.gpc-cosmetics h4 {
  margin: 0 0 5px;
  color: inherit;
  font-size: 14px;
  font-weight: 700;
}

.gpc-cosmetics > p {
  margin: 0 0 11px;
  color: inherit;
  opacity: .72;
  font-size: 12px;
  line-height: 1.45;
}

.gpc-cosmetics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 9px;
}

.gpc-cosmetic-option {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 10px 6px;
  border: 1px solid rgba(145, 153, 176, .2);
  border-radius: 10px;
  background: rgba(145, 153, 176, .035);
  cursor: pointer;
  text-align: center;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.gpc-cosmetic-option:hover,
.gpc-cosmetic-option.is-selected {
  border-color: #615dfa;
  background: rgba(97, 93, 250, .07);
  box-shadow: 0 0 0 2px rgba(97, 93, 250, .08);
}

.gpc-cosmetic-option > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.gpc-cosmetic-option:focus-within {
  outline: 2px solid #615dfa;
  outline-offset: 2px;
}

.gpc-cosmetic-preview {
  position: relative;
  display: block;
  width: 56px;
  height: 56px;
  overflow: hidden;
  background: rgba(145, 153, 176, .12);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.gpc-cosmetic-preview.is-circle {
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
}

.gpc-cosmetic-preview > img:not(.gpc-avatar-cosmetic-frame) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center;
}

.gpc-cosmetic-name {
  width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.gpc-settings-status {
  min-height: 18px;
  margin-top: 5px;
  font-size: 12px;
}

.gpc-settings-status.is-saved {
  color: #239b62;
}

.gpc-settings-status.is-error {
  color: #d44949;
}

.gpc-avatar-circle-marker {
  display: none !important;
}

.gpc-avatar-cosmetic-frame {
  position: absolute !important;
  inset: 0 !important;
  z-index: 8 !important;
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  object-fit: fill !important;
  object-position: center !important;
  pointer-events: none !important;
}

.gpc-settings .gpc-settings-preview > .gpc-avatar-cosmetic-frame {
  inset: auto !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  width: 120% !important;
  height: 120% !important;
  transform: translate(-50%, -50%) !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  clip-path: none !important;
}

/* My Frames adds a decorative layer above the avatar image. Keep it below
   the Achievements rank ring and badge layers. */
.gpc-avatar-cosmetic-frame--myframe {
  z-index: 7 !important;
}

.gpc-avatar-cosmetic-frame--anchor[data-gpc-frame-suppressed="1"] {
  visibility: hidden !important;
}

.gpc-settings-preview:not(.is-circle) > .gpc-avatar-cosmetic-frame {
  visibility: hidden !important;
}

.gpc-avatar-cosmetic-frame--anchor[data-gpc-avatar-aligned="1"]:not([data-gpc-frame-suppressed="1"]) {
  visibility: visible !important;
}

/* Frames are only shown with the circular avatar. In hexagon mode Vikinger's
   native crop remains unobstructed; a selected frame can reappear on circle. */
body.vikinger-theme [data-gpc-avatar-frame-host="1"][data-gpc-avatar-circle="1"] > .gpc-avatar-cosmetic-frame--anchor {
  z-index: 7 !important;
  visibility: visible !important;
}

body.vikinger-theme [data-gpc-avatar-frame-host="1"][data-gpc-avatar-circle="1"] {
  overflow: visible !important;
}

body.vikinger-theme [data-gpc-avatar-frame-host="1"]:not([data-gpc-avatar-circle="1"]) > .gpc-avatar-cosmetic-frame--anchor {
  visibility: hidden !important;
}

.gpc-admin-subnav {
  display: flex;
  flex: 1 0 100%;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(145, 153, 176, .2);
}

.gpc-admin-subnav button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(145, 153, 176, .26);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.gpc-admin-subnav button.is-active {
  border-color: #615dfa;
  background: #615dfa;
  color: #fff;
}

.gpc-settings-copy {
  min-width: 0;
}

.gpc-settings-section--frames {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(145, 153, 176, .2);
}

.gpc-frames {
  --gpc-frame-line: rgba(145, 153, 176, .25);
  --gpc-frame-muted: #6d7183;
  width: 100%;
  color: inherit;
}

.gpc-frames-header,
.gpc-frames-admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.gpc-frames-header h4,
.gpc-frames-admin-header h3 {
  margin: 0 0 5px;
  font-size: 1.05rem;
  font-weight: 750;
}

.gpc-frames-header p,
.gpc-frames-admin-header p {
  margin: 0;
  color: var(--gpc-frame-muted, #6d7183);
  font-size: .88rem;
  line-height: 1.55;
}

.gpc-frames-remove,
.gpc-frame-variant button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #615dfa;
  border-radius: 7px;
  background: #615dfa;
  color: #fff;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}

.gpc-frames-remove:disabled,
.gpc-frame-variant button:disabled {
  border-color: #d8d9e1;
  background: #e9eaf0;
  color: #77798a;
  cursor: not-allowed;
}

.gpc-frames-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 14px;
}

.gpc-frames-filters button {
  padding: 6px 11px;
  border: 1px solid var(--gpc-frame-line);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}

.gpc-frames-filters button.is-active {
  border-color: #615dfa;
  background: rgba(97, 93, 250, .1);
  color: #4945d1;
}

.gpc-frames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 12px;
}

.gpc-frame-pack {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--gpc-frame-line);
  border-radius: 10px;
  background: rgba(145, 153, 176, .035);
}

.gpc-frame-pack.is-selected {
  border-color: rgba(97, 93, 250, .65);
  box-shadow: 0 0 0 2px rgba(97, 93, 250, .1);
}

.gpc-frame-pack-preview {
  position: relative;
  width: 70px;
  height: 70px;
  margin: 0 auto 10px;
  overflow: hidden;
  background: rgba(145, 153, 176, .12);
  clip-path: polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
}

.gpc-frame-pack-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gpc-frame-pack-preview.is-circle {
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
}

.gpc-frame-pack-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.gpc-frame-pack-heading strong { overflow-wrap: anywhere; font-size: .9rem; }
.gpc-frame-pack-heading span { flex: none; color: var(--gpc-frame-muted); font-size: .72rem; }
.gpc-frame-lock { margin: 0 0 8px; color: #b56b18; font-size: .75rem; }
.gpc-frame-variants { display: grid; gap: 7px; }

.gpc-frame-variant {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--gpc-frame-line);
  border-radius: 8px;
  background: #fff;
}

.gpc-frame-variant.is-active { border-color: #615dfa; }
.gpc-frame-variant img { width: 38px; height: 38px; object-fit: contain; }
.gpc-frame-variant-copy { display: grid; gap: 2px; min-width: 0; }
.gpc-frame-variant-copy strong { overflow-wrap: anywhere; font-size: .78rem; }
.gpc-frame-variant-copy small { color: var(--gpc-frame-muted); font-size: .69rem; line-height: 1.3; }
.gpc-frames-status { min-height: 18px; margin: 4px 0 8px; font-size: .78rem; }
.gpc-frames-status.is-error { color: #c3424e; }
.gpc-frames-status.is-saved { color: #238657; }
.gpc-frames-empty { padding: 18px; border: 1px dashed var(--gpc-frame-line); border-radius: 8px; text-align: center; }

.gpc-frames-admin { display: grid; gap: 16px; padding-top: 18px; }
.gpc-frames-admin-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.gpc-frames-admin-stats span { padding: 8px 10px; border: 1px solid #e4e5ed; border-radius: 8px; background: #fafaff; font-size: .78rem; }
.gpc-frames-admin-panel { min-width: 0; padding: 16px; border: 1px solid #e8e8f0; border-radius: 10px; background: #fff; }
.gpc-frames-admin-panel h4 { margin: 0 0 13px; font-size: 1rem; font-weight: 750; }
.gpc-frames-admin-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.gpc-frames-admin-settings { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.gpc-frames-admin-form,.gpc-frames-admin-edit { display: grid; gap: 11px; }
.gpc-frames-admin-form label,.gpc-frames-admin-edit label,.gpc-frames-admin-settings label { display: grid; gap: 5px; min-width: 0; color: #44465d; font-size: .8rem; font-weight: 650; }
.gpc-frames-admin-form input:not([type=checkbox]),.gpc-frames-admin-form select,.gpc-frames-admin-form textarea,.gpc-frames-admin-edit input:not([type=checkbox]),.gpc-frames-admin-edit select,.gpc-frames-admin-settings select { box-sizing: border-box; width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid #d9dbe7; border-radius: 7px; background: #fff; color: #23243a; }
.gpc-frames-admin-form textarea { resize: vertical; }
.gpc-frames-admin-form small { color: #77798a; font-size: .72rem; font-weight: 400; }
.gpc-frame-upload-summary { display: grid; gap: 8px; padding: 10px; border: 1px dashed #cfd1df; border-radius: 8px; background: #fafaff; color: #4a4c62; font-size: .76rem; }
.gpc-frame-upload-summary[hidden] { display: none !important; }
.gpc-frame-upload-summary [data-gpc-frame-upload-list] { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 6px; }
.gpc-frame-upload-file { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 5px; border: 1px solid #e8e8f0; border-radius: 7px; background: #fff; }
.gpc-frame-upload-file img { flex: 0 0 30px; width: 30px; height: 30px; object-fit: contain; }
.gpc-frame-upload-file span { overflow: hidden; color: #55566c; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.gpc-frames-admin-form-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 10px; }
.gpc-frames-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; justify-content: start; gap: 7px !important; }
.gpc-frames-admin-inventory-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 13px; }
.gpc-frames-admin-inventory-heading h4 { margin: 0; }
.gpc-frames-admin-filters { display: inline-flex; flex-wrap: wrap; gap: 5px; padding: 4px; border: 1px solid #e5e5ef; border-radius: 9px; background: #f7f7fb; }
.gpc-frames-admin-filters button { min-height: 34px; padding: 7px 11px; border: 0; border-radius: 7px; background: transparent; color: #5e6074; font-size: .76rem; font-weight: 700; cursor: pointer; }
.gpc-frames-admin-filters button.is-active { background: #fff; color: #514dcc; box-shadow: 0 1px 4px rgba(35,36,58,.12); }
.gpc-frames-admin-inventory { display: grid; grid-template-columns: repeat(auto-fill,minmax(235px,1fr)); align-items: start; gap: 12px; }
.gpc-frames-admin-pack { min-width: 0; padding: 12px; border: 1px solid #e7e8ef; border-radius: 10px; background: #fff; }
.gpc-frames-admin-pack>header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.gpc-frames-admin-pack>header div { display: grid; gap: 4px; }
.gpc-frames-admin-pack>header span { color: #77798a; font-size: .72rem; }
.gpc-frames-admin-pack-cover { display: grid; grid-template-columns: 66px minmax(0,1fr) auto; align-items: center; gap: 11px; width: 100%; min-height: 84px; padding: 9px; border: 1px solid #e8e8f0; border-radius: 9px; background: #fafaff; color: #23243a; text-align: left; cursor: pointer; }
.gpc-frames-admin-pack-cover:hover,.gpc-frames-admin-pack-cover:focus-visible { border-color: #b9b7ff; background: #f5f4ff; outline: none; }
.gpc-frames-admin-pack-cover>img { display: block; width: 66px; height: 66px; object-fit: contain; border-radius: 7px; background: #fff; }
.gpc-frames-admin-pack-cover>span:nth-child(2) { display: grid; gap: 5px; }
.gpc-frames-admin-pack-cover strong { font-size: .82rem; }
.gpc-frames-admin-pack-cover small { color: #77798a; font-size: .7rem; line-height: 1.4; }
.gpc-frames-admin-pack-cover-arrow { color: #615dfa; font-size: 1.2rem; }
.gpc-frames-admin-pack-editor { margin: 8px 0 12px; padding: 10px; border: 1px solid #e8e8f0; border-radius: 8px; background: #fcfcff; }
.gpc-frames-admin-pack-editor>summary { cursor: pointer; color: #514dcc; font-size: .8rem; font-weight: 750; }
.gpc-frames-admin-pack-editor>p { margin: 8px 0 0; color: #77798a; font-size: .73rem; }
.gpc-frames-admin-pack-edit { margin-top: 10px; }
.gpc-frames-admin-pack-variant-edits { display: grid; gap: 8px; }
.gpc-frames-admin-pack-variant-edit { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 10px; padding: 8px; border: 1px solid #e8e8f0; border-radius: 8px; background: #fff; }
.gpc-frames-admin-pack-variant-edit>img { width: 48px; height: 48px; object-fit: contain; }
.gpc-frames-admin-pack-variant-edit>div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; min-width: 0; }
.gpc-frames-admin-pack-variant-edit label { display: grid; gap: 5px; min-width: 0; color: #44465d; font-size: .75rem; font-weight: 650; }
.gpc-frames-admin-pack-variant-edit input:not([type=file]) { box-sizing: border-box; width: 100%; min-height: 36px; padding: 6px 8px; border: 1px solid #d9dbe7; border-radius: 7px; background: #fff; color: #23243a; }
.gpc-frames-admin-pack-variant-edit input[type=file] { width: 100%; min-width: 0; color: #55566c; font-size: .68rem; }
.gpc-frames-admin-pack-actions { display: flex !important; flex-direction: row; align-items: center; gap: 7px; }
.gpc-frames-admin-modal { box-sizing: border-box; width: min(1120px,calc(100vw - 28px)); max-width: none; max-height: min(88vh,900px); padding: 0; overflow: hidden; border: 1px solid #dedfeb; border-radius: 14px; background: #fff; color: #23243a; box-shadow: 0 24px 80px rgba(23,24,43,.3); }
.gpc-frames-admin-modal::backdrop { background: rgba(18,19,36,.62); backdrop-filter: blur(3px); }
.gpc-frames-admin-modal[open] { display: block; }
.gpc-frames-admin-modal-shell { display: grid; grid-template-rows: auto minmax(0,1fr); max-height: min(88vh,900px); }
.gpc-frames-admin-modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid #e8e8f0; background: #fff; }
.gpc-frames-admin-modal-header h5 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 750; }
.gpc-frames-admin-modal-header p { margin: 0; color: #77798a; font-size: .78rem; }
.gpc-frames-admin-modal-close { flex: 0 0 36px; width: 36px; height: 36px; border: 0; border-radius: 9px; background: #f0f0f6; color: #414258; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.gpc-frames-admin-modal-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(245px,1fr)); align-content: start; gap: 13px; padding: 16px 20px 20px; overflow: auto; }
.gpc-frames-admin-modal-variant { min-width: 0; padding: 10px; border: 1px solid #e7e8ef; border-radius: 10px; background: #fff; }
.gpc-frames-admin-modal-variant>img { display: block; width: 100%; height: 170px; object-fit: contain; border-radius: 8px; background: #f8f8fc; }
.gpc-frames-admin-modal-variant-meta { display: grid; gap: 4px; min-width: 0; padding: 10px 2px 8px; }
.gpc-frames-admin-modal-variant-meta strong { overflow-wrap: anywhere; font-size: .86rem; }
.gpc-frames-admin-modal-variant-meta small { color: #77798a; font-size: .7rem; }
.gpc-frames-admin-modal-variant>details { padding-top: 8px; border-top: 1px solid #eeeef4; }
.gpc-frames-admin-modal-variant>details>summary { cursor: pointer; color: #514dcc; font-size: .78rem; font-weight: 700; }
.gpc-frames-admin-modal-variant-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.gpc-frames-admin-modal-variant-actions form { margin: 0; }
.gpc-frames-admin-edit { margin-top: 10px; padding: 12px; border-radius: 8px; background: #f8f8fc; }
.gpc-frames-admin-grants { display: grid; gap: 7px; }
.gpc-frames-admin-grants>div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid #ececf2; border-radius: 8px; font-size: .8rem; }
.gpc-frames-admin-grants form,.gpc-frames-admin-pack form { margin: 0; }

@media (max-width: 740px) {
  .gpc-frames-admin-columns { grid-template-columns: 1fr; }
  .gpc-frames-header,.gpc-frames-admin-header { flex-direction: column; }
}

@media (max-width: 520px) {
  .gpc-frame-variant { grid-template-columns: 34px minmax(0,1fr); }
  .gpc-frame-variant img { width: 34px; height: 34px; }
  .gpc-frame-variant button { grid-column: 1/-1; }
  .gpc-frames-admin-modal { width: calc(100vw - 18px); max-height: 94vh; border-radius: 11px; }
  .gpc-frames-admin-modal-shell { max-height: 94vh; }
  .gpc-frames-admin-modal-header { padding: 14px; }
  .gpc-frames-admin-modal-grid { grid-template-columns: 1fr; padding: 12px; }
  .gpc-frames-admin-modal-variant>img { height: 145px; }
  .gpc-frames-admin-pack-variant-edit>div { grid-template-columns: 1fr; }
  .gpc-frames-admin-grants>div { align-items: flex-start; flex-direction: column; }
}

/* Keep Vikinger's original positioning for post and profile avatar links. */
body.vikinger-theme .post .vikinger-post-user-status > .vikinger-post-avatar-link[data-gpc-avatar-frame-host="1"] {
  position: absolute !important;
}

body.vikinger-theme [data-gpc-avatar-frame-host="1"]:not([data-gpc-avatar-circle="1"]) > .gpc-avatar-cosmetic-frame--anchor {
  visibility: hidden !important;
}

/* The plugin only opts a specific user into the circle. All other Vikinger
   avatar boxes retain their original hexagon mask. */
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-124-136,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-100-110,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-82-90,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-24-26,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-30-32,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-18-20,
body.vikinger-theme .hexagon-image-124-136:has(> .gpc-avatar-circle-marker[data-active="1"]),
body.vikinger-theme .hexagon-image-100-110:has(> .gpc-avatar-circle-marker[data-active="1"]),
body.vikinger-theme .hexagon-image-82-90:has(> .gpc-avatar-circle-marker[data-active="1"]),
body.vikinger-theme .hexagon-image-24-26:has(> .gpc-avatar-circle-marker[data-active="1"]),
body.vikinger-theme .hexagon-image-30-32:has(> .gpc-avatar-circle-marker[data-active="1"]),
body.vikinger-theme .hexagon-image-18-20:has(> .gpc-avatar-circle-marker[data-active="1"]) {
  top: 0 !important;
  left: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  border-radius: 50% !important;
  background-color: transparent !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  clip-path: circle(50% at 50% 50%) !important;
  transform: none !important;
}

body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-124-136,
body.vikinger-theme .hexagon-image-124-136:has(> .gpc-avatar-circle-marker[data-active="1"]) {
  width: 124px !important;
  height: 124px !important;
  margin-top: 6px !important;
}

body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-124-136 {
  margin-top: 6px !important;
}

body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-100-110,
body.vikinger-theme .hexagon-image-100-110:has(> .gpc-avatar-circle-marker[data-active="1"]) {
  width: 100px !important;
  height: 100px !important;
  margin-top: 5px !important;
}

body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-100-110 {
  margin-top: 5px !important;
}

body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-82-90,
body.vikinger-theme .hexagon-image-82-90:has(> .gpc-avatar-circle-marker[data-active="1"]) {
  width: 82px !important;
  height: 82px !important;
  margin-top: 4px !important;
}

body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-82-90 {
  margin-top: 4px !important;
}

body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-30-32,
body.vikinger-theme .hexagon-image-30-32:has(> .gpc-avatar-circle-marker[data-active="1"]) {
  width: 30px !important;
  height: 30px !important;
  margin-top: 1px !important;
}

body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-30-32 {
  margin-top: 1px !important;
}

body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-24-26,
body.vikinger-theme .hexagon-image-24-26:has(> .gpc-avatar-circle-marker[data-active="1"]) {
  width: 24px !important;
  height: 24px !important;
  margin-top: 1px !important;
}

body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-24-26 {
  margin-top: 1px !important;
}

body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-18-20,
body.vikinger-theme .hexagon-image-18-20:has(> .gpc-avatar-circle-marker[data-active="1"]) {
  width: 18px !important;
  height: 18px !important;
  margin-top: 1px !important;
}

body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-18-20 {
  margin-top: 1px !important;
}

/* Keep scaled frames outside the Vikinger link box while JavaScript positions
   them around the rendered avatar image. */
body.vikinger-theme [data-gpc-avatar-frame-host="1"] > .gpc-avatar-cosmetic-frame--anchor {
  inset: auto !important;
  top: var(--gpc-avatar-frame-top, 0px) !important;
  right: auto !important;
  bottom: auto !important;
  left: var(--gpc-avatar-frame-left, 0px) !important;
  width: var(--gpc-avatar-frame-width, 100%) !important;
  height: var(--gpc-avatar-frame-height, 100%) !important;
  object-fit: fill !important;
}
/* Feed post and comment avatars have a 40x44px host box. Fill that space
   cleanly when the owner has selected the circular avatar. */
body.vikinger-theme .post .vikinger-post-avatar-link[data-gpc-avatar-circle="1"] .user-avatar-content,
body.vikinger-theme .vikinger-comment-avatar-picture[data-gpc-avatar-circle="1"] .user-avatar-content {
  top: 2px !important;
  left: 0 !important;
}

body.vikinger-theme .post .vikinger-post-avatar-link[data-gpc-avatar-circle="1"] .hexagon-image-30-32,
body.vikinger-theme .vikinger-comment-avatar-picture[data-gpc-avatar-circle="1"] .hexagon-image-30-32 {
  width: 40px !important;
  height: 40px !important;
  margin-top: 0 !important;
}

body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-124-136 > .vikinger-hexagon-image-element,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-100-110 > .vikinger-hexagon-image-element,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-82-90 > .vikinger-hexagon-image-element,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-24-26 > .vikinger-hexagon-image-element,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-30-32 > .vikinger-hexagon-image-element,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-image-18-20 > .vikinger-hexagon-image-element,
body.vikinger-theme .hexagon-image-124-136:has(> .gpc-avatar-circle-marker[data-active="1"]) > .vikinger-hexagon-image-element,
body.vikinger-theme .hexagon-image-100-110:has(> .gpc-avatar-circle-marker[data-active="1"]) > .vikinger-hexagon-image-element,
body.vikinger-theme .hexagon-image-82-90:has(> .gpc-avatar-circle-marker[data-active="1"]) > .vikinger-hexagon-image-element,
body.vikinger-theme .hexagon-image-24-26:has(> .gpc-avatar-circle-marker[data-active="1"]) > .vikinger-hexagon-image-element,
body.vikinger-theme .hexagon-image-30-32:has(> .gpc-avatar-circle-marker[data-active="1"]) > .vikinger-hexagon-image-element,
body.vikinger-theme .hexagon-image-18-20:has(> .gpc-avatar-circle-marker[data-active="1"]) > .vikinger-hexagon-image-element {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  clip-path: circle(50% at 50% 50%) !important;
}

body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-progress-40-44,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-border-40-44,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-progress-100-110,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-border-100-110,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-progress-124-136,
body.vikinger-theme [data-gpc-avatar-circle="1"] .hexagon-border-124-136,
body.vikinger-theme [data-gpc-avatar-circle="1"] .gsa-avatar-level-ring,
body.vikinger-theme .profile-avatar-wrapper:has(.gpc-avatar-circle-marker[data-active="1"]) .user-avatar-border,
body.vikinger-theme .profile-avatar-wrapper:has(.gpc-avatar-circle-marker[data-active="1"]) .user-avatar-progress,
body.vikinger-theme .profile-avatar-wrapper:has(.gpc-avatar-circle-marker[data-active="1"]) .user-avatar-progress-border,
body.vikinger-theme .profile-avatar-wrapper:has(.gpc-avatar-circle-marker[data-active="1"]) .gsa-avatar-level-ring,
body.vikinger-theme [data-gpc-avatar-circle="1"] .user-avatar-progress,
body.vikinger-theme [data-gpc-avatar-circle="1"] .user-avatar-progress-border {
  display: none !important;
}

body.vikinger-theme .user-avatar:has(.gpc-avatar-circle-marker[data-active="1"]) .user-avatar-border,
body.vikinger-theme .user-avatar:has(.gpc-avatar-circle-marker[data-active="1"]) .user-avatar-progress,
body.vikinger-theme .user-avatar:has(.gpc-avatar-circle-marker[data-active="1"]) .user-avatar-progress-border,
body.vikinger-theme .user-avatar:has(.gpc-avatar-circle-marker[data-active="1"]) .gsa-avatar-level-ring {
  display: none !important;
}

body.vikinger-theme .vikinger-profile-page .profile-avatar-wrapper:has(.gpc-avatar-circle-marker[data-active="1"]) .vikinger-profile-avatar-image {
  top: 20px !important;
  left: 12px !important;
  width: 124px !important;
  height: 124px !important;
  border-radius: 50% !important;
  clip-path: circle(50% at 50% 50%) !important;
}

body.vikinger-theme .vikinger-profile-page .profile-avatar-wrapper:has(.gpc-avatar-circle-marker[data-active="1"]) .user-avatar-content {
  top: 20px !important;
  left: 12px !important;
  width: 124px !important;
  height: 124px !important;
}

body.vikinger-theme .vikinger-profile-page .profile-avatar-wrapper:has(.gpc-avatar-circle-marker[data-active="1"]) .hexagon-image-100-110 {
  width: 124px !important;
  height: 124px !important;
  margin-top: 0 !important;
}

body.vikinger-theme .vikinger-profile-page .profile-avatar-wrapper:has(.gpc-avatar-circle-marker[data-active="1"]) .hexagon-148-164 {
  display: none !important;
}

body.vikinger-theme .vikinger-profile-page .user-short-description-avatar-mobile:has(.gpc-avatar-circle-marker[data-active="1"]) .user-avatar-content {
  top: 16px !important;
  left: 10px !important;
  width: 100px !important;
  height: 100px !important;
}

body.vikinger-theme .vikinger-profile-page .user-short-description-avatar-mobile:has(.gpc-avatar-circle-marker[data-active="1"]) .hexagon-image-82-90 {
  width: 100px !important;
  height: 100px !important;
  margin-top: 0 !important;
}

/* The create-post publisher uses a 44px span instead of Vikinger's avatar
   link. Keep the frame anchored to that avatar and let it extend outside. */
body.vikinger-theme .gsa-publisher-avatar-host[data-gpc-avatar-frame-host="1"] {
  overflow: visible !important;
}

body.vikinger-theme .gsa-publisher-avatar-host[data-gpc-avatar-frame-host="1"] > .gpc-avatar-cosmetic-frame--anchor {
  z-index: 7 !important;
}

@media (max-width: 600px) {
  .gpc-settings {
    padding: 14px;
  }
  .gpc-settings-overview {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
    text-align: center;
  }
  .gpc-settings-preview {
    width: 116px;
    height: 116px;
    flex-basis: 116px;
  }
  .gpc-cosmetics-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  }
}

/* HarmonyDrop-style MyFrames pack picker */
.gpc-frames-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.gpc-frame-pack {
  position: relative;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.gpc-frame-pack.has-variants { cursor: pointer; }
.gpc-frame-pack:hover { transform: translateY(-2px); border-color: var(--main-color, #615dfa); box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
.gpc-frame-pack.is-selected { border-color: var(--main-color, #615dfa); box-shadow: 0 0 0 2px rgba(97, 93, 250, .18); }
.gpc-frame-pack:focus-visible { outline: 2px solid var(--main-color, #615dfa); outline-offset: 2px; }

.gpc-frame-pack-preview {
  width: 86px;
  height: 86px;
  margin-bottom: 12px;
  overflow: visible;
  clip-path: none;
}

.gpc-frame-pack-preview img:first-child {
  border-radius: 50%;
  object-fit: cover;
}

.gpc-frame-pack-preview img:nth-child(2) {
  inset: auto;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  max-width: none;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: transform, filter, opacity;
}

.gpc-frame-pack-mark { position: absolute; right: -8px; bottom: -8px; z-index: 1; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--main-color, #615dfa); color: #fff; box-shadow: 0 8px 18px rgba(0, 0, 0, .28); }
.gpc-frame-pack-mark svg { width: 17px; height: 17px; }
.gpc-frame-pack:hover .gpc-frame-pack-preview img:nth-child(2) { animation: gpcFrameHover .55s cubic-bezier(.2, .8, .2, 1); }
.gpc-frame-pack-preview.is-circle { border-radius: 50%; }

.gpc-frame-pack-heading {
  display: block;
  min-height: 42px;
  margin-bottom: 0;
  text-align: center;
}

.gpc-frame-pack-heading strong { display: block; font-size: 14px; line-height: 1.25; }
.gpc-frame-pack-heading span { display: inline-block; margin-top: 5px; padding: 2px 7px; border-radius: 999px; background: var(--main-color, #615dfa); color: #fff; font-size: 11px; font-weight: 700; }
.gpc-frame-lock { margin-top: 10px; text-align: center; }

.gpc-frame-pack-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  margin-top: 12px;
  padding: 7px 11px;
  border: 1px solid var(--main-color, #615dfa);
  border-radius: 7px;
  background: var(--main-color, #615dfa);
  color: #fff;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter .18s ease, transform .18s ease;
}

.gpc-frame-pack-open:hover { filter: brightness(1.08); transform: translateY(-1px); }
.gpc-frame-variants[hidden], .gpc-frame-variant[hidden] { display: none !important; }

.gpc-frames-modal {
  position: fixed;
  z-index: 1090;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gpc-frames-modal.is-open { display: flex; animation: gpcFrameModalFade .16s ease-out; }
.gpc-frames-modal-backdrop { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: inherit; background: rgba(0, 0, 0, .72); }
.gpc-frames-modal-panel { position: relative; z-index: 1; width: min(860px, 100%); max-height: min(90vh, 900px); overflow: auto; border: 1px solid rgba(255, 255, 255, .1); border-radius: 8px; background: #18191d; color: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); outline: none; }
.gpc-frames-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.gpc-frames-modal-header h2 { margin: 0; color: inherit; font-size: 1.15rem; font-weight: 750; line-height: 1.3; }
.gpc-frames-modal-close { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 7px; background: rgba(255, 255, 255, .06); color: inherit; font: inherit; font-size: 25px; line-height: 1; cursor: pointer; }
.gpc-frames-modal-close:hover, .gpc-frames-modal-close:focus-visible { border-color: var(--main-color, #615dfa); background: rgba(255, 255, 255, .12); outline: none; }
.gpc-frames-modal-body { padding: 18px 20px 22px; }
.gpc-frames-modal-preview { position: relative; width: 132px; height: 132px; margin: 0 auto 18px; }
.gpc-frames-modal-avatar { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.gpc-frames-modal-frame { position: absolute; top: 50%; left: 50%; width: 120%; height: 120%; max-width: none; object-fit: contain; object-position: center; pointer-events: none; transform: translate(-50%, -50%); }
.gpc-frames-modal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }

.gpc-frame-modal-option {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, opacity .18s ease;
}

.gpc-frame-modal-option:hover, .gpc-frame-modal-option.is-active { border-color: var(--main-color, #615dfa); transform: translateY(-1px); }
.gpc-frame-modal-option:focus-visible { outline: 2px solid var(--main-color, #615dfa); outline-offset: 2px; }
.gpc-frame-modal-option:hover .gpc-frame-modal-option-preview img:last-child { animation: gpcFrameHover .55s cubic-bezier(.2, .8, .2, 1); }
.gpc-frame-modal-option.is-locked { opacity: .65; }
.gpc-frame-modal-option-preview { position: relative; display: block; width: 70px; height: 70px; margin: 0 auto 8px; }
.gpc-frame-modal-option-preview img:first-child { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.gpc-frame-modal-option-preview img:last-child { position: absolute; top: 50%; left: 50%; width: 120%; height: 120%; max-width: none; object-fit: contain; object-position: center; transform: translate(-50%, -50%); }
.gpc-frame-modal-option strong { display: block; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.gpc-frame-modal-option em { display: inline-block; margin-top: 5px; color: var(--main-color, #8f8bff); font-size: 11px; font-style: normal; font-weight: 700; line-height: 1.3; }
.gpc-frame-modal-option.is-locked em { color: #d6a86d; }
.gpc-frames-modal-open { overflow: hidden; }

html.day-mode .gpc-frame-pack,
body.vikinger-theme:not(.night-mode) .gpc-frame-pack { background: #fff; border-color: rgba(0, 0, 0, .08); }
html.day-mode .gpc-frame-pack.is-selected,
body.vikinger-theme:not(.night-mode) .gpc-frame-pack.is-selected { border-color: var(--main-color, #615dfa); }
html.day-mode .gpc-frame-pack:hover,
body.vikinger-theme:not(.night-mode) .gpc-frame-pack:hover { border-color: var(--main-color, #615dfa); }
html.day-mode .gpc-frames-modal-panel,
body.vikinger-theme:not(.night-mode) .gpc-frames-modal-panel { background: #fff; color: #111; border-color: rgba(0, 0, 0, .08); }
html.day-mode .gpc-frames-modal-header,
body.vikinger-theme:not(.night-mode) .gpc-frames-modal-header { border-color: rgba(0, 0, 0, .08); }
html.day-mode .gpc-frames-modal-close,
body.vikinger-theme:not(.night-mode) .gpc-frames-modal-close { border-color: rgba(0, 0, 0, .12); background: #f5f6f8; color: #222; }
html.day-mode .gpc-frame-modal-option,
body.vikinger-theme:not(.night-mode) .gpc-frame-modal-option { background: #fff; color: #111; border-color: rgba(0, 0, 0, .1); }

@keyframes gpcFrameModalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gpcFrameHover {
  0% { transform: translate(-50%, -50%) scale(.96) rotate(-1deg); filter: brightness(1); }
  45% { transform: translate(-50%, -50%) scale(1.08) rotate(1deg); filter: brightness(1.18) drop-shadow(0 0 12px rgba(255, 255, 255, .28)); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0); filter: brightness(1); }
}

@media (max-width: 600px) {
  .gpc-frames-modal { padding: 12px; }
  .gpc-frames-modal-backdrop { padding: inherit; }
  .gpc-frames-modal-panel { max-height: 94vh; }
  .gpc-frames-modal-header { padding: 13px 15px; }
  .gpc-frames-modal-body { padding: 15px; }
  .gpc-frames-modal-preview { width: 116px; height: 116px; }
  .gpc-frames-modal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .gpc-frame-modal-option { padding: 9px; }
}
