body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #101218;
  color: #eef2ff;
}

.container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.profile-top-container {
  position: sticky;
  top: 0;
  z-index: 220;
  margin-bottom: 1rem;
  background: #101218;
  border: 1px solid #2f3a52;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}

.public-profile-flow .profile-top-container {
  position: static;
  top: auto;
  z-index: auto;
}

.image-lightbox-actions-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.image-lightbox-delete {
  margin-left: 0;
}

.profile-sticky-header {
  position: static;
  top: auto;
  z-index: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  margin-bottom: 0.75rem;
  padding-bottom: 0;
}

.profile-sticky-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.sticky-logout-btn {
  margin-top: 0;
  margin-left: auto;
}

.sticky-preview {
  position: static;
  top: auto;
  z-index: auto;
  margin-top: 0.75rem;
  margin-bottom: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.profile-sticky-header h1 {
  margin-bottom: 0.25rem;
}

.profile-sticky-header p {
  margin: 0;
}

h1, h2 {
  margin-top: 0;
}

.card {
  background: #1a2030;
  border: 1px solid #2f3a52;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.text-font-container {
  background: #151b29;
  border: 1px solid #3a4865;
}

.upload-container {
  background: #151b29;
  border: 1px solid #3a4865;
}

.border-settings-container {
  background: #141a28;
  border: 1px solid #425275;
}

.profile-active-container,
.profile-showcase-container,
.profile-bio-container,
.profile-pictures-container {
  background: #141a28;
  border: 1px solid #3a4865;
}

.profile-badges-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0.65rem;
}

.profile-badge-preview-cell {
  border: 1px solid #3a4865;
  border-radius: 8px;
  background: #121826;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aa0a6;
  font-size: 0.82rem;
  padding: 6px;
}

.profile-badge-preview-cell img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
}

.profile-picture-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-picture-input-grid .input-half-short {
  width: 100%;
}

.profile-picture-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-picture-tile {
  border: 1px solid #3a4865;
  border-radius: 10px;
  background: #121826;
  height: 220px;
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}

.profile-picture-tile img,
.profile-picture-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-picture-tile.empty {
  cursor: default;
  color: #8f9ab5;
  font-size: 0.82rem;
}

.profile-picture-tile-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-bg-preview-wrap {
  margin-top: 0.65rem;
  width: 260px;
  height: 140px;
  border: 1px solid #3a4865;
  border-radius: 8px;
  overflow: hidden;
  background: #121826;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-bg-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-bg-preview-empty {
  color: #9aa0a6;
  font-size: 0.82rem;
  padding: 0.5rem;
  text-align: center;
}

.picture-delete-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  margin-bottom: 0;
  color: #ffd1d1;
  font-size: 0.82rem;
  user-select: none;
}

.picture-delete-toggle input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.badge-picker-content {
  width: min(1080px, 97vw);
}

.badge-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 65vh;
  overflow-y: auto;
  padding: 4px;
}

.badge-picker-item {
  border: 1px solid #3a4865;
  border-radius: 10px;
  background: #0f1320;
  color: #e8eeff;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  min-height: 170px;
}

.badge-picker-item:hover {
  border-color: #5b74a8;
  background: #151c2d;
}

.badge-picker-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.badge-picker-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

.badge-picker-name {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

.badge-picker-meta {
  font-size: 0.74rem;
  color: #9fb0d8;
}

.image-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.image-lightbox-content {
  width: min(900px, 95vw);
  max-height: 95vh;
  background: #111827;
  border: 1px solid #3a4865;
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.image-lightbox-content img {
  width: 100%;
  max-height: calc(95vh - 90px);
  object-fit: contain;
  border-radius: 8px;
}

.image-lightbox-close {
  align-self: flex-end;
  margin-top: 0;
}

.border-settings-subcontainer {
  background: #151d2d;
  border: 1px solid #3a4865;
}

.text-settings-subcontainer {
  background: #141a28;
  border: 1px solid #3a4865;
}

label {
  display: block;
  margin-top: 0.6rem;
  margin-bottom: 0.2rem;
}

.field-help {
  margin: 0.25rem 0 0.6rem 0;
  color: #9aa0a6;
  font-size: 0.85rem;
}

h3 {
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  color: #d7e3ff;
  font-size: 1rem;
}

.level-requirement-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45rem;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  border: 1px solid #7b5d19;
  background: #2f2611;
  color: #ffd76a;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.palette-panel {
  margin-top: 0.7rem;
  padding: 0.65rem;
  border: 1px dashed #3a4c6f;
  border-radius: 8px;
  background: #121826;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-width: 420px;
}

.palette-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 220px;
}

.palette-color-input {
  width: 100%;
  height: 38px;
  padding: 2px;
  border-radius: 6px;
  border: 1px solid #34415f;
  background: #0f1320;
}

input, textarea {
  width: 100%;
  background: #0f1320;
  color: #e8eeff;
  border: 1px solid #34415f;
  border-radius: 6px;
  padding: 0.6rem;
}

textarea {
  min-height: 90px;
}

.profile-bio-container textarea {
  width: 85%;
}

.btn {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.6rem 1rem;
  background: #4f7cff;
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 7px;
  cursor: pointer;
}

.btn.secondary {
  background: #586174;
}

.section-btn {
  background: #4f7cff !important;
}

.actions .btn {
  margin-right: 0.5rem;
}

.input-short {
  width: 320px;
  max-width: 100%;
}

.description-short {
  width: calc(100% - 30px);
}

.input-half-short {
  width: 50%;
  max-width: 100%;
}

.form-actions-bottom {
  margin-top: 1rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

select {
  width: 100%;
  background: #0f1320;
  color: #e8eeff;
  border: 1px solid #34415f;
  border-radius: 6px;
  padding: 0.6rem;
}

.color-picker-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-picker-group .color-input {
  width: 44px;
  min-width: 44px;
  height: 38px;
  padding: 2px;
  border-radius: 6px;
}

.color-picker-group .color-text-input {
  width: calc(100% - 52px);
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 6px;
}

.swatch {
  border: 1px solid #34415f;
  border-radius: 6px;
  height: 26px;
  cursor: pointer;
  padding: 0;
}

.swatch-transparent {
  background: repeating-linear-gradient(
    45deg,
    #2a3145 0,
    #2a3145 6px,
    #111726 6px,
    #111726 12px
  );
  color: #c8d3ff;
  font-size: 11px;
  line-height: 24px;
  text-align: center;
}

.crop-open-btn {
  margin-left: 0.5rem;
}

.hidden {
  display: none !important;
}

.crop-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.crop-modal-content {
  width: min(860px, 96vw);
  background: #1a2030;
  border: 1px solid #2f3a52;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.crop-stage-wrap {
  position: relative;
  width: 700px;
  max-width: 100%;
  margin: 0 auto;
}

#crop_canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid #34415f;
  cursor: grab;
}

#crop_canvas:active {
  cursor: grabbing;
}

.crop-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 2px dashed #ffffff;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.2);
  pointer-events: none;
  border-radius: 10px;
}

.crop-frame.circle {
  border-radius: 999px;
}

.crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.text-style-row {
  position: relative;
  margin-top: 0.8rem;
  padding: 0.65rem;
  border: 1px solid #34415f;
  border-radius: 8px;
  background: #121826;
}

.field-inline-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

.field-inline-row .inline-main-input {
  width: 50%;
  min-width: 260px;
  margin: 0;
}

.field-inline-row .inline-actions {
  margin-left: 0.2rem;
}

.text-style-title {
  display: inline-block;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.text-style-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.style-btn {
  background: #22304d;
  color: #dce7ff;
  border: 1px solid #3e5580;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.style-btn:hover {
  background: #2b3d62;
}

.style-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 260px;
  z-index: 40;
  background: #1b2438;
  border: 1px solid #3a4c6f;
  border-radius: 8px;
  padding: 0.6rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.style-panel label {
  margin-top: 0.25rem;
}

.style-color-input,
.style-select-input {
  width: 100%;
}

.bg-opacity-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.bg-opacity-input {
  width: calc(100% - 54px);
  margin: 0.35rem 0 0.5rem 0;
}

.bg-opacity-percent {
  min-width: 46px;
  text-align: right;
  font-size: 0.8rem;
  color: #c8d3ea;
}

.bg-preview {
  border: 1px solid #3e4d6a;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  color: #eef2ff;
  background: rgba(0, 0, 0, 0.4);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  cursor: pointer;
  user-select: none;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.toggle-slider {
  position: relative;
  width: 46px;
  height: 24px;
  border-radius: 999px;
  background: #3a4356;
  border: 1px solid #55607a;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d9e3ff;
  transition: transform 0.2s ease, background 0.2s ease;
}

.toggle-input:checked + .toggle-slider {
  background: #2d7cff;
  border-color: #2d7cff;
}

.toggle-input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: #ffffff;
}

.toggle-text {
  color: #e8eeff;
}

.emote-preview {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  color: #cfd8f5;
}

.emote-picker {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.emote-picker-btn {
  width: 100%;
  text-align: left;
  background: #0f1320;
  color: #e8eeff;
  border: 1px solid #34415f;
  border-radius: 6px;
  padding: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.emote-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 80;
  background: #121826;
  border: 1px solid #34415f;
  border-radius: 8px;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  padding: 0.35rem;
}

.emote-picker-group-title {
  color: #9fb0d8;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0.3rem 0.35rem;
}

.emote-picker-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #e8eeff;
  text-align: left;
  padding: 0.4rem 0.45rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.emote-picker-item:hover {
  background: #1f2a44;
}

.emote-token-preview img {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.2em;
}

.badge-selector-container {
  background: #141a28;
  border: 1px solid #3a4865;
}

.badge-slot-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0.65rem;
}

.badge-slot-item {
  border: 1px solid #3a4865;
  border-radius: 8px;
  padding: 0.55rem;
  background: #121826;
}

.badge-slot-item.locked {
  opacity: 0.8;
  border-color: #4c566f;
}

.badge-slot-select {
  width: 100%;
  margin-top: 0.25rem;
}

.badge-slot-lock {
  margin-top: 0.35rem;
  color: #ffcc7a;
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 900px) {
  .badge-slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-badges-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-picture-input-grid,
  .profile-picture-grid {
    grid-template-columns: 1fr;
  }
}

.admin-awards-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.admin-awards-col {
  background: #151d2d;
  border: 1px solid #3a4865;
  border-radius: 10px;
  padding: 0.8rem;
}

.admin-awards-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-awards-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 0.5rem;
}

.admin-awards-catalog-item {
  border: 1px solid #3a4865;
  border-radius: 8px;
  background: #111827;
  color: #e8eeff;
  padding: 8px;
  text-align: center;
}

button.admin-awards-catalog-item {
  cursor: pointer;
}

.admin-awards-catalog-item img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 6px;
}

.admin-profiles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-profile-card {
  background: #141a28;
  border: 1px solid #3a4865;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-profile-square {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid #3a4865;
  border-radius: 8px;
  overflow: hidden;
  background: #0f1320;
}

.admin-profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-profile-name {
  font-weight: 700;
  color: #e8eeff;
}

.admin-profile-sub {
  color: #9fb0d8;
  font-size: 0.86rem;
}

.admin-profile-status {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-profile-status.locked {
  background: #3a0f16;
  color: #ffb4bd;
  border: 1px solid #7f1d1d;
}

.admin-profile-status.unlocked {
  background: #0f2f1d;
  color: #9af5bf;
  border: 1px solid #166534;
}

.admin-profile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-profile-actions input[type="text"] {
  flex: 1;
  min-width: 150px;
}

.profile-locked-blur {
  position: relative;
}

.profile-locked-blur > .card {
  filter: blur(18px) saturate(0.25) brightness(0.45);
  transform: scale(1.01);
  pointer-events: none;
  user-select: none;
}

.profile-locked-overlay {
  position: sticky;
  top: 16px;
  z-index: 300;
  margin: 0 0 12px 0;
  border: 1px solid #7f1d1d;
  border-radius: 10px;
  background: rgba(24, 7, 10, 0.9);
  color: #ffd7dd;
  padding: 14px;
}

.profile-locked-overlay h2 {
  margin: 0 0 6px 0;
  color: #ffd7dd;
}

.profile-locked-reason {
  margin-top: 6px;
  color: #ffc7cf;
}

@media (max-width: 980px) {
  .admin-awards-top-grid {
    grid-template-columns: 1fr;
  }

  .admin-profiles-grid {
    grid-template-columns: 1fr;
  }
}
