:root {
  color-scheme: dark;
  --ink-0: #02070d;
  --ink-1: #06111d;
  --ink-2: #091a2b;
  --ink-3: #0d2439;
  --panel: rgba(5, 18, 31, 0.94);
  --panel-soft: rgba(8, 27, 45, 0.88);
  --line: rgba(124, 162, 191, 0.44);
  --line-soft: rgba(121, 159, 190, 0.24);
  --gold-0: #fff0b2;
  --gold-1: #edc66f;
  --gold-2: #c58a2e;
  --gold-3: #7c4c12;
  --blue-0: #d9faff;
  --blue-1: #5bd7ff;
  --blue-2: #168fd5;
  --purple: #a95cff;
  --danger: #ff6974;
  --ok: #78efb7;
  --text: #f1f5f8;
  --muted: #8da7b9;
  --stage-w: 1448px;
  --stage-h: 1086px;
  --radius: 8px;
  --ui-font: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --title-font: "Cinzel", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: #01050a; }

body {
  overflow: hidden;
  color: var(--text);
  font-family: var(--ui-font);
  background:
    radial-gradient(circle at 50% 10%, rgba(23, 108, 159, .18), transparent 34%),
    linear-gradient(180deg, #01070d, #000307 70%);
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }

.gnook-viewport {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, rgba(24, 81, 118, .18), transparent 60%),
    #01050a;
}

.gnook-stage {
  position: relative;
  width: var(--stage-w);
  height: var(--stage-h);
  flex: 0 0 auto;
  overflow: hidden;
  isolation: isolate;
  transform-origin: center center;
  background:
    linear-gradient(90deg, transparent 0 31.5%, rgba(52, 176, 244, .055) 31.6% 65.3%, transparent 65.4%),
    radial-gradient(ellipse at 50% 38%, rgba(62, 169, 229, .25), rgba(3, 18, 32, .1) 31%, transparent 55%),
    linear-gradient(180deg, #06131f 0%, #020b13 60%, #02070d 100%);
  border: 1px solid rgba(205, 154, 62, .55);
  box-shadow:
    0 0 0 2px rgba(5, 15, 25, .95) inset,
    0 0 0 3px rgba(231, 187, 93, .12) inset,
    0 38px 120px rgba(0, 0, 0, .75);
}

.gnook-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .42;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 182px, rgba(90, 163, 210, .055) 183px 184px),
    linear-gradient(110deg, transparent 0 32%, rgba(120, 219, 255, .06) 32.2% 33%, transparent 33.2% 100%);
}

.gnook-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  box-shadow:
    inset 0 0 105px rgba(0, 0, 0, .9),
    inset 0 0 24px rgba(0, 0, 0, .78);
}

.frame-corner {
  position: absolute;
  z-index: 55;
  width: 56px;
  height: 56px;
  pointer-events: none;
  opacity: .9;
  filter: drop-shadow(0 0 5px rgba(238, 188, 83, .25));
}
.frame-corner::before,
.frame-corner::after {
  content: "";
  position: absolute;
  background: linear-gradient(90deg, var(--gold-3), var(--gold-1), var(--gold-3));
  box-shadow: 0 0 7px rgba(235, 188, 91, .35);
}
.frame-corner::before { width: 48px; height: 2px; top: 14px; left: 0; }
.frame-corner::after { width: 2px; height: 48px; top: 0; left: 14px; }
.frame-corner i {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 17px;
  height: 17px;
  transform: rotate(45deg);
  border: 2px solid var(--gold-1);
  box-shadow: inset 0 0 8px rgba(236, 190, 89, .35);
}
.frame-corner.tl { top: 0; left: 0; }
.frame-corner.tr { top: 0; right: 0; transform: rotate(90deg); }
.frame-corner.br { bottom: 0; right: 0; transform: rotate(180deg); }
.frame-corner.bl { bottom: 0; left: 0; transform: rotate(270deg); }

.brand-block {
  position: absolute;
  top: 18px;
  left: 76px;
  z-index: 5;
  width: 350px;
  text-align: center;
  color: var(--gold-1);
  text-shadow: 0 2px 0 #3a2108, 0 0 16px rgba(239, 195, 95, .25);
  pointer-events: none;
}
.brand-block .brand {
  display: block;
  font-family: var(--title-font);
  font-size: 45px;
  line-height: .95;
  letter-spacing: .08em;
  font-weight: 700;
  background: linear-gradient(180deg, #fff7d0 5%, #e7ba5b 55%, #8d571c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-block .subtitle {
  display: block;
  margin-top: 3px;
  font-family: var(--title-font);
  font-size: 28px;
  line-height: 1;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.main-grid {
  position: absolute;
  z-index: 2;
  top: 106px;
  left: 28px;
  right: 28px;
  height: 802px;
  display: grid;
  grid-template-columns: 420px 500px 420px;
  gap: 14px;
}

.ui-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(120, 161, 193, .55);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(29, 63, 88, .22), transparent 16%),
    linear-gradient(180deg, rgba(7, 24, 40, .97), rgba(3, 15, 27, .97));
  box-shadow:
    inset 0 0 0 2px rgba(4, 10, 18, .85),
    inset 0 0 32px rgba(15, 75, 111, .12),
    0 10px 28px rgba(0, 0, 0, .24);
  overflow: hidden;
}

.ui-panel::before {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border: 1px solid rgba(117, 161, 194, .08);
  border-radius: 4px;
}

.left-panel {
  display: grid;
  grid-template-columns: 145px 1fr;
}

.category-rail {
  position: relative;
  z-index: 2;
  padding: 11px 9px 12px 12px;
  border-right: 1px solid rgba(105, 145, 174, .23);
  background: linear-gradient(90deg, rgba(3, 16, 28, .8), rgba(7, 23, 38, .63));
  overflow: hidden;
}
.category-rail h2 {
  margin: 0 0 8px 2px;
  color: #f2e5c3;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.category-list {
  display: grid;
  gap: 3px;
}
.category-button {
  position: relative;
  width: 100%;
  height: 36px;
  display: grid;
  grid-template-columns: 27px 1fr 12px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid rgba(94, 132, 160, .18);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(13, 39, 59, .7), rgba(4, 18, 31, .72));
  color: #e5e7e8;
  font-size: 17px;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease, transform .16s ease;
}
.category-button:hover { border-color: rgba(229, 181, 77, .62); color: #fff6d8; }
.category-button:focus-visible { outline: 2px solid var(--blue-1); outline-offset: 1px; }
.category-button[aria-pressed="true"] {
  color: #fff4cd;
  border-color: #d8a641;
  background:
    linear-gradient(90deg, rgba(156, 96, 17, .35), rgba(47, 40, 26, .4)),
    linear-gradient(180deg, #173b52, #071a2c);
  box-shadow: inset 0 0 18px rgba(255, 193, 70, .14), 0 0 9px rgba(222, 168, 63, .18);
}
.category-button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  right: -9px;
  width: 18px;
  height: 18px;
  transform: rotate(45deg);
  border-top: 1px solid #e2ad49;
  border-right: 1px solid #e2ad49;
  background: #0f293c;
  box-shadow: 3px -3px 8px rgba(233, 180, 77, .15);
}
.category-button svg { width: 23px; height: 23px; color: #e7c680; filter: drop-shadow(0 0 3px rgba(225, 174, 72, .18)); }
.category-button .chev { opacity: 0; color: var(--gold-1); }
.category-button[aria-pressed="true"] .chev { opacity: 1; }

.customization-pane {
  position: relative;
  z-index: 2;
  padding: 10px 10px 14px 14px;
  overflow: hidden;
}
.customization-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #91601f rgba(3, 11, 18, .5);
}
.customization-scroll::-webkit-scrollbar { width: 5px; }
.customization-scroll::-webkit-scrollbar-thumb { background: linear-gradient(#e0ae4f,#7b4b14); border-radius: 10px; }

.option-group { margin: 0 0 10px; }
.option-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 5px;
}
.option-group-title {
  color: #e9d8ad;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.option-group-counter { color: #718ca0; font-size: 13px; }

.option-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.option-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.option-card {
  position: relative;
  min-width: 0;
  height: 58px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(103, 137, 160, .42);
  border-radius: 4px;
  background: linear-gradient(180deg, #10283a, #07131f);
  box-shadow: inset 0 0 0 2px rgba(1, 8, 14, .7);
  cursor: pointer;
}
.option-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.option-card .option-label {
  position: absolute;
  inset: auto 2px 2px;
  padding: 2px 3px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
  text-align: center;
  color: #dce8ef;
  background: rgba(1, 8, 14, .74);
  border-radius: 2px;
  opacity: 0;
  transition: opacity .15s ease;
}
.option-card:hover .option-label,
.option-card:focus-visible .option-label { opacity: 1; }
.option-card:hover { border-color: rgba(222, 175, 73, .72); }
.option-card:focus-visible { outline: 2px solid var(--blue-1); outline-offset: 1px; }
.option-card[aria-pressed="true"] {
  border-color: var(--gold-1);
  box-shadow: inset 0 0 0 2px rgba(42, 25, 5, .9), 0 0 8px rgba(231, 184, 86, .45);
}
.option-card[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1px solid #f4d17a;
  border-radius: 50%;
  color: #fff4c7;
  font-size: 11px;
  background: rgba(84, 53, 10, .88);
}

.color-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  overflow-x: auto;
  padding: 2px 1px 4px;
  scrollbar-width: none;
}
.color-row::-webkit-scrollbar { display: none; }
.color-swatch {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  border-radius: 50%;
  border: 1px solid rgba(227, 190, 107, .58);
  background: var(--swatch, #777);
  box-shadow: inset 0 0 7px rgba(255,255,255,.22), inset 0 -5px 10px rgba(0,0,0,.38), 0 0 0 2px rgba(0,0,0,.6);
  cursor: pointer;
}
.color-swatch:hover { transform: translateY(-1px); }
.color-swatch:focus-visible { outline: 2px solid var(--blue-1); outline-offset: 2px; }
.color-swatch[aria-pressed="true"] { box-shadow: inset 0 0 7px rgba(255,255,255,.3), 0 0 0 2px #f7d47e, 0 0 11px rgba(247,212,126,.65); }

.range-shell {
  height: 29px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(209, 159, 64, .7);
  border-radius: 16px;
  background: linear-gradient(90deg, #d49b6c, #8c563a 43%, #271a1a 100%);
  box-shadow: inset 0 0 8px rgba(0,0,0,.65);
}
.range-shell input[type="range"] {
  width: 100%;
  appearance: none;
  height: 4px;
  background: transparent;
  cursor: pointer;
}
.range-shell input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #f2d18a;
  background: rgba(85, 49, 21, .72);
  box-shadow: 0 0 0 2px #503012, 0 0 10px rgba(245, 204, 118, .65);
}
.range-shell input[type="range"]::-moz-range-thumb {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 2px solid #f2d18a;
  background: rgba(85, 49, 21, .72);
  box-shadow: 0 0 0 2px #503012, 0 0 10px rgba(245, 204, 118, .65);
}

.viewer-panel {
  position: relative;
  top: -106px;
  height: 908px;
  border-left: 1px solid rgba(93, 144, 180, .16);
  border-right: 1px solid rgba(93, 144, 180, .16);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0,0,0,.4), transparent 12% 88%, rgba(0,0,0,.4)),
    radial-gradient(ellipse at 50% 44%, rgba(90, 203, 255, .27), transparent 40%),
    linear-gradient(180deg, rgba(8, 27, 44, .35), rgba(2, 11, 19, .75));
}
.viewer-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 44%, rgba(151, 226, 255, .12) 49%, rgba(213, 248, 255, .24) 50%, rgba(151, 226, 255, .1) 51%, transparent 56%),
    repeating-linear-gradient(90deg, transparent 0 120px, rgba(100, 187, 232, .055) 121px 123px);
  opacity: .65;
}
.viewer-scene {
  position: absolute;
  inset: 0 0 128px;
  perspective: 1500px;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.viewer-scene.is-dragging { cursor: grabbing; }
.viewer-glow {
  position: absolute;
  left: 50%;
  top: 3%;
  width: 350px;
  height: 690px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(131, 220, 255, .25), rgba(80, 188, 245, .08) 58%, transparent 92%);
  filter: blur(11px);
  clip-path: polygon(37% 0,63% 0,93% 100%,7% 100%);
  opacity: .9;
}
.hero-poster {
  position: absolute;
  left: 50%;
  top: -15px;
  width: 522px;
  height: 792px;
  transform: translateX(-50%) rotateY(var(--poster-yaw, 0deg));
  transform-origin: 50% 55%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(1.05) contrast(1.02) drop-shadow(0 12px 14px rgba(0,0,0,.48));
  user-select: none;
  pointer-events: none;
  transition: transform .34s cubic-bezier(.2,.8,.2,1), filter .2s ease;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, black 7%, black 93%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, black 7%, black 93%, transparent 100%);
}
.viewer-scene.is-dragging .hero-poster { transition: none; }
.hero-poster.auto-shimmer { animation: posterShimmer 4.8s ease-in-out infinite; }
@keyframes posterShimmer {
  0%,100% { filter: saturate(1.02) contrast(1.02) drop-shadow(0 12px 14px rgba(0,0,0,.48)); }
  50% { filter: saturate(1.13) contrast(1.04) brightness(1.05) drop-shadow(0 12px 18px rgba(52,174,239,.28)); }
}

model-viewer.gnook-model-viewer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  --poster-color: transparent;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
model-viewer.gnook-model-viewer.is-ready { opacity: 1; pointer-events: auto; }
.viewer-scene.has-model .hero-poster { opacity: 0; }

.particle-field,
.particle-field::before,
.particle-field::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    radial-gradient(circle, rgba(191,237,255,.95) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(244,198,91,.8) 0 1px, transparent 1.4px);
  background-size: 83px 97px, 117px 139px;
  background-position: 12px 8px, 36px 59px;
  opacity: .28;
  animation: particles 8s linear infinite;
}
.particle-field::before { transform: scale(.8); opacity: .25; animation-duration: 12s; }
.particle-field::after { transform: scale(1.15); opacity: .16; animation-duration: 16s; }
@keyframes particles { to { background-position: 28px -120px, 70px -100px; } }

.viewer-controls {
  position: absolute;
  z-index: 5;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 128px;
  padding: 10px 9px 8px;
  border-top: 1px solid rgba(103, 151, 182, .27);
  background: linear-gradient(180deg, rgba(6, 20, 34, .87), rgba(2, 11, 19, .98));
  box-shadow: 0 -9px 25px rgba(0,0,0,.26);
}
.rotation-row { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 6px; }
.viewer-button,
.small-button,
.action-button,
.bottom-button {
  position: relative;
  border: 1px solid rgba(111, 161, 194, .54);
  background: linear-gradient(180deg, #163a55, #071a2c 56%, #06131f);
  color: #f1f4f6;
  text-transform: uppercase;
  letter-spacing: .025em;
  box-shadow: inset 0 0 0 2px rgba(2, 9, 16, .7), 0 2px 8px rgba(0,0,0,.35);
  cursor: pointer;
  transition: border-color .16s ease, filter .16s ease, transform .1s ease;
}
.viewer-button:hover,
.small-button:hover,
.action-button:hover,
.bottom-button:hover { border-color: var(--gold-1); filter: brightness(1.12); }
.viewer-button:active,
.small-button:active,
.action-button:active,
.bottom-button:active { transform: translateY(1px); }
.viewer-button:focus-visible,
.small-button:focus-visible,
.action-button:focus-visible,
.bottom-button:focus-visible { outline: 2px solid var(--blue-1); outline-offset: 2px; }
.viewer-button {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 22px;
  font-size: 15px;
}
.viewer-button svg { width: 25px; height: 25px; }
.viewer-button[aria-pressed="true"] {
  border-color: var(--gold-1);
  color: #fff1bf;
  background: linear-gradient(180deg, #4a3a1b, #1e1c18 58%, #09121b);
  box-shadow: inset 0 0 12px rgba(237, 187, 81, .18), 0 0 9px rgba(221, 169, 61, .18);
}
.control-subrow {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 9px;
}
.small-button { height: 42px; border-radius: 4px; font-size: 15px; }
.speed-control {
  height: 42px;
  display: grid;
  grid-template-columns: 1fr 38px 57px 38px;
  align-items: center;
  border: 1px solid rgba(116, 157, 185, .32);
  border-radius: 21px;
  overflow: hidden;
  background: rgba(5, 18, 30, .8);
}
.speed-control .label { padding-left: 18px; color: #f4dfae; text-transform: uppercase; }
.speed-control button {
  height: 100%;
  border: 0;
  border-left: 1px solid rgba(111, 154, 184, .26);
  color: #f4e7c5;
  background: rgba(9, 29, 45, .78);
  cursor: pointer;
  font-size: 25px;
}
.speed-control output { text-align: center; color: #dfeef4; font-size: 17px; }

.right-column {
  position: relative;
  top: -58px;
  height: 860px;
  display: grid;
  grid-template-rows: 194px 158px 151px 327px;
  gap: 10px;
  min-height: 0;
}
.right-card {
  position: relative;
  border: 1px solid rgba(105, 147, 177, .42);
  border-radius: 7px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(7, 25, 42, .96), rgba(3, 14, 25, .97));
  box-shadow: inset 0 0 0 2px rgba(2,8,14,.72), inset 0 0 22px rgba(34, 107, 148, .08);
}
.right-card h2 {
  height: 38px;
  margin: 0;
  padding: 9px 14px 0;
  color: #e8d4a9;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .03em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(148, 106, 36, .44);
  background: linear-gradient(90deg, rgba(123,78,15,.16), transparent 65%);
}
.right-card h2::after {
  content: "";
  position: absolute;
  top: 37px;
  left: 14px;
  right: 14px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-2), transparent 85%);
  opacity: .55;
}
.view-all {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 13px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #d8a144;
  text-transform: uppercase;
  cursor: pointer;
}
.view-all:hover { color: #ffe39a; }

.profile-card { padding: 0; }
.profile-body {
  height: calc(100% - 38px);
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 8px;
  align-items: center;
  padding: 4px 16px 12px 7px;
}
.profile-crest {
  width: 148px;
  height: 142px;
  object-fit: cover;
  filter: drop-shadow(0 0 8px rgba(115, 84, 240, .38));
}
.profile-info { min-width: 0; }
.profile-name-line { display: flex; align-items: center; gap: 8px; }
.profile-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #f4e9cb;
  font-size: 19px;
  letter-spacing: -.15px;
  text-transform: uppercase;
}
.edit-name {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(118, 153, 179, .35);
  border-radius: 3px;
  background: rgba(11, 30, 45, .72);
  cursor: pointer;
}
.edit-name svg { width: 15px; height: 15px; }
.progress-block { margin-top: 11px; }
.progress-label { display: flex; justify-content: space-between; gap: 8px; color: #e4e8ea; font-size: 14px; }
.progress-track {
  height: 9px;
  margin-top: 4px;
  overflow: hidden;
  border: 1px solid #8a5d1d;
  border-radius: 6px;
  background: #03080d;
  box-shadow: inset 0 0 4px #000;
}
.progress-fill {
  height: 100%;
  width: var(--value, 70%);
  border-radius: inherit;
  background: linear-gradient(90deg, #147fc4, #51d9ff 75%, #d7ffff);
  box-shadow: 0 0 8px rgba(65, 210, 255, .65);
}
.progress-fill.rank { background: linear-gradient(90deg, #6b31b9, #bd63ff 78%, #f1d8ff); box-shadow: 0 0 8px rgba(168, 81, 255, .6); }

.badge-row,
.trophy-row {
  height: calc(100% - 38px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px 8px 4px;
}
.badge-item,
.trophy-item {
  min-width: 0;
  display: grid;
  grid-template-rows: 76px 1fr;
  align-items: center;
  justify-items: center;
  color: #e8e1cf;
  text-align: center;
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
}
.badge-item img,
.trophy-item img { max-width: 76px; max-height: 76px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0,0,0,.55)); }
.badge-item.locked img { filter: grayscale(1) brightness(.55); opacity: .5; }
.trophy-item { grid-template-rows: 76px 28px; }
.trophy-count {
  width: 58px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(99, 139, 167, .22);
  border-radius: 3px;
  background: rgba(2, 10, 18, .78);
  font-size: 15px;
}

.saved-card { min-height: 0; }
.saved-card h2 .slot-count { float: right; margin-right: 4px; color: #cbd2d6; font-size: 14px; }
.saved-content { height: calc(100% - 38px); padding: 8px 10px 9px; display: grid; grid-template-rows: 166px 43px 44px; gap: 8px; }
.saved-avatars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  min-height: 0;
}
.saved-avatar {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(104, 145, 174, .38);
  border-radius: 5px;
  background: linear-gradient(180deg, #112b40, #061522);
  box-shadow: inset 0 0 0 2px rgba(2,8,14,.75);
  cursor: pointer;
}
.saved-avatar img { width: 100%; height: 95px; object-fit: cover; object-position: top center; display: block; }
.saved-avatar .saved-name {
  display: block;
  height: 45px;
  padding: 5px 3px 0;
  overflow: hidden;
  color: #efe5ce;
  font-size: 10.5px;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
}
.saved-avatar .saved-level { display: block; color: #d8dde0; font-size: 12px; text-align: center; }
.saved-avatar:hover { border-color: rgba(232, 184, 82, .72); }
.saved-avatar:focus-visible { outline: 2px solid var(--blue-1); outline-offset: 1px; }
.saved-avatar[aria-selected="true"] {
  border-color: #f1c45d;
  box-shadow: inset 0 0 0 2px rgba(71,43,8,.85), 0 0 10px rgba(235,184,75,.42);
}
.saved-avatar[aria-selected="true"]::after {
  content: "✓";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #f8d779;
  border-radius: 50%;
  color: #fff5ce;
  background: rgba(103, 66, 13, .92);
}
.saved-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.action-button { height: 43px; border-radius: 4px; font-size: 15px; }
.action-button.gold {
  border-color: #e2b254;
  color: #fff5d5;
  background: linear-gradient(180deg, #b97923, #72430f 52%, #402609);
  box-shadow: inset 0 0 0 2px rgba(66,37,5,.68), 0 0 11px rgba(227,171,61,.22);
}

.bottom-nav {
  position: absolute;
  z-index: 4;
  left: 20px;
  right: 20px;
  bottom: 16px;
  height: 112px;
  display: grid;
  grid-template-columns: 54px 250px 216px 250px 276px 250px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid rgba(170, 121, 40, .55);
  background: linear-gradient(180deg, rgba(6, 19, 31, .82), rgba(2, 8, 14, .97));
  box-shadow: 0 -13px 32px rgba(0,0,0,.36);
}
.bottom-nav::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 5px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #b57a24 10% 90%, transparent);
  opacity: .75;
}
.settings-button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(102, 149, 183, .5);
  border-radius: 6px;
  background: linear-gradient(180deg, #14354e, #071623);
  cursor: pointer;
}
.settings-button svg { width: 25px; height: 25px; }
.bottom-button {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border-color: rgba(210, 159, 64, .78);
  border-radius: 6px;
  clip-path: polygon(7% 0, 93% 0, 100% 50%, 93% 100%, 7% 100%, 0 50%);
  color: #efe3c7;
  background:
    linear-gradient(180deg, rgba(23, 58, 84, .95), rgba(5, 20, 34, .97)),
    #071522;
  font-family: var(--title-font);
  font-size: 19px;
  text-transform: uppercase;
}
.bottom-button.primary {
  color: #fff0ba;
  background: linear-gradient(180deg, #1a5078, #09223b 55%, #061522);
  box-shadow: inset 0 0 18px rgba(47, 169, 230, .12), 0 0 11px rgba(227,174,64,.18);
}
.bottom-button svg { width: 35px; height: 35px; color: #edc76f; filter: drop-shadow(0 0 4px rgba(236,190,85,.3)); }

.toast-region {
  position: absolute;
  z-index: 100;
  top: 22px;
  right: 28px;
  width: 370px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 14px;
  border: 1px solid #d7a84a;
  border-radius: 5px;
  color: #fff0c9;
  background: rgba(6, 20, 33, .96);
  box-shadow: 0 12px 28px rgba(0,0,0,.46), inset 0 0 14px rgba(50,135,181,.12);
  animation: toastIn .2s ease both;
}
.toast.error { border-color: var(--danger); color: #ffd9dc; }
.toast.success { border-color: var(--ok); color: #d9ffed; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

.modal-backdrop {
  position: absolute;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 60px;
  background: rgba(0, 4, 8, .78);
  backdrop-filter: blur(6px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  position: relative;
  width: min(720px, 100%);
  max-height: 820px;
  overflow: auto;
  border: 1px solid #d4a247;
  border-radius: 8px;
  background: linear-gradient(180deg, #0b263c, #04121f 70%);
  box-shadow: 0 28px 80px rgba(0,0,0,.72), inset 0 0 0 2px rgba(2,8,14,.85), inset 0 0 38px rgba(39,127,175,.12);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(209, 158, 67, .45);
}
.modal-header h2 { margin: 0; color: #f0d796; font-family: var(--title-font); font-size: 24px; }
.modal-close { width: 36px; height: 36px; border: 1px solid rgba(120,160,187,.42); border-radius: 4px; background: #0b2030; color: white; cursor: pointer; }
.modal-body { padding: 20px; }
.form-grid { display: grid; gap: 14px; }
.form-grid label { display: grid; gap: 6px; color: #e7d5ae; text-transform: uppercase; }
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid rgba(119, 160, 188, .48);
  border-radius: 4px;
  padding: 10px 12px;
  color: white;
  background: rgba(2, 11, 18, .8);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-actions .action-button { min-width: 140px; padding: 0 16px; }
.achievement-grid-modal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.achievement-detail {
  padding: 12px;
  border: 1px solid rgba(112,151,178,.34);
  border-radius: 6px;
  text-align: center;
  background: rgba(4,16,28,.72);
}
.achievement-detail img { width: 78px; height: 78px; object-fit: contain; }
.achievement-detail h3 { margin: 6px 0 2px; color: #f0d99f; font-size: 17px; }
.achievement-detail p { margin: 0; color: #92aabb; font-size: 14px; }

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px currentColor;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}

/* Exact approved overview: one representative row per facial group, with the
   chevron opening the complete option library for that category. */
.compact-group { margin-bottom: 20px; }
.group-more {
  width: 24px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: #e7bd68;
  background: transparent;
  cursor: pointer;
}
.group-more svg { width: 19px; height: 19px; }
.group-more:hover { color: #fff0b2; background: rgba(205, 145, 43, .1); }
.group-more:focus-visible { outline: 2px solid var(--blue-1); outline-offset: 1px; }
