/* ── Reset & base ─────────────────────────────────────────────── */
html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
::-webkit-scrollbar { width: 0; height: 0; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: #141414;
  color: #F0F1FF;
  font-family: 'Josefin Sans', sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}

/* ── Utility ──────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Screen 1: Login ───────────────────────────────────────── */
#screen-login {
  position: fixed;
  inset: 0;
  background-color: #141414;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

#login-box {
  background-color: #1e1e1e;
  border: 1px solid #2e2e2e;
  border-radius: 12px;
  padding: 40px 36px 32px;
  width: 360px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

#app-title {
  margin: 0 0 24px;
}

#app-title img {
  height: 52px;
  width: auto;
}

#login-spinner {
  width: 28px;
  height: 28px;
  margin: 4px auto 28px;
  border: 3px solid #2e2e2e;
  border-top-color: #6752E0;
  border-radius: 50%;
  animation: loginSpin 0.7s linear infinite;
}

@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

/* Google button */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background-color: #ffffff;
  color: #333333;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms, box-shadow 150ms;
  -webkit-user-select: text;
     -moz-user-select: text;
      -ms-user-select: text;
          user-select: text;
}

.google-btn:hover {
  background-color: #f1f1f1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.google-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Divider */
.divider {
  position: relative;
  margin: 20px 0;
  text-align: center;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #333;
}

.divider span {
  position: relative;
  background-color: #1e1e1e;
  padding: 0 12px;
  color: #666;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Username input container */
#username-prompt {
  margin: 12px 0 0;
  color: #aaa;
  font-size: 13px;
  text-align: center;
}

#username-input-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

#username-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background-color: #242424;
  border: 1px solid #333;
  border-radius: 6px;
  color: #F0F1FF;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  -webkit-user-select: text;
     -moz-user-select: text;
      -ms-user-select: text;
          user-select: text;
  transition: border-color 120ms;
}

#username-input:focus {
  border-color: #6752E0;
}

#username-submit-btn {
  width: 100%;
  padding: 10px 16px;
  background-color: #6752E0;
  color: #F0F1FF;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms;
  -webkit-user-select: text;
     -moz-user-select: text;
      -ms-user-select: text;
          user-select: text;
}

#username-submit-btn:hover {
  background-color: #7c68f0;
}


.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #333;
}

.divider span {
  position: relative;
  background-color: #1e1e1e;
  padding: 0 12px;
  color: #666;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Guest input & button */
#guest-nickname-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background-color: #242424;
  border: 1px solid #333;
  border-radius: 6px;
  color: #F0F1FF;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  -webkit-user-select: text;
     -moz-user-select: text;
      -ms-user-select: text;
          user-select: text;
  transition: border-color 120ms;
  margin-bottom: 10px;
}

#guest-nickname-input:focus {
  border-color: #6752E0;
}

#guest-btn {
  width: 100%;
  padding: 10px 16px;
  background-color: #6752E0;
  color: #F0F1FF;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms;
  -webkit-user-select: text;
     -moz-user-select: text;
      -ms-user-select: text;
          user-select: text;
}

#guest-btn:hover {
  background-color: #7c68f0;
}

/* ── Screen 1: Nickname (legacy — mantenido para compatibilidad) ── */
#screen-nickname {
  position: fixed;
  inset: 0;
  background-color: #141414;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

#screen-nickname {
  position: fixed;
  inset: 0;
  background-color: #141414;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

#nickname-box {
  background-color: #1e1e1e;
  border: 1px solid #2e2e2e;
  border-radius: 12px;
  padding: 40px 36px 32px;
  width: 320px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

#nickname-box p {
  margin: 0 0 20px;
  font-size: 13px;
  color: #888;
  text-transform: lowercase;
  letter-spacing: .5px;
}

#nickname-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background-color: #242424;
  border: 1px solid #333;
  border-radius: 6px;
  color: #F0F1FF;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  -webkit-user-select: text;
     -moz-user-select: text;
      -ms-user-select: text;
          user-select: text;
  transition: border-color 120ms;
}

#nickname-input:focus {
  border-color: #6752E0;
}

#nickname-btn {
  margin-top: 14px;
  width: 100%;
  padding: 10px;
  background-color: #6752E0;
  border: none;
  border-radius: 6px;
  color: #F0F1FF;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: .5px;
  cursor: pointer;
  transition: background-color 120ms;
}

#nickname-btn:hover { background-color: #7b64f5; }
#nickname-btn:active { background-color: #5540cc; }

/* ── Screen 2: Lobby ─────────────────────────────────────────── */
#screen-lobby {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background-color: #141414;
}

#lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 8px;
  border-bottom: 1px solid #2e2e2e;
  gap: 12px;
}

#lobby-title {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 1px;
  color: #F0F1FF;
  display: flex;
  align-items: center;
  gap: 8px;
}

#lobby-title-icon {
  height: 52px;
  width: auto;
  flex-shrink: 0;
}

#lobby-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

#lobby-username {
  font-size: 14px;
  color: #aaa;
}

#change-nick-btn {
  background: none;
  border: 1px solid #333;
  border-radius: 6px;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  padding: 3px 8px;
  font-family: inherit;
  transition: border-color 120ms, color 120ms;
}

#change-nick-btn:hover {
  border-color: #6752E0;
  color: #F0F1FF;
}

#lobby-rooms {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.room-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: #1e1e1e;
  border: 1px solid #2e2e2e;
  border-radius: 10px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 120ms, background-color 120ms;
}

.room-card:hover {
  border-color: #6752E0;
  background-color: #22203a;
}

.room-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.room-channel-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.room-info {
  min-width: 0;
  flex: 1;
}

.room-name {
  font-size: 16px;
  font-weight: 600;
  color: #F0F1FF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-desc {
  font-size: 14px;
  color: #888;
  margin-top: 2px;
  text-transform: none;
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-flame {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #e5484d;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.room-subtitle {
  font-size: 11px;
  color: #555;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#lobby-support {
  padding: 0 20px 12px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-card-small {
  padding: 8px 18px;
}

.room-icon-small {
  font-size: 20px;
}

.room-name-small {
  font-size: 13px;
}


/* ── Screen 3: Chat ───────────────────────────────────────────── */
#screen-chat {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
}

/* ── Chat top bar ─────────────────────────────────────────────── */
#chat-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background-color: #1a1a1a;
  border-bottom: 1px solid #2e2e2e;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  z-index: 100;
}

#back-btn {
  background: none;
  border: none;
  color: #6752E0;
  font-size: 28px;
  cursor: pointer;
  padding: 0 8px;
  border-radius: 6px;
  font-family: inherit;
  line-height: 1;
  transition: background-color 120ms;
}

#back-btn:hover { background-color: #2a2a2a; }

#chat-room-name {
  font-size: 15px;
  font-weight: 600;
  color: #F0F1FF;
  letter-spacing: .5px;
}

/* ── Message list ─────────────────────────────────────────────── */
#chat {
  position: absolute;
  inset: 48px 0 60px 0;   /* top: topbar, bottom: input bar */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 0;
  overflow-anchor: none;
}

#anchor {
  overflow-anchor: auto;
  height: 1px;
  margin-bottom: 10px;
}

/* ── Message line ─────────────────────────────────────────────── */
.line-container {
  border-radius: 6px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 400ms ease-out, opacity 120ms;
  margin-bottom: 8px;
}

.line-container:last-of-type {
  margin-bottom: 0;
}

.line {
  padding: 10px;
  background-color: #242424;
  border-radius: 6px;
  position: relative;
}

/* Own messages get a subtle left accent */
.line-container.own .line {
  background-color: #1e2635;
  border-left: 3px solid #6752E0;
}

.profile-img {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #383838;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 80ms;
}

.body {
  margin-left: 52px;
  min-height: 44px;
}

.name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .4px;
  margin-bottom: 4px;
  opacity: 0;
  transition: opacity 80ms;
  -webkit-user-select: text;
     -moz-user-select: text;
          user-select: text;
}

.text {
  font-size: 15px;
  word-break: break-word;
  opacity: 0;
  transition: opacity 80ms;
  -webkit-user-select: text;
     -moz-user-select: text;
          user-select: text;
}

.hashtag {
  font-style: italic;
  color: #c084fc;
}

/* ── Rich body (quoted reply inside message) ─────────────────── */
.rich-body {
  margin-bottom: 6px;
  padding: 6px 10px;
  background-color: rgba(103, 82, 224, 0.12);
  border-left: 3px solid #6752E0;
  border-radius: 0 4px 4px 0;
  font-size: 13px;
  font-style: italic;
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-user-select: text;
     -moz-user-select: text;
          user-select: text;
}

.rich-body-author {
  font-style: normal;
  font-weight: 600;
  font-size: 12px;
  color: #6752E0;
  margin-bottom: 2px;
}

/* ── Message action buttons (reply / delete / ban) ────────────── */
.msg-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms;
  z-index: 10;
}

.line-container:hover .msg-actions,
.line-container.active .msg-actions {
  opacity: 1;
  pointer-events: auto;
}

.action-btn {
  background: rgba(30, 30, 30, 0.85);
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  padding: 3px 8px;
  font-family: inherit;
  line-height: 1.4;
  transition: color 120ms, border-color 120ms;
}

.reply-btn  { color: #888; }
.reply-btn:hover  { color: #F0F1FF; border-color: #6752E0; }

.delete-btn { color: #7a5a30; }
.delete-btn:hover { color: #e8a040; border-color: #c07020; }

.ban-btn    { color: #7a3030; }
.ban-btn:hover    { color: #e74c3c; border-color: #c0392b; }

#banned-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  background-color: #1a0808;
  border-top: 1px solid #5c1010;
  color: #c0392b;
  font-size: 14px;
  font-family: inherit;
}

/* ── Screen 4: Bans panel ─────────────────────────────────────── */
#screen-bans, #screen-support-inbox {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background-color: #141414;
}

#bans-topbar, #support-inbox-topbar {
  display: flex;
  align-items: center;
  height: 48px;
  background-color: #1a1a1a;
  border-bottom: 1px solid #2e2e2e;
  padding: 0 12px;
  gap: 12px;
  flex-shrink: 0;
}

#bans-back-btn, #support-inbox-back-btn {
  background: none;
  border: none;
  color: #F0F1FF;
  font-size: 28px;
  cursor: pointer;
  padding: 0 8px;
  font-family: inherit;
  line-height: 1;
}

#bans-title, #support-inbox-title {
  font-size: 15px;
  font-weight: 600;
  color: #F0F1FF;
}

#bans-list, #support-inbox-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ban-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #1e1e1e;
  border: 1px solid #2e2e2e;
  border-radius: 10px;
  padding: 12px 16px;
}

.ban-item-name {
  font-size: 15px;
  font-weight: 600;
  color: #F0F1FF;
}

.ban-item-name .unread-badge {
  margin-left: 6px;
  vertical-align: middle;
}

.ban-item-meta {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.unban-btn {
  background: none;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  color: #31af70;
  font-size: 13px;
  cursor: pointer;
  padding: 5px 14px;
  font-family: inherit;
  transition: border-color 120ms, color 120ms;
  flex-shrink: 0;
}

.unban-btn:hover {
  border-color: #31af70;
  color: #3dd688;
}

.close-thread-btn {
  background: none;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  color: #7a3030;
  font-size: 13px;
  cursor: pointer;
  padding: 5px 14px;
  font-family: inherit;
  transition: border-color 120ms, color 120ms;
}

.close-thread-btn:hover {
  border-color: #c0392b;
  color: #e74c3c;
}

.bans-empty {
  color: #555;
  text-align: center;
  margin-top: 40px;
  font-size: 14px;
}

/* inline emoji inside messages */
.emote-inline {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.25em;
}

/* ── Reply preview bar ────────────────────────────────────────── */
#reply-preview {
  position: absolute;
  bottom: 60px;
  left: 0;
  right: 0;
  height: 40px;
  background-color: #1a1a1a;
  border-top: 1px solid #2e2e2e;
  display: flex;
  align-items: center;
  padding: 0 10px 0 14px;
  gap: 6px;
  z-index: 99;
  overflow: hidden;
}

#reply-preview.hidden {
  display: none;
}

#reply-preview-content {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

#reply-preview-arrow {
  color: #6752E0;
  font-size: 13px;
  flex-shrink: 0;
}

#reply-preview-name {
  font-size: 12px;
  font-weight: 600;
  color: #6752E0;
  flex-shrink: 0;
}

#reply-preview-text-outer {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-style: italic;
  color: #777;
}

#reply-preview-text {
  white-space: nowrap;
}

.reply-q {
  font-style: italic;
}

#reply-preview-text .emote-inline {
  height: 1.2em;
  width: auto;
  vertical-align: middle;
}

#reply-cancel-btn {
  background: none;
  border: none;
  color: #555;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 120ms;
}

#reply-cancel-btn:hover { color: #F0F1FF; }

/* shift message list up when reply preview is visible */
#chat.has-reply {
  bottom: 100px;
}

/* ── Input bar ────────────────────────────────────────────────── */
#chat-input {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: #141414;
  z-index: 100;
}

#emoji-input {
  position: absolute;
  left: 10px;
  bottom: 13px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  border-radius: 8px;
}

#emoji-input > img {
  width: 34px;
  height: auto;
}

#text-input {
  position: absolute;
  bottom: 10px;
  left: 54px;
  right: 54px;
  height: 40px;
  background-color: #242424;
  border-radius: 6px;
  overflow: hidden;
}

#text-box {
  position: relative;
  margin: 8px 10px;
  font-size: 15px;
  font-family: inherit;
  color: #F0F1FF;
  height: 24px;
  line-height: 1.6;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  outline: none;
  -webkit-user-select: text;
     -moz-user-select: text;
          user-select: text;
  -webkit-user-modify: read-write;
     -moz-user-modify: read-write;
}

/* placeholder when empty */
#text-box:empty::before {
  content: attr(data-placeholder);
  color: #555;
  pointer-events: none;
}

#text-box > img.emote-inline {
  display: inline-block;
  width: 1.4em;
  height: 1.4em;
  vertical-align: -0.3em;
}

#send-btn {
  position: absolute;
  right: 10px;
  bottom: 13px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background-color: #6752E0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 120ms;
}

#send-btn:hover  { background-color: #7b64f5; }
#send-btn:active { background-color: #5540cc; }

#send-btn svg {
  width: 16px;
  height: 16px;
  margin-left: 2px; /* optical centering for arrow icon */
}

/* ── Emoji drawer ─────────────────────────────────────────────── */
.emoji-drawer {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 60px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  background-color: #1a1a1a;
  border-radius: 8px 8px 0 0;
  border: 1px solid #2e2e2e;
  border-bottom: none;
  padding: 6px;
  gap: 2px;
  z-index: 200;
  opacity: 1;
  transition: opacity 150ms;
}

.emoji-drawer.hidden {
  opacity: 0;
  pointer-events: none;
}

.emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 80ms;
}

.emoji:hover { background-color: #2a2a2a; }

.emoji > img {
  width: 30px;
  height: auto;
}

/* ── User menu ────────────────────────────────────────────────── */
.user-menu-wrapper {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

/* Inside lobby header the wrapper should not push the title */
#lobby-header .user-menu-wrapper {
  margin-left: 0;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #ccc;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 120ms;
  white-space: nowrap;
}

.user-menu-btn:hover {
  color: #F0F1FF;
}

.user-menu-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #444;
  transition: border-color 120ms;
}

.user-menu-avatar[src=""] {
  display: none;
}

.user-menu-btn:hover .user-menu-avatar {
  border-color: #6752E0;
}

.user-menu-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

.user-menu-header {
  padding: 10px 14px 8px;
  border-bottom: 1px solid #2a2a2a;
  font-size: 13px;
  color: #F0F1FF;
  font-weight: 600;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
  box-sizing: border-box;
}

.user-menu-chevron {
  font-size: 10px;
  opacity: 0.5;
  flex-shrink: 0;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background-color: #222;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  min-width: 160px;
  z-index: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

.user-menu-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background: none;
  border: none;
  color: #ccc;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background-color 100ms, color 100ms;
}

.user-menu-item:hover {
  background-color: #2e2e2e;
  color: #F0F1FF;
}

.user-menu-danger {
  color: #e05252;
}

.user-menu-danger:hover {
  background-color: #2e1f1f;
  color: #f07070;
}

/* ── Guest notice (read-only bar) ─────────────────────────────── */
#guest-notice {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: #1a1a1a;
  border-top: 1px solid #2e2e2e;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 100;
  font-size: 13px;
  color: #777;
}

#guest-notice button {
  background: none;
  border: 1px solid #444;
  border-radius: 6px;
  color: #6752E0;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 12px;
  transition: border-color 120ms, color 120ms;
}

#guest-notice button:hover {
  border-color: #6752E0;
  color: #8b78ff;
}

/* ── Rename modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background-color: #1e1e1e;
  border: 1px solid #2e2e2e;
  border-radius: 12px;
  padding: 28px 28px 24px;
  width: 340px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
}

.modal-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  color: #F0F1FF;
}

.modal-desc {
  margin: 0 0 18px;
  font-size: 13px;
  color: #777;
}

.modal-box input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background-color: #242424;
  border: 1px solid #333;
  border-radius: 6px;
  color: #F0F1FF;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  -webkit-user-select: text;
     -moz-user-select: text;
          user-select: text;
  transition: border-color 120ms;
  margin-bottom: 16px;
}

.modal-box input:focus {
  border-color: #6752E0;
}

.rename-availability {
  margin: -10px 0 16px;
  font-size: 12px;
  font-weight: 500;
}

.rename-availability.available { color: #4CAF50; }
.rename-availability.unavailable { color: #E05252; }

.modal-btn-confirm:disabled {
  background-color: #3a3560;
  color: #8b87a8;
  cursor: not-allowed;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 8px 18px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: background-color 120ms;
}

.modal-btn-cancel {
  background-color: #2e2e2e;
  color: #aaa;
}

.modal-btn-cancel:hover { background-color: #383838; color: #F0F1FF; }

.modal-btn-confirm {
  background-color: #6752E0;
  color: #F0F1FF;
}

.modal-btn-confirm:hover { background-color: #7b64f5; }

/* ── Premium emoji button (slot 32 in drawer) ─────────────────── */
.emoji-premium-btn {
  position: relative;
}

.emoji-premium-btn img {
  width: 30px;
  height: auto;
  filter: drop-shadow(0 0 4px rgba(103, 82, 224, 0.6));
  transition: filter 150ms, transform 150ms;
}

.emoji-premium-btn:hover img {
  filter: drop-shadow(0 0 8px rgba(103, 82, 224, 1));
  transform: scale(1.15);
}

/* ── Locked premium emote in messages ─────────────────────────── */
.locked-emote {
  font-size: 16px;
  vertical-align: middle;
  opacity: 0.6;
  cursor: default;
}

/* ── Pack shop modal ──────────────────────────────────────────── */
.pack-shop-box {
  width: 420px;
  max-width: 92vw;
}

#pack-shop-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 18px 0 20px;
}

.pack-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background-color: #242424;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 16px 14px;
  text-align: center;
  min-width: 0;
}

.pack-preview {
  overflow: hidden;
  width: 100%;
}

.pack-preview-inner {
  display: flex;
  gap: 8px;
  will-change: transform;
}

@keyframes emojiScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-1364px); } /* 31 × 44px */
}

.pack-preview img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.pack-info {
  width: 100%;
}

.pack-name {
  font-size: 15px;
  font-weight: 600;
  color: #F0F1FF;
}

.pack-buy-btn {
  width: 100%;
  padding: 9px 14px;
  line-height: 15px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background-color: #6752E0;
  color: #F0F1FF;
  transition: background-color 120ms;
}

.pack-buy-btn:hover:not(:disabled) { background-color: #7b64f5; }

.pack-buy-btn:disabled {
  background-color: #2e2e2e;
  color: #666;
  cursor: not-allowed;
}

.pack-buy-btn.pack-owned {
  background-color: #1e3a28;
  color: #4caf7d;
  cursor: default;
}

.pack-shop-section-title {
  margin-top: 4px;
}

#avatar-pack-section {
  margin: 12px 0 20px;
}

.avatar-example {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  cursor: pointer;
  user-select: none;
}

.avatar-example-avatar {
  transition: transform 120ms;
}

.avatar-example:active .avatar-example-avatar,
.avatar-example:active .avatar-frame {
  transform: scale(0.94);
}

.avatar-example-name {
  font-size: 14px;
  font-weight: 600;
}

.avatar-section-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.avatar-section-row .pack-card {
  min-width: 0;
}

.avatar-section-row .pack-card > *:last-child {
  margin-top: auto;
}

.avatar-border-slider-wrap {
  width: 100%;
  height: 33px; /* = altura de .pack-buy-btn (padding 9px + line-height 15px) */
  display: flex;
  align-items: center;
}

.modal-box .avatar-border-slider {
  width: 100%;
  accent-color: #6752E0;
  height: 2px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  box-sizing: content-box;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.avatar-border-slider::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 1px;
  background: #383838;
}

.avatar-border-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #F0F1FF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  margin-top: -10px;
  cursor: pointer;
}

.avatar-border-slider::-moz-range-track {
  height: 2px;
  border-radius: 1px;
  background: #383838;
}

.avatar-border-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #F0F1FF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  border: none;
  cursor: pointer;
}

.avatar-pack-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #6752E0;
}

.pack-coming-soon-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 10px;
  background-color: #3a2e1e;
  color: #f0a030;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Toast notification ────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1e3a28;
  color: #4caf7d;
  border: 1px solid #2e5c3a;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 400ms;
}
#toast.toast-hiding { opacity: 0; }
