/* Camada visual pós-login: vidro fosco nos planos, tinta sólida nos controles. */
:root {
  color-scheme: dark;
  --bg-deepest: #071018;
  --bg-dark: #0b1721;
  --bg-main: #0d1a24;
  --bg-elevated: #13232d;
  --bg-hover: #1a2d37;
  --accent-primary-start: #65e3d6;
  --accent-primary-end: #4dc7d9;
  --accent-secondary: #84eee2;
  --accent-cyan: #71e4dc;
  --accent-violet-deep: #2aa6b3;
  --text-primary: #f1f8f8;
  --text-secondary: #b2c4c9;
  --text-muted: #82979e;
  --glass-bg: rgba(14, 29, 39, .76);
  --glass-border: rgba(196, 244, 244, .11);
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 18px;
  --glow-cyan: rgba(81, 224, 214, .18);
  --glow-violet: rgba(81, 224, 214, .12);
}
#app-screen {
  background:
    radial-gradient(ellipse 55% 45% at 68% -8%, rgba(39, 148, 156, .12), transparent 72%),
    #08121a;
}
#app-screen #server-rail,
#app-screen #sidebar,
#app-screen #members-panel {
  background: rgba(10, 23, 32, .88) !important;
  border-color: rgba(190, 239, 241, .09) !important;
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  backdrop-filter: blur(20px) saturate(135%);
}
#app-screen #server-rail { box-shadow: 4px 0 22px rgba(0, 0, 0, .15); }
#app-screen #sidebar { background: linear-gradient(160deg, rgba(16, 34, 44, .92), rgba(10, 22, 31, .88)) !important; }
#app-screen #main-panel {
  background:
    radial-gradient(ellipse 620px 430px at 100% 0, rgba(72, 199, 192, .055), transparent 70%),
    rgba(12, 24, 33, .94);
}
#app-screen #chat-header,
#app-screen .members-panel-header {
  background: linear-gradient(105deg, rgba(21, 42, 51, .88), rgba(15, 30, 40, .78));
  border-color: rgba(190, 239, 241, .10) !important;
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}
#app-screen #chat-title { color: #f0f8f8; }
#app-screen .chat-title-sub,
#app-screen .sidebar-header-sub { color: #91a8ae; }

/* Navegação: leve tinta de vidro no estado ativo, sem caixas pesadas. */
#app-screen .rail-btn,
#app-screen .server-item,
#app-screen .friend-item,
#app-screen .channel-item,
#app-screen .settings-tab {
  border-radius: 11px !important;
  clip-path: none !important;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
#app-screen .rail-btn:hover,
#app-screen .server-item:hover,
#app-screen .friend-item:hover,
#app-screen .channel-item:hover,
#app-screen .settings-tab:hover {
  background: rgba(182, 244, 240, .075) !important;
  color: #e9ffff;
}
#app-screen .rail-btn.active,
#app-screen .server-item.active,
#app-screen .friend-item.active,
#app-screen .channel-item.active,
#app-screen .settings-tab.active {
  color: #eafffd !important;
  background: linear-gradient(120deg, rgba(88, 220, 209, .17), rgba(77, 166, 187, .09)) !important;
  border: 1px solid rgba(125, 238, 224, .15) !important;
  box-shadow: 0 5px 18px rgba(4, 12, 18, .16), inset 0 1px 0 rgba(228, 255, 252, .06);
}
#app-screen #user-bar {
  margin: 8px;
  padding: 9px 8px;
  border: 1px solid rgba(190, 239, 241, .08);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
}

/* Mensagens ficam sólidas e legíveis; só as bolhas recebem transparência. */
#app-screen .message-item { border-radius: 12px; }
#app-screen .message-item:hover { background: rgba(192, 242, 240, .035); }
#app-screen .message-item .message-content {
  border: 1px solid rgba(199, 241, 241, .075);
  border-radius: 4px 14px 14px 14px;
  background: rgba(21, 39, 49, .72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
}
#app-screen .message-item.own .message-content {
  border-color: rgba(100, 228, 216, .16);
  border-radius: 14px 4px 14px 14px;
  background: linear-gradient(145deg, rgba(43, 126, 132, .38), rgba(29, 75, 88, .46));
}
#app-screen .message-item .message-content:has(.pingo-sticker),
#app-screen .message-item .message-content:has(.code-preview-block) {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
#app-screen #message-form,
#app-screen .message-form {
  border: 1px solid rgba(194, 239, 241, .13);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(23, 43, 53, .90), rgba(14, 29, 39, .92));
  box-shadow: 0 14px 38px rgba(0, 0, 0, .20), inset 0 1px 0 rgba(235, 255, 253, .05);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
}
#app-screen input:not([type=checkbox]):not([type=radio]):not([type=range]),
#app-screen textarea,
#app-screen select {
  border: 1px solid rgba(188, 231, 235, .13);
  border-radius: 10px;
  background: rgba(5, 18, 27, .67);
  color: var(--text-primary);
}
#app-screen input:focus-visible,
#app-screen textarea:focus-visible,
#app-screen select:focus-visible {
  border-color: rgba(111, 230, 219, .58) !important;
  box-shadow: 0 0 0 3px rgba(84, 220, 211, .12) !important;
  outline: none;
}

/* Botões: família única, acento reservado para ações principais. */
#app-screen .btn,
#app-screen .btn-icon,
#app-screen .call-btn,
#app-screen .call-device-arrow,
#app-screen .members-panel-close {
  border-radius: 10px;
  clip-path: none !important;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
#app-screen .btn:not(.btn-primary),
#app-screen .btn-icon,
#app-screen .call-btn,
#app-screen .call-device-arrow {
  border: 1px solid rgba(190, 239, 241, .09);
  background: rgba(218, 255, 252, .035);
  color: #c5d8dc;
}
#app-screen .btn:not(.btn-primary):hover,
#app-screen .btn-icon:hover,
#app-screen .call-btn:hover,
#app-screen .call-device-arrow:hover {
  border-color: rgba(134, 235, 226, .22);
  background: rgba(163, 242, 234, .10);
  color: #efffff;
  transform: translateY(-1px);
}
#app-screen .btn-primary,
#app-screen .btn-primary:hover {
  border: 1px solid rgba(214, 255, 249, .28);
  border-radius: 10px;
  clip-path: none !important;
  background: linear-gradient(135deg, #79e7d7, #51c6d5);
  color: #082027;
  box-shadow: 0 7px 20px rgba(56, 199, 190, .16), inset 0 1px 0 rgba(255,255,255,.32);
}
#app-screen .btn-primary:hover { filter: brightness(1.045); transform: translateY(-1px); }
#app-screen .btn:active,
#app-screen .btn-icon:active,
#app-screen .call-btn:active { transform: scale(.98); }

/* Vidro fosco para superfícies flutuantes e cartões de conteúdo. */
#app-screen .modal-overlay,
#app-screen .popover,
#app-screen .emoji-popover,
#app-screen .user-bar-more-menu,
#app-screen .call-device-menu,
#app-screen .call-context-menu {
  background-color: rgba(9, 20, 29, .82);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
}
#app-screen .modal {
  border: 1px solid rgba(199, 242, 242, .15) !important;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(24, 43, 53, .94), rgba(12, 25, 35, .96)) !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .50), inset 0 1px 0 rgba(239, 255, 255, .07);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  backdrop-filter: blur(24px) saturate(145%);
}
#app-screen .home-welcome,
#app-screen .home-actions > button,
#app-screen .game-card,
#app-screen .store-item,
#app-screen .wfna-card,
#app-screen .admin-user,
#app-screen .invite-card,
#app-screen .call-bar {
  border: 1px solid rgba(190, 239, 241, .11);
  border-radius: 14px;
  background-color: rgba(17, 35, 45, .70);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(235, 255, 253, .035);
}
#app-screen .home-actions > button:hover,
#app-screen .game-card:hover,
#app-screen .store-item:hover {
  border-color: rgba(125, 235, 223, .25);
  background-color: rgba(22, 47, 57, .84);
  transform: translateY(-2px);
}
#app-screen .modal-settings .settings-nav {
  background: rgba(7, 19, 28, .50);
  border-color: rgba(190, 239, 241, .09);
}
#app-screen .settings-content { background: transparent; }
#app-screen .settings-tab.active { color: #dbfffb !important; }
#app-screen .chat-header-actions .btn-icon { min-width: 38px; min-height: 38px; }

@media (max-width: 680px) {
  #app-screen #server-rail,
  #app-screen #sidebar,
  #app-screen #members-panel { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  #app-screen #user-bar { border-radius: 12px; }
  #app-screen .message-form { border-radius: 14px; }
  #app-screen .modal { border-radius: 16px; }
}
@media (prefers-reduced-transparency: reduce) {
  #app-screen #server-rail,
  #app-screen #sidebar,
  #app-screen #members-panel,
  #app-screen #chat-header,
  #app-screen .modal,
  #app-screen .message-form {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background-color: #101d26 !important;
  }
}

/* Perfil: vidro leve para separar conteúdo sem competir com banner e avatar. */
#modal-profile .profile-card {
  overflow: hidden;
  border: 1px solid rgba(190, 239, 241, .19) !important;
  border-radius: 22px !important;
  background: linear-gradient(145deg, rgba(19, 39, 49, .86), rgba(10, 24, 34, .9)) !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(239, 255, 255, .12);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  backdrop-filter: blur(24px) saturate(145%);
}
#modal-profile .profile-card-banner {
  position: relative;
  isolation: isolate;
}
#modal-profile .profile-card-banner-overlay {
  background: linear-gradient(180deg, rgba(5, 14, 21, .04) 35%, rgba(7, 19, 28, .66) 100%);
}
#modal-profile .profile-card-body {
  position: relative;
  background:
    radial-gradient(ellipse at 18% 0, rgba(116, 235, 224, .075), transparent 40%),
    linear-gradient(155deg, rgba(19, 39, 49, .78), rgba(10, 23, 33, .88)) !important;
  border-top: 1px solid rgba(218, 255, 251, .12);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
}
#modal-profile .profile-identity-row {
  border-bottom: 1px solid rgba(190, 239, 241, .09);
}
#modal-profile .wcp-tabs {
  background: rgba(7, 19, 28, .28);
  border-top: 1px solid rgba(190, 239, 241, .07);
  border-bottom-color: rgba(190, 239, 241, .10) !important;
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  backdrop-filter: blur(16px) saturate(135%);
}
#modal-profile .wcp-tabs [role="tab"] {
  border-radius: 10px 10px 0 0;
  transition: color .18s ease, background .18s ease;
}
#modal-profile .wcp-tabs [role="tab"]:hover {
  background: rgba(178, 244, 239, .055);
  color: #efffff;
}
#modal-profile .wcp-tabs [role="tab"][aria-selected="true"] {
  background: linear-gradient(180deg, rgba(92, 219, 208, .13), rgba(92, 219, 208, .025));
  box-shadow: inset 0 -2px 0 #68ded5;
}
#modal-profile .wcp-now,
#modal-profile .wcp-side,
#modal-profile .profile-section-block,
#modal-profile .wcp-drawing,
#modal-profile .wcp-meta {
  border: 1px solid rgba(190, 239, 241, .105) !important;
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(177, 239, 237, .065), rgba(177, 239, 237, .025)) !important;
  box-shadow: inset 0 1px 0 rgba(239, 255, 255, .045), 0 10px 28px rgba(0, 0, 0, .09);
}
#modal-profile .profile-chips > a,
#modal-profile .profile-chips > span,
#modal-profile .profile-role,
#modal-profile .profile-badges > *,
#modal-profile .profile-status-line,
#modal-profile .wcp-round {
  border: 1px solid rgba(190, 239, 241, .13);
  background: rgba(194, 245, 241, .075);
  box-shadow: inset 0 1px 0 rgba(239, 255, 255, .07);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  backdrop-filter: blur(12px) saturate(135%);
}
#modal-profile .wcp-round:hover {
  border-color: rgba(125, 235, 223, .32);
  background: rgba(127, 230, 220, .16);
}
#modal-profile .wcp-drawing img,
#modal-profile .wcp-drawing canvas {
  border-radius: 12px;
}
@media (max-width: 600px) {
  #modal-profile .profile-card { border-radius: 18px !important; }
  #modal-profile .profile-card-body { background-color: rgba(10, 23, 33, .92) !important; }
}
@supports not ((backdrop-filter: blur(1px))) {
  #modal-profile .profile-card,
  #modal-profile .profile-card-body { background-color: #10212b !important; }
  #modal-profile .wcp-now,
  #modal-profile .wcp-side,
  #modal-profile .profile-section-block,
  #modal-profile .wcp-drawing,
  #modal-profile .wcp-meta { background: #142630 !important; }
}

/* O perfil é uma única lâmina de liquid glass; seus blocos internos não viram cards. */
#modal-profile .profile-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: rgba(11, 26, 36, .48) !important;
  border: 1px solid rgba(209, 251, 248, .27) !important;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, .42),
    inset 0 1px 0 rgba(255, 255, 255, .30),
    inset 1px 0 0 rgba(142, 239, 231, .12),
    inset 0 -1px 0 rgba(116, 209, 223, .15) !important;
  -webkit-backdrop-filter: blur(30px) saturate(165%);
  backdrop-filter: blur(30px) saturate(165%);
}
#modal-profile .profile-card::after {
  content: "";
  position: absolute;
  z-index: 8;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(118deg, transparent 18%, rgba(220, 255, 252, .075) 31%, rgba(116, 231, 226, .035) 38%, transparent 54%);
  opacity: .7;
}
#modal-profile .profile-card-body {
  background:
    linear-gradient(145deg, rgba(197, 249, 245, .075), transparent 34%),
    linear-gradient(160deg, rgba(14, 31, 41, .67), rgba(8, 22, 32, .76)) !important;
  border-top: 1px solid rgba(221, 255, 252, .16);
  -webkit-backdrop-filter: blur(26px) saturate(155%);
  backdrop-filter: blur(26px) saturate(155%);
}
#modal-profile .profile-identity-row { border-bottom: 0; }
#modal-profile .wcp-tabs {
  background: rgba(6, 19, 28, .18);
  border-top: 1px solid rgba(222, 255, 252, .075);
  border-bottom-color: rgba(222, 255, 252, .09) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}
#modal-profile .wcp-tabs [role="tab"] { background: transparent; }
#modal-profile .wcp-tabs [role="tab"][aria-selected="true"] {
  background: linear-gradient(180deg, rgba(104, 222, 213, .12), transparent);
  box-shadow: inset 0 -2px 0 #68ded5;
}
#modal-profile .wcp-now,
#modal-profile .wcp-side,
#modal-profile .profile-section-block,
#modal-profile .wcp-drawing,
#modal-profile .wcp-meta {
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
#modal-profile .profile-chips > a,
#modal-profile .profile-chips > span,
#modal-profile .profile-role,
#modal-profile .profile-badges > *,
#modal-profile .profile-status-line {
  border-color: rgba(190, 239, 241, .12);
  background: rgba(194, 245, 241, .055);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
@media (prefers-reduced-motion: reduce) {
  #modal-profile .profile-card::after { display: none; }
}
