.chat-root {
  width: 100%;
  max-width: 340px;
  height: 100%;
  margin-left: auto;
  padding: 8px 8px 8px 0;
  overflow: hidden;
}

.chat-plaque {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 8px;
  overflow: hidden;
}

.chat-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  z-index: 4;
  border: 2px solid rgba(224, 180, 90, 0.72);
  pointer-events: none;
}

.chat-corner.tl {
  top: 10px;
  left: 10px;
  border-right: 0;
  border-bottom: 0;
}

.chat-corner.tr {
  top: 10px;
  right: 10px;
  border-left: 0;
  border-bottom: 0;
}

.chat-corner.bl {
  bottom: 10px;
  left: 10px;
  border-right: 0;
  border-top: 0;
}

.chat-corner.br {
  bottom: 10px;
  right: 10px;
  border-left: 0;
  border-top: 0;
}

.chat-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding: 4px 6px 12px;
  margin: 0 4px 8px;
  border-bottom: 2px solid rgba(224, 180, 90, 0.38);
}

.chat-head-ico {
  width: 52px;
  height: 52px;
  flex: none;
}

.mascot-seal {
  position: relative;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(40, 16, 0, 0.45));
}

.mascot-seal-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mascot-seal-disc {
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 28%, #6a4018, #1c0c04 72%);
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.4),
    0 0 0 1.5px rgba(224, 180, 90, 0.55);
}

.mascot-seal-disc img {
  position: absolute;
  width: 280%;
  height: 280%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -38%);
  object-fit: cover;
  object-position: 50% 0;
}

.chat-head-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-head-copy strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream);
  text-shadow: 0 1px 0 rgba(40, 16, 0, 0.45);
  line-height: 1.1;
}

.chat-head-copy span {
  font-size: 12px;
  font-weight: 700;
  color: var(--star);
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-log {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 10px 12px;
  margin: 0 2px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(22, 8, 2, 0.58), rgba(26, 10, 4, 0.42));
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 220, 150, 0.1);
  mask-image: linear-gradient(180deg, transparent 0%, #000 16%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 16%);
}

.chat-line {
  display: block;
  color: var(--cream);
  font-weight: 700;
  font-size: 23px;
  line-height: 1.32;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  animation: chat-in 220ms ease-out;
}

.chat-line .nick {
  font-weight: 800;
}

.chat-line .nick::after {
  content: ":";
  margin: 0 0.38em 0 0.12em;
  color: var(--cream);
  font-weight: 700;
}

.chat-line .msg {
  font-weight: 600;
  color: var(--cream);
}

.chat-line img.emote {
  height: 32px;
  width: auto;
  vertical-align: -7px;
}

.chat-rail {
  position: relative;
  z-index: 3;
  flex: none;
  height: 44px;
  margin: 8px 2px 2px;
  border-radius: 14px;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 220, 150, 0.1), transparent 42%),
    linear-gradient(180deg, #5c3212 0%, #3a1c08 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 180, 0.28),
    inset 0 -4px 10px rgba(20, 8, 0, 0.35),
    inset 0 0 0 1px rgba(224, 180, 90, 0.28);
}

.chat-rail-thread {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #c4923e 6%,
    #f0d090 50%,
    #c4923e 94%,
    transparent 100%
  );
  box-shadow: 0 0 6px rgba(224, 180, 90, 0.35);
  opacity: 0.85;
}

.chat-rail-track {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  height: 100%;
  padding: 0 10px;
}

.chat-rail-stamp {
  width: 34px;
  height: 34px;
  flex: none;
  filter: drop-shadow(0 1px 2px rgba(20, 8, 0, 0.45));
}

.chat-rail-stamp svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

@keyframes chat-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 36px 48px;
  overflow: visible;
}

html[data-pos="right"] .alert-stage {
  justify-content: flex-end;
  align-items: center;
}

html[data-pos="left"] .alert-stage {
  justify-content: flex-start;
  align-items: center;
}

html[data-pos="top"] .alert-stage {
  align-items: flex-start;
}

.toast-frame {
  position: relative;
  display: flex;
  align-items: center;
  max-width: min(720px, 94vw);
  transform: translateY(18px);
  opacity: 0;
}

.toast-frame.show {
  animation: toast-in 480ms ease forwards;
}

.toast-frame.hide {
  animation: toast-out 380ms ease forwards;
}

.toast-seal {
  position: relative;
  z-index: 2;
  width: 72px;
  height: 72px;
  flex: none;
}

.toast-seal .mascot-seal-disc {
  inset: 14px;
}

.toast {
  min-width: 420px;
  max-width: 640px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 76px 14px 16px;
  color: var(--cream);
}

.toast-kamon {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 56px;
  height: 56px;
  margin-top: -28px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 1px 2px rgba(20, 8, 0, 0.35));
}

.toast-kamon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.toast .copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.toast .kind {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--star);
}

.toast .text {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

@keyframes toast-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-16px);
  }
}

html.scene-render,
html.scene-render body.scene-page,
html.scene-render .scene {
  background: transparent;
}

html.scene-render .scene-seal::before {
  animation: none;
  opacity: 1;
}

body.scene-page {
  background: #1a0c04;
  overflow: hidden;
}

.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a0c04;
}

.scene video,
.scene img.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene .veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 56%,
    rgba(16, 6, 2, 0.12) 0%,
    rgba(8, 3, 0, 0.42) 100%
  );
}

.scene .center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6% 4% 8%;
}

.scene-card {
  position: relative;
  width: min(760px, 86vw);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scene-seal {
  position: relative;
  z-index: 5;
  width: 156px;
  height: 156px;
  margin-bottom: -82px;
  filter: drop-shadow(0 10px 18px rgba(20, 8, 0, 0.5));
}

.scene-seal::before {
  content: "";
  position: absolute;
  inset: -36px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 210, 120, 0.42) 0%,
    rgba(255, 170, 60, 0.12) 46%,
    transparent 70%
  );
  z-index: -1;
  animation: glow 2.8s ease-in-out infinite;
}

.scene-seal .mascot-seal-disc {
  inset: 24px;
}

.scene-plaque {
  min-width: 0;
  width: 100%;
  padding: 96px 48px 40px;
  text-align: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 220, 150, 0.26), transparent 44%),
    linear-gradient(90deg, #6f4014 0%, #c99242 38%, #8a541c 100%);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.46),
    0 0 48px rgba(255, 186, 80, 0.14),
    inset 0 1px 0 rgba(255, 230, 180, 0.42),
    inset 0 -8px 16px rgba(40, 16, 0, 0.22);
}

.scene-kamon {
  position: absolute;
  top: 58%;
  width: 92px;
  height: 92px;
  margin-top: -46px;
  opacity: 0.52;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(20, 8, 0, 0.35));
}

.scene-kamon.left {
  left: 18px;
}

.scene-kamon.right {
  right: 18px;
}

.scene-kamon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.scene-plaque h1 {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 96px;
  font-size: clamp(32px, 4.4vw, 56px);
  font-weight: 800;
  color: var(--cream);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 0 rgba(40, 16, 0, 0.4);
}

.scene-plaque p {
  position: relative;
  z-index: 2;
  margin: 10px 0 0;
  padding: 0 96px;
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 700;
  color: var(--star);
}

.hub {
  background: #1c1008;
  color: #fff1db;
  padding: 40px 48px 64px;
  overflow: auto;
}

.hub a {
  color: #ffd56a;
}

.hub h1 {
  margin: 0 0 8px;
}

.hub .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.hub .card {
  display: block;
  padding: 16px 18px;
  border-radius: 16px;
  background: #3d2410;
  color: #fff1db;
  text-decoration: none;
}

.hub .card strong {
  display: block;
  font-size: 18px;
}

.hub .card span {
  display: block;
  margin-top: 4px;
  color: #e6c48a;
  font-size: 14px;
}

.hub code {
  font-size: 13px;
  background: #2a180c;
  padding: 1px 6px;
  border-radius: 6px;
}

.auth-box {
  max-width: 640px;
  margin: 48px auto;
  padding: 28px 32px;
  color: #fff1db;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7a4a1a;
  margin-right: 8px;
}

.status-dot.ok {
  background: #7dcf6a;
}

.status-dot.bad {
  background: #d2643a;
}
