:root {
  --ink: #25231f;
  --muted: #756f67;
  --paper: #f7f1e6;
  --panel: rgba(255, 250, 240, 0.84);
  --line: rgba(45, 42, 37, 0.16);
  --mint: #3fb89a;
  --coral: #f26b5e;
  --gold: #e6ad39;
  --blue: #486f9f;
  --shadow: 0 20px 60px rgba(47, 36, 25, 0.16);
  --loading-sleep-image-size: 100%;
  --main-stage-height: clamp(790px, calc(100vh - 104px), 930px);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  background:
    linear-gradient(rgba(255, 250, 241, 0.58), rgba(255, 250, 241, 0.5)),
    url("assets/home-background-v1.png"),
    linear-gradient(135deg, #f6eddf 0%, #e7f3ec 52%, #f8d8ce 100%);
  background-attachment: fixed;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

button {
  color: inherit;
  font: inherit;
}

.shell {
  width: calc(100vw - 40px);
  max-width: none;
  margin: 0 auto;
  padding: 24px 0 28px;
}

.topbar {
  position: relative;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  margin-bottom: 14px;
  padding: 0 4px;
  border-bottom: 2px solid rgba(37, 35, 31, 0.16);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.top-actions {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
}

.story-entry {
  height: 38px;
  padding: 0 18px;
  border: 1px solid rgba(242, 107, 94, 0.24);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.88), rgba(255, 230, 226, 0.68)),
    rgba(255, 250, 241, 0.72);
  cursor: pointer;
  color: #d45f72;
  box-shadow: 0 8px 18px rgba(242, 107, 94, 0.1);
  font-family: "华文彩云", "幼圆", "YouYuan", "华文琥珀", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.story-entry:hover {
  border-color: rgba(242, 107, 94, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.96), rgba(255, 218, 224, 0.8)),
    rgba(255, 250, 241, 0.92);
  color: #c94e64;
  transform: translateY(-1px) scale(1.02);
}

.game-repository-entry {
  justify-self: end;
  height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(63, 184, 154, 0.28);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.88), rgba(224, 247, 239, 0.72)),
    rgba(255, 250, 241, 0.72);
  cursor: pointer;
  color: #288e73;
  box-shadow: 0 8px 18px rgba(63, 184, 154, 0.1);
  font-family: "幼圆", "YouYuan", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.game-repository-entry:hover {
  border-color: rgba(63, 184, 154, 0.48);
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.96), rgba(207, 242, 230, 0.86)),
    rgba(255, 250, 241, 0.92);
  color: #20775f;
  transform: translateY(-1px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(37, 35, 31, 0.14);
  border-radius: 50%;
  background: rgba(255, 250, 241, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 6px 14px rgba(47, 36, 25, 0.08);
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 800;
}

h2 {
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.avatar-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px 0 8px;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.58);
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.avatar-button {
  cursor: pointer;
}

.avatar-button:hover {
  border-color: rgba(37, 35, 31, 0.18);
  background: rgba(255, 250, 241, 0.88);
}

.user-menu {
  position: relative;
  justify-self: end;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 100;
  display: grid;
  min-width: max-content;
  padding: 8px;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.96);
  box-shadow: 0 14px 34px rgba(47, 36, 25, 0.12);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.user-dropdown button {
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  text-align: center;
  padding: 0 14px;
  white-space: nowrap;
}

.user-dropdown button:hover {
  background: #fff0df;
}

.avatar-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, var(--coral) 0 50%, transparent 50%),
    var(--gold);
}

body.logged-out .avatar-button {
  padding-left: 12px;
}

body.logged-out .avatar-dot {
  display: none;
}

.avatar-dot.has-avatar,
.profile-avatar.has-avatar,
.player-avatar.has-avatar {
  background-color: #fee3e4;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: transparent;
}

.announcement-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  height: 36px;
  margin-bottom: 14px;
  padding: 0 12px;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.42);
  overflow: hidden;
}

.announcement-label {
  display: grid;
  place-items: center;
  width: 24px;
  height: 22px;
  border-radius: 999px;
  background: rgba(72, 111, 159, 0.14);
}

.announcement-icon {
  width: 16px;
  height: 16px;
  fill: var(--blue);
  stroke: var(--blue);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.announcement-window {
  height: 36px;
  min-width: 0;
  overflow: hidden;
}

.announcement-track {
  display: grid;
  transition: transform 0.38s cubic-bezier(0.22, 0.8, 0.22, 1);
}

.announcement-item {
  height: 36px;
  overflow: hidden;
}

.announcement-content {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  color: #315f83;
  font-size: 14px;
  font-weight: 700;
  line-height: 36px;
  white-space: nowrap;
}

.announcement-content.is-scrolling {
  max-width: none;
  padding-left: 100%;
  animation: announcementScroll 18s linear infinite;
}

.announcement-bar.paused .announcement-content.is-scrolling {
  animation-play-state: paused;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.84fr) minmax(560px, 1.7fr) minmax(280px, 0.84fr);
  align-items: stretch;
  gap: 18px;
  min-height: var(--main-stage-height);
  transition: grid-template-columns 0.34s cubic-bezier(0.22, 0.8, 0.22, 1);
}

.panel,
.stage-panel,
.inventory-panel {
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
}

.panel {
  position: relative;
  padding: 18px;
  transition:
    padding 0.34s cubic-bezier(0.22, 0.8, 0.22, 1),
    border-color 0.24s ease,
    background 0.24s ease,
    opacity 0.24s ease;
}

.claim-panel,
.status-panel {
  background: rgba(255, 250, 241, 0.18);
  border-color: rgba(37, 35, 31, 0.08);
  box-shadow: none;
  backdrop-filter: blur(6px);
}

.panel-heading,
.inventory-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.claim-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
}

.content-hub {
  position: relative;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 100%;
}

.content-hub-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  padding: 5px 9px;
  border: 1px solid rgba(37, 35, 31, 0.08);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.36);
  color: rgba(37, 35, 31, 0.64);
  font-size: 13px;
  font-weight: 900;
}

.warehouse-list {
  display: grid;
  gap: 12px;
}

.content-hub .warehouse-entry,
.content-hub .story-entry,
.content-hub .game-repository-entry {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  justify-self: stretch;
  width: 100%;
  height: auto;
  min-height: 82px;
  padding: 14px 14px 14px 12px;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 42%),
    linear-gradient(135deg, rgba(255, 250, 241, 0.72), rgba(255, 246, 233, 0.42)),
    rgba(255, 250, 241, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 0 rgba(37, 35, 31, 0.05),
    0 10px 24px rgba(47, 36, 25, 0.05);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  text-decoration: none;
  text-align: left;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease,
    opacity 0.16s ease;
}

.content-hub .warehouse-entry::after,
.content-hub .story-entry::after,
.content-hub .game-repository-entry::after {
  content: "›";
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(37, 35, 31, 0.06);
  color: rgba(37, 35, 31, 0.48);
  font-size: 20px;
  line-height: 1;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.content-hub .warehouse-entry:hover,
.content-hub .story-entry:hover,
.content-hub .game-repository-entry:hover {
  border-color: rgba(63, 184, 154, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), transparent 42%),
    linear-gradient(135deg, rgba(255, 250, 241, 0.9), rgba(236, 250, 245, 0.62)),
    rgba(255, 250, 241, 0.68);
  color: var(--ink);
  transform: translateY(-2px);
}

.content-hub .warehouse-entry:hover::after,
.content-hub .story-entry:hover::after,
.content-hub .game-repository-entry:hover::after {
  background: rgba(63, 184, 154, 0.15);
  color: #267c66;
  transform: translateX(2px);
}

.content-hub .warehouse-entry-primary {
  border-color: rgba(242, 107, 94, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), transparent 42%),
    linear-gradient(135deg, rgba(255, 230, 226, 0.72), rgba(255, 250, 241, 0.48)),
    rgba(255, 250, 241, 0.42);
}

.content-hub .warehouse-entry-primary:hover {
  border-color: rgba(242, 107, 94, 0.4);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), transparent 42%),
    linear-gradient(135deg, rgba(255, 223, 220, 0.86), rgba(255, 247, 235, 0.68)),
    rgba(255, 250, 241, 0.72);
}

.content-hub .warehouse-entry-primary:hover::after {
  background: rgba(242, 107, 94, 0.14);
  color: #c94e64;
}

.warehouse-entry strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}

.warehouse-entry small {
  display: block;
  margin-top: 4px;
  color: rgba(37, 35, 31, 0.5);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.warehouse-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255, 250, 241, 0.72);
  border-radius: 12px;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.76), transparent 28%),
    linear-gradient(135deg, rgba(63, 184, 154, 0.2), rgba(63, 184, 154, 0.1)),
    rgba(255, 250, 241, 0.6);
  color: #267c66;
  box-shadow:
    inset 0 -3px 0 rgba(37, 35, 31, 0.08),
    0 8px 16px rgba(47, 36, 25, 0.08);
  font-weight: 900;
  overflow: hidden;
}

.warehouse-entry-primary .warehouse-icon {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.76), transparent 28%),
    linear-gradient(135deg, rgba(242, 107, 94, 0.22), rgba(242, 107, 94, 0.1)),
    rgba(255, 250, 241, 0.62);
  color: #c94e64;
}

.warehouse-icon-story,
.warehouse-icon-games,
.warehouse-icon-plant,
.warehouse-icon-feedback,
.warehouse-icon-dev {
  background-position: center, center, center;
  background-repeat: no-repeat;
  background-size: 84% 84%, auto, auto;
}

.warehouse-icon-story {
  background-image:
    url("assets/content-icons/story-icon-v1.png"),
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.76), transparent 28%),
    linear-gradient(135deg, rgba(242, 107, 94, 0.22), rgba(242, 107, 94, 0.1));
}

.warehouse-icon-games {
  background-image:
    url("assets/content-icons/games-icon-v1.png"),
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.76), transparent 28%),
    linear-gradient(135deg, rgba(63, 184, 154, 0.2), rgba(63, 184, 154, 0.1));
}

.warehouse-icon-plant {
  background-image:
    url("assets/content-icons/plant-icon-v2.png"),
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.76), transparent 28%),
    linear-gradient(135deg, rgba(107, 201, 102, 0.24), rgba(63, 184, 154, 0.12));
}

.warehouse-icon-dev {
  background-image:
    url("assets/content-icons/dev-icon-v1.png"),
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.76), transparent 28%),
    linear-gradient(135deg, rgba(230, 173, 57, 0.2), rgba(242, 107, 94, 0.1));
}

.warehouse-icon-feedback {
  background-image:
    url("assets/content-icons/feedback-icon-v1.png"),
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.76), transparent 28%),
    linear-gradient(135deg, rgba(72, 111, 159, 0.2), rgba(63, 184, 154, 0.12));
  color: #486f9f;
}

.feedback-entry.has-unread .warehouse-icon-feedback {
  background-image:
    url("assets/content-icons/feedback-icon-unread-v1.png"),
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.76), transparent 28%),
    linear-gradient(135deg, rgba(72, 111, 159, 0.2), rgba(63, 184, 154, 0.12));
}

.warehouse-icon::before,
.warehouse-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.warehouse-icon-story::before,
.warehouse-icon-story::after,
.warehouse-icon-games::before,
.warehouse-icon-games::after,
.warehouse-icon-plant::before,
.warehouse-icon-plant::after,
.warehouse-icon-feedback::before,
.warehouse-icon-feedback::after,
.warehouse-icon-dev::before,
.warehouse-icon-dev::after {
  content: none;
  display: none;
}

.warehouse-icon-story::before {
  width: 24px;
  height: 28px;
  border: 2px solid #c94e64;
  border-radius: 5px 7px 7px 5px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.8) 0 45%, transparent 45%),
    linear-gradient(135deg, #ffafb7, #ffd9c5);
  box-shadow: inset -3px 0 0 rgba(255, 250, 241, 0.6);
  transform: rotate(-7deg);
}

.warehouse-icon-story::after {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fffaf1;
  box-shadow:
    12px -9px 0 -2px #f2c94c,
    -10px 10px 0 -3px #f26b5e;
  transform: rotate(12deg);
}

.warehouse-icon-games::before {
  width: 30px;
  height: 20px;
  border: 2px solid #267c66;
  border-radius: 12px 12px 10px 10px;
  background: linear-gradient(135deg, #bdebdc, #fffaf1);
}

.warehouse-icon-games::after {
  width: 4px;
  height: 14px;
  border-radius: 3px;
  background: #267c66;
  box-shadow:
    -5px 5px 0 -1px #267c66,
    13px 1px 0 0 #f26b5e,
    20px 5px 0 0 #f2c94c;
  transform: rotate(90deg);
}

.warehouse-icon-plant::before {
  width: 5px;
  height: 24px;
  border-radius: 999px;
  background: #3fa872;
  transform: translateY(8px);
}

.warehouse-icon-plant::after {
  width: 26px;
  height: 18px;
  border-radius: 16px 16px 16px 4px;
  background:
    radial-gradient(circle at 32% 35%, rgba(255, 255, 255, 0.52), transparent 24%),
    linear-gradient(135deg, #8fdc74, #3fa872);
  box-shadow: -12px 9px 0 -3px #6fcf97;
  transform: translate(4px, -4px) rotate(-18deg);
}

.warehouse-icon-dev::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(37, 35, 31, 0.42);
  box-shadow:
    -12px 0 0 rgba(37, 35, 31, 0.3),
    12px 0 0 rgba(37, 35, 31, 0.3);
}

.warehouse-icon-dev::after {
  inset: 10px;
  border: 2px dashed rgba(37, 35, 31, 0.18);
  border-radius: 10px;
}

.warehouse-icon-story::before,
.warehouse-icon-story::after,
.warehouse-icon-games::before,
.warehouse-icon-games::after,
.warehouse-icon-plant::before,
.warehouse-icon-plant::after,
.warehouse-icon-feedback::before,
.warehouse-icon-feedback::after,
.warehouse-icon-dev::before,
.warehouse-icon-dev::after {
  content: none;
  display: none;
}

.warehouse-entry-disabled {
  cursor: default;
  opacity: 0.7;
}

.content-hub .warehouse-entry-disabled:hover {
  border-color: rgba(37, 35, 31, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 42%),
    linear-gradient(135deg, rgba(255, 250, 241, 0.72), rgba(255, 246, 233, 0.42)),
    rgba(255, 250, 241, 0.4);
  transform: none;
}

.content-hub .warehouse-entry-disabled::after {
  content: "筹备";
  width: auto;
  min-width: 42px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(37, 35, 31, 0.06);
  color: rgba(37, 35, 31, 0.46);
  font-size: 12px;
  font-weight: 900;
}

.claim-panel > :not(.collapse-toggle),
.leaderboard-panel > :not(.collapse-toggle) {
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 0.2s ease,
    transform 0.28s cubic-bezier(0.22, 0.8, 0.22, 1),
    visibility 0s linear 0s;
}

.collapse-toggle {
  position: absolute;
  top: 50%;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 22px;
  height: 76px;
  border: 1px solid rgba(37, 35, 31, 0.12);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.7);
  backdrop-filter: blur(10px);
  cursor: pointer;
  color: rgba(37, 35, 31, 0.58);
  font-size: 20px;
  line-height: 1;
  transform: translateY(-50%);
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.34s cubic-bezier(0.22, 0.8, 0.22, 1);
}

.collapse-toggle:hover {
  background: rgba(255, 250, 241, 0.95);
  color: var(--ink);
}

.left-toggle {
  right: -11px;
}

.right-toggle {
  left: -11px;
}

.panel.collapsed {
  padding: 18px;
  border-color: transparent;
  background: transparent;
  backdrop-filter: none;
}

.panel.collapsed > :not(.collapse-toggle) {
  opacity: 0;
  transform: scale(0.96);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    transform 0.2s ease,
    visibility 0s linear 0.16s;
}

.panel.collapsed .collapse-toggle {
  transform: translateY(-50%);
}

.claim-panel.collapsed .collapse-toggle {
  left: -11px;
  right: auto;
  transform: translateY(-50%) translateX(1px);
}

.leaderboard-panel.collapsed .collapse-toggle {
  left: auto;
  right: -11px;
  transform: translateY(-50%) translateX(-1px);
}

.daily-gift-machine {
  position: absolute;
  left: clamp(18px, 4vw, 42px);
  top: 52%;
  z-index: 24;
  display: grid;
  justify-items: center;
  gap: 8px;
  transform: translateY(-50%);
}

.daily-gift-button {
  appearance: none;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  image-rendering: pixelated;
  transition:
    opacity 180ms ease,
    visibility 180ms ease,
    transform 180ms ease;
}

.daily-gift-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.daily-gift-button:not(:disabled) .daily-gift-sprite {
  animation: dailyGiftIdleShake 5.4s ease-in-out infinite;
}

.daily-gift-sprite {
  display: block;
  width: 96px;
  height: 96px;
  background-image: url("assets/daily-gift/gift-pack-open-sprite.png");
  background-repeat: no-repeat;
  background-size: 768px 96px;
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 10px rgba(37, 35, 31, 0.16));
  transform-origin: 50% 82%;
}

.daily-gift-machine.opening .daily-gift-sprite {
  animation: dailyGiftOpen 0.78s steps(7) forwards;
}

.daily-gift-machine.claimed .daily-gift-button {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.88);
}

.daily-gift-machine.opening .daily-gift-button {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.daily-gift-output {
  position: absolute;
  left: 50%;
  top: 70px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-width: 120px;
  min-height: 58px;
  pointer-events: none;
  transform: translateX(-50%);
}

.gacha-machine {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 430px;
  padding-top: 22px;
  padding-bottom: 72px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  overflow: visible;
}

.gacha-machine.cranking {
  animation: gachaShake 0.72s ease-in-out;
}

.gacha-dome {
  position: relative;
  width: min(92%, 236px);
  height: 188px;
  margin-top: 0;
  border: 2px solid rgba(37, 35, 31, 0.84);
  border-bottom: 0;
  border-radius: 132px 132px 28px 28px;
  background:
    radial-gradient(circle at 38% 24%, rgba(255, 255, 255, 0.72), transparent 18%),
    rgba(255, 250, 241, 0.58);
  overflow: hidden;
}

.capsule {
  position: absolute;
  width: 54px;
  height: 38px;
  border: 1px solid rgba(37, 35, 31, 0.24);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint) 0 50%, #fff8ed 50%);
  transform: rotate(var(--spin));
  animation: capsuleFloat 4.8s ease-in-out infinite;
}

.capsule-a {
  --spin: -18deg;
  left: 34px;
  top: 94px;
}

.capsule-b {
  --spin: 20deg;
  right: 34px;
  top: 72px;
  background: linear-gradient(90deg, var(--coral) 0 50%, #fff8ed 50%);
  animation-delay: -1.3s;
}

.capsule-c {
  --spin: 8deg;
  left: 88px;
  top: 34px;
  background: linear-gradient(90deg, var(--gold) 0 50%, #fff8ed 50%);
  animation-delay: -2.1s;
}

.capsule-d {
  --spin: -30deg;
  right: 72px;
  bottom: 18px;
  background: linear-gradient(90deg, var(--blue) 0 50%, #fff8ed 50%);
  animation-delay: -3s;
}

.gacha-body {
  position: relative;
  display: grid;
  align-items: center;
  justify-items: center;
  width: min(100%, 258px);
  min-height: 184px;
  padding: 22px 22px 24px;
  border: 2px solid rgba(37, 35, 31, 0.84);
  border-radius: 16px 16px 8px 8px;
  background: linear-gradient(180deg, #fffaf1, #f2c9bd);
  box-shadow: 8px 8px 0 rgba(37, 35, 31, 0.78);
}

.gacha-knob {
  appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin-top: 0;
  padding: 0;
  border: 7px solid #245892;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.95), transparent 22%),
    radial-gradient(circle, #fffdf8 0 58%, #f0ede5 59% 100%);
  cursor: pointer;
  box-shadow: none;
}

.knob-handle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 18px;
  border: 1px solid rgba(37, 35, 31, 0.16);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #dedbd2);
  box-shadow: none;
  transform: translate(-50%, -50%) rotate(-18deg);
}

.gacha-knob:hover:not(:disabled) {
  filter: brightness(1.05);
}

.gacha-knob:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.gacha-machine.cranking .gacha-knob {
  animation: knobTurn 0.72s ease-in-out;
}

.gacha-mouth {
  position: absolute;
  left: 50%;
  bottom: -15px;
  display: flex;
  box-sizing: border-box;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
  width: 168px;
  height: 52px;
  padding-top: 15px;
  border: 2px solid rgba(37, 35, 31, 0.84);
  border-radius: 0 0 18px 18px;
  background: #fffaf1;
  transform: translateX(-50%);
}

.prize-token,
.flying-prize,
.drag-preview {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(37, 35, 31, 0.24);
  border-radius: 50%;
  background: var(--gift-color);
  color: #fff8ed;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(47, 36, 25, 0.18);
}

.prize-token.has-image,
.flying-prize.has-image,
.drag-preview.has-image {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 8px 8px rgba(47, 36, 25, 0.22));
}

.prize-token img,
.flying-prize img,
.drag-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.prize-token {
  animation: prizePop 0.62s cubic-bezier(0.2, 1.2, 0.35, 1);
}

.flying-prize {
  position: fixed;
  z-index: 200;
  pointer-events: none;
}

.drag-preview {
  pointer-events: none;
}

.live-drag-preview {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(37, 35, 31, 0.24);
  border-radius: 50%;
  background: var(--gift-color);
  color: #fff8ed;
  font-size: 20px;
  font-weight: 900;
  pointer-events: none;
  will-change: transform;
}

.live-drag-preview.has-image {
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 10px 10px rgba(47, 36, 25, 0.22));
}

.live-drag-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.result-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.24);
}

.result-board {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.result-board b {
  color: var(--blue);
}

.stage-panel {
  padding: 0;
  overflow: hidden;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: var(--main-stage-height);
  padding-top: 28px;
  padding-bottom: 122px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 250, 241, 0.6), rgba(255, 250, 241, 0.24)),
    radial-gradient(ellipse at center bottom, rgba(63, 184, 154, 0.32), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(246, 213, 194, 0.36));
  overflow: hidden;
}

.stage::before {
  content: "";
  position: absolute;
  inset: auto 9% 132px;
  height: 18px;
  border-radius: 50%;
  background: rgba(37, 35, 31, 0.18);
  filter: blur(11px);
}

.stage.drop-ready {
  outline: 3px solid rgba(63, 184, 154, 0.55);
  outline-offset: -8px;
}

.reaction-bubble {
  position: absolute;
  top: 34px;
  left: 50%;
  z-index: 5;
  max-width: min(360px, 80%);
  padding: 11px 15px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #fffaf1;
  box-shadow: 5px 5px 0 var(--gold);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  font-weight: 700;
  text-align: center;
}

.reaction-bubble.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.stage-loading .reaction-bubble {
  opacity: 0;
  visibility: hidden;
}

.sound-toggle {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 28;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(37, 35, 31, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.64);
  backdrop-filter: blur(10px);
  cursor: pointer;
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(37, 35, 31, 0.12);
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.sound-toggle:hover {
  border-color: rgba(37, 35, 31, 0.28);
  background: rgba(255, 250, 241, 0.9);
  transform: translateY(-1px);
}

.sound-toggle:active {
  transform: translateY(1px);
}

.sound-toggle:not(.is-muted) {
  color: var(--blue);
}

.sound-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-wave,
.sound-slash {
  fill: none;
}

.sound-toggle.is-muted .sound-wave {
  opacity: 0;
}

.sound-toggle:not(.is-muted) .sound-slash {
  opacity: 0;
}

.character {
  position: relative;
  z-index: 2;
  width: min(82%, 560px);
  height: min(88%, 680px);
  min-height: 520px;
  transform: translateY(18px);
  filter: drop-shadow(0 26px 22px rgba(37, 35, 31, 0.22));
  user-select: none;
  pointer-events: auto;
}

.live2d-canvas,
.loading-placeholder,
.character-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.loading-placeholder {
  inset: auto;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: var(--loading-sleep-image-size);
  height: var(--loading-sleep-image-size);
  object-fit: contain;
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.sleep-effects {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.sleep-z {
  position: absolute;
  color: rgba(37, 35, 31, 0.86);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(37, 35, 31, 0.12);
  animation: sleepFloat 2.8s ease-in-out infinite;
}

.sleep-z-a {
  left: 19%;
  top: 33%;
  font-size: 34px;
}

.sleep-z-b {
  left: 25%;
  top: 39%;
  font-size: 22px;
  animation-delay: 0.65s;
}

.sleep-bubble {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(37, 35, 31, 0.62);
  border-radius: 999px;
  animation: sleepBubble 3.4s ease-in-out infinite;
}

.sleep-bubble-a {
  right: 25%;
  top: 31%;
}

.sleep-bubble-b {
  right: 19%;
  top: 42%;
  width: 10px;
  height: 10px;
  animation-delay: 0.8s;
}

.sleep-bubble-c {
  right: 31%;
  top: 55%;
  width: 8px;
  height: 8px;
  animation-delay: 1.25s;
}

.live2d-canvas {
  display: block;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.feedback-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.feedback-debug-label {
  position: absolute;
  left: 50%;
  top: 18px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  max-width: min(92%, 420px);
  padding: 5px 9px;
  border: 1px solid rgba(37, 35, 31, 0.18);
  border-radius: 6px;
  background: rgba(255, 250, 241, 0.88);
  color: rgba(37, 35, 31, 0.82);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  white-space: nowrap;
}

.stage.feedback-active .feedback-debug-label {
  opacity: 0;
}

.stage.feedback-active .feedback-canvas {
  opacity: 1;
}

.character.feedback-active .live2d-canvas {
  opacity: 0;
}

.character-fallback {
  object-fit: contain;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.live2d-status {
  position: absolute;
  left: 50%;
  bottom: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(37, 35, 31, 0.12);
  border-radius: 6px;
  background: rgba(255, 250, 241, 0.78);
  color: rgba(37, 35, 31, 0.72);
  font-size: 12px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.character.live2d-ready .live2d-canvas {
  opacity: 1;
}

.character.live2d-ready.feedback-active .live2d-canvas {
  opacity: 0;
}

.character.live2d-ready .loading-placeholder,
.character.live2d-error .loading-placeholder,
.character.live2d-ready .sleep-effects,
.character.live2d-error .sleep-effects,
.character.live2d-ready .character-fallback,
.character.live2d-ready .live2d-status {
  opacity: 0;
  visibility: hidden;
}

.character.live2d-error .character-fallback {
  opacity: 1;
  visibility: visible;
}

.character.live2d-error .live2d-status {
  color: #a74239;
}

.interaction-cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 32;
  display: none;
  width: 86px;
  height: 86px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  will-change: transform;
  filter: drop-shadow(0 5px 5px rgba(37, 35, 31, 0.18));
}

.stage.hand-cursor-active {
  cursor: none;
}

.stage.hand-cursor-active .sound-toggle,
.stage.hand-cursor-active .focus-mode-toggle {
  cursor: pointer;
}

.interaction-cursor.visible {
  display: block;
}

.interaction-cursor.pat-mode {
  transform: translate(-50%, -64%) rotate(-5deg);
}

.interaction-cursor.poke-mode {
  transform: translate(-18%, -20%);
}

.focus-mode-toggle {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(37, 35, 31, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.64);
  backdrop-filter: blur(10px);
  cursor: pointer;
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(37, 35, 31, 0.12);
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.focus-mode-toggle:hover {
  border-color: rgba(37, 35, 31, 0.28);
  background: rgba(255, 250, 241, 0.9);
  transform: translateY(-1px);
}

.focus-mode-toggle:active {
  transform: translateY(1px);
}

.focus-icon {
  position: relative;
  display: block;
  width: 21px;
  height: 21px;
}

.focus-icon i {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: currentColor;
  border-style: solid;
}

.focus-icon i:nth-child(1) {
  top: 0;
  left: 0;
  border-width: 2px 0 0 2px;
}

.focus-icon i:nth-child(2) {
  top: 0;
  right: 0;
  border-width: 2px 2px 0 0;
}

.focus-icon i:nth-child(3) {
  right: 0;
  bottom: 0;
  border-width: 0 2px 2px 0;
}

.focus-icon i:nth-child(4) {
  bottom: 0;
  left: 0;
  border-width: 0 0 2px 2px;
}

body.focus-mode {
  overflow: hidden;
}

body.focus-mode .shell {
  width: 100vw;
  height: 100vh;
  padding: 0;
}

body.focus-mode .topbar,
body.focus-mode .announcement-bar,
body.focus-mode .claim-panel,
body.focus-mode .leaderboard-panel,
body.focus-mode .inventory-panel,
body.focus-mode .site-footer {
  display: none;
}

body.focus-mode .workspace {
  display: block;
  width: 100vw;
  height: 100vh;
  min-height: 0;
}

body.focus-mode .stage-panel {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.focus-mode .stage {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border-radius: 0;
}

body.focus-mode .character {
  width: min(58vw, 620px);
  height: 82vh;
  min-height: 0;
}

body.focus-mode .reaction-bubble {
  top: 28px;
}

body.focus-mode .focus-mode-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  width: 46px;
  height: 46px;
  background: rgba(255, 250, 241, 0.78);
}

body.focus-mode .focus-icon i:nth-child(1) {
  top: 6px;
  left: 6px;
}

body.focus-mode .focus-icon i:nth-child(2) {
  top: 6px;
  right: 6px;
}

body.focus-mode .focus-icon i:nth-child(3) {
  right: 6px;
  bottom: 6px;
}

body.focus-mode .focus-icon i:nth-child(4) {
  bottom: 6px;
  left: 6px;
}

.status-panel {
  position: relative;
  display: grid;
  align-content: start;
  gap: 16px;
}

.leaderboard-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow-y: auto;
  margin: 0;
  padding: 0 4px 0 0;
  list-style: none;
  overscroll-behavior: contain;
  scrollbar-color: rgba(37, 35, 31, 0.34) rgba(255, 250, 241, 0.18);
  scrollbar-width: thin;
}

.leaderboard-list::-webkit-scrollbar {
  width: 8px;
}

.leaderboard-list::-webkit-scrollbar-track {
  background: rgba(255, 250, 241, 0.18);
  border-radius: 999px;
}

.leaderboard-list::-webkit-scrollbar-thumb {
  background: rgba(37, 35, 31, 0.34);
  border-radius: 999px;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 24px 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
}

.leaderboard-list .leaderboard-empty {
  display: grid;
  place-items: center;
  min-height: 88px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.lamp-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lamp-status div {
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
}

.lamp-status span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.lamp-status strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.rank {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.leaderboard-list li:nth-child(1) .rank {
  color: var(--gold);
}

.player-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(37, 35, 31, 0.12);
  border-radius: 50%;
  background: hsl(var(--avatar-hue) 64% 72%);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.player-name {
  min-width: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-name:hover {
  color: var(--coral);
}

.leaderboard-list strong {
  color: var(--muted);
  font-size: 15px;
}

.profile-popover {
  position: absolute;
  z-index: 120;
  display: grid;
  gap: 7px;
  width: 184px;
  padding: 12px;
  border: 1px solid rgba(37, 35, 31, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.98);
  box-shadow: 0 16px 38px rgba(47, 36, 25, 0.18);
}

.profile-popover[hidden] {
  display: none;
}

.profile-popover strong {
  font-size: 15px;
}

.profile-popover span {
  color: var(--muted);
  font-size: 12px;
}

.profile-popover button {
  height: 34px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: #fff8ed;
  cursor: pointer;
}

.my-rank {
  display: grid;
  grid-template-columns: 24px 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid rgba(37, 35, 31, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.38);
}

.self-avatar {
  --avatar-hue: 38;
}

.self-name {
  cursor: default;
  pointer-events: none;
}

.my-rank strong {
  color: var(--coral);
  font-size: 15px;
}

.inventory-panel {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  min-height: 138px;
  margin-top: 18px;
  padding: 16px 18px;
  background: rgba(255, 250, 241, 0.18);
  border-color: rgba(37, 35, 31, 0.08);
  box-shadow: none;
  backdrop-filter: blur(6px);
}

.stage-inventory {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 2.8vw, 26px);
  z-index: 24;
  width: min(calc(100% - clamp(28px, 6vw, 68px)), 980px);
  min-height: 106px;
  margin-top: 0;
  padding: 18px 12px 12px;
  border: 1px solid rgba(37, 35, 31, 0.08);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.22);
  box-shadow: 0 16px 36px rgba(47, 36, 25, 0.08);
  backdrop-filter: blur(10px);
  transition:
    min-height 0.24s ease,
    padding 0.24s ease,
    width 0.24s ease,
    transform 0.24s ease,
    background 0.24s ease,
    box-shadow 0.24s ease;
  transform: translateX(-50%);
}

.inventory-toggle {
  position: absolute;
  top: -18px;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 48px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(37, 35, 31, 0.12);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 246, 232, 0.82)),
    rgba(255, 250, 241, 0.9);
  box-shadow: 0 8px 18px rgba(47, 36, 25, 0.12);
  color: #625b4f;
  cursor: pointer;
  transform: translateX(-50%);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.inventory-toggle:hover {
  border-color: rgba(242, 107, 94, 0.28);
  box-shadow: 0 10px 22px rgba(47, 36, 25, 0.16);
  transform: translateX(-50%) translateY(-1px);
}

.inventory-toggle i {
  width: 11px;
  height: 11px;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.18s ease;
}

.stage-inventory.collapsed {
  left: 50%;
  width: 48px;
  min-height: 0;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  transform: translateX(-50%);
}

.stage-inventory.collapsed .inventory-toggle i {
  transform: translateY(3px) rotate(225deg);
}

.stage-inventory.collapsed .gift-rail {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.gift-rail {
  display: grid;
  grid-template-columns: repeat(7, minmax(82px, 1fr));
  gap: 10px;
  max-height: 190px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transition:
    max-height 0.24s ease,
    opacity 0.18s ease,
    transform 0.24s ease;
}

.stage-inventory .gift-rail {
  grid-template-columns: repeat(7, minmax(64px, 1fr));
}

.gift-slot {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 92px;
  padding: 9px;
  border: 1px dashed rgba(37, 35, 31, 0.22);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.34);
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.stage-inventory .gift-slot {
  min-height: 72px;
  padding: 6px;
  background: rgba(255, 250, 241, 0.38);
}

.stage-inventory .gift-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 3px;
}

.gift-slot.filled {
  border-style: solid;
  border-color: rgba(37, 35, 31, 0.72);
  background: #fffaf1;
  cursor: grab;
  touch-action: none;
}

.gift-slot.filled:hover:not(.disabled) {
  transform: translateY(-3px);
  box-shadow: 5px 5px 0 rgba(37, 35, 31, 0.88);
}

.gift-slot.disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.6);
}

.empty-slot-mark {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(37, 35, 31, 0.16);
  border-radius: 50%;
  opacity: 0.55;
}

.gift-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--gift-color);
  color: #fff8ed;
  font-size: 20px;
  font-weight: 900;
}

.gift-icon.has-image {
  border-radius: 0;
  background: transparent;
}

.gift-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.gift-slot h3 {
  margin: 0 0 8px;
  font-size: 14px;
  text-align: center;
}

.gift-slot p {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.gift-count {
  position: absolute;
  right: 7px;
  top: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff8ed;
  font-size: 12px;
  font-weight: 800;
}

.site-footer {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: 18px;
  padding: 14px 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
}

.footer-link-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 20px;
}

.footer-links a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 800;
  transition: color 0.16s ease;
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.footer-icon img {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.footer-actions a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.footer-actions a:hover {
  color: var(--ink);
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(37, 35, 31, 0.28);
  backdrop-filter: blur(8px);
}

.modal-layer[hidden],
.modal-sheet[hidden] {
  display: none;
}

.modal-sheet {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(37, 35, 31, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.94);
  box-shadow: 0 24px 70px rgba(47, 36, 25, 0.22);
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 12px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(37, 35, 31, 0.72);
  border-radius: 0;
  background: #fff5df;
  box-shadow:
    3px 3px 0 rgba(37, 35, 31, 0.22),
    inset -3px -3px 0 rgba(242, 107, 94, 0.18),
    inset 3px 3px 0 rgba(255, 255, 255, 0.8);
  cursor: pointer;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  image-rendering: pixelated;
  transition: transform 0.08s steps(1), box-shadow 0.08s steps(1), background 0.08s steps(1);
}

.modal-close:hover {
  background: #ffe2dc;
}

.modal-close:active {
  transform: translate(2px, 2px);
  box-shadow:
    1px 1px 0 rgba(37, 35, 31, 0.22),
    inset -3px -3px 0 rgba(242, 107, 94, 0.18),
    inset 3px 3px 0 rgba(255, 255, 255, 0.8);
}

.login-notice-sheet {
  width: min(460px, calc(100vw - 32px));
  padding: 24px;
  background:
    radial-gradient(circle at 16% 18%, rgba(63, 184, 154, 0.14), transparent 28%),
    linear-gradient(135deg, rgba(255, 250, 241, 0.98), rgba(255, 245, 230, 0.96));
}

.login-notice-head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.login-notice-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(255, 250, 241, 0.94);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--coral));
  color: #fffaf1;
  box-shadow: 0 12px 24px rgba(230, 173, 57, 0.2);
  font-size: 20px;
  font-weight: 900;
}

.feedback-sheet {
  width: min(940px, calc(100vw - 32px));
  background:
    radial-gradient(circle at 12% 8%, rgba(72, 111, 159, 0.12), transparent 28%),
    radial-gradient(circle at 90% 18%, rgba(63, 184, 154, 0.12), transparent 30%),
    rgba(255, 250, 241, 0.96);
}

.feedback-head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.feedback-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(72, 111, 159, 0.32);
  border-radius: 12px;
  background-image:
    url("assets/content-icons/feedback-icon-v1.png"),
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(225, 240, 235, 0.62)),
    linear-gradient(135deg, rgba(255, 250, 241, 0.92), rgba(255, 250, 241, 0.84));
  background-position: center, center, center;
  background-repeat: no-repeat;
  background-size: 84% 84%, auto, auto;
  box-shadow: inset -4px -4px 0 rgba(72, 111, 159, 0.1);
}

.feedback-head h2,
.feedback-history h3 {
  margin: 0;
}

.feedback-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.feedback-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
  gap: 18px;
}

.feedback-form,
.feedback-history {
  min-height: 440px;
  padding: 16px;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.48);
}

.feedback-form {
  display: grid;
  align-content: start;
  gap: 13px;
}

.feedback-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.feedback-form input[type="text"],
.feedback-form textarea {
  width: 100%;
  border: 1px solid rgba(37, 35, 31, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font: inherit;
}

.feedback-form input[type="text"] {
  height: 40px;
  padding: 0 12px;
}

.feedback-form textarea {
  min-height: 130px;
  resize: vertical;
  padding: 11px 12px;
}

.feedback-upload input {
  padding: 10px;
  border: 1px dashed rgba(72, 111, 159, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.feedback-upload small {
  color: rgba(37, 35, 31, 0.52);
  line-height: 1.5;
}

.feedback-file-list {
  display: grid;
  gap: 6px;
}

.feedback-file-list span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(72, 111, 159, 0.08);
  color: #486f9f;
  font-size: 12px;
  font-weight: 800;
}

.feedback-history {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.feedback-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feedback-ticket-list {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 390px;
  overflow: auto;
  padding-right: 4px;
}

.feedback-ticket-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
}

.feedback-ticket-card header,
.feedback-reply-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.feedback-ticket-card h4 {
  margin: 0;
  font-size: 15px;
}

.feedback-ticket-card p,
.feedback-reply-item p {
  margin: 0;
  color: rgba(37, 35, 31, 0.72);
  font-size: 13px;
  line-height: 1.6;
}

.feedback-attachment-list,
.feedback-reply-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feedback-attachment-list a {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(63, 184, 154, 0.12);
  color: #267c66;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.feedback-reply-list {
  display: grid;
}

.feedback-reply-item {
  padding: 9px 10px;
  border-left: 3px solid rgba(230, 173, 57, 0.66);
  border-radius: 6px;
  background: rgba(230, 173, 57, 0.08);
}

.feedback-status {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(37, 35, 31, 0.08);
  color: rgba(37, 35, 31, 0.62);
  font-size: 12px;
  font-weight: 900;
}

.feedback-status.open {
  background: rgba(72, 111, 159, 0.12);
  color: #486f9f;
}

.feedback-status.replied {
  background: rgba(63, 184, 154, 0.14);
  color: #267c66;
}

.feedback-status.closed {
  background: rgba(37, 35, 31, 0.08);
  color: rgba(37, 35, 31, 0.52);
}

.login-notice-head p {
  margin: 0 0 4px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 900;
}

.login-notice-head h2 {
  margin: 0;
  font-size: 23px;
}

.login-notice-content {
  max-height: 260px;
  margin: 20px 0;
  padding: 16px;
  overflow-y: auto;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.38);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.8;
  white-space: pre-wrap;
}

.contributors-sheet {
  width: min(720px, calc(100vw - 32px));
  overflow: hidden;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.96), rgba(239, 249, 244, 0.94)),
    rgba(255, 250, 241, 0.96);
}

.contributors-head {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 2px 48px 20px 2px;
  border-bottom: 1px solid rgba(37, 35, 31, 0.1);
}

.contributors-mark {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 2px solid rgba(255, 250, 241, 0.92);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mint), #6dcbb3);
  color: #fffaf1;
  box-shadow: 0 12px 26px rgba(63, 184, 154, 0.22);
  font-size: 25px;
  font-weight: 900;
}

.contributors-head h2 {
  margin: 0;
  font-size: 24px;
}

.contributors-head p {
  max-width: 540px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.contributors-head strong {
  display: inline-block;
  margin-top: 9px;
  color: var(--blue);
  font-size: 12px;
}

.contributors-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-height: 300px;
  margin-top: 18px;
  padding: 2px 10px 2px 2px;
  overflow-y: auto;
  scrollbar-color: rgba(63, 184, 154, 0.68) rgba(37, 35, 31, 0.06);
  scrollbar-width: thin;
}

.contributors-grid::-webkit-scrollbar {
  width: 7px;
}

.contributors-grid::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(37, 35, 31, 0.06);
}

.contributors-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(63, 184, 154, 0.68);
}

.contributors-grid:focus-visible {
  outline: 2px solid rgba(63, 184, 154, 0.68);
  outline-offset: 4px;
}

.contributors-grid div {
  display: grid;
  justify-items: center;
  min-width: 0;
  min-height: 132px;
  padding: 14px 8px 12px;
  border: 1px solid rgba(37, 35, 31, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.4);
  text-align: center;
}

.contributors-grid div:nth-child(4n + 2) span {
  background: linear-gradient(135deg, #e7b33d, #f1cb72);
}

.contributors-grid div:nth-child(4n + 3) span {
  background: linear-gradient(135deg, #f07d70, #f5aaa1);
}

.contributors-grid div:nth-child(4n) span {
  background: linear-gradient(135deg, #6599d8, #91b8e7);
}

.contributors-grid span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 3px solid rgba(255, 250, 241, 0.9);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mint), #78cdb8);
  color: #fffaf1;
  box-shadow: 0 8px 18px rgba(37, 35, 31, 0.12);
  font-size: 21px;
  font-weight: 900;
}

.contributors-grid span img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.contributors-grid b {
  max-width: 100%;
  margin-top: 9px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contributors-grid small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.about-sheet {
  width: min(720px, calc(100vw - 32px));
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.97), rgba(242, 249, 246, 0.95)),
    rgba(255, 250, 241, 0.96);
}

.about-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 2px 48px 18px 2px;
  border-bottom: 1px solid rgba(37, 35, 31, 0.1);
}

.about-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 2px solid rgba(255, 250, 241, 0.92);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #f0c86c);
  color: #fffaf1;
  box-shadow: 0 12px 26px rgba(230, 173, 57, 0.22);
  font-size: 24px;
  font-weight: 900;
}

.about-head h2 {
  margin: 0;
  font-size: 24px;
}

.about-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.about-content {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.about-content p {
  margin: 0;
  color: rgba(37, 35, 31, 0.78);
  font-size: 13px;
  line-height: 1.85;
}

.authorization-shot {
  margin: 18px 0 0;
  padding: 10px;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.4);
}

.authorization-shot img {
  display: block;
  width: 100%;
  height: 230px;
  border-radius: 6px;
  object-fit: cover;
  object-position: center;
}

.authorization-shot figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.profile-sheet {
  width: min(900px, calc(100vw - 32px));
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.94), rgba(239, 249, 244, 0.9)),
    rgba(255, 250, 241, 0.92);
}

.profile-cover {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  min-height: 190px;
  padding: 22px 56px 22px 22px;
  border: 1px solid rgba(37, 35, 31, 0.12);
  border-radius: 8px;
  background:
    var(--profile-default-cover-image, url("assets/profile-pigniu-id-photo-v1.png")) right 12px top -28px / 292px auto no-repeat,
    #fee3e4;
  overflow: hidden;
}

.profile-cover.has-custom-cover {
  background:
    linear-gradient(90deg, rgba(255, 250, 241, 0.9), rgba(255, 250, 241, 0.36)),
    var(--profile-cover-image) center / cover no-repeat,
    #fee3e4;
}

.profile-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.profile-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 3px solid rgba(255, 250, 241, 0.9);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mint), #74cdb6);
  color: #fff8ed;
  box-shadow: 0 14px 34px rgba(63, 184, 154, 0.28);
  font-size: 30px;
  font-weight: 900;
}

.profile-identity {
  min-width: 0;
}

.profile-id {
  display: inline-flex;
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.profile-identity h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

.profile-identity p {
  max-width: 520px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-tags span {
  padding: 5px 9px;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.68);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.profile-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.profile-actions button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(37, 35, 31, 0.14);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.64);
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.profile-actions button:hover {
  border-color: rgba(37, 35, 31, 0.24);
  background: rgba(255, 250, 241, 0.94);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.profile-stats div {
  min-height: 82px;
  padding: 13px;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.38);
}

.profile-stats span,
.profile-log span,
.section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-stats strong {
  display: block;
  margin-top: 10px;
  font-size: 18px;
}

.profile-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.profile-column {
  display: grid;
  gap: 12px;
  align-content: start;
}

.profile-section {
  padding: 16px;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.32);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h3 {
  margin: 0;
  font-size: 17px;
}

.medal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px;
  max-height: 336px;
  padding: 2px 10px 4px 2px;
  overflow-y: auto;
  scrollbar-color: rgba(230, 173, 57, 0.68) rgba(37, 35, 31, 0.06);
  scrollbar-width: thin;
}

.medal-grid::-webkit-scrollbar {
  width: 7px;
}

.medal-grid::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(37, 35, 31, 0.06);
}

.medal-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(230, 173, 57, 0.68);
}

.medal-grid:focus-visible {
  outline: 2px solid rgba(230, 173, 57, 0.72);
  outline-offset: 4px;
}

.medal-grid span {
  display: grid;
  justify-items: center;
  align-content: center;
  align-items: center;
  gap: 7px;
  min-height: 124px;
  padding: 10px 8px 9px;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.78), transparent 46%),
    linear-gradient(180deg, rgba(255, 248, 230, 0.74), rgba(230, 173, 57, 0.16));
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.medal-grid b {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.72), rgba(230, 173, 57, 0.2));
  color: #795719;
  font-size: 28px;
  line-height: 1;
}

.medal-grid em {
  display: block;
  width: 100%;
  min-height: 16px;
  color: #4c4338;
  font-style: normal;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.medal-grid b.medal-image {
  position: relative;
  overflow: hidden;
  background: transparent;
}

.medal-grid b.medal-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.medal-grid .locked {
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.52), transparent 46%),
    rgba(255, 255, 255, 0.24);
  color: var(--muted);
}

.medal-grid .locked b {
  background: rgba(37, 35, 31, 0.08);
  color: var(--muted);
}

.medal-grid .locked b.medal-image img {
  filter: grayscale(1) saturate(0.1) contrast(0.86) opacity(0.78);
}

.medal-grid .locked b.medal-image::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(92, 92, 92, 0.42);
  pointer-events: none;
}

.medal-grid .profile-empty {
  grid-column: 1 / -1;
  justify-content: center;
  background: rgba(255, 255, 255, 0.24);
  color: var(--muted);
}

.profile-log {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-log li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(37, 35, 31, 0.08);
}

.profile-log li:last-child {
  border-bottom: 0;
}

.profile-log b {
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.profile-log .profile-empty {
  display: block;
  color: var(--muted);
  text-align: center;
}

.auth-sheet {
  width: min(880px, calc(100vw - 32px));
  min-height: 560px;
  overflow: hidden;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(255, 250, 241, 0.06) 0%, rgba(255, 250, 241, 0.08) 54%, rgba(255, 250, 241, 0.94) 72%, rgba(255, 250, 241, 0.98) 100%),
    url("assets/auth-pixel-scene-v1.png") center / cover no-repeat;
}

.settings-sheet {
  width: min(760px, calc(100vw - 32px));
}

.display-settings-sheet {
  width: min(560px, calc(100vw - 32px));
}

.display-preference-list {
  display: grid;
  gap: 10px;
}

.display-preference {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 72px;
  padding: 11px 14px;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.54);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.display-preference:hover {
  border-color: rgba(63, 184, 154, 0.34);
  background: rgba(255, 250, 241, 0.88);
}

.preference-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fffaf1;
  font-size: 16px;
  font-weight: 900;
}

.gacha-symbol {
  background: var(--coral);
}

.rank-symbol {
  background: var(--blue);
}

.preference-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.preference-copy strong {
  font-size: 15px;
}

.preference-copy small,
.display-settings-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.switch-control {
  position: relative;
  display: block;
  width: 46px;
  height: 26px;
}

.switch-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(37, 35, 31, 0.16);
  border-radius: 999px;
  background: rgba(37, 35, 31, 0.1);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fffaf1;
  box-shadow: 0 2px 5px rgba(47, 36, 25, 0.22);
  transition: transform 0.2s cubic-bezier(0.22, 0.8, 0.22, 1);
}

.switch-control input:checked + .switch-track {
  border-color: rgba(63, 184, 154, 0.62);
  background: var(--mint);
}

.switch-control input:checked + .switch-track::after {
  transform: translateX(20px);
}

.switch-control input:focus-visible + .switch-track {
  outline: 2px solid rgba(72, 111, 159, 0.72);
  outline-offset: 3px;
}

.display-settings-note {
  margin: -2px 2px 0;
}

.auth-form {
  display: grid;
  gap: 15px;
  width: min(340px, 100%);
  margin: 0 0 0 auto;
  padding: 18px;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.82);
  box-shadow: 0 16px 34px rgba(47, 36, 25, 0.12);
  backdrop-filter: blur(6px);
}

.settings-form {
  display: grid;
  gap: 15px;
}

.profile-edit-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.avatar-editor {
  display: grid;
  justify-items: center;
  padding: 16px;
  border: 1px solid rgba(37, 35, 31, 0.09);
  border-radius: 8px;
  background: rgba(254, 227, 228, 0.42);
}

.avatar-editor-title {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.avatar-editor-title strong {
  font-size: 15px;
}

.avatar-editor-title span {
  color: var(--muted);
  font-size: 11px;
}

.avatar-crop-stage {
  position: relative;
  width: 210px;
  height: 210px;
  overflow: hidden;
  border: 3px solid rgba(255, 250, 241, 0.96);
  border-radius: 50%;
  background:
    linear-gradient(45deg, rgba(37, 35, 31, 0.04) 25%, transparent 25% 75%, rgba(37, 35, 31, 0.04) 75%),
    linear-gradient(45deg, rgba(37, 35, 31, 0.04) 25%, rgba(255, 255, 255, 0.42) 25% 75%, rgba(37, 35, 31, 0.04) 75%);
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
  box-shadow:
    0 0 0 1px rgba(37, 35, 31, 0.14),
    0 12px 28px rgba(47, 36, 25, 0.12);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.avatar-crop-stage:active {
  cursor: grabbing;
}

.avatar-crop-stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  pointer-events: none;
  user-select: none;
  will-change: width, height, transform;
}

.avatar-crop-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--mint), #74cdb6);
  color: #fffaf1;
  font-size: 58px;
  font-weight: 900;
}

.avatar-crop-empty[hidden] {
  display: none;
}

.avatar-crop-guide {
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(255, 255, 255, 0.84);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(37, 35, 31, 0.12);
  pointer-events: none;
}

.avatar-upload-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
}

.avatar-upload-actions button {
  height: 38px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.avatar-upload-button {
  border: 1px solid rgba(63, 184, 154, 0.42);
  background: rgba(224, 247, 239, 0.8);
  color: #247c65;
}

.avatar-remove-button {
  border: 1px solid rgba(37, 35, 31, 0.12);
  background: rgba(255, 250, 241, 0.68);
  color: var(--muted);
}

.avatar-zoom-control {
  width: 100%;
  margin-top: 14px;
}

.settings-form .avatar-zoom-control {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.settings-form .avatar-zoom-control input {
  width: 100%;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--mint);
}

.settings-form .avatar-zoom-control input:focus {
  box-shadow: none;
}

.avatar-editor-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.profile-fields {
  display: grid;
  gap: 15px;
}

.cover-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.36);
}

.cover-editor-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.cover-editor-title strong {
  font-size: 13px;
}

.cover-editor-title span {
  color: var(--muted);
  font-size: 11px;
}

.cover-preview {
  position: relative;
  min-height: 98px;
  aspect-ratio: 10 / 3;
  border: 1px solid rgba(37, 35, 31, 0.12);
  border-radius: 7px;
  background:
    var(--profile-default-cover-image, url("assets/profile-pigniu-id-photo-v1.png")) center / cover no-repeat,
    #fee3e4;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.cover-preview.has-custom-cover {
  background:
    var(--profile-cover-image) center / cover no-repeat,
    #fee3e4;
}

.cover-preview:active {
  cursor: grabbing;
}

.cover-preview img {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  max-width: none;
  transform-origin: center;
  pointer-events: none;
}

.cover-preview img[hidden] {
  display: none;
}

.cover-crop-guide {
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.88);
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 1px rgba(37, 35, 31, 0.12),
    0 0 0 999px rgba(37, 35, 31, 0.06);
  pointer-events: none;
}

.settings-form .profile-visibility-setting {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(37, 35, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.36);
  cursor: pointer;
}

.settings-form .profile-visibility-setting input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--mint);
}

.profile-visibility-setting span {
  display: grid;
  gap: 3px;
  color: var(--ink);
}

.profile-visibility-setting small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.auth-form[hidden] {
  display: none;
}

.auth-hero {
  position: relative;
  display: block;
  align-items: center;
  margin: -2px 0 4px;
  padding: 0 34px 14px 0;
  border-bottom: 1px solid rgba(37, 35, 31, 0.08);
}

.auth-hero::before,
.auth-hero::after {
  content: none;
}

.auth-hero::before {
  left: 18px;
}

.auth-hero::after {
  left: 42px;
  background: rgba(242, 107, 94, 0.16);
}

.auth-mascot {
  display: none;
}

.auth-form h2 {
  margin-bottom: 5px;
  font-size: 22px;
}

.auth-hero p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.settings-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: -2px 36px 4px 0;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(37, 35, 31, 0.08);
}

.settings-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--mint);
  color: #fff8ed;
  font-size: 20px;
  font-weight: 900;
}

.settings-mark.lock-mark {
  background: var(--blue);
}

.settings-head h2 {
  margin: 0 0 5px;
  font-size: 22px;
}

.settings-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-form label,
.settings-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input,
.settings-form input,
.settings-form textarea {
  height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(37, 35, 31, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.settings-form textarea {
  min-height: 88px;
  padding-top: 11px;
  resize: vertical;
  line-height: 1.6;
}

.auth-form input:focus,
.settings-form input:focus,
.settings-form textarea:focus {
  border-color: rgba(63, 184, 154, 0.7);
  box-shadow: 0 0 0 3px rgba(63, 184, 154, 0.14);
}

.form-submit {
  height: 46px;
  margin-top: 2px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--ink), #315f83);
  color: #fff8ed;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(37, 35, 31, 0.16);
}

.form-submit:hover {
  filter: brightness(1.04);
}

.form-submit:disabled,
.auth-form button:disabled {
  cursor: wait;
  filter: none;
  opacity: 0.62;
}

.auth-form[aria-busy="true"] input {
  background: rgba(245, 242, 235, 0.74);
}

.settings-form[aria-busy="true"] input,
.settings-form[aria-busy="true"] textarea {
  background: rgba(245, 242, 235, 0.74);
}

.profile-sheet[aria-busy="true"] {
  cursor: wait;
  opacity: 0.76;
}

.settings-actions {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 10px;
}

.ghost-submit {
  height: 46px;
  margin-top: 2px;
  border: 1px solid rgba(37, 35, 31, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.68);
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.ghost-submit:hover {
  border-color: rgba(37, 35, 31, 0.22);
  color: var(--ink);
}

.form-message {
  min-height: 18px;
  margin: -2px 0 0;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.form-message.success {
  color: var(--mint);
}

.auth-message:empty {
  display: none;
}

.auth-switch {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.auth-switch button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--blue);
  font-weight: 800;
}

body.logged-out .user-dropdown {
  display: none;
}

@keyframes idle {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-7px) scale(1.01);
  }
}

@keyframes gachaShake {
  0%,
  100% {
    transform: translateX(0) rotate(0);
  }
  18% {
    transform: translateX(-5px) rotate(-1.4deg);
  }
  36% {
    transform: translateX(5px) rotate(1.4deg);
  }
  54% {
    transform: translateX(-3px) rotate(-0.8deg);
  }
  72% {
    transform: translateX(3px) rotate(0.8deg);
  }
}

@keyframes dailyGiftIdleShake {
  0%,
  84%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  88% {
    transform: translateX(-2px) rotate(-3deg);
  }
  92% {
    transform: translateX(2px) rotate(3deg);
  }
  96% {
    transform: translateX(-1px) rotate(-2deg);
  }
}

@keyframes dailyGiftOpen {
  from {
    background-position: 0 0;
    transform: translateY(0) scale(1);
  }
  to {
    background-position: -672px 0;
    transform: translateY(-2px) scale(1.04);
  }
}

@keyframes announcementScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes knobTurn {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(720deg);
  }
}

@keyframes capsuleFloat {
  0%,
  100% {
    transform: translateY(0) rotate(var(--spin));
  }
  50% {
    transform: translateY(-8px) rotate(calc(var(--spin) + 8deg));
  }
}

@keyframes prizePop {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.42);
  }
  70% {
    opacity: 1;
    transform: translateY(4px) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-16px);
  }
}

@keyframes sleepFloat {
  0%,
  100% {
    opacity: 0.42;
    transform: translate3d(0, 8px, 0) rotate(-7deg);
  }
  45% {
    opacity: 0.95;
    transform: translate3d(-4px, -10px, 0) rotate(4deg);
  }
  80% {
    opacity: 0.15;
    transform: translate3d(-8px, -20px, 0) rotate(8deg);
  }
}

@keyframes sleepBubble {
  0%,
  100% {
    opacity: 0.22;
    transform: translate3d(0, 8px, 0) scale(0.7);
  }
  45% {
    opacity: 0.88;
    transform: translate3d(4px, -8px, 0) scale(1);
  }
  85% {
    opacity: 0.1;
    transform: translate3d(8px, -18px, 0) scale(1.18);
  }
}

@media (max-width: 1100px) {
  .shell {
    width: min(100% - 24px, 920px);
  }

  .workspace,
  .inventory-panel {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .workspace {
    min-height: 0;
  }

  .stage {
    min-height: 540px;
  }

  .stage-inventory .gift-rail {
    grid-template-columns: repeat(4, minmax(54px, 1fr));
  }

  .gift-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-body {
    grid-template-columns: 1fr;
  }

  .feedback-layout {
    grid-template-columns: 1fr;
  }

  .feedback-form,
  .feedback-history {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 16px, 560px);
    padding-top: 10px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .top-actions {
    position: static;
    transform: none;
  }

  .game-repository-entry {
    justify-self: stretch;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 18px;
  }

  .avatar-button,
  .user-menu {
    width: 100%;
  }

  .avatar-button {
    justify-content: space-between;
  }

  .panel,
  .inventory-panel {
    padding: 13px;
  }

  .user-dropdown {
    left: 0;
    right: 0;
  }

  .stage {
    min-height: 460px;
    padding-top: 18px;
    padding-bottom: 118px;
  }

  .character {
    width: 92%;
    height: 420px;
    min-height: 0;
    transform: translateY(10px);
  }

  .stage-inventory {
    left: 50%;
    width: calc(100% - 20px);
    bottom: 10px;
    padding: 9px;
  }

  .stage-inventory .gift-rail {
    grid-template-columns: repeat(3, minmax(48px, 1fr));
    gap: 7px;
  }

  .stage-inventory .gift-slot {
    min-height: 62px;
  }

  body.focus-mode .character {
    width: min(86vw, 520px);
    height: 78vh;
  }

  .gift-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-layer {
    padding: 12px;
  }

  .profile-sheet {
    width: calc(100vw - 24px);
    padding: 12px;
  }

  .contributors-sheet {
    width: calc(100vw - 24px);
    padding: 18px 14px 14px;
  }

  .about-sheet {
    width: calc(100vw - 24px);
    padding: 18px 14px 14px;
  }

  .settings-sheet {
    width: calc(100vw - 24px);
  }

  .profile-edit-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .avatar-editor {
    width: min(100%, 300px);
    justify-self: center;
  }

  .contributors-head {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding-right: 38px;
  }

  .contributors-mark {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }

  .contributors-head h2 {
    font-size: 21px;
  }

  .contributors-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: min(360px, 48vh);
  }

  .contributors-grid div {
    min-height: 122px;
    padding-inline: 5px;
  }

  .contributors-grid span {
    width: 52px;
    height: 52px;
  }

  .about-head {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding-right: 38px;
  }

  .about-mark {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }

  .about-head h2 {
    font-size: 21px;
  }

  .authorization-shot img {
    height: 190px;
  }

  .profile-cover {
    grid-template-columns: 1fr;
    padding: 18px 44px 18px 16px;
  }

  .profile-head {
    align-items: flex-start;
  }

  .profile-avatar {
    width: 58px;
    height: 58px;
    font-size: 23px;
  }

  .profile-identity h2 {
    font-size: 21px;
  }

  .profile-actions {
    justify-content: flex-start;
  }

  .profile-stats,
  .medal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-log li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .auth-sheet {
    min-height: 0;
    padding-top: 180px;
    background:
      linear-gradient(180deg, rgba(255, 250, 241, 0.04) 0%, rgba(255, 250, 241, 0.18) 42%, rgba(255, 250, 241, 0.98) 68%),
      url("assets/auth-pixel-scene-v1.png") 26% top / auto 260px no-repeat,
      rgba(255, 250, 241, 0.96);
  }

  .auth-form {
    width: 100%;
    margin: 0;
    background: rgba(255, 250, 241, 0.9);
  }

  .settings-actions {
    grid-template-columns: 1fr;
  }
}
