:root {
  --bg-main: #fff1fb;
  --bg-main-alt: #f6e8ff;
  --bg-accent: #e6eeff;
  --bg-glow: rgba(255, 105, 196, 0.35);
  --bg-glow-alt: rgba(103, 142, 255, 0.35);
  --ink-strong: #231a32;
  --ink-soft: #5a4f73;
  --accent-pink: #ff4db8;
  --accent-blue: #4b6bff;
  --accent: #ff4db8;
  --accent-strong: #4b6bff;
  --accent-warm: #ff7ad1;
  --accent-gradient: linear-gradient(135deg, #ff4db8, #4b6bff);
  --accent-gradient-strong: linear-gradient(135deg, #ff2f9a, #3a5bff);
  --accent-soft: rgba(255, 77, 184, 0.12);
  --accent-soft-strong: rgba(75, 107, 255, 0.18);
  --accent-soft-border: rgba(75, 107, 255, 0.25);
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-muted: rgba(255, 255, 255, 0.75);
  --surface-gradient: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.88));
  --composer-bg: rgba(255, 255, 255, 0.98);
  --composer-border: rgba(150, 150, 195, 0.35);
  --composer-shadow: 0 16px 28px rgba(78, 82, 140, 0.2);
  --composer-icon-bg: rgba(255, 255, 255, 0.96);
  --composer-icon-color: #6f648a;
  --composer-placeholder: #b1a7c8;
  --topbar-gradient: linear-gradient(90deg, rgba(255, 128, 214, 0.92), rgba(128, 190, 255, 0.92));
  --topbar-border: rgba(255, 255, 255, 0.35);
  --topbar-icon-bg: rgba(255, 255, 255, 0.16);
  --topbar-icon-hover: rgba(255, 255, 255, 0.26);
  --topbar-shadow: 0 12px 24px rgba(77, 84, 164, 0.28);
  --border: rgba(79, 90, 164, 0.22);
  --shadow: 0 18px 40px rgba(43, 32, 71, 0.16);
  --shadow-soft: 0 10px 18px rgba(72, 84, 160, 0.22);
  --icon-shadow: 0 10px 18px rgba(73, 92, 196, 0.3);
  --call-glow: rgba(255, 77, 184, 0.45);
  --pulse-color: rgba(255, 77, 184, 0.4);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --radius-media: 20px;
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-bg-strong: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 18px 44px rgba(43, 32, 71, 0.18);
  --glass-blur: blur(20px) saturate(150%);
  --glass-sheen: linear-gradient(160deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 60%);
  --glass-sheen-strong: linear-gradient(120deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0) 45%);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  touch-action: manipulation;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Fira Sans", sans-serif;
  color: var(--ink-strong);
  background:
    radial-gradient(circle at 12% 18%, var(--bg-glow), transparent 46%),
    radial-gradient(circle at 88% 12%, var(--bg-glow-alt), transparent 48%),
    linear-gradient(140deg, var(--bg-main), var(--bg-accent) 55%, var(--bg-main-alt) 100%);
  background-size: 200% 200%, 200% 200%, 200% 200%;
  background-repeat: no-repeat;
  animation: gradientShift 80s ease infinite;
  min-height: 100vh;
  padding: 32px;
  overflow: hidden;
}

html[data-low-power="true"] body,
body[data-low-power="true"],
body[data-low-power="true"][data-brand],
body[data-low-power="true"][data-brand][data-theme] {
  --bg-main: #f3f4f6;
  --bg-main-alt: #f3f4f6;
  --bg-accent: #f3f4f6;
  --bg-glow: transparent;
  --bg-glow-alt: transparent;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-muted: #f8fafc;
  --surface-gradient: #ffffff;
  --composer-bg: #ffffff;
  --composer-border: #d1d5db;
  --composer-shadow: none;
  --composer-placeholder: #6b7280;
  --border: #d1d5db;
  --shadow: none;
  --shadow-soft: none;
  --icon-shadow: none;
  --call-glow: transparent;
  --pulse-color: transparent;
  --glass-bg: #ffffff;
  --glass-bg-strong: #ffffff;
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --radius-media: 10px;
  animation: none !important;
  background: #f3f4f6 !important;
  background-size: 100% 100% !important;
}

body[data-low-power="true"][data-theme="dark"],
body[data-low-power="true"][data-brand][data-theme="dark"] {
  --bg-main: #0f1115;
  --bg-main-alt: #0f1115;
  --bg-accent: #0f1115;
  --ink-strong: #e5e7eb;
  --ink-soft: #9ca3af;
  --surface: #111827;
  --surface-strong: #111827;
  --surface-muted: #0f172a;
  --surface-gradient: #111827;
  --composer-bg: #111827;
  --composer-border: #374151;
  --composer-placeholder: #9ca3af;
  --border: #374151;
  --glass-bg: #111827;
  --glass-bg-strong: #111827;
  background: #0f1115 !important;
}

body[data-low-power="true"] :not(.topbar, .topbar *, .app-footer, .app-footer *, video, video *),
body[data-low-power="true"] :not(.topbar, .topbar *, .app-footer, .app-footer *, video, video *)::before,
body[data-low-power="true"] :not(.topbar, .topbar *, .app-footer, .app-footer *, video, video *)::after {
  animation: none !important;
  transition: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
  will-change: auto !important;
}

body[data-low-power="true"] .app,
body[data-low-power="true"] .chatroom,
body[data-low-power="true"] .composer,
body[data-low-power="true"] .composer-input,
body[data-low-power="true"] .panel-card,
body[data-low-power="true"] .modal-content,
body[data-low-power="true"] .settings-card,
body[data-low-power="true"] .message.assistant .bubble,
body[data-low-power="true"] .message.system .bubble,
body[data-low-power="true"] .message .media,
body[data-low-power="true"] .gallery-item,
body[data-low-power="true"] .community-item,
body[data-low-power="true"] .slot-card,
body[data-low-power="true"] .swal2-popup {
  background: var(--surface-strong) !important;
  border-color: var(--border) !important;
}

body[data-low-power="true"] .message.user .bubble {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

body[data-low-power="true"] .chatroom::before,
body[data-low-power="true"] .chatroom::after,
body[data-low-power="true"] .app::before,
body[data-low-power="true"] .app::after,
body[data-low-power="true"] .composer::before,
body[data-low-power="true"] .composer::after,
body[data-low-power="true"] .panel-card::before,
body[data-low-power="true"] .panel-card::after,
body[data-low-power="true"] .swal2-popup::before {
  content: none !important;
  display: none !important;
}

body[data-low-power="true"] .message .bubble,
body[data-low-power="true"] .composer,
body[data-low-power="true"] .composer-input,
body[data-low-power="true"] .panel-card,
body[data-low-power="true"] .modal-content,
body[data-low-power="true"] .settings-card,
body[data-low-power="true"] .slot-card {
  border-radius: var(--radius-sm) !important;
}

body.dream-character-locked {
  overflow: hidden;
}

body.dream-character-locked .app,
body.dream-character-locked .character-modal,
body.dream-character-locked .modal {
  pointer-events: none;
  user-select: none;
}

body.cloud-sync-loading {
  overflow: hidden;
}

body.cloud-sync-loading .app,
body.cloud-sync-loading .character-modal,
body.cloud-sync-loading .modal {
  pointer-events: none;
  user-select: none;
}

body[data-theme="dark"] {
  --bg-main: #120a1d;
  --bg-main-alt: #1c1130;
  --bg-accent: #0f193a;
  --bg-glow: rgba(255, 92, 207, 0.28);
  --bg-glow-alt: rgba(92, 123, 255, 0.25);
  --ink-strong: #f6f1ff;
  --ink-soft: #c8bfe5;
  --accent-pink: #ff5ccf;
  --accent-blue: #5c7bff;
  --accent: #ff5ccf;
  --accent-strong: #5c7bff;
  --accent-warm: #ff7ad7;
  --accent-gradient: linear-gradient(135deg, #ff5ccf, #5c7bff);
  --accent-gradient-strong: linear-gradient(135deg, #ff3fbf, #4363ff);
  --accent-soft: rgba(255, 92, 207, 0.18);
  --accent-soft-strong: rgba(92, 123, 255, 0.22);
  --accent-soft-border: rgba(92, 123, 255, 0.4);
  --surface: rgba(20, 17, 34, 0.9);
  --surface-strong: rgba(28, 22, 46, 0.95);
  --surface-muted: rgba(28, 22, 46, 0.8);
  --surface-gradient: linear-gradient(160deg, rgba(28, 22, 46, 0.98), rgba(20, 17, 34, 0.9));
  --composer-bg: rgba(34, 28, 52, 0.96);
  --composer-border: rgba(150, 140, 200, 0.45);
  --composer-shadow: 0 18px 30px rgba(6, 4, 16, 0.7);
  --composer-icon-bg: rgba(255, 255, 255, 0.08);
  --composer-icon-color: #d6c9f0;
  --composer-placeholder: #bfb1da;
  --topbar-gradient: linear-gradient(90deg, rgba(197, 84, 255, 0.92), rgba(92, 158, 255, 0.92));
  --topbar-border: rgba(255, 255, 255, 0.22);
  --topbar-icon-bg: rgba(255, 255, 255, 0.12);
  --topbar-icon-hover: rgba(255, 255, 255, 0.22);
  --topbar-shadow: 0 12px 26px rgba(6, 4, 16, 0.6);
  --border: rgba(120, 112, 174, 0.35);
  --shadow: 0 20px 44px rgba(6, 4, 16, 0.6);
  --shadow-soft: 0 12px 20px rgba(6, 4, 16, 0.6);
  --icon-shadow: 0 12px 20px rgba(6, 4, 16, 0.65);
  --call-glow: rgba(255, 92, 207, 0.45);
  --pulse-color: rgba(255, 92, 207, 0.35);
  --glass-bg: rgba(22, 19, 36, 0.62);
  --glass-bg-strong: rgba(28, 23, 46, 0.72);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 20px 46px rgba(6, 4, 16, 0.65);
  --glass-blur: blur(18px) saturate(140%);
  --glass-sheen: linear-gradient(160deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 60%);
  --glass-sheen-strong: linear-gradient(120deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 45%);
}

body[data-brand="fevermate"] {
  --bg-main: #0b0905;
  --bg-main-alt: #140f08;
  --bg-accent: #1a1307;
  --bg-glow: rgba(214, 178, 90, 0.3);
  --bg-glow-alt: rgba(76, 52, 14, 0.25);
  --ink-strong: #f6e8c7;
  --ink-soft: #cbb88b;
  --accent-pink: #d6b25a;
  --accent-blue: #2a1b08;
  --accent: #d6b25a;
  --accent-strong: #2a1b08;
  --accent-warm: #efcf7a;
  --accent-gradient: linear-gradient(135deg, #d6b25a, #2a1b08);
  --accent-gradient-strong: linear-gradient(135deg, #e2c46f, #1a1206);
  --accent-soft: rgba(214, 178, 90, 0.18);
  --accent-soft-strong: rgba(214, 178, 90, 0.26);
  --accent-soft-border: rgba(214, 178, 90, 0.4);
  --surface: rgba(18, 13, 6, 0.92);
  --surface-strong: rgba(22, 16, 7, 0.96);
  --surface-muted: rgba(22, 16, 7, 0.82);
  --surface-gradient: linear-gradient(160deg, rgba(24, 18, 9, 0.98), rgba(12, 9, 4, 0.9));
  --composer-bg: rgba(20, 14, 6, 0.96);
  --composer-border: rgba(214, 178, 90, 0.35);
  --composer-icon-bg: rgba(255, 255, 255, 0.08);
  --composer-icon-color: #d8c39a;
  --composer-placeholder: #b8a57d;
  --topbar-gradient: linear-gradient(90deg, rgba(214, 178, 90, 0.92), rgba(42, 27, 8, 0.92));
  --topbar-border: rgba(214, 178, 90, 0.25);
  --topbar-icon-bg: rgba(214, 178, 90, 0.14);
  --topbar-icon-hover: rgba(214, 178, 90, 0.24);
  --topbar-shadow: 0 12px 26px rgba(8, 6, 2, 0.7);
  --border: rgba(214, 178, 90, 0.3);
  --shadow: 0 20px 44px rgba(8, 6, 2, 0.7);
  --shadow-soft: 0 12px 20px rgba(8, 6, 2, 0.6);
  --icon-shadow: 0 12px 20px rgba(8, 6, 2, 0.6);
  --call-glow: rgba(214, 178, 90, 0.5);
  --pulse-color: rgba(214, 178, 90, 0.35);
  --glass-bg: rgba(18, 13, 6, 0.62);
  --glass-bg-strong: rgba(24, 18, 9, 0.72);
  --glass-border: rgba(214, 178, 90, 0.2);
  --glass-shadow: 0 20px 46px rgba(8, 6, 2, 0.65);
  --glass-blur: blur(18px) saturate(140%);
  --glass-sheen: linear-gradient(160deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 60%);
  --glass-sheen-strong: linear-gradient(120deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 45%);
}

body[data-brand="fevermate"][data-theme="light"] {
  --bg-main: #f7f0e3;
  --bg-main-alt: #f1e4cc;
  --bg-accent: #f9f2e2;
  --bg-glow: rgba(214, 178, 90, 0.25);
  --bg-glow-alt: rgba(76, 52, 14, 0.18);
  --ink-strong: #3a2a12;
  --ink-soft: #6d5a32;
  --accent-pink: #cfa953;
  --accent-blue: #3a2a12;
  --accent: #cfa953;
  --accent-strong: #3a2a12;
  --accent-warm: #e4c672;
  --accent-gradient: linear-gradient(135deg, #cfa953, #3a2a12);
  --accent-gradient-strong: linear-gradient(135deg, #d8b768, #2f210e);
  --accent-soft: rgba(207, 169, 83, 0.16);
  --accent-soft-strong: rgba(207, 169, 83, 0.22);
  --accent-soft-border: rgba(207, 169, 83, 0.35);
  --surface: rgba(255, 250, 242, 0.9);
  --surface-strong: rgba(255, 250, 242, 0.96);
  --surface-muted: rgba(255, 250, 242, 0.78);
  --surface-gradient: linear-gradient(160deg, rgba(255, 250, 242, 0.98), rgba(244, 230, 202, 0.9));
  --composer-bg: rgba(255, 252, 246, 0.96);
  --composer-border: rgba(207, 169, 83, 0.28);
  --composer-icon-bg: rgba(207, 169, 83, 0.12);
  --composer-icon-color: #6a532a;
  --composer-placeholder: #9a8458;
  --topbar-gradient: linear-gradient(90deg, rgba(214, 178, 90, 0.92), rgba(95, 69, 24, 0.88));
  --topbar-border: rgba(207, 169, 83, 0.3);
  --topbar-icon-bg: rgba(207, 169, 83, 0.14);
  --topbar-icon-hover: rgba(207, 169, 83, 0.24);
  --topbar-shadow: 0 12px 26px rgba(78, 56, 18, 0.24);
  --border: rgba(207, 169, 83, 0.28);
  --shadow: 0 18px 36px rgba(78, 56, 18, 0.2);
  --shadow-soft: 0 10px 18px rgba(78, 56, 18, 0.22);
  --icon-shadow: 0 10px 18px rgba(78, 56, 18, 0.25);
  --call-glow: rgba(207, 169, 83, 0.45);
  --pulse-color: rgba(207, 169, 83, 0.32);
  --glass-bg: rgba(255, 250, 242, 0.62);
  --glass-bg-strong: rgba(255, 250, 242, 0.72);
  --glass-border: rgba(207, 169, 83, 0.3);
  --glass-shadow: 0 18px 36px rgba(78, 56, 18, 0.22);
  --glass-blur: blur(18px) saturate(140%);
  --glass-sheen: linear-gradient(160deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 60%);
  --glass-sheen-strong: linear-gradient(120deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0) 45%);
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100%;
  min-height: 0;
  animation: rise 0.8s ease forwards;
}


.app-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 8px 4px;
}

.take-break-button {
  background: linear-gradient(45deg, var(--accent-pink), var(--accent-warm), var(--accent-blue), var(--accent-pink));
  background-size: 220% 100%;
  animation: gradientShift 6s ease infinite;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-sizing: border-box;
}

.take-break-button:hover {
  transform: translateY(-1px);
}

.take-break-button:active {
  transform: translateY(1px);
}

body[data-brand="fevermate"] .take-break-button,
body[data-brand="fevermate"] .break-flip {
  display: none;
}

.break-flip {
  position: relative;
  min-width: 150px;
  height: 30px;
  perspective: 900px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.break-flip.is-static-flip {
  perspective: none;
}

.break-flip-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.break-flip.is-flipped .break-flip-card {
  transform: rotateX(180deg);
}

.break-flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.break-flip-face[aria-hidden="true"] {
  display: none;
}

.break-flip-face[aria-hidden="false"] {
  display: flex;
}

.break-flip-face .take-break-button {
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.break-flip-face.break-front {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.break-flip-face.break-back {
  transform: rotateX(180deg) translateZ(0);
  -webkit-transform: rotateX(180deg) translateZ(0);
}

.break-flip.is-static-flip .break-flip-card {
  transform: none;
}

.break-flip.is-static-flip .break-flip-face {
  transform: none;
  -webkit-transform: none;
}

.join-community-button {
  position: relative;
  overflow: hidden;
}

.join-community-size-holder {
  display: inline-block;
  opacity: 0;
  pointer-events: none;
}

.join-community-button.is-linked .join-community-size-holder {
  opacity: 1;
}

.join-community-marquee {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: inherit;
  box-sizing: border-box;
  pointer-events: none;
}

.join-community-button.is-linked .join-community-marquee {
  display: none;
}

.join-community-marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  width: max-content;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.join-community-marquee-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-right: 18px;
}

.join-community-actions {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.join-community-action-card {
  text-decoration: none;
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: inherit;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.join-community-action-card.is-disabled {
  opacity: 0.65;
  filter: grayscale(0.15);
  box-shadow: none;
}

.join-community-action-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.join-community-action-card.discord {
  border-color: var(--accent-soft-border);
  background:
    linear-gradient(140deg, var(--accent-soft), transparent 70%),
    var(--surface);
}

.join-community-action-card.notifications {
  border-color: var(--accent-soft-border);
  background:
    linear-gradient(140deg, var(--accent-soft-strong), transparent 70%),
    var(--surface);
}

.join-community-action-card.pwa {
  border-color: var(--accent-soft-border);
  background:
    linear-gradient(140deg, var(--accent-soft), transparent 70%),
    var(--surface);
}

.join-community-action-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.join-community-action-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-strong);
}

.join-community-action-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  position: relative;
}

.join-community-action-badge .xp-bonus-check {
  color: #1c9b6b;
  font-size: 12px;
  opacity: 0;
  transform: translateY(-50%) scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
  position: absolute;
  right: 6px;
  top: 50%;
  pointer-events: none;
}

.join-community-action-badge.is-unlocked {
  padding-right: 18px;
}

.join-community-action-badge.is-unlocked .xp-bonus-check {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.join-community-action-sub {
  font-size: 12px;
  color: var(--ink-soft);
}

.join-community-action-card .solid-button {
  align-self: flex-start;
  min-width: 160px;
}

.join-community-action-card .solid-button.is-disabled {
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--border);
  box-shadow: none;
}

.join-community-action-cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.join-community-popup {
  width: min(360px, 90vw) !important;
  border-radius: 22px !important;
  overflow: hidden;
  position: relative;
}

.join-community-popup .swal2-html-container {
  margin: 0 !important;
  position: static !important;
}

.join-community-popup .swal2-title {
  padding-right: 40px;
}

.join-community-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  z-index: 6;
  box-shadow: var(--shadow-soft);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.join-community-close:hover {
  background: var(--surface-muted);
  color: var(--ink-strong);
  border-color: var(--accent-soft-border);
}

.join-community-discord {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  gap: 8px;
  text-align: left;
}

.join-community-discord-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.join-community-discord-body {
  display: grid;
  gap: 6px;
}

.join-community-discord-actions {
  display: flex;
  justify-content: flex-end;
}

.join-community-discord-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.join-community-discord-user img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.discord-user-info {
  display: grid;
  gap: 2px;
}

.discord-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-strong);
}

.discord-user-handle,
.discord-user-email,
.join-community-discord-status,
.join-community-discord-guild {
  font-size: 12px;
  color: var(--ink-soft);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 5px 3px 8px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.footer-flip {
  position: relative;
  min-width: 196px;
  height: 32px;
  perspective: 900px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.footer-flip.is-static-flip {
  perspective: none;
}

.footer-flip-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.footer-flip.is-flipped .footer-flip-card {
  transform: rotateX(180deg);
}

.footer-flip.is-static-flip .footer-flip-card {
  transform: none;
  -webkit-transform: none;
}

.footer-flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.footer-flip.is-static-flip .footer-flip-face {
  transform: none;
  -webkit-transform: none;
}

.footer-flip-face[aria-hidden="true"] {
  display: none;
  pointer-events: none;
}

.footer-flip-face[aria-hidden="false"] {
  display: flex;
  pointer-events: auto;
  z-index: 1;
}

.footer-flip-face .language-switcher {
  width: 100%;
  justify-content: center;
  gap: 10px;
}

.footer-flip-face.footer-back {
  transform: rotateX(180deg) translateZ(0);
  -webkit-transform: rotateX(180deg) translateZ(0);
}

.footer-flip-face.footer-front {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.footer-flip.is-static-flip .footer-flip-face.footer-front,
.footer-flip.is-static-flip .footer-flip-face.footer-back {
  transform: none;
  -webkit-transform: none;
}

@supports (-webkit-touch-callout: none) {
  .footer-flip {
    perspective: none;
  }

  .footer-flip-card {
    transform: none !important;
    -webkit-transform: none !important;
  }

  .footer-flip-face,
  .footer-flip-face.footer-front,
  .footer-flip-face.footer-back {
    transform: none !important;
    -webkit-transform: none !important;
  }
}

.xp-bar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  position: relative;
  cursor: pointer;
  overflow: visible;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.xp-bar:hover,
.xp-bar:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.xp-bar::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-gradient);
  border: 1px solid var(--glass-border);
  color: var(--ink-strong);
  font-size: 9px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.xp-bar::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  width: 8px;
  height: 8px;
  transform: translateX(-50%) rotate(45deg) translateY(8px);
  background: var(--surface);
  border-left: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.xp-bar:hover::after,
.xp-bar:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.xp-bar:hover::before,
.xp-bar:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) rotate(45deg) translateY(0);
}

@media (hover: none), (pointer: coarse) {
  .xp-bar::after,
  .xp-bar::before {
    content: none;
  }

  .xp-bar:hover,
  .xp-bar:focus-visible {
    transform: none;
    box-shadow: var(--shadow-soft);
  }
}

.xp-title,
.xp-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.xp-level {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-strong);
}

.xp-meter {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-border);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
  position: relative;
}

.xp-meter span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  transition: width 0.55s ease;
  box-shadow: 0 0 10px rgba(255, 122, 209, 0.45);
  transform-origin: center;
}

.xp-meter::after {
  content: "";
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: -40%;
  width: 40%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  opacity: 0;
  pointer-events: none;
}

.xp-bar.is-earning .xp-meter::after {
  opacity: 1;
  animation: xpSweep 0.8s ease;
}

.xp-bar.is-earning .xp-meter span {
  animation: xpPulse 0.6s ease;
}

.xp-divider {
  opacity: 0.6;
}

.character-language-switcher {
  width: 100%;
  justify-content: space-between;
  margin-top: 5px;
}

.language-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.language-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.language-select-wrap::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid var(--ink-soft);
  transform: translateY(-30%);
  pointer-events: none;
}

.language-select-wrap select {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-strong);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 22px 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 14px rgba(25, 25, 45, 0.12);
}

.language-select-wrap select:focus-visible {
  outline: 2px solid var(--accent-soft-border);
  outline-offset: 2px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes callGlow {
  0% {
    box-shadow: 0 0 0 0 var(--call-glow);
  }
  55% {
    box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

@keyframes vipPulse {
  0%,
  100% {
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
  }
  50% {
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  }
}

@keyframes glowSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes iconGlow {
  0% {
    filter: drop-shadow(0 0 3px var(--accent-pink)) drop-shadow(0 0 4px var(--accent-blue));
  }
  50% {
    filter: drop-shadow(0 0 6px var(--accent-pink)) drop-shadow(0 0 7px var(--accent-blue));
  }
  100% {
    filter: drop-shadow(0 0 3px var(--accent-pink)) drop-shadow(0 0 4px var(--accent-blue));
  }
}

@keyframes xpSweep {
  0% {
    transform: translateX(-120%);
    opacity: 0;
  }
  30% {
    opacity: 0.9;
  }
  100% {
    transform: translateX(320%);
    opacity: 0;
  }
}

@keyframes xpPulse {
  0% {
    transform: scaleY(1);
  }
  45% {
    transform: scaleY(1.25);
  }
  100% {
    transform: scaleY(1);
  }
}

@keyframes callVibrate {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  8% {
    transform: translate3d(-2px, -1px, 0) rotate(-8deg);
  }
  16% {
    transform: translate3d(2px, 1px, 0) rotate(8deg);
  }
  24% {
    transform: translate3d(-2px, 1px, 0) rotate(-6deg);
  }
  32% {
    transform: translate3d(2px, -1px, 0) rotate(6deg);
  }
  40% {
    transform: translate3d(-1px, 0, 0) rotate(-4deg);
  }
  48% {
    transform: translate3d(1px, 0, 0) rotate(4deg);
  }
  56%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.icon-gradient-stop.start {
  stop-color: var(--accent-pink);
  animation: gradientStopA 2.8s ease-in-out infinite;
}

.icon-gradient-stop.mid {
  stop-color: var(--accent-warm);
  animation: gradientStopB 3.2s ease-in-out infinite;
}

.icon-gradient-stop.end {
  stop-color: var(--accent-blue);
  animation: gradientStopC 3.6s ease-in-out infinite;
}

@keyframes gradientStopA {
  0% {
    stop-color: var(--accent-pink);
  }
  50% {
    stop-color: var(--accent-blue);
  }
  100% {
    stop-color: var(--accent-pink);
  }
}

@keyframes gradientStopB {
  0% {
    stop-color: var(--accent-warm);
  }
  50% {
    stop-color: var(--accent-pink);
  }
  100% {
    stop-color: var(--accent-warm);
  }
}

@keyframes gradientStopC {
  0% {
    stop-color: var(--accent-blue);
  }
  50% {
    stop-color: var(--accent-warm);
  }
  100% {
    stop-color: var(--accent-blue);
  }
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--glass-sheen-strong), var(--topbar-gradient);
  background-size: 200% 200%;
  background-repeat: no-repeat;
  background-clip: padding-box;
  background-origin: border-box;
  animation: gradientShift 60s ease infinite;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--topbar-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

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

.avatar {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: visible;
  border: 2px solid var(--accent-soft-border);
  cursor: pointer;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  position: relative;
  z-index: 2;
}

.swap-avatar-button {
  position: absolute;
  left: 50%;
  top: -18px;
  transform: translate(-50%, -6px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--surface-gradient);
  color: var(--ink-strong);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 3;
}

.swap-avatar-button .icon {
  width: 12px;
  height: 12px;
}

.avatar:hover .swap-avatar-button,
.avatar:focus-within .swap-avatar-button {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -10px);
}

.swap-avatar-button:focus-visible {
  outline: 2px solid var(--accent-soft-border);
  outline-offset: 2px;
}

.pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--pulse-color);
  animation: pulse 2.8s ease infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 var(--pulse-color);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(0, 0, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

.brand-text .title {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-text .title .name-text {
  display: inline-block;
  min-width: 0;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cloud-label {
  appearance: none;
  display: none;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4), 0 0 18px rgba(255, 105, 196, 0.45);
  cursor: pointer;
}

.cloud-label.is-active {
  display: inline-flex;
}

.cloud-label:hover {
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.55), 0 0 22px rgba(255, 105, 196, 0.55);
}

.cloud-label:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

.vip-label {
  --vip-glow-soft: 6px;
  --vip-glow-strong: 14px;
  --vip-glow-color: rgba(200, 205, 214, 0.35);
  --vip-glow-color-strong: rgba(200, 205, 214, 0.4);
  display: none;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(120, 126, 138, 0.35);
  border: 1px solid rgba(220, 223, 230, 0.6);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  box-shadow:
    0 0 var(--vip-glow-soft) var(--vip-glow-color),
    0 0 var(--vip-glow-strong) var(--vip-glow-color-strong);
  animation: vip-glow 2.8s ease-in-out infinite;
}

.vip-label.is-active {
  display: inline-flex;
}

.vip-label.is-free {
  --vip-glow-soft: 4px;
  --vip-glow-strong: 10px;
  --vip-glow-color: rgba(200, 205, 214, 0.28);
  --vip-glow-color-strong: rgba(200, 205, 214, 0.35);
  background: rgba(120, 126, 138, 0.35);
  border-color: rgba(220, 223, 230, 0.6);
}

.vip-label.is-vip {
  --vip-glow-soft: 8px;
  --vip-glow-strong: 18px;
  --vip-glow-color: rgba(48, 214, 128, 0.4);
  --vip-glow-color-strong: rgba(48, 214, 128, 0.5);
  background: rgba(44, 186, 107, 0.35);
  border-color: rgba(129, 255, 190, 0.65);
}

.vip-label.is-gpt {
  --vip-glow-soft: 10px;
  --vip-glow-strong: 22px;
  --vip-glow-color: rgba(80, 140, 255, 0.45);
  --vip-glow-color-strong: rgba(80, 140, 255, 0.6);
  background: rgba(55, 122, 255, 0.35);
  border-color: rgba(120, 170, 255, 0.7);
}

.vip-label.is-ultra {
  --vip-glow-soft: 12px;
  --vip-glow-strong: 26px;
  --vip-glow-color: rgba(255, 96, 108, 0.5);
  --vip-glow-color-strong: rgba(255, 96, 108, 0.65);
  background: rgba(255, 80, 90, 0.35);
  border-color: rgba(255, 160, 168, 0.7);
}

.vip-label.is-ultra-500 {
  --vip-glow-soft: 14px;
  --vip-glow-strong: 32px;
  --vip-glow-color: rgba(255, 120, 205, 0.55);
  --vip-glow-color-strong: rgba(255, 120, 205, 0.75);
  background: rgba(255, 105, 196, 0.35);
  border-color: rgba(255, 177, 224, 0.75);
}

.vip-label[data-tooltip] {
  position: relative;
}

.vip-label[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--surface-gradient);
  border: 1px solid var(--glass-border);
  color: var(--ink-strong);
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: pre-line;
  text-align: left;
  min-width: 200px;
  box-shadow: var(--shadow-soft);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.vip-label[data-tooltip]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  width: 8px;
  height: 8px;
  transform: translateX(-50%) rotate(45deg) translateY(8px);
  background: var(--surface);
  border-left: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.vip-label[data-tooltip]:hover::after,
.vip-label[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes vip-glow {
  0%,
  100% {
    box-shadow:
      0 0 var(--vip-glow-soft) var(--vip-glow-color),
      0 0 var(--vip-glow-strong) var(--vip-glow-color-strong);
  }
  50% {
    box-shadow:
      0 0 calc(var(--vip-glow-soft) + 6px) var(--vip-glow-color),
      0 0 calc(var(--vip-glow-strong) + 12px) var(--vip-glow-color-strong);
  }
}

.brand-text .subtitle {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-actions,
.icon-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.auth-action {
  display: none;
  height: 32px;
  padding: 0 14px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--topbar-icon-bg);
  color: white;
  border: 1px solid var(--topbar-border);
  box-shadow: none;
}

.auth-action:hover {
  background: var(--topbar-icon-hover);
}

.vip-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-warm), var(--accent-blue));
  background-size: 200% 200%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  animation: gradientShift 6s ease infinite, vipPulse 2.8s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vip-button.is-manage {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-pink), var(--accent-warm));
}

.vip-button.hidden {
  display: none;
}

.vip-button:hover {
  transform: translateY(-1px);
}

.vip-button:active {
  transform: translateY(1px);
}

.vip-button .icon {
  width: 14px;
  height: 14px;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.5));
}

.music-generator-button[hidden] {
  display: none !important;
}

.music-generator-button {
  position: relative;
  z-index: 1;
  pointer-events: auto !important;
}

#musicModal {
  z-index: 120;
  pointer-events: auto !important;
}

#musicModal .modal-content {
  pointer-events: auto !important;
}

body.cloud-sync-loading #musicModal,
body.dream-character-locked #musicModal {
  pointer-events: auto !important;
  user-select: auto !important;
}

.topbar .icon-only,
.topbar .ghost-button.icon-only,
.topbar .solid-button.icon-only {
  width: 30px;
  height: 30px;
  background: var(--topbar-icon-bg);
  color: white;
  border: 1px solid var(--topbar-border);
  box-shadow: none;
}

.topbar .icon-only:hover,
.topbar .ghost-button.icon-only:hover,
.topbar .solid-button.icon-only:hover {
  background: var(--topbar-icon-hover);
}

#callButton .icon,
#communityButton .icon {
  stroke: url(#icon-gradient);
  fill: none;
  color: transparent;
  filter: drop-shadow(0 0 3px var(--accent-pink)) drop-shadow(0 0 4px var(--accent-blue));
}

#communityButton .icon {
  animation: iconGlow 2.4s ease-in-out infinite;
}

#callButton {
  transform-origin: 50% 50%;
  will-change: transform;
  animation: callVibrate 1s ease-in-out infinite;
}

#callButton:hover,
#callButton.stop-shake {
  animation: none;
}

#callButton .icon {
  transform-box: fill-box;
  animation: iconGlow 2.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  #communityButton .icon {
    animation: none;
  }
  .icon-gradient-stop {
    animation: none;
  }
  body,
  .topbar,
  .take-break-button,
  .break-flip-card,
  .vip-button,
  .solid-button,
  .send-button,
  .icon-only,
  .icon-button,
  .wide-button,
  .record-send-button,
  .auth-toggle .chip.active,
  .preset-button.active,
  .switch input:checked + .slider,
  .swal2-styled.swal2-confirm,
  .message.user .bubble,
  .carousel-dot.active,
  .meter-bar span,
  .meter-bar.out span,
  .slot-card.is-active,
  .panel-card,
  .community-character-button,
  .community-load.loading,
  .swal2-popup,
  .dream-character-overlay-spinner,
  .firework,
  .xp-bar.is-earning .xp-meter span,
  .xp-bar.is-earning .xp-meter::after {
    animation: none;
  }

  .swal2-popup::before {
    animation: none;
  }

  .media-image:hover::after,
  .gallery-item:hover::after,
  .photo-preview:hover::after {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .message:hover .bubble,
  .message:hover .media {
    animation: none;
  }
}

.ghost-button,
.solid-button,
.send-button,
.wide-button,
.icon-button,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.icon-fill {
  fill: currentColor;
  stroke: none;
}

.icon-only {
  width: 42px;
  height: 42px;
  padding: 0;
}

.wide-button.icon-only {
  width: 100%;
  height: 44px;
  padding: 0;
}

.send-button.icon-only {
  width: 44px;
  height: 44px;
  padding: 0;
}

.chip.icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
}

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

.ghost-button {
  background: transparent;
  border-color: var(--border);
  padding: 8px 16px;
  color: var(--ink-soft);
}

.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
  border-color: var(--accent-soft-border);
}

.ghost-button.danger {
  color: #ff4d5a;
  border-color: rgba(255, 77, 90, 0.45);
  background: rgba(255, 77, 90, 0.08);
}

.solid-button {
  background: var(--accent-gradient);
  color: white;
  padding: 8px 16px;
  border-color: transparent;
}

.solid-button:hover {
  background: var(--accent-gradient-strong);
  transform: translateY(-1px);
}

.topbar .auth-action {
  background: var(--topbar-icon-bg);
  color: white;
  border-color: var(--topbar-border);
  box-shadow: none;
}

.topbar .auth-action:hover {
  background: var(--topbar-icon-hover);
}

.icon-only {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  box-shadow: var(--icon-shadow);
}

.icon-only:hover {
  background: var(--accent-gradient-strong);
}

.solid-button,
.send-button,
.icon-only,
.icon-button,
.wide-button,
.record-send-button,
.auth-toggle .chip.active,
.preset-button.active,
.switch input:checked + .slider,
.swal2-styled.swal2-confirm,
.message.user .bubble,
.carousel-dot.active,
.meter-bar span,
.meter-bar.out span {
  background-size: 200% 200%;
  animation: gradientShift 48s ease infinite;
}

.ghost-button.icon-only,
.solid-button.icon-only,
.icon-button.icon-only,
.send-button.icon-only,
.wide-button.icon-only,
.chip.icon-only {
  padding: 0;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  height: 100%;
}

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

.layout.no-sidepanel .sidepanel {
  display: none;
}

.sidepanel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 100%;
  overflow: auto;
}

.panel-card {
  background: var(--surface-gradient);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  background-size: 200% 200%;
  animation: floatIn 0.7s ease forwards, gradientShift 60s ease infinite;
}

.panel-card:nth-child(2) {
  animation-delay: 0.1s;
}

.panel-card:nth-child(3) {
  animation-delay: 0.2s;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-title {
  font-weight: 600;
  margin-bottom: 12px;
}

.panel-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.stat-label {
  color: var(--ink-soft);
}

.stat-value {
  font-weight: 600;
}

.chip {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: transparent;
  padding: 8px 14px;
  text-align: left;
  font-size: 13px;
}

.chip:hover {
  background: var(--accent-soft-strong);
}

.chip.icon-only {
  padding: 0;
}

.wide-button {
  width: 100%;
  padding: 10px 14px;
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
}

.wide-button:hover {
  background: var(--accent-gradient-strong);
}

.wide-button.icon-only {
  padding: 0;
}

.chatroom {
  background: var(--glass-sheen), var(--glass-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.chatroom.is-dragover {
  border-color: var(--accent-strong);
  box-shadow: var(--glass-shadow), 0 0 0 2px rgba(75, 107, 255, 0.25);
}

.chatroom.is-dragover::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: calc(var(--radius-lg) - 6px);
  border: 2px dashed var(--accent-strong);
  pointer-events: none;
  z-index: 2;
}

.chatroom.has-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--chatroom-bg-image);
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  z-index: 0;
}

.chatroom-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
  z-index: 0;
  pointer-events: none;
}

.chatroom.has-bg .chat-log,
.chatroom.has-bg .composer,
.chatroom.has-bg-video .chat-log,
.chatroom.has-bg-video .composer {
  position: relative;
  z-index: 1;
}

.chat-log {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  min-height: 0;
}

.scroll-bottom-button {
  position: absolute;
  right: 24px;
  bottom: 106px;
  bottom: calc(106px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, rgba(16, 18, 34, 0.92), rgba(58, 91, 255, 0.65));
  color: #f8f9ff;
  box-shadow: 0 14px 30px rgba(15, 22, 45, 0.4), 0 6px 18px rgba(88, 104, 255, 0.35);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 3;
}

.scroll-bottom-button .icon {
  width: 18px;
  height: 18px;
}

.scroll-bottom-button .scroll-bottom-label {
  white-space: nowrap;
}

.scroll-bottom-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-bottom-button:hover {
  box-shadow: 0 16px 36px rgba(15, 22, 45, 0.5), 0 8px 22px rgba(88, 104, 255, 0.5);
}

.scroll-bottom-button:active {
  transform: translateY(1px);
}

.message {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 72%;
  animation: messageIn 0.35s ease;
  --message-shadow-base: 0 12px 24px rgba(43, 32, 71, 0.14);
  --message-glow-core: rgba(43, 32, 71, 0.1);
  --message-glow-core-strong: rgba(43, 32, 71, 0.16);
  --message-glow-outer: rgba(255, 77, 184, 0.05);
  --message-glow-outer-strong: rgba(255, 77, 184, 0.12);
}

.message.is-blurred {
  filter: blur(1.4px);
  opacity: 0.55;
}

.message.is-compacted {
  display: none;
}

.message.memory-summary {
  align-self: center;
  max-width: 86%;
  text-align: left;
  --message-shadow-base: 0 10px 20px rgba(43, 32, 71, 0.12);
  --message-glow-core: rgba(75, 107, 255, 0.08);
  --message-glow-outer: rgba(255, 77, 184, 0.05);
}

.message.memory-summary .bubble {
  background: linear-gradient(160deg, #fff7d1, #f2c861);
  border: 1px solid rgba(198, 148, 34, 0.6);
  color: #3a2a12;
  box-shadow: var(--message-shadow-base), 0 10px 24px rgba(198, 148, 34, 0.22);
}

.message.memory-summary .memory-summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #8a6a1f;
}

body[data-theme="dark"] .message.memory-summary .bubble {
  background: linear-gradient(160deg, #f8e08a, #d4a43a);
  border-color: rgba(255, 220, 140, 0.55);
  color: #1b1205;
  box-shadow: var(--message-shadow-base), 0 12px 26px rgba(214, 178, 90, 0.35);
}

body[data-theme="dark"] .message.memory-summary .memory-summary-label {
  color: #f1d58a;
}

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

@keyframes message-hover-glow {
  0%,
  100% {
    box-shadow:
      var(--message-shadow-base),
      0 0 6px var(--message-glow-core),
      0 0 12px var(--message-glow-outer);
  }
  50% {
    box-shadow:
      var(--message-shadow-base),
      0 0 10px var(--message-glow-core-strong),
      0 0 18px var(--message-glow-outer-strong);
  }
}

.message.user {
  margin-left: auto;
  align-items: flex-end;
  --message-shadow-base: 0 12px 24px rgba(75, 107, 255, 0.25);
  --message-glow-core: rgba(75, 107, 255, 0.18);
  --message-glow-core-strong: rgba(75, 107, 255, 0.26);
  --message-glow-outer: rgba(255, 77, 184, 0.12);
  --message-glow-outer-strong: rgba(255, 77, 184, 0.2);
}

.message.assistant {
  margin-right: auto;
  align-items: flex-start;
  --message-shadow-base: 0 12px 24px rgba(43, 32, 71, 0.14);
  --message-glow-core: rgba(43, 32, 71, 0.1);
  --message-glow-core-strong: rgba(43, 32, 71, 0.18);
  --message-glow-outer: rgba(75, 107, 255, 0.08);
  --message-glow-outer-strong: rgba(75, 107, 255, 0.14);
}

.bubble {
  --message-glow-core: rgba(43, 32, 71, 0.1);
  --message-glow-core-strong: rgba(43, 32, 71, 0.16);
  --message-glow-outer: rgba(255, 77, 184, 0.05);
  --message-glow-outer-strong: rgba(255, 77, 184, 0.12);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  line-height: 1.5;
  background: var(--accent-soft);
  position: relative;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message.user .bubble {
  --message-glow-core: rgba(75, 107, 255, 0.18);
  --message-glow-core-strong: rgba(75, 107, 255, 0.26);
  --message-glow-outer: rgba(255, 77, 184, 0.12);
  --message-glow-outer-strong: rgba(255, 77, 184, 0.2);
  background: var(--accent-gradient);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 24px rgba(75, 107, 255, 0.25);
}

.message.assistant .bubble {
  --message-glow-core: rgba(43, 32, 71, 0.1);
  --message-glow-core-strong: rgba(43, 32, 71, 0.18);
  --message-glow-outer: rgba(75, 107, 255, 0.08);
  --message-glow-outer-strong: rgba(75, 107, 255, 0.14);
  background: var(--glass-sheen), var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 24px rgba(43, 32, 71, 0.14);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.message.assistant.spice-it-up-message .bubble.spice-it-up-description {
  color: rgba(105, 105, 105, 0.6);
}

body[data-theme="dark"] .message.assistant.spice-it-up-message .bubble.spice-it-up-description {
  color: rgba(225, 225, 225, 0.6);
}

.message.system .bubble.system-error-link,
.message.system .bubble.system-error-bubble {
  background: linear-gradient(135deg, #8f1d1d, #c72d2d) !important;
  border: 1px solid rgba(255, 215, 215, 0.55) !important;
  color: #fff !important;
}

.message.system .bubble.system-error-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.message.system .bubble.system-error-link:hover {
  background: linear-gradient(135deg, #a61f1f, #d43737) !important;
  box-shadow: 0 12px 24px rgba(151, 22, 22, 0.35);
}

.message.system .bubble.system-error-link:focus-visible {
  outline: 2px solid rgba(255, 220, 220, 0.95);
  outline-offset: 2px;
}

.message.system.system-error-message .meta {
  color: #9d2424;
}

.message:hover .bubble,
.message:hover .media {
  box-shadow:
    var(--message-shadow-base),
    0 0 8px var(--message-glow-core),
    0 0 14px var(--message-glow-outer);
  animation: message-hover-glow 2.6s ease-in-out infinite;
}

.message.user:hover .bubble {
  animation: gradientShift 48s ease infinite, message-hover-glow 2.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .media-image:hover::after,
  .gallery-item:hover::after,
  .photo-preview:hover::after,
  .message:hover .bubble,
  .message:hover .media,
  .message.user:hover .bubble {
    animation: none;
  }

  .message .meta {
    transition: none;
  }
}

.message .meta {
  font-size: 12px;
  color: var(--ink-soft);
  transition: opacity 160ms ease, transform 160ms ease;
}

.message .meta.is-meta-text-transitioning {
  opacity: 0.28;
  transform: translateY(1px);
}

.message .voice-trimmed-note {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 6px;
}

.message .actions {
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.message:hover .actions,
.message.editing .actions {
  opacity: 1;
}

.message.user .actions {
  align-self: flex-end;
}

.message.assistant .actions {
  align-self: flex-start;
}

.action-button {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  color: #2a1c44;
  border-color: rgba(75, 107, 255, 0.5);
  box-shadow: 0 8px 18px rgba(75, 107, 255, 0.25);
  font-weight: 600;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.action-button:hover {
  background: linear-gradient(135deg, rgba(255, 77, 184, 0.18), rgba(75, 107, 255, 0.18));
  transform: translateY(-1px);
}

.message.user .action-button {
  background: rgba(226, 222, 246, 0.96);
  border-color: rgba(75, 107, 255, 0.55);
  color: #2a1c44;
  box-shadow: 0 8px 16px rgba(75, 107, 255, 0.22);
}

.message.user .action-button:hover {
  background: linear-gradient(135deg, rgba(255, 77, 184, 0.22), rgba(75, 107, 255, 0.22));
}

body[data-theme="dark"] .message.user .action-button {
  background: var(--surface-muted);
  color: var(--ink-soft);
  border-color: var(--border);
  box-shadow: none;
}

body[data-theme="dark"] .action-button {
  background: var(--surface-muted);
  color: var(--ink-soft);
  border-color: var(--border);
  box-shadow: none;
}

.action-button.danger {
  color: #ff4d5a;
  border-color: rgba(255, 77, 90, 0.6);
}

.action-button.debug {
  color: #2556d8;
  border-color: rgba(37, 86, 216, 0.62);
}

.llm-debug-popup {
  max-width: calc(100vw - 24px);
}

.llm-debug-panel {
  max-height: min(64vh, 620px);
  overflow: auto;
  border: 1px solid rgba(75, 107, 255, 0.25);
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
  text-align: left;
}

.llm-debug-panel pre {
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.message.editing .bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-strong);
}

.message.editing .bubble[contenteditable] {
  cursor: text;
  white-space: pre-wrap;
  outline: 2px solid rgba(75, 107, 255, 0.35);
  outline-offset: 2px;
}

.edit-input {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-strong);
  background: var(--surface);
  resize: vertical;
  min-height: 70px;
}

.edit-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.small-button {
  padding: 6px 12px;
  font-size: 12px;
}

.media {
  width: 100%;
  border-radius: var(--radius-media);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  display: flex;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(43, 32, 71, 0.12);
  position: relative;
}

.media img,
.media video {
  display: block;
  max-height: 420px;
  border-radius: calc(var(--radius-media) - 4px);
}

.media img {
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.photo-generation-placeholder {
  min-height: 220px;
  align-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}

.photo-generation-placeholder.is-overloaded {
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.94), rgba(220, 38, 38, 0.88));
  border-color: rgba(255, 180, 180, 0.78);
}

.photo-generation-spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 3px solid rgba(128, 118, 153, 0.28);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: photo-generation-spin 0.9s linear infinite;
}

.photo-generation-placeholder.is-overloaded .photo-generation-spinner {
  border-color: rgba(255, 255, 255, 0.32);
  border-top-color: #ffffff;
}

.photo-generation-placeholder-text {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

@keyframes photo-generation-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes photo-selection-glow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.media-image::after,
.gallery-item::after,
.photo-preview::after,
.video-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  box-sizing: border-box;
  background: linear-gradient(120deg, rgba(255, 77, 184, 0.95), rgba(255, 122, 209, 0.7), rgba(75, 107, 255, 0.95));
  background-size: 220% 220%;
  background-position: 0% 50%;
  background-repeat: no-repeat;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
  filter:
    drop-shadow(0 0 36px rgba(255, 77, 184, 0.55))
    drop-shadow(0 0 80px rgba(75, 107, 255, 0.5))
    drop-shadow(0 0 120px rgba(255, 122, 209, 0.35));
  transition: opacity 0.2s ease;
}

.media-image:hover::after,
.gallery-item:hover::after,
.photo-preview:hover::after,
.video-preview:hover::after {
  opacity: 1;
  animation: photo-selection-glow 4.6s ease infinite;
}

.media-image:hover,
.gallery-item:hover,
.photo-preview:hover,
.video-preview:hover {
  box-shadow:
    0 10px 20px rgba(43, 32, 71, 0.16),
    0 0 30px rgba(255, 77, 184, 0.5),
    0 0 60px rgba(75, 107, 255, 0.45),
    0 0 90px rgba(255, 122, 209, 0.35);
}

.media.is-locked img,
.gallery-item.is-locked img {
  filter: blur(14px);
  transform: scale(1.02);
}

.media-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(10, 12, 20, 0.55);
  text-align: center;
  z-index: 3;
  border-radius: inherit;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.media-lock-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.media-lock-button {
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 999px;
  text-transform: none;
}

.media-lock-button.vip-glow {
  position: relative;
  box-shadow:
    0 0 12px rgba(255, 205, 75, 0.55),
    0 0 28px rgba(255, 122, 209, 0.45),
    0 0 46px rgba(75, 107, 255, 0.35);
  animation: vip-glow-pulse 3.4s ease-in-out infinite;
}

@keyframes vip-glow-pulse {
  0% {
    box-shadow:
      0 0 10px rgba(255, 205, 75, 0.45),
      0 0 22px rgba(255, 122, 209, 0.35),
      0 0 38px rgba(75, 107, 255, 0.28);
    transform: translateZ(0);
  }
  50% {
    box-shadow:
      0 0 16px rgba(255, 205, 75, 0.75),
      0 0 34px rgba(255, 122, 209, 0.6),
      0 0 54px rgba(75, 107, 255, 0.48);
    transform: translateZ(0) scale(1.02);
  }
  100% {
    box-shadow:
      0 0 10px rgba(255, 205, 75, 0.45),
      0 0 22px rgba(255, 122, 209, 0.35),
      0 0 38px rgba(75, 107, 255, 0.28);
    transform: translateZ(0);
  }
}

.media video {
  width: 100%;
  height: auto;
  object-fit: cover;
  cursor: pointer;
}

.gallery-item video {
  cursor: pointer;
}

.media audio {
  width: 100%;
}

.media img {
  cursor: pointer;
}

.composer {
  border-top: none;
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  background: transparent;
}

.composer-tools {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.composer-input {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 8px 12px;
  border-radius: 22px;
  background: var(--glass-sheen), var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--composer-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  min-height: 56px;
  flex-wrap: nowrap;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.composer-input.is-locked {
  opacity: 0.75;
}

.composer-input #sendButton {
  display: none;
}

.composer-input.has-text #sendButton {
  display: inline-flex;
}

.composer-input.has-text #recordButton,
.composer-input.has-text #uploadButton {
  display: none;
}

.composer-input .icon-button {
  background: var(--composer-icon-bg);
  color: var(--composer-icon-color);
  border: 1px solid var(--composer-border);
  box-shadow: none;
  width: 34px;
  height: 34px;
}

.composer-input .icon-button:hover {
  background: var(--accent-soft);
}

.recording-panel {
  display: none;
  align-items: center;
  gap: 12px;
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-border);
}

.queue-pool {
  position: relative;
  display: none;
}

.queue-pool.is-visible {
  display: block;
}

.queue-pool-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  font-size: 12px;
  color: var(--ink-strong);
  box-shadow: var(--shadow-soft);
}

.queue-pool-count {
  font-weight: 600;
  color: var(--ink-strong);
}

.queue-pool-tooltip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  min-width: 220px;
  max-width: min(420px, 90vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
}

.queue-pool:hover .queue-pool-tooltip,
.queue-pool:focus-within .queue-pool-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.queue-pool-item {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-strong);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.queue-pool-item:last-child {
  border-bottom: none;
}

.spice-it-up-button {
  display: none;
  align-self: flex-start;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 150, 182, 0.85);
  background: linear-gradient(135deg, #ff2f58 0%, #ff4d95 46%, #ff1550 100%);
  background-size: 180% 180%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow:
    0 8px 20px rgba(255, 34, 98, 0.45),
    0 0 18px rgba(255, 63, 153, 0.4);
  cursor: pointer;
  position: relative;
  overflow: visible;
  white-space: nowrap;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.spice-it-up-button.is-visible {
  display: inline-flex;
  animation: spiceGlowPulse 1.9s ease-in-out infinite, gradientShift 7s ease infinite;
}

.spice-it-up-button.is-buzzing {
  animation: spiceGlowPulse 1.9s ease-in-out infinite, gradientShift 7s ease infinite, spiceBuzzShake 1s linear 1;
}

.spice-it-up-button:hover {
  transform: translateY(-1px);
  filter: saturate(1.15) brightness(1.05);
  box-shadow:
    0 12px 28px rgba(255, 34, 98, 0.55),
    0 0 26px rgba(255, 63, 153, 0.62);
}

.spice-it-up-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  animation: none;
  box-shadow: 0 8px 18px rgba(148, 34, 70, 0.25);
}

@keyframes spiceGlowPulse {
  0% {
    box-shadow:
      0 8px 20px rgba(255, 34, 98, 0.38),
      0 0 16px rgba(255, 63, 153, 0.32);
  }
  50% {
    box-shadow:
      0 12px 28px rgba(255, 34, 98, 0.6),
      0 0 28px rgba(255, 63, 153, 0.66);
  }
  100% {
    box-shadow:
      0 8px 20px rgba(255, 34, 98, 0.38),
      0 0 16px rgba(255, 63, 153, 0.32);
  }
}

.spice-it-up-buzz-particles {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1200;
  pointer-events: none;
}

.spice-it-up-buzz-particle {
  --spice-buzz-flip: 1;
  position: absolute;
  left: 0;
  top: 0;
  line-height: 1;
  font-size: 17px;
  opacity: 0;
  transform: translate(-50%, -50%) scaleX(var(--spice-buzz-flip));
  transform-origin: center;
  will-change: transform, opacity;
  animation: spiceBuzzParticle var(--spice-buzz-duration, 860ms) cubic-bezier(0.2, 0.75, 0.24, 1) forwards;
  animation-delay: var(--spice-buzz-delay, 0ms);
}

.spice-it-up-buzz-particle.is-flipped {
  --spice-buzz-flip: -1;
}

@keyframes spiceBuzzShake {
  0% { transform: translate(0, 0) rotate(0deg); }
  16% { transform: translate(-1px, 1px) rotate(-1deg); }
  33% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 0) rotate(-1deg); }
  66% { transform: translate(1px, 1px) rotate(1deg); }
  83% { transform: translate(-1px, -1px) rotate(-1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes spiceBuzzParticle {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(var(--spice-buzz-flip)) scale(0.55) rotate(0deg);
  }
  14% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--spice-buzz-tx), var(--spice-buzz-ty)) scaleX(var(--spice-buzz-flip)) scale(1) rotate(var(--spice-buzz-rot, 0deg));
  }
}

.composer.is-recording .recording-panel {
  display: flex;
}

.composer.is-recording .composer-input,
.composer.is-recording .send-button,
.composer.is-recording .record-button {
  display: none;
}

.timer {
  font-size: 13px;
  font-weight: 600;
  min-width: 42px;
  text-align: center;
  color: var(--ink-strong);
}

.audio-visualizer {
  display: block;
  flex: 1;
  height: 47px;
  padding: 0 4px;
}

.audio-visualizer span {
  width: 3px;
  height: 6px;
  background: var(--accent);
  border-radius: 999px;
  animation: audioPulse 1s ease-in-out infinite;
  animation-play-state: paused;
}

.composer.is-recording .audio-visualizer span {
  animation-play-state: running;
}

.audio-visualizer span:nth-child(2) {
  animation-delay: 0.1s;
}

.audio-visualizer span:nth-child(3) {
  animation-delay: 0.2s;
}

.audio-visualizer span:nth-child(4) {
  animation-delay: 0.3s;
}

.audio-visualizer span:nth-child(5) {
  animation-delay: 0.4s;
}

@keyframes audioPulse {
  0%,
  100% {
    height: 6px;
    opacity: 0.55;
  }
  50% {
    height: 16px;
    opacity: 1;
  }
}

.recording-panel .icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
}

.recording-panel .icon-button .icon {
  width: 18px;
  height: 18px;
}

.record-send-button {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
}

.record-send-button:hover {
  background: var(--accent-gradient-strong);
}

.icon-button {
  background: var(--accent-gradient);
  border-color: transparent;
  padding: 6px 10px;
  font-size: 12px;
  color: white;
  box-shadow: var(--icon-shadow);
}

.icon-button:hover {
  background: var(--accent-gradient-strong);
}

.icon-button.is-disabled,
.icon-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.icon-button.is-disabled:hover,
.icon-button:disabled:hover {
  background: var(--accent-gradient);
}

.icon-button.record-button {
  padding: 0;
  width: 36px;
  height: 36px;
  margin-right: 0;
}

.icon-button.icon-only {
  padding: 0;
}

#messageInput {
  flex: 1;
  border: none;
  resize: none;
  font-family: inherit;
  font-size: 16px;
  background: transparent;
  color: var(--ink-strong);
  min-height: 42px;
  max-height: 210px;
  overflow-y: hidden;
  outline: none;
  padding: 8px 4px;
  line-height: 1.45;
  min-width: 0;
}

#messageInput::placeholder {
  color: var(--composer-placeholder);
  opacity: 1;
}

.send-button {
  background: var(--accent-gradient);
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  min-width: 88px;
  box-shadow: var(--icon-shadow);
  height: 42px;
}

.send-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.send-button.icon-only {
  padding: 0;
}

.emoji-panel {
  position: fixed;
  right: 36px;
  bottom: 120px;
  width: 240px;
  background: var(--glass-sheen), var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow);
  padding: 12px;
  display: none;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.emoji-panel.active {
  display: block;
  animation: messageIn 0.2s ease;
}

.emoji-header {
  font-weight: 600;
  margin-bottom: 8px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.emoji-grid button {
  border: none;
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 6px 0;
  cursor: pointer;
}

.character-modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 16, 28, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
  backdrop-filter: blur(8px);
  --character-scale: clamp(0.7, calc(100vh / 620), 1);
}

.character-modal.active {
  display: flex;
}

.character-sheet {
  width: min(420px, 92vw);
  background: var(--glass-sheen), var(--glass-bg-strong);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transform: scale(var(--character-scale));
  transform-origin: center;
}

.character-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.character-header .modal-header-actions {
  flex-shrink: 0;
}

.character-title {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 20px;
}

.character-subtitle {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.character-carousel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.carousel-viewport {
  flex: 1;
  overflow: hidden;
  touch-action: pan-y;
}

.carousel-track {
  display: flex;
  transition: transform 0.35s ease;
}

.character-card {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.character-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.character-meta-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.character-video {
  width: min(100%, clamp(180px, 42vh, 420px));
  aspect-ratio: 9 / 10.4;
  border-radius: 18px;
  background: #0f1020;
  object-fit: cover;
}

.character-name {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
}

.character-age {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.character-role {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.2;
}

.community-character-button {
  width: 100%;
  margin-top: 2px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(120deg, rgba(255, 174, 43, 0.98), rgba(255, 47, 154, 0.98), rgba(58, 91, 255, 0.95));
  background-size: 200% 200%;
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 12px 26px rgba(255, 122, 35, 0.45), 0 10px 22px rgba(255, 47, 154, 0.4), 0 8px 18px rgba(58, 91, 255, 0.35);
  text-shadow: 0 1px 2px rgba(21, 18, 35, 0.2);
  animation: communityGlow 3.2s ease infinite, gradientShift 48s ease infinite;
}

.community-character-button::before,
.community-character-button::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.community-character-button::before {
  inset: -40%;
  background:
    radial-gradient(circle at 18% 28%, rgba(255, 255, 255, 0.7), transparent 26%),
    radial-gradient(circle at 72% 22%, rgba(255, 255, 255, 0.55), transparent 28%),
    radial-gradient(circle at 82% 72%, rgba(255, 255, 255, 0.45), transparent 30%),
    radial-gradient(circle at 30% 78%, rgba(255, 255, 255, 0.4), transparent 30%);
  opacity: 0.6;
  animation: communitySparkle 3.6s linear infinite;
}

.community-character-button::after {
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.65) 45%, transparent 70%);
  transform: translateX(-140%);
  opacity: 0.35;
  animation: communityShine 3.8s ease-in-out infinite;
}

.community-character-label {
  position: relative;
  z-index: 1;
}

.community-character-button:hover {
  background: linear-gradient(120deg, rgba(255, 204, 93, 1), rgba(255, 31, 143, 1), rgba(58, 91, 255, 1));
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(255, 156, 64, 0.5), 0 12px 26px rgba(255, 31, 143, 0.45), 0 10px 24px rgba(58, 91, 255, 0.4);
}

.dream-character-button {
  width: 100%;
  margin-top: 6px;
  padding: 11px 16px;
  border: 1px solid rgba(126, 194, 255, 0.72);
  background:
    linear-gradient(135deg, rgba(79, 168, 255, 0.96), rgba(42, 121, 255, 0.94), rgba(73, 214, 255, 0.96));
  background-size: 220% 220%;
  color: #f8fcff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22px;
  box-shadow:
    0 14px 30px rgba(31, 103, 255, 0.28),
    0 0 0 1px rgba(146, 217, 255, 0.12) inset;
  animation: gradientShift 8s ease infinite;
}

.dream-character-button:hover {
  border-color: rgba(176, 233, 255, 0.92);
  background:
    linear-gradient(135deg, rgba(102, 187, 255, 1), rgba(53, 133, 255, 1), rgba(91, 228, 255, 1));
  box-shadow:
    0 18px 36px rgba(31, 103, 255, 0.34),
    0 0 28px rgba(73, 214, 255, 0.2);
  transform: translateY(-1px);
}

@keyframes communityGlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes communitySparkle {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.45;
  }
  50% {
    transform: translate(4%, -4%) scale(1.04);
    opacity: 0.8;
  }
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.5;
  }
}

@keyframes communityShine {
  0% {
    transform: translateX(-140%);
  }
  55% {
    transform: translateX(120%);
  }
  100% {
    transform: translateX(120%);
  }
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--accent-soft-border);
  padding: 0;
}

.carousel-dot.active {
  background: var(--accent-gradient);
}

.carousel-nav {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 24, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--glass-sheen), var(--glass-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 760px;
  width: 100%;
  max-height: 80vh;
  overflow: auto;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.slot-modal {
  max-width: 720px;
}

.slot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-gradient);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.slot-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.slot-meta-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.slot-meta-value {
  font-weight: 600;
  color: var(--ink-strong);
}

.slot-meta-note {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--ink-soft);
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.slot-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.slot-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.slot-card.is-active {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--accent-soft), var(--accent-soft)) padding-box,
    linear-gradient(120deg, #00f5ff, #53ffb5, #f7ff6e, #ff8ae2) border-box;
  background-size: auto, 200% 200%;
  animation: gradientShift 18s ease infinite;
  box-shadow: var(--shadow-soft), 0 0 16px rgba(0, 245, 255, 0.35);
}

.slot-card.is-locked {
  opacity: 0.6;
}

.slot-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.slot-card-title {
  font-weight: 600;
  font-size: 14px;
}

.slot-card-status {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.slot-card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
}

.slot-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.slot-card-rename {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.slot-card-rename:hover {
  color: var(--ink-strong);
}

.slot-card.is-active .slot-card-action {
  color: var(--ink-strong);
}

.slot-card.is-locked .slot-card-action {
  color: var(--ink-soft);
}

.slot-card.is-locked .slot-card-rename {
  color: var(--ink-soft);
  opacity: 0.7;
}

body.auth-lock,
body.vip-purchase-lock {
  overflow: hidden;
}

.auth-modal {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  background: #050302;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-card {
  position: relative;
  isolation: isolate;
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  max-width: none;
  max-height: none;
  padding: clamp(22px, 4vw, 44px);
  border: none;
  border-radius: 0 !important;
  overflow: auto;
  box-shadow: none;
  background: #070403 !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-backdrop,
.auth-backdrop-image,
.auth-backdrop-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-backdrop {
  z-index: 0;
  overflow: hidden;
}

.auth-backdrop-image {
  top: -4%;
  bottom: -4%;
  width: 54%;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.94;
  transform: scale(1.08);
}

.auth-backdrop-left {
  left: -6%;
  right: auto;
  background-image: url("./assets/left.png");
  background-position: left center;
}

.auth-backdrop-right {
  left: auto;
  right: -6%;
  background-image: url("./assets/right.png");
  background-position: right center;
}

.auth-backdrop-overlay {
  background:
    radial-gradient(circle at 50% 8%, rgba(240, 200, 108, 0.18) 0%, rgba(240, 200, 108, 0) 22%),
    radial-gradient(circle at center, rgba(8, 5, 3, 0.08) 0%, rgba(8, 5, 3, 0.24) 34%, rgba(8, 5, 3, 0.82) 100%),
    linear-gradient(180deg, rgba(6, 3, 2, 0.54) 0%, rgba(6, 3, 2, 0.18) 22%, rgba(6, 3, 2, 0.24) 58%, rgba(6, 3, 2, 0.88) 100%),
    linear-gradient(90deg, rgba(7, 4, 3, 0.98) 0%, rgba(7, 4, 3, 0.48) 18%, rgba(7, 4, 3, 0.08) 34%, rgba(7, 4, 3, 0.08) 66%, rgba(7, 4, 3, 0.48) 82%, rgba(7, 4, 3, 0.98) 100%);
}

@keyframes authBackdropFadeA {
  0%,
  45% {
    opacity: 0.94;
  }

  50%,
  95% {
    opacity: 0;
  }

  100% {
    opacity: 0.94;
  }
}

@keyframes authBackdropFadeB {
  0%,
  45% {
    opacity: 0;
  }

  50%,
  95% {
    opacity: 0.94;
  }

  100% {
    opacity: 0;
  }
}

.auth-close {
  position: absolute;
  top: clamp(16px, 2.2vw, 28px);
  right: clamp(16px, 2.2vw, 28px);
  z-index: 2;
  min-width: 88px;
  justify-content: center;
  background: rgba(20, 14, 10, 0.52);
  border: 1px solid rgba(246, 232, 199, 0.14);
  color: #fff7e6;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
}

.auth-close:hover {
  background: rgba(34, 24, 16, 0.74);
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 780px);
  min-height: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 3vw, 34px);
  padding: clamp(48px, 7vw, 88px) 0 clamp(24px, 5vw, 46px);
  text-align: center;
}

.auth-copy {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.auth-copy-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: #fff7e7;
  text-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
}

.auth-copy-accent {
  color: #f0c86c;
}

.auth-copy-subtitle {
  margin: 0;
  max-width: 36rem;
  font-size: clamp(14px, 1.7vw, 20px);
  line-height: 1.5;
  color: rgba(255, 244, 222, 0.82);
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.auth-panel {
  width: min(100%, 430px);
  padding: clamp(22px, 2.5vw, 30px);
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  background:
    linear-gradient(180deg, rgba(255, 251, 244, 0.98), rgba(245, 236, 222, 0.94));
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.48);
  color: #1a120a;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

.auth-panel-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-panel-title {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(28px, 3vw, 34px);
  line-height: 1;
  color: #140d07;
}

.auth-panel-subtitle {
  font-size: 13px;
  line-height: 1.5;
  color: #6b5941;
}

.auth-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(26, 18, 10, 0.06);
}

.auth-toggle .chip {
  min-height: 44px;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  color: #6d5c45;
  box-shadow: none;
}

.auth-toggle .chip.active {
  background: linear-gradient(135deg, #efca77, #b7892c 58%, #8b651f);
  color: #161006;
  box-shadow: 0 12px 22px rgba(139, 101, 31, 0.26);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-panel .settings-field {
  position: relative;
}

.auth-panel .settings-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-panel .settings-field input {
  min-height: 54px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(62, 42, 16, 0.1);
  background: rgba(255, 255, 255, 0.82);
  color: #1d1309;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.auth-panel .settings-field input::placeholder {
  color: #8c7a62;
}

.auth-panel .settings-field input:focus {
  border-color: rgba(183, 137, 44, 0.52);
  box-shadow: 0 0 0 4px rgba(214, 178, 90, 0.16);
}

.auth-submit {
  width: 100%;
  justify-content: center;
  min-height: 54px;
  border-radius: 18px;
  font-size: 16px;
  box-shadow: 0 18px 34px rgba(143, 104, 30, 0.26);
}

.auth-legal-note {
  margin: 2px 4px 0;
  font-size: 11px;
  line-height: 1.5;
  color: #7e6c53;
  text-align: center;
}

.auth-language-switcher {
  width: 100%;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(247, 239, 226, 0.92));
  border: 1px solid rgba(62, 42, 16, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 14px 28px rgba(68, 48, 19, 0.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-language-switcher .language-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: #8a7658;
}

.auth-language-switcher .language-select-wrap {
  flex: 0 0 auto;
}

.auth-language-switcher .language-select-wrap::after {
  right: 14px;
  border-left-width: 4px;
  border-right-width: 4px;
  border-top-width: 5px;
  border-top-color: #8a6b2f;
}

.auth-language-switcher .language-select-wrap select {
  min-width: 154px;
  min-height: 42px;
  padding: 10px 34px 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(183, 137, 44, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 247, 229, 0.96), rgba(247, 238, 220, 0.9));
  color: #2d1d0d;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 22px rgba(143, 104, 30, 0.12);
}

.auth-language-switcher .language-select-wrap select:focus-visible {
  outline: 2px solid rgba(214, 178, 90, 0.34);
  outline-offset: 2px;
}

.auth-status {
  min-height: 20px;
  font-size: 13px;
  color: #6d5c45;
  text-align: center;
}

.auth-status.error {
  color: #c03a36;
}

.auth-status.success {
  color: #0e8a63;
}

@media (max-width: 900px) {
  .auth-card {
    padding: 20px;
  }

  .auth-shell {
    width: min(100%, 560px);
    gap: 22px;
  }

  .auth-copy-title {
    font-size: clamp(38px, 10vw, 60px);
  }
}

@media (max-width: 640px) {
  .auth-card {
    padding: 16px 14px 20px;
  }

  .auth-backdrop-image {
    top: 0;
    bottom: 0;
    width: 100%;
    will-change: opacity;
  }

  .auth-backdrop-left {
    left: 0;
    right: 0;
    background-position: center top;
    animation: authBackdropFadeA 10s ease-in-out infinite;
  }

  .auth-backdrop-right {
    left: 0;
    right: 0;
    background-position: center top;
    animation: authBackdropFadeB 10s ease-in-out infinite;
  }

  .auth-close {
    top: max(12px, env(safe-area-inset-top));
    right: 14px;
  }

  .auth-shell {
    width: 100%;
    padding-top: clamp(56px, 14vw, 86px);
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    gap: 20px;
  }

  .auth-copy {
    max-width: 340px;
    gap: 12px;
  }

  .auth-copy-title {
    font-size: clamp(32px, 12vw, 48px);
  }

  .auth-copy-subtitle {
    font-size: 13px;
  }

  .auth-panel {
    width: 100%;
    padding: 20px 18px;
    border-radius: 26px;
  }

  .auth-language-switcher {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 16px;
  }

  .auth-language-switcher .language-select-wrap,
  .auth-language-switcher .language-select-wrap select {
    width: 100%;
  }

  .auth-toggle {
    gap: 6px;
    padding: 4px;
  }

  .auth-toggle .chip {
    min-height: 40px;
    font-size: 11px;
  }

  .auth-panel .settings-field input,
  .auth-submit {
    min-height: 52px;
  }
}

.fevermate-vip-card {
  max-width: 1080px;
}

.fevermate-vip-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fevermate-vip-hero {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, var(--accent-soft-strong), transparent 40%),
    linear-gradient(145deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.fevermate-vip-hero::after {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft-strong), transparent 68%);
  pointer-events: none;
}

.fevermate-vip-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent-soft-border);
  background: var(--accent-soft);
  color: var(--ink-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fevermate-vip-copy {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fevermate-vip-heading {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  color: var(--ink-strong);
}

.fevermate-vip-note {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.fevermate-vip-billing {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
}

#fevermateVipModal .chip.is-active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(8, 6, 2, 0.28);
}

.fevermate-vip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.fevermate-vip-plan {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%),
    var(--surface-gradient);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.fevermate-vip-plan:hover {
  transform: translateY(-2px);
  border-color: var(--accent-soft-border);
}

.fevermate-vip-plan.is-featured {
  border-color: var(--accent-soft-border);
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(214, 178, 90, 0.18);
}

.fevermate-vip-plan.is-current,
.fevermate-vip-plan.is-owned {
  border-color: var(--accent-soft-border);
  background:
    linear-gradient(180deg, rgba(214, 178, 90, 0.12), transparent 30%),
    var(--surface-gradient);
}

.fevermate-vip-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.fevermate-vip-plan-name {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.05;
  color: var(--ink-strong);
}

.fevermate-vip-plan-subtitle {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.fevermate-vip-plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.fevermate-vip-plan-badge.subtle {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-soft);
  border: 1px solid var(--border);
}

.fevermate-vip-plan-badge.premium {
  background: linear-gradient(135deg, #f0d184, #a87817 55%, #3a2406);
}

.fevermate-vip-price-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.fevermate-vip-price {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(34px, 4vw, 42px);
  line-height: 0.95;
  color: var(--ink-strong);
}

.fevermate-vip-price-suffix {
  color: var(--ink-soft);
  font-size: 13px;
  padding-bottom: 6px;
}

.fevermate-vip-bill {
  min-height: 38px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.fevermate-vip-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-strong);
  font-size: 13px;
}

.fevermate-vip-features li {
  position: relative;
  padding-left: 18px;
  line-height: 1.45;
}

.fevermate-vip-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.fevermate-vip-buy {
  width: 100%;
  margin-top: auto;
  justify-content: center;
}

.fevermate-vip-buy:disabled {
  opacity: 0.68;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.fevermate-vip-buy:disabled:hover {
  transform: none;
}

.fevermate-vip-footer {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header-actions .icon-button.is-disabled,
.modal-header-actions .ghost-button.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

.modal-title {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 22px;
}

.modal-subtitle {
  color: var(--ink-soft);
  font-size: 13px;
}

@media (max-width: 720px) {
  .fevermate-vip-card {
    padding: 18px;
  }

  .fevermate-vip-hero,
  .fevermate-vip-plan {
    padding: 16px;
  }

  .fevermate-vip-plan-head {
    flex-direction: column;
  }

  .fevermate-vip-billing {
    width: 100%;
  }

  .fevermate-vip-billing .chip {
    flex: 1 1 0;
  }
}

.dream-character-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 14, 24, 0.7);
  z-index: 70;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.dream-character-overlay.active {
  display: flex;
}

.dream-character-overlay-card {
  width: min(520px, 92vw);
  background: var(--glass-sheen-strong), var(--glass-bg-strong);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.dream-character-overlay-card.is-hidden {
  display: none;
}

.dream-character-overlay-title {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 22px;
}

.dream-character-overlay-subtitle {
  font-size: 13px;
  color: var(--ink-soft);
  max-width: 360px;
}

.dream-character-overlay-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--accent-strong);
  animation: dreamSpin 0.9s linear infinite;
}

.dream-character-fireworks {
  position: relative;
  width: 200px;
  height: 130px;
}

.dream-character-chat-now {
  margin-top: 4px;
  padding: 10px 18px;
  letter-spacing: 0.6px;
}

.firework {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0;
  box-shadow:
    0 -18px 0 #ffd166,
    12px -12px 0 #ff7ad1,
    18px 0 0 #7aa2ff,
    12px 12px 0 #ffa14d,
    0 18px 0 #7bf1a8,
    -12px 12px 0 #ff6b6b,
    -18px 0 0 #f9f871,
    -12px -12px 0 #5ad8ff;
  animation: fireworkBurst 2.4s ease-out infinite;
}

.firework:nth-child(1) {
  left: 18%;
  top: 22%;
  animation-delay: 0s;
}

.firework:nth-child(2) {
  left: 78%;
  top: 18%;
  animation-delay: 0.4s;
}

.firework:nth-child(3) {
  left: 50%;
  top: 36%;
  animation-delay: 0.8s;
}

.firework:nth-child(4) {
  left: 26%;
  top: 68%;
  animation-delay: 1.1s;
}

.firework:nth-child(5) {
  left: 74%;
  top: 72%;
  animation-delay: 1.5s;
}

.firework:nth-child(6) {
  left: 50%;
  top: 60%;
  animation-delay: 1.9s;
}

@keyframes dreamSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes fireworkBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.25);
  }
}

#dreamCharacterModal {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 165, 76, 0.2), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(72, 110, 255, 0.24), transparent 30%),
    linear-gradient(180deg, #08131f 0%, #07101a 56%, #04090f 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dream-character-card {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  max-width: none;
  max-height: none;
  padding: clamp(20px, 3vw, 34px);
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 218, 167, 0.1), transparent 20%),
    radial-gradient(circle at 82% 18%, rgba(117, 143, 255, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(8, 18, 31, 0.98), rgba(7, 12, 22, 0.98));
}

#dreamCharacterModal .modal-header {
  width: min(100%, 980px);
  margin: 0 auto;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#dreamCharacterModal .modal-title {
  color: #fff8ee;
  font-size: clamp(34px, 3.4vw, 48px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 34px rgba(0, 0, 0, 0.38);
}

#dreamCharacterModal .modal-subtitle {
  margin-top: 6px;
  color: rgba(244, 248, 255, 0.92);
  font-size: 15px;
  line-height: 1.55;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.34);
}

.dream-character-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dream-character-back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 10px 14px;
}

.dream-character-back-button .icon {
  width: 16px;
  height: 16px;
}

.dream-character-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: min(100%, 980px);
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 18px;
  padding: 20px 0 28px;
}

.dream-character-body::-webkit-scrollbar {
  display: none;
}

.dream-character-name-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dream-character-name-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(227, 235, 255, 0.7);
}

.dream-character-description-field {
  position: relative;
  padding: 1px;
  border-radius: 22px;
  background: linear-gradient(120deg, rgba(255, 182, 72, 0.92), rgba(255, 78, 167, 0.9), rgba(79, 118, 255, 0.92));
  background-size: 220% 220%;
  box-shadow: 0 20px 42px rgba(255, 120, 44, 0.12), 0 16px 34px rgba(79, 118, 255, 0.14);
  animation: gradientShift 20s ease infinite;
}

.dream-character-description-field::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 21px;
  background:
    radial-gradient(circle at top right, rgba(255, 211, 120, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(11, 18, 31, 0.94), rgba(8, 13, 24, 0.96));
  pointer-events: none;
}

.dream-character-description-field > * {
  position: relative;
  z-index: 1;
}

.dream-character-description-field .dream-character-name-label {
  padding: 14px 16px 0;
  background: linear-gradient(120deg, #ffd68b 0%, #ff9dcf 52%, #9bc6ff 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 14s ease infinite;
}

.dream-character-name-input,
.dream-character-description-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(10, 18, 31, 0.78);
  color: #f7f9ff;
  font: inherit;
  font-size: 15px;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 28px rgba(0, 0, 0, 0.18);
}

.dream-character-description-input {
  border-color: rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(255, 182, 72, 0.14), transparent 28%),
    radial-gradient(circle at bottom left, rgba(86, 116, 255, 0.12), transparent 32%),
    rgba(10, 18, 31, 0.88);
  min-height: 112px;
  line-height: 1.45;
  resize: none;
}

.dream-character-name-input::placeholder,
.dream-character-description-input::placeholder {
  color: rgba(201, 210, 231, 0.56);
}

.dream-character-name-input:focus,
.dream-character-description-input:focus {
  outline: none;
  border-color: rgba(255, 180, 90, 0.75);
  box-shadow: 0 0 0 2px rgba(255, 180, 90, 0.2), 0 16px 34px rgba(0, 0, 0, 0.22);
}

.dream-character-description-input:focus {
  border-color: rgba(255, 164, 92, 0.86);
  box-shadow: 0 0 0 2px rgba(255, 153, 85, 0.18), 0 0 0 5px rgba(91, 121, 255, 0.12), 0 20px 40px rgba(0, 0, 0, 0.24);
}

.dream-character-samples {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dream-character-samples-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dream-character-samples-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(227, 235, 255, 0.78);
}

.dream-character-samples-subtitle {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(222, 231, 247, 0.68);
  max-width: 720px;
}

.dream-character-samples-viewport {
  position: relative;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 10px;
  margin: 0 -2px;
  scroll-snap-type: none;
  scroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  cursor: grab;
  user-select: none;
  mask-image: linear-gradient(to right, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
}

.dream-character-samples-viewport::-webkit-scrollbar {
  display: none;
}

.dream-character-samples-viewport.is-dragging {
  cursor: grabbing;
}

.dream-character-samples-track {
  display: flex;
  gap: 12px;
  min-width: max-content;
}

.dream-character-sample-card {
  position: relative;
  flex: 0 0 clamp(120px, 16vw, 156px);
  aspect-ratio: 9 / 16;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 186, 92, 0.1), transparent 38%),
    rgba(10, 18, 31, 0.94);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.dream-character-sample-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 10, 18, 0.12) 0%, rgba(8, 10, 18, 0) 36%, rgba(8, 10, 18, 0.36) 100%);
  pointer-events: none;
}

.dream-character-sample-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 187, 96, 0.78);
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.26);
}

.dream-character-sample-card:focus-visible {
  outline: none;
  border-color: rgba(255, 187, 96, 0.92);
  box-shadow: 0 0 0 2px rgba(255, 187, 96, 0.26), 0 24px 40px rgba(0, 0, 0, 0.26);
}

.dream-character-sample-card.is-selected {
  border-color: rgba(255, 187, 96, 0.98);
  box-shadow: 0 0 0 2px rgba(255, 187, 96, 0.22), 0 26px 44px rgba(255, 122, 35, 0.22);
}

.dream-character-sample-card:disabled {
  opacity: 0.62;
  cursor: progress;
  transform: none;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.18);
}

.dream-character-sample-card video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: rgba(7, 11, 18, 0.96);
  pointer-events: none;
}

.dream-character-sample-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  min-width: 36px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  background: rgba(8, 12, 20, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(250, 244, 232, 0.94);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.dream-character-dropzone {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle at top, rgba(255, 175, 88, 0.12), transparent 42%),
    rgba(11, 19, 31, 0.78);
  border-radius: 22px;
  padding: clamp(18px, 2.8vw, 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: clamp(176px, 22vh, 220px);
  gap: 8px;
  text-align: center;
  color: #f7f9ff;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.2);
}

.dream-character-drop-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 138px;
  pointer-events: none;
}

.dream-character-dropzone.has-image {
  justify-content: flex-start;
  min-height: clamp(280px, 34vh, 340px);
  padding-top: 16px;
  padding-bottom: 18px;
  background:
    radial-gradient(circle at top, rgba(255, 175, 88, 0.08), transparent 42%),
    rgba(10, 18, 31, 0.9);
}

.dream-character-dropzone.has-image .dream-character-drop-placeholder {
  display: none;
}

.dream-character-dropzone .icon {
  width: 30px;
  height: 30px;
}

.dream-character-dropzone:hover {
  border-color: rgba(255, 184, 94, 0.92);
  box-shadow: 0 26px 54px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.dream-character-dropzone.is-dragover {
  border-color: rgba(255, 184, 94, 0.92);
  background:
    radial-gradient(circle at top, rgba(255, 184, 94, 0.18), transparent 40%),
    rgba(14, 25, 42, 0.86);
  box-shadow: 0 22px 44px rgba(75, 107, 255, 0.22);
}

.dream-character-dropzone.is-disabled,
.dream-character-dropzone[aria-disabled="true"] {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.dream-character-drop-title {
  font-weight: 600;
  font-size: 16px;
}

.dream-character-drop-subtitle {
  font-size: 12px;
  color: rgba(222, 231, 247, 0.7);
}

.dream-character-url-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dream-character-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
}

.dream-character-actions .dream-character-generate-button,
.dream-character-actions .dream-character-continue-button {
  width: min(100%, 320px);
}

.dream-character-url-input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(10, 18, 31, 0.78);
  color: #f7f9ff;
  font: inherit;
  font-size: 14px;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 28px rgba(0, 0, 0, 0.18);
}

.dream-character-url-input::placeholder {
  color: rgba(201, 210, 231, 0.56);
}

.dream-character-url-input:focus {
  outline: none;
  border-color: rgba(92, 138, 255, 0.85);
  box-shadow: 0 0 0 2px rgba(92, 138, 255, 0.22), 0 16px 34px rgba(0, 0, 0, 0.22);
}

.dream-character-generate-button {
  flex-shrink: 0;
  min-width: 230px;
  padding: 14px 22px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(120deg, rgba(255, 174, 43, 0.98), rgba(255, 47, 154, 0.98), rgba(58, 91, 255, 0.95));
  background-size: 220% 220%;
  box-shadow: 0 16px 32px rgba(255, 122, 35, 0.42), 0 12px 28px rgba(255, 47, 154, 0.34), 0 10px 24px rgba(58, 91, 255, 0.3);
  color: #fffaf4;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(16, 18, 30, 0.28);
  animation: communityGlow 3.2s ease infinite, gradientShift 48s ease infinite;
}

.dream-character-generate-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.58) 44%, transparent 72%);
  transform: translateX(-140%);
  opacity: 0.32;
  animation: communityShine 3.8s ease-in-out infinite;
  pointer-events: none;
}

.dream-character-generate-button:hover {
  background: linear-gradient(120deg, rgba(255, 204, 93, 1), rgba(255, 31, 143, 1), rgba(58, 91, 255, 1));
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(255, 156, 64, 0.48), 0 14px 30px rgba(255, 31, 143, 0.4), 0 12px 28px rgba(58, 91, 255, 0.36);
}

.dream-character-generate-button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.dream-character-continue-button {
  flex-shrink: 0;
  min-width: 230px;
  padding: 14px 22px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(232, 244, 255, 0.82);
  background: linear-gradient(120deg, rgba(24, 140, 255, 0.98), rgba(32, 86, 255, 0.98), rgba(32, 206, 255, 0.94));
  background-size: 220% 220%;
  box-shadow: 0 16px 34px rgba(24, 140, 255, 0.34), 0 12px 28px rgba(32, 86, 255, 0.28), 0 10px 24px rgba(32, 206, 255, 0.24);
  color: #f8fcff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(10, 18, 34, 0.34);
  animation: communityGlow 3.2s ease infinite, gradientShift 20s ease infinite;
}

.dream-character-continue-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.52) 44%, transparent 72%);
  transform: translateX(-140%);
  opacity: 0.3;
  animation: communityShine 3.6s ease-in-out infinite;
  pointer-events: none;
}

.dream-character-continue-button:hover {
  background: linear-gradient(120deg, rgba(70, 170, 255, 1), rgba(52, 110, 255, 1), rgba(58, 219, 255, 1));
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(56, 156, 255, 0.4), 0 14px 30px rgba(52, 110, 255, 0.34), 0 12px 28px rgba(58, 219, 255, 0.28);
}

.dream-character-continue-button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.dream-character-preview {
  display: none;
}

.dream-character-dropzone.has-image .dream-character-preview,
.dream-character-preview.has-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: min(100%, 300px);
  margin: 0 auto;
  flex: 0 0 auto;
  gap: 12px;
}

.dream-character-preview img {
  width: 100%;
  max-width: 100%;
  max-height: clamp(170px, 22vh, 210px);
  aspect-ratio: auto;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.22);
  object-fit: contain;
  background: rgba(5, 9, 16, 0.94);
}

.dream-character-preview-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dream-character-preview-button {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(13, 21, 35, 0.7);
  color: #f7f9ff;
}

.dream-character-preview-button:hover {
  border-color: rgba(255, 184, 94, 0.7);
  background: rgba(21, 30, 46, 0.86);
}

.dream-character-preview-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.dream-character-status {
  min-height: 20px;
  font-size: 13px;
  color: rgba(222, 231, 247, 0.72);
}

.dream-character-status.error {
  color: #ff4d5a;
}

.dream-character-status.success {
  color: #1c9b6b;
}

.dream-character-status.loading {
  color: var(--ink-strong);
}

@media (max-width: 520px) {
  #dreamCharacterModal .dream-character-card {
    padding: 18px 16px;
  }

  .dream-character-samples-subtitle {
    font-size: 12px;
  }

  .dream-character-samples-viewport {
    mask-image: none;
    padding-bottom: 8px;
  }

  .dream-character-sample-card {
    flex-basis: clamp(118px, 40vw, 148px);
    border-radius: 18px;
  }

  .dream-character-url-row {
    flex-direction: column;
    align-items: stretch;
  }

  .dream-character-generate-button {
    min-width: min(100%, 280px);
  }

  .dream-character-continue-button {
    min-width: min(100%, 280px);
  }

  .dream-character-preview-actions {
    width: 100%;
    flex-direction: column;
  }

  .dream-character-preview-button {
    width: 100%;
  }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  align-items: start;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-media);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  box-shadow: 0 10px 20px rgba(43, 32, 71, 0.12);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: calc(var(--radius-media) - 4px);
}

.gallery-item img {
  cursor: pointer;
}

.gallery-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 12px;
}

.gallery-delete-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  border-radius: 999px;
  border: 1px solid rgba(255, 77, 90, 0.6);
  background: rgba(18, 12, 28, 0.65);
  color: #ff4d5a;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gallery-delete-button:hover {
  background: rgba(255, 77, 90, 0.2);
  transform: translateY(-1px);
}

.community-card {
  max-width: 980px;
}

#communityModal .modal-content {
  position: relative;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

#communityModal .community-close-float {
  position: sticky;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 6;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
  pointer-events: none;
}

#communityModal .community-close-float .icon-button {
  pointer-events: auto;
}

#communityModal .community-focus-video,
#communityModal .community-hover-video,
#communityModal .community-media-video {
  pointer-events: none;
}

.community-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.community-toolbar-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.community-toolbar input {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: inherit;
  background: var(--surface);
  color: var(--ink-strong);
}

.community-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.community-sort-button {
  padding: 6px 14px;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.community-sort-button.is-active {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-soft);
}

.community-sort-button.is-active:hover {
  background: var(--accent-gradient-strong);
}

.community-status {
  min-height: 18px;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.community-status.error {
  color: #ff4d5a;
}

.community-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    position: relative;
  }

.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-content: start;
    align-self: start;
  }

.community-load {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  min-height: 36px;
  border-radius: 999px;
  border: 1px dashed var(--accent-soft-border);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  position: relative;
  overflow: hidden;
}

.community-load.hidden {
  display: none;
}

.community-load.loading {
  border-style: solid;
  background: var(--surface-gradient);
  background-size: 200% 200%;
  color: var(--ink-strong);
  box-shadow: var(--shadow-soft);
  animation: gradientShift 80s ease infinite;
}

.community-load.end {
  background: var(--surface-muted);
}

.community-load::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.6) 45%, transparent 70%);
  opacity: 0;
  transform: translateX(-120%);
}

.community-load.loading::after {
  opacity: 0.6;
  animation: communitySweep 2.4s ease-in-out infinite;
}

.community-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(90, 79, 115, 0.3);
  border-top-color: var(--accent-pink);
  animation: communitySpin 0.8s linear infinite;
  display: none;
}

.community-load.loading .community-spinner {
  display: block;
}

.community-load-text {
  position: relative;
  z-index: 1;
}

.community-sentinel {
  grid-column: 1 / -1;
  height: 1px;
}

@keyframes communitySpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes communitySweep {
  0% {
    transform: translateX(-120%);
  }
  55% {
    transform: translateX(120%);
  }
  100% {
    transform: translateX(120%);
  }
}

.community-item {
  position: relative;
  border-radius: var(--radius-media);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.community-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(43, 32, 71, 0.18);
}

.community-item.active {
  border-color: var(--accent-pink);
}

.community-delete-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  border: 1px solid rgba(179, 58, 58, 0.7);
  border-radius: 8px;
  padding: 6px 9px;
  background: rgba(179, 58, 58, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(20, 10, 12, 0.22);
  cursor: pointer;
}

.community-delete-button:hover:not(:disabled) {
  background: rgba(143, 34, 34, 0.96);
}

.community-delete-button:disabled,
.community-delete-detail:disabled {
  opacity: 0.6;
  cursor: wait;
}

.community-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.community-media {
  position: relative;
}

.community-media.is-video-hover img {
  opacity: 0;
}

.community-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.community-media-img,
.community-media-video {
  transition: opacity 1.4s ease, filter 1.4s ease;
  will-change: opacity, filter;
  transform: translateZ(0);
}

.community-media-video {
  opacity: 0;
  filter: blur(8px);
  pointer-events: none;
}

@keyframes communityImageCycle {
  0%, 25% {
    opacity: 1;
    filter: blur(0);
  }
  32%, 70% {
    opacity: 0;
    filter: blur(6px);
  }
  78%, 100% {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes communityVideoCycle {
  0%, 25% {
    opacity: 0;
    filter: blur(6px);
  }
  32%, 70% {
    opacity: 1;
    filter: blur(0);
  }
  78%, 100% {
    opacity: 0;
    filter: blur(6px);
  }
}

.community-media.is-video-cycle-ready .community-media-img {
  opacity: 0;
  filter: blur(6px);
  animation: none;
}

.community-media.is-video-cycle-ready .community-media-video {
  opacity: 1;
  filter: none;
  animation: none;
}

.community-thumb .community-focus-video {
  opacity: 0;
  filter: blur(8px);
  pointer-events: none;
  transition: opacity 0.6s ease, filter 0.6s ease;
}

@media (hover: none), (pointer: coarse) {
  .community-detail .community-media.is-video-cycle-ready .community-media-img,
  .community-sheet-body .community-media.is-video-cycle-ready .community-media-img {
    opacity: 0;
    animation: none;
  }

  .community-detail .community-media.is-video-cycle-ready .community-media-video,
  .community-sheet-body .community-media.is-video-cycle-ready .community-media-video {
    opacity: 1;
    filter: none;
    animation: none;
  }

  .community-thumb.is-video-focus-ready img {
    opacity: 0;
  }

  .community-thumb.is-video-focus-ready .community-focus-video {
    opacity: 1;
    filter: none;
  }
}

.community-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.6s ease;
  }

.community-thumb .icon {
  width: 32px;
  height: 32px;
  opacity: 0.6;
}

.community-item-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.community-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-strong);
}

.community-item-date {
  font-size: 11px;
  color: var(--ink-soft);
}

.community-item-tag {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-strong);
  background: var(--surface-muted);
  border: 1px solid var(--accent-soft-border);
}

.community-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.community-item-tags .community-item-tag {
  margin-top: 0;
}

.community-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(12, 9, 18, 0.68), rgba(24, 18, 32, 0.55));
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 3;
}

.community-loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.community-loading-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--accent-soft-border);
  box-shadow: var(--shadow-soft);
  color: var(--ink-strong);
  font-size: 12px;
}

.community-loading-overlay .community-spinner {
  display: block;
}

.community-detail {
  border-radius: var(--radius-media);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  padding: 16px;
  min-height: 220px;
  display: none;
  flex-direction: column;
  gap: 12px;
}

.community-detail img {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    height: auto;
    object-fit: contain;
    margin: 0 auto;
  }

  .community-sheet-body img {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    height: auto;
    object-fit: contain;
    margin: 0 auto;
  }

.community-detail .community-media,
.community-sheet-body .community-media {
  width: 100%;
  display: flex;
  justify-content: center;
}

.community-detail .community-media video,
.community-sheet-body .community-media video {
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

.community-detail-title {
  font-size: 18px;
  font-family: "Fraunces", "Times New Roman", serif;
  color: var(--ink-strong);
}

.community-detail-meta {
  font-size: 12px;
  color: var(--ink-soft);
}

.community-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.community-detail-tag {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-strong);
  background: var(--surface-muted);
  border: 1px solid var(--accent-soft-border);
}

.community-detail-text {
  font-size: 13px;
  color: var(--ink-strong);
  line-height: 1.5;
}

.community-detail-empty {
  font-size: 13px;
  color: var(--ink-soft);
}

.community-rating-stars {
  position: relative;
  display: inline-block;
  letter-spacing: 0.08em;
  line-height: 1;
  font-size: 12px;
}

.community-rating-stars-base,
.community-rating-stars-fill {
  display: block;
  white-space: nowrap;
}

.community-rating-stars-base {
  color: rgba(255, 255, 255, 0.28);
}

.community-rating-stars-fill {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  color: #ffbd59;
  text-shadow: 0 0 10px rgba(255, 189, 89, 0.45);
}

.community-rating-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 195, 112, 0.32);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 189, 89, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.community-rating-card[data-has-votes="false"] {
  border-style: dashed;
  opacity: 0.86;
}

.community-rating-card-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.community-rating-card-score {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-strong);
  white-space: nowrap;
}

.community-rating-card-count {
  font-size: 10px;
  color: var(--ink-soft);
  white-space: nowrap;
  text-align: right;
}

.community-rating-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 195, 112, 0.32);
  background: linear-gradient(152deg, rgba(255, 255, 255, 0.08), rgba(255, 189, 89, 0.1));
  box-shadow: var(--shadow-soft);
}

.community-rating-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.community-rating-panel-stars {
  display: inline-flex;
  align-items: center;
}

.community-rating-panel-stars .community-rating-stars {
  font-size: 15px;
}

.community-rating-panel-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.community-rating-panel-score {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-strong);
}

.community-rating-panel-votes {
  font-size: 11px;
  color: var(--ink-soft);
}

.community-rating-counts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.community-rating-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-soft-border);
  font-size: 11px;
  color: var(--ink-strong);
  background: rgba(255, 255, 255, 0.08);
}

.community-rating-count.up {
  border-color: rgba(42, 201, 125, 0.42);
}

.community-rating-count.down {
  border-color: rgba(244, 98, 98, 0.42);
}

.community-rating-count-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.community-rating-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.community-rating-form-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-strong);
}

.community-rating-vote-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.community-rating-vote-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--accent-soft-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.community-rating-vote-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.community-rating-vote-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.community-rating-vote-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.community-rating-thumb-icon {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.community-rating-count.up .community-rating-count-icon {
  color: #5ad290;
}

.community-rating-count.down .community-rating-count-icon {
  color: #ff8a8a;
}

.community-rating-vote-button.is-active[data-vote="up"] {
  border-color: rgba(42, 201, 125, 0.58);
  background: rgba(42, 201, 125, 0.16);
}

.community-rating-vote-button.is-active[data-vote="down"] {
  border-color: rgba(244, 98, 98, 0.58);
  background: rgba(244, 98, 98, 0.16);
}

.community-rating-comment-input {
  border-radius: 12px;
  border: 1px solid var(--accent-soft-border);
  background: rgba(18, 22, 32, 0.32);
  color: var(--ink-strong);
  font-size: 12px;
  line-height: 1.45;
  padding: 10px 12px;
  resize: vertical;
  min-height: 90px;
}

.community-rating-comment-input:focus {
  outline: none;
  border-color: var(--accent-soft-border);
  box-shadow: 0 0 0 2px rgba(255, 189, 89, 0.16);
}

.community-rating-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.community-rating-word-count {
  font-size: 11px;
  color: var(--ink-soft);
}

.community-rating-submit {
  min-width: 140px;
}

.community-rating-form-status {
  min-height: 16px;
  font-size: 11px;
  color: var(--ink-soft);
}

.community-rating-form-status.is-error {
  color: #ff8a8a;
}

.community-rating-form-status.is-success {
  color: #7fe0aa;
}

.community-rating-form-status.is-muted {
  color: var(--ink-soft);
}

.community-rating-comments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.community-rating-comments-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-strong);
}

.community-rating-comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 2px;
}

.community-rating-comment-empty {
  font-size: 12px;
  color: var(--ink-soft);
  border: 1px dashed var(--accent-soft-border);
  border-radius: 12px;
  padding: 10px 12px;
}

.community-rating-comment {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--accent-soft-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(18, 22, 32, 0.28);
}

.community-rating-comment.is-up {
  border-color: rgba(42, 201, 125, 0.42);
}

.community-rating-comment.is-down {
  border-color: rgba(244, 98, 98, 0.42);
}

.community-rating-comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.community-rating-comment-vote {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-strong);
}

.community-rating-comment.is-up .community-rating-comment-vote {
  color: #5ad290;
}

.community-rating-comment.is-down .community-rating-comment-vote {
  color: #ff8a8a;
}

.community-rating-comment-xid {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-strong);
}

.community-rating-comment-date {
  margin-left: auto;
  font-size: 10px;
  color: var(--ink-soft);
}

.community-rating-comment-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-strong);
  white-space: pre-wrap;
  word-break: break-word;
}

.community-link {
    align-self: flex-start;
  }

  .community-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
  }

  .community-sheet {
    position: fixed;
    inset: 0;
    background: rgba(15, 22, 24, 0.78);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
  }

  .community-sheet.active {
    opacity: 1;
    pointer-events: auto;
  }

  .community-sheet-panel {
    background: var(--glass-bg-strong);
    border-radius: 0;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 16px;
    width: 100%;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(16px);
    transition: transform 0.2s ease;
  }

  .community-sheet.active .community-sheet-panel {
    transform: translateY(0);
  }

  .community-sheet-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 12px;
  }

  .community-sheet-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-strong);
  }

  .community-sheet-close {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    padding: 0;
    border-color: var(--border);
    background: var(--surface);
    color: var(--ink-strong);
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 25;
    box-shadow: var(--shadow-soft);
  }

  .community-sheet-close .icon {
    width: 18px;
    height: 18px;
  }

  .community-sheet-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 20px;
  }

  #communityModal.community-sheet-open .modal-content {
    overflow: hidden;
  }

  @media (min-width: 900px) {
    .community-sheet {
      align-items: center;
      justify-content: center;
      padding: 28px;
    }

    .community-sheet-panel {
      width: min(900px, 92vw);
      height: min(80vh, 780px);
      border-radius: var(--radius-lg);
      padding: 20px 24px 24px;
    }

    .community-sheet-body img {
      max-height: 32vh;
      width: auto;
      max-width: 100%;
      align-self: center;
    }
  }

.call-card {
  max-width: 420px;
}

.call-controls {
  display: flex;
  gap: 12px;
}

.call-visualizer-wrap {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.avatar-container {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-visualizer {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 1;
  z-index: 0;
}

#callAvatarImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: relative;
  z-index: 1;
  border-radius: 50%;
  display: block;
}

@keyframes border-spin {
  from { transform: translate(-50%, -50%) rotate(0); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes zoomInOut {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.zoom-effect {
  animation: zoomInOut 0.5s infinite !important;
}

.rotating-rainbow-border {
  --border-radius: 100%;
  --border-bg: conic-gradient(from 90deg, #4481ed, #ff69b4 10%, #ff69b4 25%, #ff69b4 50%, #ff69b4 50%, #4e8af4 76%);
  --border-size: 0.25rem;
  --box-shadow-color: 0 0 15px 3px rgba(255, 0, 255, 0.3), 0 0 15px 3px rgba(0, 0, 255, 0.3);
  width: 120px;
  height: 120px;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: var(--border-size);
  border-radius: var(--border-radius);
  display: inline-block;
  box-shadow: var(--box-shadow-color);
  z-index: 1;
}

.rotating-rainbow-border::before {
  content: '';
  display: block;
  background: var(--border-bg);
  width: calc(100% * 1.41421356237);
  padding-bottom: calc(100% * 1.41421356237);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 100%;
  z-index: -2;
  animation: border-spin 8s linear infinite;
}

.rotating-rainbow-border::after {
  content: '';
  position: absolute;
  inset: var(--border-size);
  background: white;
  z-index: -1;
  border-radius: calc(var(--border-radius) - var(--border-size));
}

.call-meters {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.call-meter {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meter-label {
  width: 70px;
  font-size: 12px;
  color: var(--ink-muted);
}

.meter-bar {
  flex: 1;
  height: 8px;
  background: var(--accent-soft-strong);
  border-radius: 999px;
  overflow: hidden;
}

.meter-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  transition: width 0.2s ease;
}

.meter-bar.out span {
  background: var(--accent-gradient-strong);
}

.prompt-card {
  max-width: 520px;
}

.music-card {
  max-width: 760px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.music-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.music-status {
  min-height: 20px;
  font-size: 12px;
  color: var(--ink-soft);
}

.music-status[data-tone="error"] {
  color: var(--accent-pink);
}

.music-status[data-tone="success"] {
  color: var(--accent-blue);
}

.music-compose-form .music-autogen-button {
  border-color: var(--accent-soft-border);
  color: var(--accent-strong);
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 70%),
    var(--surface);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  animation: music-autogen-glow 1.9s ease-in-out infinite;
}

.music-compose-form .music-autogen-button:hover {
  border-color: var(--accent-blue);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 12px var(--accent-soft-strong),
    0 0 24px rgba(75, 107, 255, 0.24);
}

.music-compose-form .music-autogen-button:disabled {
  animation: none;
  opacity: 0.72;
  box-shadow: none;
}

@keyframes music-autogen-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.02) inset,
      0 0 7px rgba(255, 77, 184, 0.2),
      0 0 16px rgba(75, 107, 255, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06) inset,
      0 0 14px rgba(255, 77, 184, 0.32),
      0 0 26px rgba(75, 107, 255, 0.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .music-compose-form .music-autogen-button {
    animation: none;
  }
}

.music-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.music-item,
.music-empty {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 12px;
}

.music-empty {
  text-align: center;
  color: var(--ink-soft);
}

.music-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.music-item-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.music-item-task {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-weight: 600;
}

.music-badge {
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.music-badge[data-status="completed"] {
  color: #11a46a;
  border-color: rgba(17, 164, 106, 0.4);
  background: rgba(17, 164, 106, 0.12);
}

.music-badge[data-status="failed"] {
  color: #d6456b;
  border-color: rgba(214, 69, 107, 0.4);
  background: rgba(214, 69, 107, 0.12);
}

.music-badge[data-status="queued"],
.music-badge[data-status="processing"] {
  color: #3b74d8;
  border-color: rgba(59, 116, 216, 0.4);
  background: rgba(59, 116, 216, 0.12);
}

.music-delete-button {
  font-size: 10px;
  padding: 4px 10px;
  line-height: 1.2;
}

.music-item-time {
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.music-item-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.music-item-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-strong);
  white-space: pre-wrap;
  word-break: break-word;
}

.music-lyrics {
  margin-top: 8px;
}

.music-lyrics summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-soft);
}

.music-lyrics pre {
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.03);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-strong);
  max-height: 180px;
  overflow-y: auto;
}

.music-tracks {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.music-track {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: rgba(0, 0, 0, 0.02);
}

.music-track audio {
  width: 100%;
}

.music-track-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.music-track-actions .ghost-button {
  font-size: 11px;
  padding: 6px 10px;
}

.music-track-actions .ghost-button.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.music-item-error {
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent-pink);
}

.prompt-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prompt-body textarea,
.prompt-body input {
  flex: 0 0 auto;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: inherit;
  background: var(--surface);
  color: var(--ink-strong);
}

.prompt-body textarea {
  min-height: 44px;
  line-height: 1.4;
  resize: none;
  overflow-y: hidden;
}

.prompt-options {
  margin-top: 12px;
}

.prompt-options[hidden] {
  display: none;
}

.prompt-footer {
  margin-top: 16px;
}

.prompt-footer .solid-button {
  width: 100%;
  padding: 12px 18px;
  font-size: 15px;
}

.settings-card {
  max-width: 720px;
}

.cloud-tools-card {
  max-width: 520px;
}

.cloud-tools-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cloud-tools-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.cloud-tools-actions .solid-button,
.cloud-tools-actions .ghost-button {
  width: 100%;
}

.cloud-tools-note {
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  color: #ff4d5a;
}

#pushCloudButton {
  background: linear-gradient(120deg, #00f5ff, #53ffb5, #f7ff6e);
  color: #0b0f10;
  border-color: transparent;
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.45), 0 0 18px rgba(83, 255, 181, 0.35);
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
  background-size: 200% 200%;
  animation: gradientShift 18s ease infinite;
}

#pushCloudButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.6), 0 0 22px rgba(83, 255, 181, 0.5);
}

#pushCloudButton:focus-visible {
  outline: 2px solid rgba(0, 245, 255, 0.6);
  outline-offset: 3px;
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
}

.gradient-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gradient-row input[type="color"] {
  width: 52px;
  height: 36px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.gradient-row input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.gradient-row input[type="color"]::-webkit-color-swatch {
  border-radius: 10px;
  border: none;
}

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

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: var(--surface-muted);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.switch input:checked + .slider {
  background: var(--accent-gradient);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.swal2-popup {
  font-family: "Space Grotesk", "Fira Sans", sans-serif;
  background: var(--surface-gradient) !important;
  color: var(--ink-strong) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
  position: relative;
  overflow: hidden;
}

.swal2-popup::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--surface-gradient);
  background-size: 200% 200%;
  animation: gradientShift 70s ease infinite;
  pointer-events: none;
  z-index: 0;
}

.swal2-popup > * {
  position: relative;
  z-index: 1;
}

.swal2-title {
  font-family: "Fraunces", "Times New Roman", serif;
  color: var(--ink-strong) !important;
}

.swal2-html-container {
  color: var(--ink-soft) !important;
}

.copyable-prompt-text {
  cursor: pointer;
  border-radius: 10px;
  padding: 4px 6px;
  margin: 2px -6px 0;
  transition: background 0.18s ease, color 0.18s ease;
}

.copyable-prompt-text:hover,
.copyable-prompt-text:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.copyable-prompt-text[data-copy-state="copied"] {
  background: rgba(34, 197, 94, 0.14);
}

.copyable-prompt-text[data-copy-state="failed"] {
  background: rgba(239, 68, 68, 0.14);
}

.swal2-styled.swal2-confirm {
  background: var(--accent-gradient) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: var(--shadow-soft) !important;
}

.swal2-styled.swal2-cancel {
  background: transparent !important;
  color: var(--ink-soft) !important;
  border: 1px solid var(--border) !important;
}

.swal2-icon.swal2-warning {
  border-color: var(--accent-pink) !important;
  color: var(--accent-pink) !important;
}

.xp-shop-popup {
  width: min(420px, 92vw) !important;
  border-radius: 24px !important;
  overflow: hidden;
}

.xp-shop-popup .swal2-close {
  width: 32px;
  height: 32px;
  margin: 8px;
  position: absolute;
  top: 6px;
  right: 6px;
  border-radius: 999px;
  color: var(--ink-soft) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  z-index: 6;
  transition: background 0.2s ease, color 0.2s ease;
}

.xp-shop-popup .swal2-close:hover {
  background: var(--accent-soft);
  color: var(--ink-strong) !important;
}

.xp-shop {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.xp-shop-sub {
  font-size: 12px;
  color: var(--ink-soft);
}

.xp-shop-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  row-gap: 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.xp-shop-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-strong);
}

.xp-shop-grid {
  display: grid;
  gap: 12px;
}

.xp-shop-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.xp-shop-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-strong);
}

.xp-shop-meta,
.xp-shop-owned,
.xp-shop-cost {
  font-size: 11px;
  color: var(--ink-soft);
}

.xp-shop-action {
  width: 100%;
  font-size: 11px;
  padding: 8px 12px;
  margin-top: 6px;
}

.xp-shop-action.is-disabled {
  opacity: 0.65;
  box-shadow: none;
  cursor: not-allowed;
}

.xp-shop-status {
  min-height: 16px;
  font-size: 11px;
  color: var(--ink-soft);
}

.xp-shop-status[data-tone="error"] {
  color: var(--accent-pink);
}

.xp-shop-status[data-tone="success"] {
  color: var(--accent-blue);
}

.settings-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.settings-field input,
.settings-field textarea,
.settings-field select {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--ink-strong);
}

.settings-field textarea {
  resize: vertical;
}

#corePromptInput,
#looklikeInput,
#musicPromptInput,
#musicLyricsInput {
  resize: none;
  overflow-y: hidden;
  line-height: 1.4;
}

.settings-hint {
  font-size: 12px;
  color: var(--ink-soft);
}

.settings-meta {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.settings-advanced {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px 12px;
}

.settings-footer {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-footer-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.settings-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.settings-footer-key {
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.settings-footer-value {
  color: var(--ink-strong);
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-advanced summary {
  cursor: pointer;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.advanced-lock-label {
  display: none;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent-strong);
}

.settings-advanced.is-locked .advanced-lock-label {
  display: inline-block;
}

.settings-advanced.is-locked .settings-advanced-body {
  opacity: 0.6;
}

.settings-advanced-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.temperature-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.temperature-row input[type="range"] {
  flex: 1;
}

.temperature-value {
  min-width: 40px;
  text-align: right;
  font-size: 13px;
  color: var(--ink-strong);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-button {
  font-size: 12px;
  padding: 6px 12px;
}

.preset-button.active {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
}

.settings-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.settings-actions-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

@media (max-width: 640px) {
  .settings-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .settings-actions-right {
    order: 2;
    align-self: flex-end;
  }

  .share-card-button {
    width: 100%;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-soft);
    order: 1;
  }

  #freshRestartButton {
    font-size: 11px;
    padding: 6px 10px;
    width: auto;
    order: 3;
    align-self: flex-start;
  }

  .slot-meta {
    flex-direction: column;
    align-items: flex-start;
  }

}

.photo-modal,
.video-modal {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-content.photo-modal,
.modal-content.video-modal {
  max-height: 90vh;
}

.photo-preview,
.video-preview {
  border-radius: var(--radius-media);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  flex-shrink: 0;
}

.photo-preview {
  display: inline-flex;
  align-self: center;
  width: fit-content;
  max-width: 100%;
}

.photo-info-button,
.video-info-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-strong);
  box-shadow: 0 8px 18px rgba(25, 25, 45, 0.12);
  z-index: 2;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.photo-info-button:hover,
.video-info-button:hover {
  background: var(--surface-muted);
}

.photo-info-button:disabled,
.video-info-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.photo-preview:hover .photo-info-button,
.photo-preview:focus-within .photo-info-button,
.video-preview:hover .video-info-button,
.video-preview:focus-within .video-info-button,
.photo-info-button:focus-visible,
.video-info-button:focus-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (hover: none) {
  .photo-info-button,
  .video-info-button {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

.photo-preview img,
.video-preview video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 65vh;
  display: block;
  object-fit: contain;
  border-radius: calc(var(--radius-media) - 4px);
}

.photo-actions,
.video-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.photo-actions .ghost-button,
.photo-actions .solid-button,
.video-actions .ghost-button,
.video-actions .solid-button {
  min-height: 38px;
  padding: 6px 12px;
  font-size: 13px;
}

.photo-actions button:disabled,
.video-actions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.photo-video-gen2-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.neon-glow-button {
  position: relative;
  overflow: hidden;
  color: #031918;
  background: linear-gradient(120deg, #00f6ff 0%, #30ff8a 45%, #00f6ff 100%);
  border: 1px solid rgba(0, 255, 214, 0.85);
  box-shadow:
    0 0 10px rgba(0, 255, 214, 0.55),
    0 0 22px rgba(0, 255, 214, 0.45),
    0 0 34px rgba(0, 255, 214, 0.35);
  text-shadow: 0 0 8px rgba(0, 255, 214, 0.6);
  animation: neonPulse 2.2s ease-in-out infinite;
}

.neon-glow-button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -120%;
  width: 240%;
  height: 200%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
  opacity: 0.7;
  transform: translateX(-35%);
  animation: neonSweep 3.6s ease-in-out infinite;
  pointer-events: none;
}

.neon-glow-button:hover {
  border-color: rgba(0, 255, 214, 0.95);
  box-shadow:
    0 0 14px rgba(0, 255, 214, 0.7),
    0 0 28px rgba(0, 255, 214, 0.5),
    0 0 46px rgba(0, 255, 214, 0.4);
}

.neon-glow-button:disabled {
  animation: none;
  box-shadow: none;
  text-shadow: none;
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.neon-glow-gen2-button {
  position: relative;
  overflow: hidden;
  color: #14021b;
  background: linear-gradient(120deg, #ff4df5 0%, #7b58ff 45%, #35d3ff 100%);
  border: 1px solid rgba(255, 77, 245, 0.85);
  box-shadow:
    0 0 10px rgba(255, 77, 245, 0.5),
    0 0 22px rgba(123, 88, 255, 0.45),
    0 0 34px rgba(53, 211, 255, 0.35);
  text-shadow: 0 0 8px rgba(255, 77, 245, 0.6);
  animation: neonPulseGen2 2.2s ease-in-out infinite;
}

.neon-glow-gen2-button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -120%;
  width: 240%;
  height: 200%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  opacity: 0.75;
  transform: translateX(-35%);
  animation: neonSweepGen2 3.6s ease-in-out infinite;
  pointer-events: none;
}

.neon-glow-gen2-button:hover {
  border-color: rgba(255, 77, 245, 0.95);
  box-shadow:
    0 0 14px rgba(255, 77, 245, 0.7),
    0 0 28px rgba(123, 88, 255, 0.55),
    0 0 46px rgba(53, 211, 255, 0.4);
}

.neon-glow-gen2-button:disabled {
  animation: none;
  box-shadow: none;
  text-shadow: none;
  background: var(--surface-muted);
  color: var(--ink-muted);
}

@keyframes neonPulse {
  0% {
    box-shadow:
      0 0 10px rgba(0, 255, 214, 0.45),
      0 0 20px rgba(0, 255, 214, 0.35),
      0 0 32px rgba(0, 255, 214, 0.25);
  }
  50% {
    box-shadow:
      0 0 16px rgba(0, 255, 214, 0.75),
      0 0 30px rgba(0, 255, 214, 0.6),
      0 0 48px rgba(0, 255, 214, 0.45);
  }
  100% {
    box-shadow:
      0 0 10px rgba(0, 255, 214, 0.45),
      0 0 20px rgba(0, 255, 214, 0.35),
      0 0 32px rgba(0, 255, 214, 0.25);
  }
}

@keyframes neonSweep {
  0% {
    transform: translateX(-55%);
    opacity: 0;
  }
  40% {
    opacity: 0.9;
  }
  100% {
    transform: translateX(55%);
    opacity: 0;
  }
}

@keyframes neonPulseGen2 {
  0% {
    box-shadow:
      0 0 10px rgba(255, 77, 245, 0.45),
      0 0 20px rgba(123, 88, 255, 0.35),
      0 0 32px rgba(53, 211, 255, 0.25);
  }
  50% {
    box-shadow:
      0 0 16px rgba(255, 77, 245, 0.75),
      0 0 30px rgba(123, 88, 255, 0.6),
      0 0 48px rgba(53, 211, 255, 0.45);
  }
  100% {
    box-shadow:
      0 0 10px rgba(255, 77, 245, 0.45),
      0 0 20px rgba(123, 88, 255, 0.35),
      0 0 32px rgba(53, 211, 255, 0.25);
  }
}

@keyframes neonSweepGen2 {
  0% {
    transform: translateX(-55%);
    opacity: 0;
  }
  40% {
    opacity: 0.9;
  }
  100% {
    transform: translateX(55%);
    opacity: 0;
  }
}

.vip-purchase-link {
  margin-top: 10px;
  text-align: center;
}

.vip-purchase-link a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.photo-video-gen2-button .gen2-audio-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #ffffff;
  background: linear-gradient(135deg, #2ee8a3 0%, #19b5ff 45%, #5b6bff 100%);
  box-shadow: 0 6px 12px rgba(25, 181, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.photo-share-button,
.video-share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.photo-share-button .share-reward-badge,
.video-share-button .share-reward-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #ffffff;
  background: linear-gradient(135deg, #ffb347 0%, #ff5ac8 45%, #6a6dff 100%);
  box-shadow: 0 6px 14px rgba(255, 90, 200, 0.35), 0 0 12px rgba(106, 109, 255, 0.4);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.6);
  animation: rewardPulse 2.4s ease-in-out infinite;
}

.photo-share-button.is-claimed .share-reward-badge,
.video-share-button.is-claimed .share-reward-badge {
  animation: none;
  filter: grayscale(0.6);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(255, 255, 255, 0.7);
  opacity: 0.7;
}

@keyframes rewardPulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 6px 14px rgba(255, 90, 200, 0.35), 0 0 10px rgba(106, 109, 255, 0.35);
  }
  50% {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 10px 18px rgba(255, 90, 200, 0.45), 0 0 16px rgba(106, 109, 255, 0.55);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 6px 14px rgba(255, 90, 200, 0.35), 0 0 10px rgba(106, 109, 255, 0.35);
  }
}

.photo-status,
.video-status {
  min-height: 18px;
  font-size: 12px;
  color: var(--ink-soft);
}

@media (max-width: 980px) {
  body {
    padding: 16px;
  }

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

  .sidepanel {
    order: 2;
  }

  .chatroom {
    min-height: 0;
  }

  .scroll-bottom-button {
    right: 16px;
    bottom: 96px;
    bottom: calc(96px + env(safe-area-inset-bottom));
    padding: 7px 12px;
  }

  .community-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "detail" "grid";
  }

  .community-detail {
    grid-area: detail;
    position: sticky;
    top: 0;
    z-index: 2;
    max-height: 65vh;
    overflow: auto;
  }

  .community-grid {
    grid-area: grid;
  }
}

@media (max-width: 680px) {
  body {
    min-height: 100dvh;
    height: 100dvh;
    padding: 12px;
  }

  .app,
  .layout,
  .chatroom {
    height: 100%;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-auto-rows: auto;
    align-items: center;
    gap: 10px 12px;
    padding: 10px 12px 12px;
  }

  .community-detail {
    display: none;
  }

  .brand {
    width: 100%;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    align-items: center;
  }

  .brand-text .title {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .brand-text .title .name-text {
    flex-basis: 100%;
    max-width: 100%;
  }

  .top-actions {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    align-self: start;
    align-items: flex-end;
    flex-direction: column;
    gap: 8px;
    width: auto;
  }

  .community-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-actions,
  .icon-actions {
    width: auto;
    justify-content: flex-end;
    gap: 6px;
  }

  .avatar {
    width: 34px;
    height: 34px;
  }

  .brand-text .title {
    font-size: 16px;
  }

  .brand-text .title .name-text {
    max-width: 140px;
  }

  .cloud-label {
    font-size: 9px;
    padding: 2px 6px;
  }

  .vip-label {
    font-size: 9px;
    padding: 2px 6px;
  }

  .break-flip {
    min-width: 120px;
    height: 26px;
  }

  .take-break-button {
    padding: 4px 10px;
    font-size: 10px;
  }

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

  .gallery-item {
    aspect-ratio: auto;
  }

  .gallery-item img,
  .gallery-item video {
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .gallery-meta {
    font-size: 11px;
    padding: 5px 8px;
  }

  .topbar .icon-only,
  .topbar .ghost-button.icon-only,
  .topbar .solid-button.icon-only {
    width: 28px;
    height: 28px;
  }

  .app-footer {
    justify-content: center;
    padding-bottom: 8px;
  }

  .take-break-button {
    font-size: 10px;
    padding: 6px 12px;
  }

  .language-switcher {
    padding: 3px 5px;
  }

  .language-label {
    font-size: 8px;
  }

  .language-select-wrap select {
    font-size: 9px;
    padding: 4px 20px 4px 8px;
  }

  .auth-action {
    height: 28px;
    padding: 0 9px;
    font-size: 9px;
    letter-spacing: 0.05em;
  }

  .vip-button {
    height: 28px;
    padding: 0 10px;
    font-size: 9px;
    letter-spacing: 0.05em;
  }

  .message {
    max-width: 90%;
  }

  .composer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .composer-tools {
    flex-direction: row;
  }

  .composer-input {
    border-radius: 18px;
    padding: 6px 8px;
    border: 1px solid var(--composer-border);
    background: var(--composer-bg);
    box-shadow: var(--composer-shadow);
    min-height: 60px;
    gap: 4px;
  }

  #messageInput {
    min-height: 44px;
    max-height: 220px;
    font-size: 16px;
  }

  .send-button {
    min-width: 64px;
    height: 40px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .composer-input .icon-button.icon-only {
    width: 32px;
    height: 32px;
  }

  .composer-input .icon-button .icon {
    width: 16px;
    height: 16px;
  }

  .media img,
  .media video {
    max-height: 320px;
  }

  .character-sheet {
    width: 92vw;
    padding: 16px;
  }

  .carousel-nav {
    display: none;
  }

  .photo-modal,
  .video-modal {
    gap: 12px;
  }

  .photo-preview,
  .video-preview {
    max-height: none;
  }

  .photo-preview img,
  .video-preview video {
    max-height: 52vh;
  }

  .photo-actions,
  .video-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .photo-actions .ghost-button,
  .photo-actions .solid-button,
  .video-actions .ghost-button,
  .video-actions .solid-button {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .quick-sparks,
  .media-studio {
    display: none;
  }
}

@media (max-height: 700px) {
  .character-modal {
    padding: 16px;
  }
}

@media (max-height: 700px) {
  .character-subtitle {
    display: none;
  }

  .character-meta {
    gap: 4px;
  }

  .character-role {
    font-size: 16px;
    font-weight: 600;
    color: inherit;
  }

  .character-age {
    padding: 3px 8px;
    font-size: 10px;
  }
}

@media (max-height: 560px) {
  .character-modal {
    padding: 12px;
  }

  .character-sheet {
    max-height: 92vh;
    overflow-y: auto;
  }
}

/* Final low-power overrides at end of file to win cascade against theme blocks. */
html[data-low-power="true"] body,
body[data-low-power="true"] {
  background: #f3f4f6 !important;
}

html[data-low-power="true"][data-theme="dark"] body,
body[data-low-power="true"][data-theme="dark"] {
  background: #0f1115 !important;
}

body[data-low-power="true"] .app,
body[data-low-power="true"] .chatroom,
body[data-low-power="true"] .composer,
body[data-low-power="true"] .composer-input,
body[data-low-power="true"] .panel-card,
body[data-low-power="true"] .modal-content,
body[data-low-power="true"] .settings-card,
body[data-low-power="true"] .slot-card,
body[data-low-power="true"] .message .bubble,
body[data-low-power="true"] .gallery-item,
body[data-low-power="true"] .community-item {
  background-image: none !important;
  box-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  border-radius: 8px !important;
}

body[data-low-power="true"] .chatroom::before,
body[data-low-power="true"] .chatroom::after,
body[data-low-power="true"] .app::before,
body[data-low-power="true"] .app::after,
body[data-low-power="true"] .composer::before,
body[data-low-power="true"] .composer::after,
body[data-low-power="true"] .panel-card::before,
body[data-low-power="true"] .panel-card::after {
  display: none !important;
  content: none !important;
}

/* Hard fallback: honor the html low-power flag even if body dataset lags behind. */
html[data-low-power="true"] body {
  --surface-gradient: none !important;
  --bg-glow: transparent !important;
  --bg-glow-alt: transparent !important;
  background-image: none !important;
}

html[data-low-power="true"] body,
html[data-low-power="true"] body :not(.topbar, .topbar *, .app-footer, .app-footer *, video, video *),
html[data-low-power="true"] body :not(.topbar, .topbar *, .app-footer, .app-footer *, video, video *)::before,
html[data-low-power="true"] body :not(.topbar, .topbar *, .app-footer, .app-footer *, video, video *)::after {
  animation: none !important;
  transition: none !important;
  box-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-low-power="true"] body .chatroom::before,
html[data-low-power="true"] body .chatroom::after,
html[data-low-power="true"] body .app::before,
html[data-low-power="true"] body .app::after,
html[data-low-power="true"] body .composer::before,
html[data-low-power="true"] body .composer::after,
html[data-low-power="true"] body .panel-card::before,
html[data-low-power="true"] body .panel-card::after {
  display: none !important;
  content: none !important;
}

/* Class fallback for low power mode, used when attribute sync is delayed. */
html.low-power-mode body {
  --surface-gradient: none !important;
  --bg-glow: transparent !important;
  --bg-glow-alt: transparent !important;
  background-image: none !important;
}

html.low-power-mode body,
html.low-power-mode body :not(.topbar, .topbar *, .app-footer, .app-footer *, video, video *),
html.low-power-mode body :not(.topbar, .topbar *, .app-footer, .app-footer *, video, video *)::before,
html.low-power-mode body :not(.topbar, .topbar *, .app-footer, .app-footer *, video, video *)::after {
  animation: none !important;
  transition: none !important;
  box-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html.low-power-mode body .chatroom::before,
html.low-power-mode body .chatroom::after,
html.low-power-mode body .app::before,
html.low-power-mode body .app::after,
html.low-power-mode body .composer::before,
html.low-power-mode body .composer::after,
html.low-power-mode body .panel-card::before,
html.low-power-mode body .panel-card::after {
  display: none !important;
  content: none !important;
}

/* Extra low-power trims: keep decorative layers static and remove costly video/filter compositing. */
body[data-low-power="true"] .topbar,
body[data-low-power="true"] .topbar *,
body[data-low-power="true"] .app-footer,
body[data-low-power="true"] .app-footer *,
html[data-low-power="true"] body .topbar,
html[data-low-power="true"] body .topbar *,
html[data-low-power="true"] body .app-footer,
html[data-low-power="true"] body .app-footer *,
html.low-power-mode body .topbar,
html.low-power-mode body .topbar *,
html.low-power-mode body .app-footer,
html.low-power-mode body .app-footer * {
  animation: none !important;
  transition: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-low-power="true"] .chatroom-bg-video,
body[data-low-power="true"] .community-thumb .community-focus-video,
body[data-low-power="true"] .community-thumb .community-hover-video,
html[data-low-power="true"] body .chatroom-bg-video,
html[data-low-power="true"] body .community-thumb .community-focus-video,
html[data-low-power="true"] body .community-thumb .community-hover-video,
html.low-power-mode body .chatroom-bg-video,
html.low-power-mode body .community-thumb .community-focus-video,
html.low-power-mode body .community-thumb .community-hover-video {
  display: none !important;
}

body[data-low-power="true"] .community-thumb img,
body[data-low-power="true"] .community-thumb .community-focus-video,
body[data-low-power="true"] .community-thumb .community-hover-video,
html[data-low-power="true"] body .community-thumb img,
html[data-low-power="true"] body .community-thumb .community-focus-video,
html[data-low-power="true"] body .community-thumb .community-hover-video,
html.low-power-mode body .community-thumb img,
html.low-power-mode body .community-thumb .community-focus-video,
html.low-power-mode body .community-thumb .community-hover-video {
  animation: none !important;
  transition: none !important;
  filter: none !important;
  will-change: auto !important;
}

body[data-low-power="true"] .community-thumb.is-video-hover img,
body[data-low-power="true"] .community-thumb.is-video-focus-ready img,
html[data-low-power="true"] body .community-thumb.is-video-hover img,
html[data-low-power="true"] body .community-thumb.is-video-focus-ready img,
html.low-power-mode body .community-thumb.is-video-hover img,
html.low-power-mode body .community-thumb.is-video-focus-ready img {
  opacity: 1 !important;
  filter: none !important;
}

/* Keep character details media transitions intact in low-power mode. */
body[data-low-power="true"] .community-detail .community-media-img,
body[data-low-power="true"] .community-sheet-body .community-media-img,
html[data-low-power="true"] body .community-detail .community-media-img,
html[data-low-power="true"] body .community-sheet-body .community-media-img,
html.low-power-mode body .community-detail .community-media-img,
html.low-power-mode body .community-sheet-body .community-media-img {
  transition: opacity 1.4s ease, filter 1.4s ease !important;
  will-change: opacity, filter !important;
  filter: blur(0) !important;
}

body[data-low-power="true"] .community-detail .community-media.is-video-cycle-ready .community-media-img,
body[data-low-power="true"] .community-sheet-body .community-media.is-video-cycle-ready .community-media-img,
html[data-low-power="true"] body .community-detail .community-media.is-video-cycle-ready .community-media-img,
html[data-low-power="true"] body .community-sheet-body .community-media.is-video-cycle-ready .community-media-img,
html.low-power-mode body .community-detail .community-media.is-video-cycle-ready .community-media-img,
html.low-power-mode body .community-sheet-body .community-media.is-video-cycle-ready .community-media-img {
  opacity: 0 !important;
  filter: blur(6px) !important;
}

body[data-low-power="true"] .community-detail .community-media.is-video-cycle-ready .community-media-video,
body[data-low-power="true"] .community-sheet-body .community-media.is-video-cycle-ready .community-media-video,
html[data-low-power="true"] body .community-detail .community-media.is-video-cycle-ready .community-media-video,
html[data-low-power="true"] body .community-sheet-body .community-media.is-video-cycle-ready .community-media-video,
html.low-power-mode body .community-detail .community-media.is-video-cycle-ready .community-media-video,
html.low-power-mode body .community-sheet-body .community-media.is-video-cycle-ready .community-media-video {
  opacity: 1 !important;
  filter: none !important;
}
