/* Fake Chat Generator — stage layout + messenger chat look */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f6d5c8;
  font-family: "Noto Sans Khmer", "Segoe UI", sans-serif;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

#viewport {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(165deg, #f8dcd0 0%, #f3c4b4 50%, #efb8a8 100%);
}

#stage {
  position: relative;
  width: 1080px;
  height: 1920px;
  transform-origin: center center;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 40px;
  box-shadow:
    0 30px 60px rgba(120, 70, 50, 0.22),
    0 0 0 2px rgba(255, 255, 255, 0.65);
  background: #faf6f1;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
}

.screen.active {
  display: block;
}

.full-bleed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.abs {
  position: absolute;
}

.hidden {
  display: none !important;
}

/* Image action buttons (asset-based) */
.img-btn {
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.img-btn:active {
  transform: scale(0.97);
  filter: brightness(1.08);
}

.img-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  background: transparent;
}

.img-btn.pill {
  border-radius: 999px;
}

.img-btn.tile {
  border-radius: 28px;
}

/* Dynamic text — larger for 1080x1920 readability (rules/rule-ui-text_km.txt) */
.dyn-title {
  font-size: 72px;
  font-weight: 700;
  text-align: center;
  color: #ffffff;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
}

.dyn-title.dark {
  color: #1a3344;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.dyn-desc {
  font-size: 42px;
  font-weight: 700;
  text-align: center;
  color: #e8f4ff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  line-height: 1.35;
}

.dyn-desc.dark {
  color: #2a4558;
  text-shadow: none;
}

.title-hero-card {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 36px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(140, 90, 70, 0.12);
  overflow: hidden;
}

.title-logo-img {
  width: 88%;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 20px;
}

.title-copy-card {
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 14px 32px rgba(140, 90, 70, 0.12);
  padding: 36px 40px;
}

/* Home art mode: use the provided full screen artwork as main UI */
#screen-title .title-hero-card,
#screen-title .title-copy-card,
#screen-title #quick-picks,
#screen-title .lang-row {
  display: none;
}

/* Keep click target, but hide the default button graphic (art already includes START). */
#screen-title #btn-start img {
  opacity: 0;
}

.dyn-desc.on-title {
  color: #2b211c;
  text-shadow: none;
  font-size: 48px;
  font-weight: 700;
  line-height: 1.35;
}

.dyn-desc.on-title.sub {
  font-size: 40px;
  font-weight: 600;
  color: #6a554c;
  margin-top: 16px;
}

.img-btn.on-title {
  filter: drop-shadow(0 14px 22px rgba(120, 50, 30, 0.35));
}

.title-btn-start {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5252 0%, #c62828 100%);
  color: #fff;
  font-size: 56px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 6px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 12px 36px rgba(198, 40, 40, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.4);
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  animation: startPulse 2s ease-in-out infinite;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.title-btn-start:active {
  transform: scale(0.93);
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.4);
}

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

.title-btn-settings {
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #555;
  font-size: 60px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: settingsSpin 8s linear infinite;
  transition: transform 0.2s ease, background 0.2s ease;
}

.title-btn-settings:active {
  transform: scale(0.88) rotate(90deg);
  background: rgba(255, 255, 255, 1);
}

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

/* Extra contrast plate behind language tiles */
.lang-row {
  position: absolute;
  left: 250px;
  top: 1390px;
  width: 580px;
  height: 210px;
  background: #ffffff;
  border-radius: 36px;
  box-shadow: 0 14px 32px rgba(140, 90, 70, 0.14);
}

.dyn-title.dark {
  color: #2b211c;
  text-shadow: none;
}

.dyn-desc.dark {
  color: #5a463c;
  text-shadow: none;
}

.soft-panel,
.soft-panel.light {
  background: #ffffff;
  border: 0;
  border-radius: 28px;
  box-shadow: 0 12px 28px rgba(140, 90, 70, 0.1);
}

.dyn-name {
  font-size: 48px;
  font-weight: 700;
  color: #111111;
  letter-spacing: -0.02em;
}

.dyn-sub {
  font-size: 30px;
  font-weight: 600;
  color: #34c759;
  margin-top: 4px;
}

.dyn-time {
  font-size: 28px;
  font-weight: 500;
  color: #8e8e93;
  margin-top: 6px;
}

.dyn-msg {
  font-size: 40px;
  font-weight: 500;
  line-height: 1.35;
  color: #111111;
  white-space: pre-wrap;
  word-break: break-word;
}

.dyn-msg.out {
  color: #ffffff;
}

.fictional-tag {
  font-size: 28px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}

/* ========== CHAT PLAY STUDIO (Game-style) ========== */

.studio-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    #6420a2 0%,
    #4f1780 35%,
    #37105f 70%,
    #2a0c45 100%
  );
}

.studio-bg::before {
  content: '';
  position: absolute;
  top: -60px;
  left: -60px;
  right: -60px;
  height: 300px;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(150, 80, 230, 0.45) 0%,
    transparent 70%
  );
}

.studio-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to top, rgba(30, 8, 55, 0.65), transparent);
}

/* Decorative elements */
#screen-studio::before {
  content: '★  ✦  ★';
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 28px;
  color: rgba(255, 180, 255, 0.5);
  letter-spacing: 80px;
  z-index: 1;
  pointer-events: none;
}

#screen-studio::after {
  content: '✦  ★  ✦';
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 22px;
  color: rgba(255, 200, 100, 0.4);
  letter-spacing: 60px;
  z-index: 1;
  pointer-events: none;
}

/* Top bar */
.studio-topbar {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 200px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 36px 0;
}

.studio-top-btn {
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
}

.studio-top-btn:active {
  transform: scale(0.93);
}

/* Top bar actions (export + settings) */
.studio-top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.settings-mini {
  width: 90px;
  height: 80px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  color: #2a1040;
  font-size: 38px;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.back-btn {
  width: 100px;
  height: 100px;
  border-radius: 24px;
  background: linear-gradient(180deg, #e74c8b 0%, #c0286e 100%);
  color: #fff;
  font-size: 48px;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(180, 30, 90, 0.5);
}

.export-btn {
  height: 80px;
  padding: 0 32px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f5a623 0%, #e08900 100%);
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 2px;
  box-shadow: 0 8px 20px rgba(200, 130, 0, 0.5);
}

.top-btn-icon {
  font-size: 36px;
  line-height: 1;
}

.studio-logo-text {
  font-size: 60px;
  font-weight: 900;
  line-height: 0.95;
  text-align: center;
  color: #ffd700;
  text-shadow:
    0 3px 0 #c8860a,
    0 6px 12px rgba(0,0,0,0.4),
    0 0 30px rgba(255, 215, 0, 0.3);
  letter-spacing: 6px;
  text-transform: uppercase;
}

/* Chat panel */
.studio-chat-panel {
  position: absolute;
  left: 40px;
  top: 210px;
  width: 1000px;
  height: 1170px;
  background: linear-gradient(180deg, #fdf5e6 0%, #faecd4 100%);
  border-radius: 36px;
  border: 6px solid #8b3fa0;
  box-shadow:
    0 0 0 3px rgba(180, 100, 220, 0.3),
    0 20px 50px rgba(60, 10, 80, 0.4),
    inset 0 2px 0 rgba(255,255,255,0.6);
  overflow: hidden;
  z-index: 2;
}

/* Chat header */
.studio-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 2px solid rgba(139, 63, 160, 0.15);
  background: rgba(255,255,255,0.5);
}

.studio-chat-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.studio-header-avatars {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.studio-header-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #e8c6f0;
  box-shadow: 0 4px 12px rgba(139, 63, 160, 0.2);
}

.studio-header-avatars.stack {
  padding-right: 20px;
}

.studio-header-avatars.stack .stack-avatar {
  width: 72px;
  height: 72px;
  border: 4px solid #fff;
  margin-right: -28px;
  box-shadow: 0 4px 12px rgba(139, 63, 160, 0.25);
}

.studio-chat-header-right.group-mode .studio-header-name-right {
  display: none;
}

.msg-sender-name {
  font-size: 24px;
  font-weight: 700;
  color: #8a6a9a;
  margin: 0 0 6px 6px;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-writing-dm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.studio-writing-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.studio-writing-people {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px 8px 10px;
  -webkit-overflow-scrolling: touch;
}

.studio-writing-people::-webkit-scrollbar {
  height: 6px;
}

.studio-writing-people::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 3px;
}

.studio-writing-pick {
  position: relative;
  width: 78px;
  height: 78px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
}

.studio-writing-pick img {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: block;
}

.studio-writing-pick.active img {
  border: 5px solid #34c759;
  box-shadow:
    0 0 0 4px rgba(52, 199, 89, 0.25),
    0 4px 14px rgba(0, 0, 0, 0.25);
}

.studio-writing-pick.out-side.active img {
  border-color: #7ec8ff;
  box-shadow:
    0 0 0 4px rgba(126, 200, 255, 0.3),
    0 4px 14px rgba(0, 0, 0, 0.25);
}

.studio-writing-pick .studio-writing-check {
  bottom: -2px;
  right: -2px;
}

.cast-group-block {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 3px solid rgba(139, 63, 160, 0.15);
}

.cast-group-hint {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 600;
  color: #8a6a9a;
}

.cast-add-btn.disabled,
.cast-add-btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.compose-senders-row {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  padding: 10px 40px;
  box-sizing: border-box;
}

.compose-sender-btn {
  width: 200px;
  height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.compose-sender-btn .avatar-pick {
  width: 160px;
  height: 160px;
}

.compose-sender-name {
  font-size: 26px;
  text-align: center;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.studio-header-name {
  font-size: 44px;
  font-weight: 700;
  color: #2a1040;
}

.studio-header-status {
  font-size: 28px;
  font-weight: 600;
  color: #34c759;
}

.studio-chat-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.studio-header-name-right {
  font-size: 44px;
  font-weight: 700;
  color: #2a1040;
}

.studio-header-avatar-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

/* Chat feed */
.studio-chat-feed {
  position: relative;
  width: 100%;
  height: calc(100% - 150px - 80px);
  padding: 20px 28px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  -webkit-overflow-scrolling: touch;
}

.studio-chat-feed::-webkit-scrollbar {
  width: 6px;
}

.studio-chat-feed::-webkit-scrollbar-track {
  background: transparent;
}

.studio-chat-feed::-webkit-scrollbar-thumb {
  background: rgba(139, 63, 160, 0.3);
  border-radius: 3px;
}

/* Fictional content badge */
.studio-fictional-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(180deg, #64238f 0%, #32105f 100%);
  border-top: 2px solid rgba(200, 140, 255, 0.2);
  color: #e8d0ff;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 5px;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.fictional-star {
  font-size: 26px;
  color: #ffd700;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
}

/* Bottom composer panel */
.studio-composer-panel {
  position: absolute;
  left: 40px;
  bottom: 40px;
  width: 1000px;
  height: 500px;
  background: linear-gradient(
    180deg,
    #7e36c2 0%,
    #5c25b0 50%,
    #3b146f 100%
  );
  border-radius: 40px;
  border: 5px solid rgba(200, 130, 255, 0.3);
  box-shadow:
    0 -4px 30px rgba(80, 20, 120, 0.3),
    0 20px 60px rgba(40, 5, 60, 0.5),
    inset 0 2px 0 rgba(255,255,255,0.12);
  padding: 28px 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  z-index: 2;
}

.studio-writing-as {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding-bottom: 4px;
  min-height: 100px;
}

.studio-writing-avatar {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,0.35);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.studio-writing-avatar.self {
  width: 90px;
  height: 90px;
  border: 5px solid #34c759;
  box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.25), 0 4px 14px rgba(0,0,0,0.25);
}

.studio-writing-avatar-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.studio-writing-check {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #34c759;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #7030a0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.studio-writing-label {
  font-size: 40px;
  font-weight: 600;
  color: #f0d8ff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.studio-writing-label strong {
  color: #fff;
  font-weight: 800;
}

/* Input row */
.studio-input-row {
  width: 100%;
}

.studio-input-row #quick-input {
  width: 100%;
  height: 90px;
  border: 0;
  outline: none;
  border-radius: 45px;
  background: #fdf5e6;
  color: #2a1040;
  font-size: 38px;
  font-weight: 500;
  font-family: inherit;
  padding: 0 36px;
  box-shadow:
    inset 0 3px 8px rgba(0,0,0,0.06),
    0 4px 12px rgba(0,0,0,0.08);
}

.studio-input-row #quick-input::placeholder {
  color: #a090a8;
  font-size: 36px;
}

.studio-input-row #quick-input:focus {
  background: #fff;
  box-shadow:
    inset 0 0 0 3px rgba(139, 63, 160, 0.4),
    0 4px 12px rgba(0,0,0,0.08);
}

/* Action row */
.studio-action-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.studio-action-btn {
  height: 100px;
  padding: 0 28px;
  border: 0;
  border-radius: 24px;
  cursor: pointer;
  font-family: inherit;
  font-size: 30px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  flex: 1;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease;
}

.studio-action-btn:active {
  transform: scale(0.93);
}

.photo-btn {
  background: linear-gradient(180deg, #6b48b8 0%, #4e2e90 100%);
  box-shadow:
    0 8px 20px rgba(80, 40, 130, 0.45),
    inset 0 2px 0 rgba(255,255,255,0.15);
}

.sticker-btn {
  background: linear-gradient(180deg, #6b48b8 0%, #4e2e90 100%);
  box-shadow:
    0 8px 20px rgba(80, 40, 130, 0.45),
    inset 0 2px 0 rgba(255,255,255,0.15);
}

.action-icon {
  font-size: 38px;
}

.studio-send-btn {
  flex: 1.8;
  height: 100px;
  border: 0;
  border-radius: 50px;
  background: linear-gradient(180deg, #ff5070 0%, #e02040 50%, #c01830 100%);
  color: #fff;
  font-family: inherit;
  font-size: 46px;
  font-weight: 900;
  letter-spacing: 5px;
  cursor: pointer;
  box-shadow:
    0 10px 30px rgba(200, 30, 60, 0.55),
    inset 0 3px 0 rgba(255,255,255,0.3),
    0 0 0 3px rgba(255, 80, 112, 0.2);
  text-shadow: 0 2px 6px rgba(0,0,0,0.25);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease;
}

.studio-send-btn:active {
  transform: scale(0.95);
  box-shadow:
    0 5px 16px rgba(200, 30, 60, 0.4),
    inset 0 3px 0 rgba(255,255,255,0.3);
}

/* Message avatar sizing in studio */

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: 100%;
}

.msg-row.out {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.msg-row.out .msg-avatar,
.msg-row.no-avatar .msg-avatar {
  visibility: hidden;
}

.msg-meta {
  display: flex;
  flex-direction: column;
  max-width: 740px;
}

.msg-row.out .msg-meta {
  align-items: flex-end;
}

.msg-row.in .msg-meta {
  align-items: flex-start;
}

/* Chat bubbles — game-style */
.msg-bubble {
  max-width: 740px;
  padding: 20px 28px;
  border-radius: 28px;
  background: #fff;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.msg-row.in .msg-bubble {
  border-bottom-left-radius: 8px;
  background: #ffffff;
  border: 0;
}

.msg-row.out .msg-bubble {
  border-bottom-right-radius: 8px;
  background: #a8e6a3;
}

.msg-row.out .msg-bubble .dyn-msg {
  color: #1a3a1a;
}

.msg-bubble.photo-only {
  padding: 8px;
  background: linear-gradient(135deg, #4db6ac 0%, #26a69a 100%) !important;
  border-radius: 28px;
  box-shadow: 0 6px 18px rgba(0,100,80,0.2);
}

.msg-photo {
  display: block;
  width: 420px;
  max-width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 20px;
}

.msg-row.selected .msg-bubble {
  outline: 3px solid #ff9f0a;
  outline-offset: 3px;
}

.msg-reply-quote {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 12px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.06);
  border-left: 6px solid #9344b0;
  max-width: 100%;
}

.msg-reply-quote.out {
  background: rgba(0, 0, 0, 0.08);
  border-left-color: #2f7a2f;
}

.msg-reply-name {
  font-size: 24px;
  font-weight: 800;
  color: #6b3a80;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-reply-quote.out .msg-reply-name {
  color: #1f5a1f;
}

.msg-reply-text {
  font-size: 26px;
  font-weight: 600;
  color: #555555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 620px;
}

.msg-bubble.photo-only .msg-reply-quote {
  margin: 4px 4px 10px;
}

/* Selected message action bar */
.msg-actions {
  position: absolute;
  left: 50%;
  bottom: 560px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 22px;
  background: rgba(40, 12, 70, 0.96);
  border: 3px solid rgba(255, 215, 0, 0.55);
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(20, 0, 40, 0.45);
  width: auto;
  height: auto;
  max-width: calc(100% - 80px);
  box-sizing: border-box;
}

.msg-actions.hidden {
  display: none !important;
}

.msg-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 78px;
  padding: 0 28px;
  border: 0;
  border-radius: 22px;
  font-family: inherit;
  font-size: 32px;
  font-weight: 800;
  cursor: pointer;
}

.msg-action-btn.reply {
  background: #34c759;
  color: #ffffff;
}

.msg-action-btn.delete {
  background: #ff3b30;
  color: #ffffff;
}

.msg-action-btn:active {
  transform: scale(0.96);
}

.msg-action-icon {
  font-size: 36px;
  line-height: 1;
}

/* Composer reply preview */
.reply-quote-bar {
  display: flex;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  min-height: 88px;
  padding: 12px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.16);
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-sizing: border-box;
}

.reply-quote-accent {
  width: 8px;
  border-radius: 8px;
  background: #ffd700;
  flex-shrink: 0;
}

.reply-quote-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.reply-quote-name {
  font-size: 26px;
  font-weight: 800;
  color: #ffe27a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-quote-text {
  font-size: 28px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-quote-cancel {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
}

.reply-quote-cancel:active {
  transform: scale(0.94);
}

/* Slim realistic composer */
.phone-composer-clean {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 156px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px 34px;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(60, 60, 67, 0.18);
  backdrop-filter: blur(12px);
}

.sender-tabs-clean {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.sender-tab-mini {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid transparent;
  padding: 0;
  overflow: hidden;
  background: #e5e5ea;
  cursor: pointer;
}

.sender-tab-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sender-tab-mini.active {
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25);
}

.sender-tab-mini.active.in-side {
  border-color: #34c759;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.25);
}

.phone-composer-clean #quick-input {
  flex: 1;
  height: 80px;
  border: 0;
  outline: none;
  border-radius: 40px;
  background: #eef0f4;
  color: #111111;
  font-size: 36px;
  font-weight: 500;
  font-family: inherit;
  padding: 0 30px;
  min-width: 0;
}

.phone-composer-clean #quick-input::placeholder {
  color: #8e8e93;
  font-size: 34px;
}

.phone-composer-clean #quick-input:focus {
  background: #ffffff;
  box-shadow: inset 0 0 0 2px #0a84ff;
}

.composer-icon-btn {
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  background: #eef0f4;
  cursor: pointer;
  flex-shrink: 0;
}

.composer-icon-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.send-mini {
  width: 150px;
  height: 82px;
  flex-shrink: 0;
}

.reply-toast {
  position: absolute;
  left: 50%;
  bottom: 510px;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 26px;
  border-radius: 999px;
  background: #fff6d6;
  border: 2px solid #ffd60a;
  box-shadow: 0 10px 24px rgba(140, 110, 20, 0.16);
  max-width: 900px;
  animation: coachPulse 1s ease-in-out 2;
}

.reply-toast .write-as-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.reply-toast .write-as-text {
  font-size: 34px;
  font-weight: 700;
  color: #5a3d00;
  white-space: nowrap;
}

@keyframes coachPulse {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.03);
  }
}

.studio-tools-clean {
  position: absolute;
  left: 70px;
  top: 1750px;
  width: 940px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 12px 24px;
  background: linear-gradient(180deg, #f8e4d8 0%, #f3d0c0 100%);
  border-radius: 32px;
  box-shadow: 0 12px 28px rgba(140, 90, 70, 0.14);
}

.studio-tools-clean .img-btn {
  width: 400px;
  height: 110px;
}

.template-slot {
  position: absolute;
  overflow: hidden;
  border-radius: 36px;
  box-shadow: 0 14px 32px rgba(140, 90, 70, 0.14);
  background: #ffffff;
}

/* How-to overlay */
.howto-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(255, 250, 240, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
}

.howto-card {
  width: 860px;
  background: #ffffff;
  border-radius: 36px;
  padding: 48px 44px 36px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.howto-title {
  font-size: 64px;
  font-weight: 700;
  color: #0f1a24;
  text-align: center;
  margin-bottom: 28px;
}

.settings-howto-title {
  font-size: 54px;
  margin-top: 22px;
  margin-bottom: 22px;
}

#settings-title {
  font-size: 56px;
  margin-bottom: 18px;
}

.settings-lang-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin: 18px 0 8px;
}

.settings-lang-btn.active {
  outline: 6px solid #0a84ff;
  outline-offset: 6px;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18);
}

.howto-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.howto-steps li {
  font-size: 38px;
  font-weight: 600;
  color: #1c2a38;
  background: #eef6ff;
  border-left: 8px solid #0a84ff;
  border-radius: 16px;
  padding: 26px 28px;
  line-height: 1.35;
}

/* Templates */
.template-slot img.cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.template-slot .label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 16px;
  background: linear-gradient(transparent, rgba(60, 35, 25, 0.55));
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  z-index: 2;
}

.group-template-slot {
  border: 5px solid #8b3fa0 !important;
  box-shadow:
    0 14px 32px rgba(139, 63, 160, 0.28),
    inset 0 0 0 3px rgba(255, 215, 0, 0.25) !important;
}

.group-cover {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.28), transparent 45%),
    linear-gradient(135deg, #7b2d8e 0%, #5c1a7a 45%, #2f0a4a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-bottom: 70px;
}

.group-cover-badge {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #2a1040;
  background: #ffd700;
  padding: 10px 28px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.group-cover-avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 24px;
}

.group-cover-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #fff;
  margin-right: -24px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.group-cover-sub {
  font-size: 30px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.group-template-slot .label {
  background: linear-gradient(transparent, rgba(20, 0, 40, 0.72));
  font-size: 48px;
}

/* Home quick-pick (smaller template cards) */
.quick-pick-slot {
  z-index: 6;
  border-radius: 28px;
}

.quick-pick-slot .label {
  padding: 14px 12px;
  font-size: 24px;
}

.quick-pick-slot img.cover {
  border-radius: 28px;
}

.avatar-pick {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.avatar-pick.selected {
  outline: 6px solid #2bb0ff;
  outline-offset: 5px;
}

#name-input,
#compose-input {
  width: 100%;
  height: 100%;
  border: 0;
  background: #f3f6f9;
  color: #111111;
  font-size: 40px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  resize: none;
  padding: 28px 32px;
  border-radius: 28px;
}

#export-strip {
  display: flex;
  gap: 18px;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

#export-strip img {
  width: 240px;
  height: 426px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* ========== CAST SCREEN (Game-style) ========== */
.cast-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #7b2d8e 0%, #5c1a7a 40%, #3d0f5c 100%);
}

.cast-topbar {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 160px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 36px 0;
}

.cast-topbar-title {
  font-size: 56px;
  font-weight: 900;
  color: #ffd700;
  text-shadow: 0 3px 0 #c8860a, 0 6px 12px rgba(0,0,0,0.4);
  letter-spacing: 4px;
  text-transform: uppercase;
}

/* People list panel */
.cast-people-panel {
  position: absolute;
  left: 40px;
  top: 180px;
  width: 1000px;
  height: 320px;
  background: linear-gradient(180deg, #fdf5e6 0%, #faecd4 100%);
  border-radius: 32px;
  border: 5px solid #8b3fa0;
  box-shadow: 0 12px 40px rgba(60, 10, 80, 0.4);
  display: flex;
  align-items: center;
  padding: 20px 28px;
  gap: 16px;
  z-index: 2;
}

.cast-people-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  overflow-x: auto;
  padding: 10px 0;
}

.cast-person-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 180px;
  padding: 16px;
  border-radius: 24px;
  border: 4px solid transparent;
  background: transparent;
  font-family: inherit;
  transition: all 0.15s ease;
}

.cast-person-chip.selected {
  border-color: #9344b0;
  background: rgba(147, 68, 176, 0.12);
}

.cast-person-chip img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.cast-person-chip .chip-name {
  font-size: 34px;
  font-weight: 700;
  color: #2a1040;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cast-person-chip .chip-side {
  font-size: 24px;
  font-weight: 600;
  color: #8b3fa0;
}

.cast-add-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px dashed #8b3fa0;
  background: rgba(147, 68, 176, 0.08);
  color: #8b3fa0;
  font-size: 28px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.cast-add-btn:active {
  transform: scale(0.93);
  background: rgba(147, 68, 176, 0.18);
}

/* Edit panel */
.cast-edit-panel {
  position: absolute;
  left: 40px;
  top: 530px;
  width: 1000px;
  height: 1060px;
  background: linear-gradient(180deg, #fdf5e6 0%, #faecd4 100%);
  border-radius: 32px;
  border: 5px solid #8b3fa0;
  box-shadow: 0 12px 40px rgba(60, 10, 80, 0.4);
  padding: 32px 36px;
  z-index: 2;
  overflow-y: auto;
}

.cast-edit-label {
  font-size: 34px;
  font-weight: 700;
  color: #5a2070;
  margin-bottom: 14px;
  display: block;
}

.cast-edit-name-row {
  margin-bottom: 28px;
}

.cast-name-input {
  width: 100%;
  height: 100px;
  border: 4px solid #d4b0e8;
  background: #fff;
  color: #2a1040;
  font-size: 42px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  padding: 0 32px;
  border-radius: 28px;
  transition: border-color 0.15s ease;
}

.cast-name-input:focus {
  border-color: #9344b0;
  box-shadow: 0 0 0 4px rgba(147, 68, 176, 0.15);
}

.cast-avatar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 10px 0;
  justify-content: center;
}

.cast-avatar-grid .avatar-pick {
  width: 140px;
  height: 140px;
  border: 4px solid #e8d0f0;
  transition: all 0.15s ease;
}

.cast-avatar-grid .avatar-pick.selected {
  border-color: #9344b0;
  outline: 5px solid rgba(147, 68, 176, 0.3);
  outline-offset: 3px;
  box-shadow: 0 8px 24px rgba(147, 68, 176, 0.35);
}

.cast-side-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.cast-side-btn {
  height: 70px;
  padding: 0 36px;
  border: 3px solid #9344b0;
  border-radius: 35px;
  background: #fff;
  color: #5a2070;
  font-size: 32px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cast-side-btn:active {
  background: #f0e0f8;
  transform: scale(0.95);
}

.cast-remove-btn {
  margin-top: 28px;
  width: 100%;
  height: 90px;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(180deg, #ff6b6b 0%, #d44040 100%);
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(200, 40, 40, 0.35);
  transition: transform 0.1s ease;
}

.cast-remove-btn:active {
  transform: scale(0.95);
}
